%bcond_without dynamic # don't build dynamic (base) version
%bcond_without static # don't build static version
%bcond_without initrd # don't build initrd version
-%bcond_with dietlibc # build dietlibc-based initrd and static versions
+%bcond_with musl # build musl-based initrd and static versions
%bcond_with glibc # build glibc-based initrd and static versions
%bcond_without verbose # verbose build
# Options below are useful, when you want fileutils and grep providing.
# functionality as their GNU countenders.
#
%ifnarch %{ix86} %{x8664} ppc
-%define with_glibc 1
-%endif
-%ifarch x32
-# until uClibc builds on x32
-%undefine with_static
+%define with_musl 1
%endif
Summary: Set of common Unix utilities for embeded systems
Summary(pl.UTF-8): Zestaw narzędzi uniksowych dla systemów wbudowanych
Name: busybox
# stable line only
Version: 1.35.0
-Release: 0.1
+Release: 2
License: GPL v2
Group: Applications
Source0: http://www.busybox.net/downloads/%{name}-%{version}.tar.bz2
BuildRequires: gcc >= 3.2
BuildRequires: perl-tools-pod
BuildRequires: rpmbuild(macros) >= 1.652
-%if %{with glibc}
+%if %{with glibc} || %{with dynamic}
BuildRequires: libtirpc-devel
BuildRequires: pkgconfig
%endif
%if %{with initrd} || %{with static}
- %if %{with dietlibc}
-BuildRequires: dietlibc-static
+ %if %{with musl}
+BuildRequires: linux-musl-headers
+BuildRequires: musl-devel
+BuildRequires: libtirpc-musl-devel
%else
%if %{with glibc}
BuildRequires: glibc-static
%define tirpcdlibs %(pkg-config --libs libtirpc|sed s/-l//g)
%endif
+%if %{with musl}
+%define tirpcslibs %(pkg-config --libs libtirpc|sed s/-l//g)
+%endif
+
%description
BusyBox combines tiny versions of many common UNIX utilities into a
single small executable. It provides minimalist replacements for most
install -d built
%if %{with initrd}
install %{SOURCE2} .config
-echo 'CONFIG_EXTRA_LDLIBS="%{?with_glibc:%{tirpcslibs}}"' >> .config
+%if %{with musl}
+sed -i -e 's|CONFIG_FEATURE_VI_REGEX_SEARCH=y|# CONFIG_FEATURE_VI_REGEX_SEARCH is not set|g' .config
+%endif
+echo 'CONFIG_EXTRA_LDLIBS="%{?with_glibc:%{tirpcslibs}} %{?with_musl:%{tirpcslibs}}"' >> .config
%{__make} oldconfig
%{__make} \
%{?with_verbose:V=1} \
- EXTRA_CFLAGS="%{rpmcflags} %{tirpccflags} -Os -D_GNU_SOURCE %{!?with_glibc:-fno-stack-protector}" \
- EXTRA_LDFLAGS="%{rpmldflags} -static -Wl,-z,noexecstack" \
-%if %{with dietlibc}
- LIBRARIES="-lrpc" \
- CC="diet %{__cc}"
+ EXTRA_CFLAGS="%{rpmcflags} %{tirpccflags} -Os -D_GNU_SOURCE %{?with_musl:-I%{_includedir}/musl} %{!?with_glibc:-fno-stack-protector}" \
+ EXTRA_LDFLAGS="%{rpmldflags} -static -Wl,-z,noexecstack %{?with_musl:-L%{_libdir}/musl}" \
+%if %{with musl}
+ CC="musl-gcc"
%else
%if %{with glibc}
%{CrossOpts} \
install %{SOURCE3} .config
%else
install %{SOURCE1} .config
-echo 'CONFIG_EXTRA_LDLIBS="%{?with_glibc:%{tirpcslibs}}"' >> .config
+echo 'CONFIG_EXTRA_LDLIBS="%{?with_glibc:%{tirpcslibs}} %{?with_musl:%{tirpcslibs}}""' >> .config
+%endif
+%if %{with musl}
+sed -i -e 's|CONFIG_FEATURE_VI_REGEX_SEARCH=y|# CONFIG_FEATURE_VI_REGEX_SEARCH is not set|g' .config
+sed -i -e 's|CONFIG_EXTRA_COMPAT=y|# CONFIG_EXTRA_COMPAT is not set|g' .config
%endif
%{__make} oldconfig
%{__make} \
%{?with_verbose:V=1} \
- EXTRA_CFLAGS="%{rpmcflags} %{tirpccflags} -Os -D_GNU_SOURCE %{!?with_glibc:-fno-stack-protector}" \
- EXTRA_LDFLAGS="%{rpmldflags} -static -Wl,-z,noexecstack" \
-%if %{with dietlibc}
- LIBRARIES="-lrpc" \
- CC="diet %{__cc}"
+ EXTRA_CFLAGS="%{rpmcflags} %{tirpccflags} -Os -D_GNU_SOURCE %{?with_musl:-I%{_includedir}/musl} %{!?with_glibc:-fno-stack-protector}" \
+ EXTRA_LDFLAGS="%{rpmldflags} -static -Wl,-z,noexecstack %{?with_musl:-L%{_libdir}/musl}" \
+%if %{with musl}
+ CC="musl-gcc"
%else
%if %{with glibc}
%{CrossOpts} \