From e5a79eeebffbadccac877d39e642ddc2e8f9d956c498f1631a05fdbc85770adc Mon Sep 17 00:00:00 2001 From: Thorsten Kukuk Date: Mon, 11 Jul 2022 12:57:07 +0000 Subject: [PATCH] Accepting request 987007 from home:lnussel:branches:Base:System - prepare spec file for rpmbuild --build-in-place --noprep - use bcond for static and ww3 subpackages - fix verbose flag OBS-URL: https://build.opensuse.org/request/show/987007 OBS-URL: https://build.opensuse.org/package/show/Base:System/busybox?expand=0&rev=105 --- busybox.changes | 7 +++++++ busybox.install.patch | 4 ++-- busybox.spec | 46 ++++++++++++++++++++++--------------------- 3 files changed, 33 insertions(+), 24 deletions(-) diff --git a/busybox.changes b/busybox.changes index 69bea8e..9c0d4d7 100644 --- a/busybox.changes +++ b/busybox.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jun 30 08:30:05 UTC 2022 - Ludwig Nussel + +- prepare spec file for rpmbuild --build-in-place --noprep +- use bcond for static and ww3 subpackages +- fix verbose flag + ------------------------------------------------------------------- Fri Jun 10 17:52:27 UTC 2022 - Marcos de Souza diff --git a/busybox.install.patch b/busybox.install.patch index 6a9da5a..7cb8c71 100644 --- a/busybox.install.patch +++ b/busybox.install.patch @@ -1,5 +1,5 @@ ---- applets/install.sh -+++ applets/install.sh 2019/03/29 09:03:34 +--- a/applets/install.sh ++++ b/applets/install.sh 2019/03/29 09:03:34 @@ -1,11 +1,11 @@ -#!/bin/sh +#!/usr/bin/busybox sh diff --git a/busybox.spec b/busybox.spec index 34e0b84..09ec280 100644 --- a/busybox.spec +++ b/busybox.spec @@ -16,6 +16,13 @@ # +%ifarch x86_64 aarch64 i586 +%bcond_without ww3 +%else +%bcond_with ww3 +%endif +%bcond_without static + Name: busybox Version: 1.35.0 Release: 0 @@ -24,7 +31,6 @@ License: GPL-2.0-or-later Group: System/Base URL: https://www.busybox.net/ Source: https://busybox.net/downloads/%{name}-%{version}.tar.bz2 -Source1: BusyBox.1 Source2: busybox.config # Make sure busybox-static.config stays in sync with busybox.config - # exception: SELinux commands - these do not build statically. @@ -45,10 +51,6 @@ BuildRequires: pkgconfig(libselinux) # for test suite BuildRequires: zip -%ifarch x86_64 aarch64 i586 -%define build_ww3 1 -%endif - %description BusyBox combines tiny versions of many common UNIX utilities into a single executable. It provides minimalist replacements for utilities @@ -90,28 +92,24 @@ cd /usr/share/busybox/testsuite PATH=/usr/share/busybox:$PATH SKIP_KNOWN_BUGS=1 ./runtest %prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch100 -p0 -cp -a %{SOURCE1} docs/ +%autosetup -p1 find "(" -name CVS -o -name .cvsignore -o -name .svn -o -name .gitignore ")" \ -exec rm -Rf {} + %build export KCONFIG_NOTIMESTAMP=KCONFIG_NOTIMESTAMP -export VERBOSE=-v -export BUILD_VERBOSE=2 -export CFLAGS="%{optflags} -fno-strict-aliasing -I/usr/include/tirpc" +export KBUILD_VERBOSE=1 +export CFLAGS="%{optflags} -fPIC -fno-strict-aliasing -I/usr/include/tirpc" export CC="gcc" export HOSTCC=gcc +%if %{with static} cat %{SOURCE3} %{SOURCE2} > .config make %{?_smp_mflags} -e oldconfig make -e %{?_smp_mflags} mv busybox busybox-static +%endif -%if 0%{?build_ww3} +%if 0%{with ww3} make -e %{?_smp_mflags} clean cat %{SOURCE7} %{SOURCE3} %{SOURCE2} > .config make %{?_smp_mflags} -e oldconfig @@ -129,7 +127,7 @@ make -e make -e doc busybox.links %{?_smp_mflags} %if 0%{?usrmerged} -for i in busybox.links %{?build_ww3:busybox-warewulf3.links}; do +for i in busybox.links %{?with_ww3:busybox-warewulf3.links}; do sed -i -e 's,^/\(s\?bin\)/,/usr/\1/,' $i done %endif @@ -140,12 +138,14 @@ install -d %{buildroot}/%{_datadir}/busybox install -m 0644 busybox.links %{buildroot}%{_datadir}/busybox install applets/install.sh %{buildroot}%{_bindir}/busybox.install install -m 0755 busybox %{buildroot}%{_bindir} +%if %{with static} install -m 0755 busybox-static %{buildroot}%{_bindir} +%endif install -d %{buildroot}%{_sysconfdir} install -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/ install -d %{buildroot}%{_mandir}/man1 -install -m 644 docs/BusyBox.1 %{buildroot}%{_mandir}/man1 -%if 0%{?build_ww3} +install -m 644 docs/busybox.1 %{buildroot}%{_mandir}/man1 +%if %{with ww3} install -m 0644 busybox-warewulf3.links %{buildroot}%{_datadir}/busybox install -m 0755 busybox-warewulf3 %{buildroot}%{_bindir} %endif @@ -155,8 +155,8 @@ cp -a testsuite %{buildroot}%{_datadir}/busybox/testsuite %check export KCONFIG_NOTIMESTAMP=KCONFIG_NOTIMESTAMP -export BUILD_VERBOSE=2 -export CFLAGS="%{optflags} -fno-strict-aliasing -I/usr/include/tirpc" +export KBUILD_VERBOSE=1 +export CFLAGS="%{optflags} -fPIC -fno-strict-aliasing -I/usr/include/tirpc" export CC="gcc" export HOSTCC=gcc export SKIP_KNOWN_BUGS=1 @@ -167,7 +167,7 @@ make -e %{?_smp_mflags} test %license LICENSE %doc docs/mdev.txt %config %{_sysconfdir}/man.conf -%doc %{_mandir}/man1/BusyBox.1.gz +%doc %{_mandir}/man1/busybox.1.gz %{_bindir}/busybox %{_bindir}/busybox.install %dir %{_datadir}/busybox @@ -178,11 +178,13 @@ make -e %{?_smp_mflags} test %{_datadir}/busybox/.config %{_datadir}/busybox/testsuite +%if %{with static} %files static %license LICENSE %{_bindir}/busybox-static +%endif -%if 0%{?build_ww3} +%if %{with ww3} %files warewulf3 %license LICENSE %{_bindir}/busybox-warewulf3