]> git.pld-linux.org Git - packages/busybox.git/blobdiff - busybox.spec
dynamic configuration needs libtirpc-devel
[packages/busybox.git] / busybox.spec
index 803783aa3c78d829019c4a1cf164c262a93250d6..b000c7676653170eb368a5bcdc7a0bd0ba5e1024 100644 (file)
@@ -16,7 +16,7 @@
 %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
@@ -42,7 +38,7 @@ Summary(pt_BR.UTF-8): BusyBox é um conjunto de utilitários UNIX em um único b
 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
@@ -66,13 +62,15 @@ URL:                http://www.busybox.net/
 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
@@ -122,6 +120,10 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %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
@@ -200,15 +202,17 @@ Statycznie skonsolidowany busybox dla initrd.
 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} \
@@ -230,16 +234,19 @@ mv -f busybox built/busybox.initrd
 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} \
This page took 0.049428 seconds and 4 git commands to generate.