2008-08-14 16:18:07 +02:00
|
|
|
#
|
2011-03-01 16:36:09 +01:00
|
|
|
# spec file for package build
|
2008-08-14 16:18:07 +02:00
|
|
|
#
|
2016-03-04 08:36:19 +01:00
|
|
|
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
2008-08-14 16:18:07 +02:00
|
|
|
#
|
2008-10-05 17:44:11 +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.
|
|
|
|
|
2008-08-14 16:18:07 +02:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
2015-01-30 08:44:02 +01:00
|
|
|
# needsrootforbuild
|
|
|
|
# needsbinariesforbuild
|
2008-08-14 16:18:07 +02:00
|
|
|
|
2008-12-05 02:27:32 +01:00
|
|
|
|
2016-10-25 17:55:26 +02:00
|
|
|
%define version_unconverted 20161025
|
2016-04-08 11:59:56 +02:00
|
|
|
|
2008-08-14 16:18:07 +02:00
|
|
|
Name: build
|
|
|
|
Summary: A Script to Build SUSE Linux RPMs
|
2012-04-17 15:58:01 +02:00
|
|
|
License: GPL-2.0+ and GPL-2.0
|
2012-02-13 09:51:45 +01:00
|
|
|
Group: Development/Tools/Building
|
2016-10-25 17:55:26 +02:00
|
|
|
Version: 20161025
|
2011-09-26 22:36:55 +02:00
|
|
|
Release: 0
|
2011-10-25 16:40:31 +02:00
|
|
|
Source: obs-build-%{version}.tar.gz
|
2008-08-14 16:18:07 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
BuildArch: noarch
|
2009-04-22 10:21:51 +02:00
|
|
|
# Manual requires to avoid hard require to bash-static
|
2009-07-27 17:09:13 +02:00
|
|
|
AutoReqProv: off
|
2015-01-30 08:44:02 +01:00
|
|
|
%if 0%{?suse_version} > 1200
|
|
|
|
# required for test suite
|
|
|
|
BuildRequires: build-mkbaselibs
|
|
|
|
%endif
|
2010-02-25 09:24:40 +01:00
|
|
|
# Keep the following dependencies in sync with obs-worker package
|
|
|
|
Requires: bash
|
|
|
|
Requires: binutils
|
2012-02-29 11:04:04 +01:00
|
|
|
Requires: perl
|
2010-03-10 16:12:24 +01:00
|
|
|
Requires: tar
|
2013-08-12 18:58:28 +02:00
|
|
|
%if 0%{?fedora}
|
|
|
|
Requires: perl-MD5
|
|
|
|
Requires: perl-TimeDate
|
|
|
|
%endif
|
2011-05-12 12:21:16 +02:00
|
|
|
Conflicts: bsdtar < 2.5.5
|
|
|
|
%if 0%{?suse_version} > 1000
|
2010-11-11 13:26:23 +01:00
|
|
|
# None of them are actually required for core features.
|
|
|
|
# Perl helper scripts use them.
|
|
|
|
Recommends: perl(Date::Language)
|
|
|
|
Recommends: perl(Date::Parse)
|
|
|
|
Recommends: perl(LWP::UserAgent)
|
|
|
|
Recommends: perl(Pod::Usage)
|
|
|
|
Recommends: perl(Time::Zone)
|
|
|
|
Recommends: perl(URI)
|
|
|
|
Recommends: perl(XML::Parser)
|
2015-01-30 08:25:22 +01:00
|
|
|
Recommends: perl(Net::SSL)
|
2016-06-30 07:48:41 +02:00
|
|
|
Recommends: perl(YAML)
|
|
|
|
Recommends: perl(YAML::LibYAML)
|
2010-12-09 15:52:49 +01:00
|
|
|
Recommends: bsdtar
|
2012-08-21 11:33:28 +02:00
|
|
|
Recommends: qemu-linux-user
|
2010-11-11 13:26:23 +01:00
|
|
|
%endif
|
2008-08-14 16:18:07 +02:00
|
|
|
|
2011-08-09 14:52:32 +02:00
|
|
|
%if 0%{?suse_version} > 1120 || ! 0%{?suse_version}
|
|
|
|
Requires: build-mkbaselibs
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if 0%{?suse_version} > 1120 || 0%{?mdkversion}
|
|
|
|
Recommends: build-mkdrpms
|
|
|
|
%endif
|
|
|
|
|
2008-08-14 16:18:07 +02: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
|
|
|
|
Requires: build
|
|
|
|
|
|
|
|
%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
|
2009-07-27 17:09:13 +02:00
|
|
|
|
2013-05-14 14:10:30 +02:00
|
|
|
%define initvm_arch %{_host_cpu}
|
|
|
|
%if %{_host_cpu} == "i686"
|
|
|
|
%define initvm_arch i586
|
|
|
|
%endif
|
|
|
|
%package initvm-%{initvm_arch}
|
2013-05-08 13:11:42 +02:00
|
|
|
Summary: Virtualization initializer for emulated cross architecture builds
|
|
|
|
Group: Development/Tools/Building
|
|
|
|
Requires: build
|
|
|
|
BuildRequires: gcc
|
|
|
|
BuildRequires: glibc-devel
|
|
|
|
Provides: build-initvm
|
|
|
|
Obsoletes: build-initvm
|
|
|
|
%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
|
|
|
|
|
2008-08-14 16:18:07 +02:00
|
|
|
%prep
|
2011-10-25 16:40:31 +02:00
|
|
|
%setup -q -n obs-build-%version
|
2008-08-14 16:18:07 +02:00
|
|
|
|
2008-10-05 17:44:11 +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-05 17:44:11 +02:00
|
|
|
|
2008-08-14 16:18:07 +02:00
|
|
|
%install
|
2013-05-08 13:11:42 +02:00
|
|
|
# initvm
|
2013-05-17 11:42:02 +02:00
|
|
|
%if 0%{?suse_version}
|
2013-05-08 13:11:42 +02:00
|
|
|
make DESTDIR=$RPM_BUILD_ROOT initvm-install
|
2013-05-14 14:10:30 +02:00
|
|
|
strip $RPM_BUILD_ROOT/usr/lib/build/initvm.*
|
2013-05-08 13:11:42 +02:00
|
|
|
export NO_BRP_STRIP_DEBUG="true"
|
|
|
|
chmod 0644 $RPM_BUILD_ROOT/usr/lib/build/initvm.*
|
2013-05-17 11:42:02 +02:00
|
|
|
%endif
|
2013-05-08 13:11:42 +02:00
|
|
|
|
|
|
|
# main
|
2009-04-22 10:21:51 +02:00
|
|
|
make DESTDIR=$RPM_BUILD_ROOT install
|
2011-10-25 16:17:37 +02:00
|
|
|
cd $RPM_BUILD_ROOT/usr/lib/build/configs/
|
2016-08-11 15:53:48 +02:00
|
|
|
%if 0%{?sle_version} && 0%{?is_opensuse}
|
|
|
|
# super special leap distro
|
|
|
|
major="$[%sle_version/10000+30]"
|
|
|
|
minor="$[%sle_version/100-1200]"
|
|
|
|
ln -s sl$major.$minor.conf default.conf
|
2015-11-05 16:02:43 +01:00
|
|
|
%else
|
2011-10-25 16:17:37 +02:00
|
|
|
%if 0%{?suse_version}
|
|
|
|
%if 0%{?sles_version}
|
|
|
|
ln -s sles%{sles_version}.conf default.conf
|
2010-03-10 16:12:24 +01:00
|
|
|
%else
|
|
|
|
V=%suse_version
|
|
|
|
ln -s sl${V:0:2}.${V:2:1}.conf default.conf
|
|
|
|
%endif
|
2015-01-30 08:44:02 +01:00
|
|
|
test -e default.conf || exit 1
|
|
|
|
%endif
|
2015-11-05 16:02:43 +01:00
|
|
|
%endif
|
2015-01-30 08:44:02 +01:00
|
|
|
|
|
|
|
%check
|
|
|
|
if [ `whoami` != "root" ]; then
|
|
|
|
echo "WARNING: Not building as root, tests did not run!"
|
|
|
|
exit 0
|
|
|
|
fi
|
2015-06-17 17:02:56 +02:00
|
|
|
if [ ! -e $RPM_BUILD_ROOT/usr/lib/build/configs/default.conf ]; then
|
2015-06-16 16:58:07 +02:00
|
|
|
%if 0%{?suse_version}
|
|
|
|
echo "ERROR: No default build conf, tests did not run!"
|
|
|
|
exit 1
|
|
|
|
%else
|
|
|
|
echo "WARNING: No default build conf, tests did not run!"
|
|
|
|
exit 0
|
|
|
|
%endif
|
|
|
|
fi
|
2015-01-30 08:44:02 +01:00
|
|
|
# get back the default.conf link
|
|
|
|
cp -av $RPM_BUILD_ROOT/usr/lib/build/configs/default.conf configs/
|
|
|
|
# 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
|
|
|
|
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-10 16:12:24 +01:00
|
|
|
%endif
|
2015-01-30 08:44:02 +01:00
|
|
|
./testbuild.sh /.build.binaries/
|
2008-08-14 16:18:07 +02:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc README
|
|
|
|
/usr/bin/build
|
2009-04-22 10:21:51 +02:00
|
|
|
/usr/bin/buildvc
|
2008-08-14 16:18:07 +02: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 01:22:06 +02:00
|
|
|
%{_mandir}/man1/build.1*
|
2014-10-27 10:09:29 +01:00
|
|
|
%{_mandir}/man1/unrpm.1*
|
|
|
|
%{_mandir}/man1/vc.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
|
2008-08-14 16:18:07 +02: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 16:52:27 +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 16:52:27 +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
|
|
|
|
2008-08-14 16:18:07 +02:00
|
|
|
%changelog
|