1 # _without_embed - don't build uClibc version
2 # _without_static - don't build static version
3 Summary: Set of common unix utils for embeded systems
4 Summary(pl): Zestaw narzêdzi uniksowych dla systemów wbudowanych
10 Source0: ftp://ftp.lineo.com/pub/busybox/%{name}-%{version}.tar.gz
11 Source1: %{name}-config.h
12 Patch0: %{name}-logconsole.patch
13 Patch1: %{name}-tee.patch
14 Patch3: %{name}-printf-gettext.patch
15 Patch4: %{name}-loadfont.patch
16 Patch5: %{name}-cread.patch
17 Patch6: %{name}-malloc.patch
18 Patch7: %{name}-pivot_root.patch
19 URL: http://busybox.lineo.com/
20 %{!?_without_embed:BuildRequires: uClibc-devel}
21 %{!?_without_embed:BuildRequires: uClibc-static}
22 %{!?_without_static:BuildRequires: glibc-static}
23 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 %define embed_path /usr/lib/embed
26 %define embed_cc %{_arch}-uclibc-cc
27 %define embed_cflags %{rpmcflags} -Os
30 BusyBox combines tiny versions of many common UNIX utilities into a
31 single small executable. It provides minimalist replacements for most
32 of the utilities you usually find in fileutils, shellutils, findutils,
33 textutils, grep, gzip, tar, etc. BusyBox provides a fairly complete
34 POSIX environment for any small or embedded system. The utilities in
35 BusyBox generally have fewer options than their full-featured GNU
36 cousins; however, the options that are included provide the expected
37 functionality and behave very much like their GNU counterparts.
39 BusyBox has been written with size-optimization and limited resources
40 in mind. It is also extremely modular so you can easily include or
41 exclude commands (or features) at compile time. This makes it easy to
42 customize your embedded systems. To create a working system, just add
43 a kernel, a shell (such as ash), and an editor (such as elvis-tiny or
47 BusyBox sk³ada ma³e wersje wielu narzêdzi uniksowych w jeden ma³y plik
48 wykonywalny. Zapewnia minimalne zastêpniki wiêkszo¶ci narzêdzi
49 zawartych w pakietach fileutils, shellutils, findutils, grep, gzip,
50 tar itp. BusyBox daje w miarê kompletne ¶rodowisko POSIX dla ma³ych
51 lub wbudowanych systemów. Narzêdzia maj± mniej opcji ni¿ ich pe³ne
52 odpowiedniki GNU, ale maj± podstawow± funkcjonalno¶æ. Do dzia³aj±cego
53 systemu potrzeba jeszcze tylko kernela, shella (np. ash) oraz edytora
54 (np. elvis-tiny albo ae).
57 Summary: Static busybox
58 Summary(pl): Statycznie linkowany busybox
64 %description static -l pl
65 Statycznie linkowany busybox.
68 Summary: Busybox for embedded systems
69 Summary(pl): Busybox dla systemów wbudowanych
73 Busybox for embedded systems.
75 %description embed -l pl
76 Busybox dla systemów wbudowanych.
89 cp -f %{SOURCE1} Config.h
91 %if %{!?_without_embed:1}%{?_without_embed:0}
93 CFLAGS_EXTRA="%{embed_cflags}" \
95 mv -f busybox busybox-embed-shared
97 CFLAGS_EXTRA="%{embed_cflags}" \
100 mv -f busybox busybox-embed-static
104 %if %{?_without_static:0}%{!?_without_static:1}
106 CFLAGS_EXTRA="%{rpmcflags}" \
107 LDFLAGS="%{rpmldflags} -static"
108 mv -f busybox busybox.static
113 CFLAGS_EXTRA="%{rpmcflags}" \
114 LDFLAGS="%{rpmldflags}"
117 rm -rf $RPM_BUILD_ROOT
118 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,%{_libdir}/busybox}
120 %if %{!?_without_embed:1}%{?_without_embed:0}
121 install -d $RPM_BUILD_ROOT%{embed_path}/{shared,static,aux}
123 install busybox-embed-static $RPM_BUILD_ROOT%{embed_path}/static/busybox
124 install busybox-embed-shared $RPM_BUILD_ROOT%{embed_path}/shared/busybox
126 for i in `cat busybox.links`; do
127 ln -sfn busybox "$RPM_BUILD_ROOT%{embed_path}/shared/`basename $i`"
128 ln -sfn busybox "$RPM_BUILD_ROOT%{embed_path}/static/`basename $i`"
130 install busybox.links $RPM_BUILD_ROOT%{embed_path}/aux
133 %{!?_without_static:install busybox.static $RPM_BUILD_ROOT%{_bindir}}
135 install busybox $RPM_BUILD_ROOT%{_bindir}
136 install busybox.links $RPM_BUILD_ROOT%{_libdir}/busybox
137 install docs/BusyBox.1 $RPM_BUILD_ROOT%{_mandir}/man1
138 echo ".so BusyBox.1" > $RPM_BUILD_ROOT%{_mandir}/man1/busybox.1
140 gzip -9nf AUTHORS TODO Changelog README
143 rm -rf $RPM_BUILD_ROOT
146 %defattr(644,root,root,755)
148 %attr(755,root,root) %{_bindir}/busybox
152 %if %{?_without_static:0}%{!?_without_static:1}
154 %defattr(644,root,root,755)
155 %attr(755,root,root) %{_bindir}/busybox.static
158 %if %{!?_without_embed:1}%{?_without_embed:0}
160 %defattr(644,root,root,755)
161 %attr(755,root,root) %{embed_path}/s*/*