2007-01-16 00:06:25 +01:00
|
|
|
#
|
2021-09-02 11:53:00 +02:00
|
|
|
# spec file
|
2007-01-16 00:06:25 +01:00
|
|
|
#
|
2023-01-02 09:17:33 +01:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2007-01-16 00:06:25 +01:00
|
|
|
#
|
2008-08-15 22:36:21 +02:00
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2018-08-29 16:01:15 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2007-01-16 00:06:25 +01:00
|
|
|
#
|
2015-01-30 08:44:02 +01:00
|
|
|
# needsrootforbuild
|
|
|
|
# needsbinariesforbuild
|
2007-01-16 00:06:25 +01:00
|
|
|
|
2008-05-31 12:08:28 +02:00
|
|
|
|
2020-05-20 18:42:18 +02:00
|
|
|
%if 0%{?suse_version}
|
2020-03-13 15:12:51 +01:00
|
|
|
%define __pkg_name build
|
2020-05-20 18:42:18 +02:00
|
|
|
%else
|
|
|
|
%define __pkg_name obs-build
|
2020-03-13 14:47:01 +01:00
|
|
|
%endif
|
|
|
|
|
|
|
|
Name: %{__pkg_name}
|
2007-01-16 00:06:25 +01:00
|
|
|
Summary: A Script to Build SUSE Linux RPMs
|
2020-03-13 14:47:01 +01:00
|
|
|
License: GPL-2.0-only OR GPL-3.0-only
|
2012-02-13 09:51:45 +01:00
|
|
|
Group: Development/Tools/Building
|
2023-02-08 12:57:46 +01:00
|
|
|
Version: 20230208
|
2011-09-26 22:36:55 +02:00
|
|
|
Release: 0
|
2011-10-25 16:40:31 +02:00
|
|
|
Source: obs-build-%{version}.tar.gz
|
2007-01-16 00:06:25 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2007-09-15 12:05:41 +02:00
|
|
|
BuildArch: noarch
|
2017-11-23 09:19:17 +01:00
|
|
|
#!BuildIgnore: build-mkbaselibs build-mkbaselibs-sle
|
2010-02-25 02:19:14 +01:00
|
|
|
# Keep the following dependencies in sync with obs-worker package
|
|
|
|
Requires: bash
|
|
|
|
Requires: binutils
|
2022-03-07 10:40:25 +01:00
|
|
|
Requires: findutils
|
2012-02-29 11:04:04 +01:00
|
|
|
Requires: perl
|
2010-03-09 16:59:01 +01:00
|
|
|
Requires: tar
|
2020-03-13 14:47:01 +01:00
|
|
|
# needed for fuser
|
|
|
|
Requires: psmisc
|
|
|
|
# just to verify existence of packages
|
|
|
|
BuildRequires: bash
|
|
|
|
BuildRequires: binutils
|
|
|
|
BuildRequires: perl
|
|
|
|
BuildRequires: psmisc
|
|
|
|
BuildRequires: tar
|
|
|
|
# For testcases
|
2021-08-19 12:14:40 +02:00
|
|
|
BuildRequires: perl(Date::Parse)
|
2020-03-13 14:47:01 +01:00
|
|
|
BuildRequires: perl(Test::Harness)
|
|
|
|
BuildRequires: perl(Test::More)
|
2021-08-19 12:14:40 +02:00
|
|
|
%if 0%{?fedora}
|
2013-08-12 18:58:28 +02:00
|
|
|
Requires: perl-MD5
|
2021-01-28 13:47:24 +01:00
|
|
|
Requires: perl-TimeDate
|
|
|
|
BuildRequires: perl-TimeDate
|
2013-08-12 18:58:28 +02:00
|
|
|
%endif
|
2011-05-12 12:21:16 +02:00
|
|
|
Conflicts: bsdtar < 2.5.5
|
2022-03-07 10:40:25 +01:00
|
|
|
%if 0%{?suse_version}
|
|
|
|
Conflicts: qemu < 2.5.0
|
|
|
|
%endif
|
2021-08-19 12:14:40 +02:00
|
|
|
BuildRequires: perl(Date::Parse)
|
2020-03-13 14:47:01 +01:00
|
|
|
BuildRequires: perl(Test::Harness)
|
|
|
|
BuildRequires: perl(Test::More)
|
2022-09-26 13:22:10 +02:00
|
|
|
%if 0%{?suse_version} >= 1200
|
2021-05-21 10:58:16 +02:00
|
|
|
BuildRequires: perl(YAML::LibYAML)
|
2022-09-26 13:22:10 +02:00
|
|
|
%endif
|
2021-08-19 12:14:40 +02:00
|
|
|
%if 0%{?suse_version} > 1000 || 0%{?centos_version} >= 800 || 0%{?rhel_version} >= 800 || 0%{?fedora_version} >= 21
|
2010-11-11 13:26:23 +01:00
|
|
|
# None of them are actually required for core features.
|
|
|
|
# Perl helper scripts use them.
|
2022-09-26 10:31:35 +02:00
|
|
|
Recommends: perl(Archive::Tar)
|
2021-08-30 14:48:47 +02:00
|
|
|
Recommends: /sbin/mkfs.ext3
|
2022-11-18 16:40:41 +01:00
|
|
|
Recommends: /sbin/mkfs.ext3
|
|
|
|
Recommends: /usr/bin/qemu-kvm
|
2021-08-30 14:48:47 +02:00
|
|
|
Recommends: /usr/bin/qemu-kvm
|
|
|
|
Recommends: bsdtar
|
2022-11-18 16:40:41 +01:00
|
|
|
Recommends: bsdtar
|
2021-08-30 14:48:47 +02:00
|
|
|
Recommends: qemu-linux-user
|
2022-11-18 16:40:41 +01:00
|
|
|
Recommends: qemu-linux-user
|
|
|
|
Recommends: zstd
|
2021-08-30 14:48:47 +02:00
|
|
|
Recommends: zstd
|
2022-09-26 10:31:35 +02:00
|
|
|
Recommends: perl(Config::IniFiles)
|
|
|
|
Recommends: perl(Date::Language)
|
2010-11-11 13:26:23 +01:00
|
|
|
Recommends: perl(Date::Parse)
|
|
|
|
Recommends: perl(LWP::UserAgent)
|
|
|
|
Recommends: perl(Pod::Usage)
|
|
|
|
Recommends: perl(Time::Zone)
|
|
|
|
Recommends: perl(URI)
|
|
|
|
Recommends: perl(XML::Parser)
|
2016-06-30 07:48:41 +02:00
|
|
|
Recommends: perl(YAML::LibYAML)
|
2022-11-18 16:40:41 +01:00
|
|
|
# for vc:
|
|
|
|
Recommends: /usr/bin/dnsdomainname
|
|
|
|
Recommends: /usr/bin/rpmdev-packager
|
2010-11-11 13:26:23 +01:00
|
|
|
%endif
|
2007-01-16 00:06:25 +01:00
|
|
|
|
2011-08-09 14:52:32 +02:00
|
|
|
%if 0%{?suse_version} > 1120 || ! 0%{?suse_version}
|
2020-03-13 14:47:01 +01:00
|
|
|
Requires: %{__pkg_name}-mkbaselibs
|
2011-08-09 14:52:32 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if 0%{?suse_version} > 1120 || 0%{?mdkversion}
|
2020-03-13 14:47:01 +01:00
|
|
|
Recommends: %{__pkg_name}-mkdrpms
|
2011-08-09 14:52:32 +02:00
|
|
|
%endif
|
|
|
|
|
2020-07-23 08:04:07 +02:00
|
|
|
# With fedora 33 the POSIX module was split out of the perl
|
|
|
|
# package
|
|
|
|
BuildRequires: perl(POSIX)
|
|
|
|
Requires: perl(POSIX)
|
|
|
|
|
2007-01-16 00:06:25 +01:00
|
|
|
%description
|
|
|
|
This package provides a script for building RPMs for SUSE Linux in a
|
|
|
|
chroot environment.
|
|
|
|
|
|
|
|
|
2010-04-15 17:55:11 +02:00
|
|
|
%if 0%{?suse_version} > 1120 || ! 0%{?suse_version}
|
|
|
|
|
|
|
|
%package mkbaselibs
|
|
|
|
Summary: Tools to generate base lib packages
|
|
|
|
# NOTE: this package must not have dependencies which may break boot strapping (eg. perl modules)
|
2016-10-20 10:50:41 +02:00
|
|
|
Group: Development/Tools/Building
|
2010-04-15 17:55:11 +02:00
|
|
|
|
|
|
|
%description mkbaselibs
|
|
|
|
This package contains the parts which may be installed in the inner build system
|
|
|
|
for generating base lib packages.
|
2010-11-11 13:26:23 +01:00
|
|
|
|
|
|
|
%package mkdrpms
|
|
|
|
Summary: Tools to generate delta rpms
|
2012-09-24 17:48:01 +02:00
|
|
|
Group: Development/Tools/Building
|
2010-11-11 13:26:23 +01:00
|
|
|
Requires: deltarpm
|
|
|
|
# XXX: we wanted to avoid that but mkdrpms needs Build::Rpm::rpmq
|
2020-03-13 14:47:01 +01:00
|
|
|
Requires: %{__pkg_name}
|
2010-11-11 13:26:23 +01:00
|
|
|
|
|
|
|
%description mkdrpms
|
|
|
|
This package contains the parts which may be installed in the inner build system
|
|
|
|
for generating delta rpm packages.
|
|
|
|
|
2010-04-15 17:55:11 +02:00
|
|
|
%endif
|
2007-01-16 00:06:25 +01:00
|
|
|
|
2013-05-14 14:10:30 +02:00
|
|
|
%define initvm_arch %{_host_cpu}
|
2020-07-23 08:04:07 +02:00
|
|
|
%if "%{_host_cpu}" == "i686"
|
2013-05-14 14:10:30 +02:00
|
|
|
%define initvm_arch i586
|
|
|
|
%endif
|
2021-08-30 14:48:47 +02:00
|
|
|
|
2013-05-14 14:10:30 +02:00
|
|
|
%package initvm-%{initvm_arch}
|
2013-05-08 13:11:42 +02:00
|
|
|
Summary: Virtualization initializer for emulated cross architecture builds
|
|
|
|
Group: Development/Tools/Building
|
2020-03-13 14:47:01 +01:00
|
|
|
Requires: %{__pkg_name}
|
2013-05-08 13:11:42 +02:00
|
|
|
BuildRequires: gcc
|
|
|
|
BuildRequires: glibc-devel
|
2020-03-13 14:47:01 +01:00
|
|
|
Provides: %{__pkg_name}-initvm
|
|
|
|
Obsoletes: %{__pkg_name}-initvm
|
2013-05-08 13:11:42 +02:00
|
|
|
%if 0%{?suse_version} > 1200
|
|
|
|
BuildRequires: glibc-devel-static
|
|
|
|
%endif
|
|
|
|
|
2013-05-14 14:10:30 +02:00
|
|
|
%description initvm-%{initvm_arch}
|
2013-05-08 13:11:42 +02:00
|
|
|
This package provides a script for building RPMs for SUSE Linux in a
|
|
|
|
chroot or a secure virtualized
|
|
|
|
|
2007-01-16 00:06:25 +01:00
|
|
|
%prep
|
2011-10-25 16:40:31 +02:00
|
|
|
%setup -q -n obs-build-%version
|
2007-01-16 00:06:25 +01:00
|
|
|
|
2008-10-22 15:31:56 +02:00
|
|
|
%build
|
2013-05-17 11:42:02 +02:00
|
|
|
%if 0%{?suse_version}
|
|
|
|
# initvm
|
2013-05-08 13:11:42 +02:00
|
|
|
make CFLAGS="$RPM_BUILD_FLAGS" initvm-all
|
2013-05-17 11:42:02 +02:00
|
|
|
%endif
|
2008-10-22 15:31:56 +02:00
|
|
|
|
2007-01-16 00:06:25 +01:00
|
|
|
%install
|
2013-05-08 13:11:42 +02:00
|
|
|
# initvm
|
2013-05-17 11:42:02 +02:00
|
|
|
%if 0%{?suse_version}
|
2018-01-23 15:05:54 +01:00
|
|
|
make DESTDIR=%{buildroot} initvm-install
|
|
|
|
strip %{buildroot}/usr/lib/build/initvm.*
|
2013-05-08 13:11:42 +02:00
|
|
|
export NO_BRP_STRIP_DEBUG="true"
|
2013-05-17 11:42:02 +02:00
|
|
|
%endif
|
2013-05-08 13:11:42 +02:00
|
|
|
|
|
|
|
# main
|
2018-01-23 15:05:54 +01:00
|
|
|
make DESTDIR=%{buildroot} install
|
2017-07-20 18:29:47 +02:00
|
|
|
|
|
|
|
# tweak default config on suse
|
2011-10-25 16:17:37 +02:00
|
|
|
%if 0%{?suse_version}
|
2018-01-23 15:05:54 +01:00
|
|
|
cd %{buildroot}/usr/lib/build/configs/
|
2017-07-20 18:29:47 +02:00
|
|
|
SUSE_V=%{?suse_version}
|
|
|
|
SLE_V=%{?sle_version}
|
|
|
|
%if 0%{?sle_version} && 0%{?is_opensuse} && %suse_version == 1315
|
|
|
|
# this is SUSE Leap 42.X
|
|
|
|
ln -s sl42.${SLE_V:3:1}.conf default.conf
|
|
|
|
%endif
|
|
|
|
%if 0%{?sle_version} && 0%{?is_opensuse} && %suse_version > 1315
|
|
|
|
# this is SUSE Leap 15 and higher
|
|
|
|
ln -s sl${SLE_V:0:2}.${SLE_V:3:1}.conf default.conf
|
|
|
|
%endif
|
2021-11-25 14:07:22 +01:00
|
|
|
%if !0%{?sle_version} && ( 0%{?suse_version} <= 1310 || 0%{?suse_version} == 1320 || 0%{?suse_version} == 1330 )
|
2017-07-20 18:29:47 +02:00
|
|
|
# this is old openSUSE releases and Factory
|
|
|
|
ln -s sl${SUSE_V:0:2}.${SUSE_V:2:1}.conf default.conf
|
2010-03-09 16:59:01 +01:00
|
|
|
%endif
|
2021-11-25 14:07:22 +01:00
|
|
|
%if !0%{?sle_version} && ( 0%{?suse_version} == 1599 )
|
|
|
|
ln -s tumbleweed.conf default.conf
|
|
|
|
%endif
|
2017-07-20 18:29:47 +02:00
|
|
|
%if 0%{?sle_version} && !0%{?is_opensuse}
|
|
|
|
# this is SUSE SLE 12 and higher
|
|
|
|
ln -s sle${SLE_V:0:2}.${SLE_V:3:1}.conf default.conf
|
|
|
|
%endif
|
2017-07-20 18:41:00 +02:00
|
|
|
%if 0%{?sles_version} == 1110
|
2020-03-13 14:47:01 +01:00
|
|
|
# this is SUSE SLE 11
|
2017-07-20 18:41:00 +02:00
|
|
|
ln -s sles11sp2.conf default.conf
|
|
|
|
%endif
|
2017-07-20 18:29:47 +02:00
|
|
|
# make sure that we have a config
|
2015-01-30 08:44:02 +01:00
|
|
|
test -e default.conf || exit 1
|
|
|
|
%endif
|
2017-07-20 18:29:47 +02:00
|
|
|
|
|
|
|
# tweak baselibs config on suse
|
|
|
|
%if 0%{?suse_version}
|
2018-01-23 15:05:54 +01:00
|
|
|
cd %{buildroot}/usr/lib/build
|
2017-07-20 18:29:47 +02:00
|
|
|
%if %suse_version == 1500
|
|
|
|
# SLE 15 / Leap 15
|
|
|
|
ln -sf baselibs_configs/baselibs_global-sle15.conf baselibs_global.conf
|
|
|
|
%endif
|
2018-01-31 14:40:03 +01:00
|
|
|
%if %suse_version == 1315
|
|
|
|
# SLE 12 / Leap 42
|
2017-07-20 18:29:47 +02:00
|
|
|
ln -sf baselibs_configs/baselibs_global-sle12.conf baselibs_global.conf
|
|
|
|
%endif
|
2018-01-31 14:40:03 +01:00
|
|
|
%if %suse_version <= 1110
|
|
|
|
# SLE 11
|
|
|
|
ln -sf baselibs_configs/baselibs_global-sle11.conf baselibs_global.conf
|
|
|
|
%endif
|
2017-07-20 18:29:47 +02:00
|
|
|
test -e baselibs_global.conf || exit 1
|
2015-11-05 16:02:43 +01:00
|
|
|
%endif
|
2015-01-30 08:44:02 +01:00
|
|
|
|
|
|
|
%check
|
2020-03-13 14:47:01 +01:00
|
|
|
for i in build build-* ; do bash -n $i || exit 1 ; done
|
|
|
|
|
|
|
|
# run perl module unit tests
|
|
|
|
LANG=C make test || exit 1
|
|
|
|
|
2015-01-30 08:44:02 +01:00
|
|
|
if [ `whoami` != "root" ]; then
|
2020-03-13 14:47:01 +01:00
|
|
|
echo "WARNING: Not building as root, build test did not run!"
|
2015-01-30 08:44:02 +01:00
|
|
|
exit 0
|
|
|
|
fi
|
2018-01-23 15:05:54 +01:00
|
|
|
if [ ! -f "%{buildroot}/usr/lib/build/configs/default.conf" ]; then
|
2020-03-13 14:47:01 +01:00
|
|
|
echo "WARNING: No default config, build test did not run!"
|
2017-07-19 20:06:21 +02:00
|
|
|
exit 0
|
|
|
|
fi
|
2015-01-30 08:44:02 +01:00
|
|
|
# get back the default.conf link
|
2018-01-23 15:05:54 +01:00
|
|
|
cp -av %{buildroot}/usr/lib/build/configs/default.conf configs/
|
2015-01-30 08:44:02 +01:00
|
|
|
# do not get confused when building this already with build:
|
|
|
|
export BUILD_IGNORE_2ND_STAGE=1
|
|
|
|
# use our own build code
|
|
|
|
export BUILD_DIR=$PWD
|
2020-03-13 14:47:01 +01:00
|
|
|
|
|
|
|
# simple chroot build test
|
2015-01-30 08:44:02 +01:00
|
|
|
cd test
|
|
|
|
# target is autodetected
|
|
|
|
%if 0%{?sles_version}
|
|
|
|
echo "SLES config differs currently on purpose between OBS and build script."
|
|
|
|
echo "Skipping test case"
|
|
|
|
exit 0
|
|
|
|
%endif
|
|
|
|
%if 0%{?qemu_user_space_build}
|
|
|
|
echo "test suite is not prepared to run using qemu linux user"
|
|
|
|
echo "Skipping test case"
|
|
|
|
exit 0
|
2010-03-09 16:59:01 +01:00
|
|
|
%endif
|
2017-11-23 09:19:17 +01:00
|
|
|
# we need to patch the not packaged configs, due to the buildignore
|
|
|
|
sed -i 's,build-mkbaselibs,,' ../configs/*.conf
|
2021-08-19 12:14:40 +02:00
|
|
|
if [ ! -e /.build.packages/rpmlint-Factory.rpm ]; then
|
|
|
|
sed -i 's,rpmlint-Factory,,' ../configs/*.conf
|
|
|
|
fi
|
2022-09-27 13:35:12 +02:00
|
|
|
if [ ! -e /.build.packages/rpmlint-strict.rpm ]; then
|
|
|
|
sed -i 's,rpmlint-strict,,' ../configs/*.conf
|
|
|
|
fi
|
2022-11-18 16:40:41 +01:00
|
|
|
if [ ! -e /.build.packages/rpmlint-mini.rpm ]; then
|
|
|
|
sed -i 's,rpmlint-mini,,' ../configs/*.conf
|
|
|
|
fi
|
2015-01-30 08:44:02 +01:00
|
|
|
./testbuild.sh /.build.binaries/
|
2007-01-16 00:06:25 +01:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2021-10-25 11:26:42 +02:00
|
|
|
%doc README.md docs
|
2007-01-16 00:06:25 +01:00
|
|
|
/usr/bin/build
|
2021-08-19 12:14:40 +02:00
|
|
|
/usr/bin/pbuild
|
2009-06-16 18:20:30 +02:00
|
|
|
/usr/bin/buildvc
|
2007-01-16 00:06:25 +01:00
|
|
|
/usr/bin/unrpm
|
|
|
|
/usr/lib/build
|
2013-04-29 09:42:59 +02:00
|
|
|
%config(noreplace) /usr/lib/build/emulator/emulator.sh
|
2008-10-22 15:31:56 +02:00
|
|
|
%{_mandir}/man1/build.1*
|
2014-10-27 10:09:29 +01:00
|
|
|
%{_mandir}/man1/unrpm.1*
|
2020-03-13 14:47:01 +01:00
|
|
|
%{_mandir}/man1/buildvc.1*
|
2021-08-19 12:14:40 +02:00
|
|
|
%{_mandir}/man1/pbuild.1*
|
2013-05-24 20:32:42 +02:00
|
|
|
%if 0%{?suse_version}
|
2013-05-08 13:11:42 +02:00
|
|
|
%exclude /usr/lib/build/initvm.*
|
2013-05-24 20:32:42 +02:00
|
|
|
%endif
|
2007-01-16 00:06:25 +01:00
|
|
|
|
2010-04-15 17:55:11 +02:00
|
|
|
%if 0%{?suse_version} > 1120 || ! 0%{?suse_version}
|
|
|
|
%exclude /usr/lib/build/mkbaselibs
|
2010-04-19 01:02:29 +02:00
|
|
|
%exclude /usr/lib/build/baselibs*
|
2010-11-11 13:26:23 +01:00
|
|
|
%exclude /usr/lib/build/mkdrpms
|
2010-04-15 17:55:11 +02:00
|
|
|
|
|
|
|
%files mkbaselibs
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%dir /usr/lib/build
|
|
|
|
/usr/lib/build/mkbaselibs
|
2010-04-19 01:02:29 +02:00
|
|
|
/usr/lib/build/baselibs*
|
2010-11-11 13:26:23 +01:00
|
|
|
|
|
|
|
%files mkdrpms
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%dir /usr/lib/build
|
|
|
|
/usr/lib/build/mkdrpms
|
2010-04-15 17:55:11 +02:00
|
|
|
%endif
|
|
|
|
|
2013-05-17 11:42:02 +02:00
|
|
|
%if 0%{?suse_version}
|
2013-05-14 14:10:30 +02:00
|
|
|
%files initvm-%{initvm_arch}
|
2013-05-08 13:11:42 +02:00
|
|
|
%defattr(-,root,root)
|
|
|
|
/usr/lib/build/initvm.*
|
2013-05-17 11:42:02 +02:00
|
|
|
%endif
|
2013-05-08 13:11:42 +02:00
|
|
|
|
2007-08-02 21:42:25 +02:00
|
|
|
%changelog
|