%bcond_without initrd # don't build initrd version
%bcond_with dietlibc
+%bcond_with glibc
-%define pre pre2
+%ifnarch %{ix86}
+%define with_glibc 1
+%endif
+
+%define pre pre4
Summary: Set of common unix utils for embeded systems
Summary(pl): Zestaw narzêdzi uniksowych dla systemów wbudowanych
Summary(pt_BR): BusyBox é um conjunto de utilitários UNIX em um único binário
Name: busybox
Version: 1.00
-Release: 0.%{pre}.7
+Release: 0.%{pre}.1
License: GPL
Group: Applications
-Source0: http://www.busybox.net/downloads/%{name}-%{version}-pre2.tar.bz2
-# Source0-md5: 06e433389a8b34ce1031a144ba5677d1
+Source0: http://www.busybox.net/downloads/%{name}-%{version}-pre4.tar.bz2
+# Source0-md5: e423335994b5cd2d078dad3492768d51
Source1: %{name}.config
Source2: %{name}-initrd.config
%{?with_altconfig:Source3: %{cfgfile}}
Patch0: %{name}-logconsole.patch
-Patch1: %{name}-tee.patch
-Patch3: %{name}-printf-gettext.patch
-Patch4: %{name}-loadfont.patch
-Patch5: %{name}-pivot_root.patch
-Patch6: %{name}-malloc.patch
-Patch7: %{name}-raid_start.patch
-Patch8: %{name}-insmod_ng.patch
-Patch9: %{name}-force-dietlibc.patch
-Patch10: %{name}-insmod-gpl.patch
-Patch11: %{name}-ash_exec.patch
+Patch1: %{name}-print_ascii.patch
+Patch2: %{name}-printf-gettext.patch
+Patch3: %{name}-loadfont.patch
+Patch4: %{name}-pivot_root.patch
+Patch5: %{name}-malloc.patch
+Patch6: %{name}-raid_start.patch
+Patch7: %{name}-insmod_ng.patch
+Patch8: %{name}-force-dietlibc.patch
+Patch9: %{name}-ash_exec.patch
URL: http://www.busybox.net/
%{?with_fileutl_prov:Provides: fileutils}
%{?with_grep_prov:Provides: grep}
%{?with_sh_prov:Provides: /bin/sh}
%{?with_static:BuildRequires: glibc-static}
-%{?with_initrd:BuildRequires: %{?with_dietlibc:dietlibc}%{?!with_dietlibc:uClibc}-static}
+%if %{with initrd}
+ %if %{with dietlibc}
+BuildRequires: dietlibc-static
+ %else
+ %if %{with glibc}
+BuildRequires: glibc-static
+ %else
+BuildRequires: uClibc-static >= 0.9.21
+ %endif
+ %endif
+%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _initrd_bindir /bin
%package static
Summary: Static busybox
-Summary(pl): Statycznie linkowany busybox
+Summary(pl): Statycznie skonsolidowany busybox
Group: Applications
%description static
Static busybox.
%description static -l pl
-Statycznie linkowany busybox.
+Statycznie skonsolidowany busybox.
%package initrd
Summary: Static busybox for initrd
-Summary(pl): Statycznie linkowany busybox dla initrd
+Summary(pl): Statycznie skonsolidowany busybox dla initrd
Group: Applications
%description initrd
Static busybox for initrd.
%description initrd -l pl
-Statycznie linkowany busybox dla initrd.
+Statycznie skonsolidowany busybox dla initrd.
%prep
%setup -q -n %{name}-%{version}-%{pre}
%patch0 -p1
%patch1 -p1
-#X %patch3 -p1 // UPDATE ME
+#X %patch2 -p1 // UPDATE ME
+%patch3 -p1
%patch4 -p1
-%patch5 -p1
-#%patch6 -p1 // not needed
+#%patch5 -p1 // not needed
+%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
-%patch10 -p1
-%patch11 -p1
%build
install %{SOURCE1} .config
-%if %{with altconfig}
-install %{SOURCE3} .config
-%endif
-
%if %{with initrd}
install %{SOURCE2} .config
%{__make} oldconfig
%if %{with dietlibc}
LIBRARIES="-lrpc" \
CC="diet gcc"
+%else
+%if %{with glibc}
+ CC="%{__cc}"
%else
CC="%{_target_cpu}-uclibc-gcc"
%endif
+%endif
+
mv -f busybox busybox.initrd
%{__make} clean
install %{SOURCE1} .config
%endif
+%if %{with altconfig}
+install %{SOURCE3} .config
+%endif
+
%if %{with static}
%{__make} oldconfig
%{__make} \
# install links to busybox binary, when linkfl is defined
%if %{with linkfl}
-make install PREFIX=$RPM_BUILD_ROOT
+make install \
+ PREFIX=$RPM_BUILD_ROOT
%else
install busybox $RPM_BUILD_ROOT%{_bindir}
%endif