From fbed533afe8b13322d35a73b7c71d5d6d0c48a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 30 Jan 2015 07:44:02 +0000 Subject: [PATCH] sync with OBS unstable package OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build?expand=0&rev=248 --- build.spec | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/build.spec b/build.spec index 6417e96..2407ac1 100644 --- a/build.spec +++ b/build.spec @@ -14,6 +14,8 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # +# needsrootforbuild +# needsbinariesforbuild Name: build @@ -22,13 +24,15 @@ License: GPL-2.0+ and GPL-2.0 Group: Development/Tools/Building Version: 20150115 Release: 0 -#!BuildIgnore: build-mkbaselibs Source: obs-build-%{version}.tar.gz -Source1: baselibs.conf BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch # Manual requires to avoid hard require to bash-static AutoReqProv: off +%if 0%{?suse_version} > 1200 +# required for test suite +BuildRequires: build-mkbaselibs +%endif # Keep the following dependencies in sync with obs-worker package Requires: bash Requires: binutils @@ -139,9 +143,34 @@ cd $RPM_BUILD_ROOT/usr/lib/build/configs/ V=%suse_version ln -s sl${V:0:2}.${V:2:1}.conf default.conf %endif -test -e default.conf +test -e default.conf || exit 1 %endif +%check +if [ `whoami` != "root" ]; then + echo "WARNING: Not building as root, tests did not run!" + exit 0 +fi +# 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 +%endif +./testbuild.sh /.build.binaries/ + %files %defattr(-,root,root) %doc README