]> git.pld-linux.org Git - packages/busybox.git/blame - busybox.spec
rel 8; enable builtin sleep for initrd
[packages/busybox.git] / busybox.spec
CommitLineData
e7982b05 1# TODO:
a54ace54
CM
2# - review patch 3. Updated to 1.17.3, but the code changed so much it's unclear
3# if it still serves a purpose
4# - sparc64 modules support in sparc(32), x86_64 modules support in i386 version
5# - make internal commands work even if busybox is not in /bin/busybox (initrd)
6# or when /proc is not mounted (static / normal)
598da0d3 7#
2678f462 8# Conditional build:
b5011fd7 9# alternative busybox config file (replaces default one) you should
4a69c6c5 10# define cfgfile macro, i.e.
d635bde0 11#
6f6b5afa 12# rpm --rebuild busybox.*.src.rpm --with altconfig --define "cfgfile bb-emb-config.h"
a54ace54 13#
2678f462
JB
14%bcond_with altconfig # use alternative config (defined by cfgfile)
15%bcond_with linkfl # creates links to busybox binary and puts them into file list
63de0802 16%bcond_without dynamic # don't build dynamic (base) version
3637c580
JR
17%bcond_without static # don't build static version
18%bcond_without initrd # don't build initrd version
4643837f 19%bcond_with musl # build musl-based initrd and static versions
3637c580 20%bcond_with glibc # build glibc-based initrd and static versions
494a100b 21%bcond_without verbose # verbose build
d635bde0 22# Options below are useful, when you want fileutils and grep providing.
23# For example, ash package requires fileutils and grep.
2678f462
JB
24%bcond_with fileutl_prov # adds fileutils providing
25%bcond_with grep_prov # adds grep providing
d635bde0 26# Option below is useful, when busybox is built with shell support.
2678f462 27%bcond_with sh_prov # adds /bin/sh providing
6b50dd3e 28# WARNING! Shell, fileutils and grep providing may depend on config file!
d635bde0 29# Fileutils, grep and shell provided with busybox have not such
30# functionality as their GNU countenders.
2678f462 31#
c15e3058 32%ifnarch %{ix86} %{x8664} ppc
9e624dde 33%define with_musl 1
1735ff25 34%endif
dce89576 35Summary: Set of common Unix utilities for embeded systems
718bff43
ER
36Summary(pl.UTF-8): Zestaw narzędzi uniksowych dla systemów wbudowanych
37Summary(pt_BR.UTF-8): BusyBox é um conjunto de utilitários UNIX em um único binário
ee61dafa 38Name: busybox
586f52e3 39# stable line only
36e1d67e 40Version: 1.35.0
61cba60e 41Release: 8
bbbc183d 42License: GPL v2
d79d7625 43Group: Applications
693dc2a0 44Source0: http://www.busybox.net/downloads/%{name}-%{version}.tar.bz2
36e1d67e 45# Source0-md5: 585949b1dd4292b604b7d199866e9913
4f8fe04f
AM
46Source1: %{name}.config
47Source2: %{name}-initrd.config
8f98fac8 48%{?with_altconfig:Source3: %{cfgfile}}
aad3a7f3 49Patch0: x32.patch
b2b9509f 50Patch1: %{name}-logconsole.patch
51Patch2: %{name}-printf-gettext.patch
29a4a582
JR
52Patch4: %{name}-kernel_headers.patch
53Patch5: %{name}-insmod-morearchs.patch
54Patch6: %{name}-dhcp.patch
55Patch7: %{name}-fix_64_archs.patch
7a6bf0ae 56Patch8: busybox-1.31.1-stime-fix.patch
29a4a582 57Patch9: %{name}-ash-export-PATH.patch
459c400e 58Patch10: 0001-modutils-check-ELF-header-before-calling-finit_module.patch
b36f2957 59Patch11: strip-quotes.patch
87902b66 60URL: http://www.busybox.net/
255676bf 61BuildRequires: gcc >= 3.2
839c36a5 62BuildRequires: perl-tools-pod
d41f35db 63BuildRequires: rpmbuild(macros) >= 1.652
7d81af7d 64%if %{with glibc} || %{with dynamic}
6648e383
JP
65BuildRequires: libtirpc-devel
66BuildRequires: pkgconfig
67%endif
ef0df9c1 68%if %{with initrd} || %{with static}
4643837f
AM
69 %if %{with musl}
70BuildRequires: linux-musl-headers
71BuildRequires: musl-devel
d32b3739 72BuildRequires: libtirpc-musl-devel
6f6b5afa 73 %else
74 %if %{with glibc}
1735ff25 75BuildRequires: glibc-static
b36f2957 76BuildRequires: libcom_err-static
6648e383 77BuildRequires: libtirpc-static
b36f2957
AM
78BuildRequires: openssl-static
79BuildRequires: sqlite3-static
6f6b5afa 80 %else
cbbddfaa 81%if "%{_target_base_arch}" != "%{_host_base_arch}"
9922ba41 82BuildRequires: cross%{_target_base_arch}-uClibc-static
9a45af3a 83%else
9922ba41 84 %ifarch ppc %{x8664}
c574afd9 85BuildRequires: uClibc-static >= 3:0.9.30.1
9922ba41 86 %else
c574afd9 87BuildRequires: uClibc-static >= 3:0.9.30.1
9922ba41 88 %endif
9a45af3a 89%endif
6f6b5afa 90 %endif
91 %endif
1735ff25 92%endif
a54ace54 93%{?with_sh_prov:Provides: /bin/sh}
2678f462
JB
94%{?with_fileutl_prov:Provides: fileutils}
95%{?with_grep_prov:Provides: grep}
0f80cc3e 96Provides: busybox-implementation = %{version}-%{release}
ee61dafa
MM
97BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
98
a7ec8c50
AM
99%define _enable_debug_packages 0
100
e7982b05 101%define _bindir /bin
fc11b50f 102
cbbddfaa 103%if "%{_target_base_arch}" != "%{_host_base_arch}"
9922ba41 104 %define CrossOpts CROSS="%{_target_cpu}-pld-linux-"
105%else
106 %define CrossOpts %{nil}
107%endif
108
558ca139
JR
109%define filterout_ld -Wl,-z,(combreloc|relro)
110
b4887080
JP
111%if %{with dynamic}
112%define tirpcdcflags %(pkg-config --cflags libtirpc)
113%endif
114%if %{with initrd} || %{with static}
115%if %{with musl}
116%define tirpcscflags -I%{_includedir}/musl/tirpc
117%endif
118%if %{with glibc}
119%define tirpcscflags %(pkg-config --cflags libtirpc)
120%endif
121%endif
c92df9cf 122%if %{with glibc}
6648e383 123%if %{with initrd} || %{with static}
b36f2957 124%define tirpcslibs %(pkg-config --libs --static libtirpc krb5 krb5-gssapi openssl sqlite3|sed 's/-l//g')
6648e383 125%endif
6648e383 126%endif
c92df9cf
AM
127
128%if %{with dynamic}
129%define tirpcdlibs %(pkg-config --libs libtirpc|sed s/-l//g)
6648e383
JP
130%endif
131
a9ed32a3 132%if %{with musl}
b4887080 133%define tirpcslibs tirpc
a9ed32a3
AM
134%endif
135
ee61dafa 136%description
65512310 137BusyBox combines tiny versions of many common UNIX utilities into a
138single small executable. It provides minimalist replacements for most
139of the utilities you usually find in fileutils, shellutils, findutils,
140textutils, grep, gzip, tar, etc. BusyBox provides a fairly complete
141POSIX environment for any small or embedded system. The utilities in
142BusyBox generally have fewer options than their full-featured GNU
143cousins; however, the options that are included provide the expected
144functionality and behave very much like their GNU counterparts.
145
146BusyBox has been written with size-optimization and limited resources
147in mind. It is also extremely modular so you can easily include or
148exclude commands (or features) at compile time. This makes it easy to
149customize your embedded systems. To create a working system, just add
150a kernel, a shell (such as ash), and an editor (such as elvis-tiny or
151ae).
ee61dafa 152
c499e458
JR
153%description -l pl.UTF-8
154BusyBox składa małe wersje wielu narzędzi uniksowych w jeden mały plik
155wykonywalny. Zapewnia minimalne zastępniki większości narzędzi
b7f899e9 156zawartych w pakietach fileutils, shellutils, findutils, grep, gzip,
c499e458
JR
157tar itp. BusyBox daje w miarę kompletne środowisko POSIX dla małych
158lub wbudowanych systemów. Narzędzia mają mniej opcji niż ich pełne
159odpowiedniki GNU, ale mają podstawową funkcjonalność. Do działającego
b7f899e9
JB
160systemu potrzeba jeszcze tylko kernela, shella (np. ash) oraz edytora
161(np. elvis-tiny albo ae).
162
c499e458
JR
163%description -l pt_BR.UTF-8
164BusyBox combina versões reduzidas de muitos utilitários UNIX num único
165executável, fornecendo substitutos minimalistas para muitos dos
166executáveis encontrados em pacotes como fileutils, shellutils,
167findutils, textutils, grep, gzip, tar, etc. Os utilitários do BusyBox
168em geral têm menos opções que os utilitários GNU, mas as opções
68092394 169implementadas comportam-se de maneira similar aos equivalentes GNU.
170
34ec6041
JB
171%package static
172Summary: Static busybox
718bff43 173Summary(pl.UTF-8): Statycznie skonsolidowany busybox
34ec6041 174Group: Applications
34ec6041
JB
175
176%description static
177Static busybox.
178
c499e458 179%description static -l pl.UTF-8
dfafd31f 180Statycznie skonsolidowany busybox.
34ec6041 181
52db7bd4
MM
182%package initrd
183Summary: Static busybox for initrd
718bff43 184Summary(pl.UTF-8): Statycznie skonsolidowany busybox dla initrd
11aa4d91 185Group: Base
1857f402 186Conflicts: geninitrd < 10000.20
0f80cc3e 187Provides: busybox-implementation = %{version}-%{release}
52db7bd4
MM
188
189%description initrd
190Static busybox for initrd.
191
c499e458 192%description initrd -l pl.UTF-8
dfafd31f 193Statycznie skonsolidowany busybox dla initrd.
52db7bd4 194
ee61dafa 195%prep
693dc2a0 196%setup -q
aad3a7f3 197%patch0 -p1
0b555ee8
JB
198%patch1 -p1
199%patch2 -p1
0cf45dc5 200%patch4 -p1
0b555ee8 201%patch5 -p1
5a7abf9a 202%patch6 -p1
0b555ee8 203%patch7 -p1
7a6bf0ae 204%patch8 -p1
586f52e3 205%patch9 -p1
459c400e 206%patch10 -p1
b36f2957 207%patch11 -p1
ea0cda84 208
ee61dafa 209%build
839c36a5 210install -d built
52db7bd4 211%if %{with initrd}
4f8fe04f 212install %{SOURCE2} .config
4643837f
AM
213%if %{with musl}
214sed -i -e 's|CONFIG_FEATURE_VI_REGEX_SEARCH=y|# CONFIG_FEATURE_VI_REGEX_SEARCH is not set|g' .config
4643837f 215%endif
a9ed32a3 216echo 'CONFIG_EXTRA_LDLIBS="%{?with_glibc:%{tirpcslibs}} %{?with_musl:%{tirpcslibs}}"' >> .config
4f8fe04f 217%{__make} oldconfig
52db7bd4 218%{__make} \
91a4c8e3 219 %{?with_verbose:V=1} \
ed59edba 220 EXTRA_CFLAGS="%{rpmcflags} %{?tirpcscflags} -Os -D_GNU_SOURCE %{?with_musl:-I%{_includedir}/musl} %{!?with_glibc:-fno-stack-protector}" \
4643837f
AM
221 EXTRA_LDFLAGS="%{rpmldflags} -static -Wl,-z,noexecstack %{?with_musl:-L%{_libdir}/musl}" \
222%if %{with musl}
223 CC="musl-gcc"
1735ff25
MM
224%else
225%if %{with glibc}
9922ba41 226 %{CrossOpts} \
1735ff25 227 CC="%{__cc}"
27ca3ce9 228%else
cbbddfaa 229 %if "%{_target_base_arch}" != "%{_host_base_arch}"
9922ba41 230 CROSS="%{_target_cpu}-uclibc-" \
a54ace54 231 %endif
27ca3ce9
AM
232 CC="%{_target_cpu}-uclibc-gcc"
233%endif
1735ff25
MM
234%endif
235
839c36a5 236mv -f busybox built/busybox.initrd
52db7bd4 237%{__make} clean
52db7bd4
MM
238%endif
239
6648e383 240%if %{with static}
1735ff25
MM
241%if %{with altconfig}
242install %{SOURCE3} .config
13fc95fb
ER
243%else
244install %{SOURCE1} .config
a9ed32a3 245echo 'CONFIG_EXTRA_LDLIBS="%{?with_glibc:%{tirpcslibs}} %{?with_musl:%{tirpcslibs}}""' >> .config
1735ff25 246%endif
4643837f
AM
247%if %{with musl}
248sed -i -e 's|CONFIG_FEATURE_VI_REGEX_SEARCH=y|# CONFIG_FEATURE_VI_REGEX_SEARCH is not set|g' .config
4643837f
AM
249sed -i -e 's|CONFIG_EXTRA_COMPAT=y|# CONFIG_EXTRA_COMPAT is not set|g' .config
250%endif
4f8fe04f 251%{__make} oldconfig
6f6b5afa 252%{__make} \
91a4c8e3 253 %{?with_verbose:V=1} \
ed59edba 254 EXTRA_CFLAGS="%{rpmcflags} %{?tirpcscflags} -Os -D_GNU_SOURCE %{?with_musl:-I%{_includedir}/musl} %{!?with_glibc:-fno-stack-protector}" \
4643837f
AM
255 EXTRA_LDFLAGS="%{rpmldflags} -static -Wl,-z,noexecstack %{?with_musl:-L%{_libdir}/musl}" \
256%if %{with musl}
257 CC="musl-gcc"
ef0df9c1
JR
258%else
259%if %{with glibc}
260 %{CrossOpts} \
52db7bd4 261 CC="%{__cc}"
ef0df9c1 262%else
cbbddfaa 263 %if "%{_target_base_arch}" != "%{_host_base_arch}"
ef0df9c1 264 CROSS="%{_target_cpu}-uclibc-" \
a54ace54 265 %endif
ef0df9c1
JR
266 CC="%{_target_cpu}-uclibc-gcc"
267%endif
268%endif
269
839c36a5 270mv -f busybox built/busybox.static
2481202a 271%{__make} clean
34ec6041 272%endif
2481202a 273
63de0802 274%if %{with dynamic}
6648e383
JP
275%if %{with altconfig}
276install %{SOURCE3} .config
277%else
278install %{SOURCE1} .config
c92df9cf 279echo 'CONFIG_EXTRA_LDLIBS="%{tirpcdlibs}"' >> .config
6648e383 280%endif
b5011fd7 281%{__make} oldconfig
b7f899e9 282%{__make} \
91a4c8e3 283 %{?with_verbose:V=1} \
9922ba41 284 %{CrossOpts} \
b4887080 285 EXTRA_CFLAGS="%{rpmcflags} %{tirpcdcflags} %{!?with_glibc:-fno-stack-protector}" \
fb8bb2b8 286 EXTRA_LDFLAGS="%{rpmldflags} -Wl,-z,noexecstack" \
f5ad7fd6 287 CC="%{__cc}"
bf1f4257 288%{__make} busybox.links docs/busybox.1
63de0802 289%endif
4e2ab1f5 290
ee61dafa
MM
291%install
292rm -rf $RPM_BUILD_ROOT
b7f899e9 293
63de0802
JB
294%if %{with static}
295install -d $RPM_BUILD_ROOT%{_bindir}
296install built/busybox.static $RPM_BUILD_ROOT%{_bindir}
297%endif
298
a71afd72
JR
299%if %{with initrd}
300install -d $RPM_BUILD_ROOT%{_libdir}/initrd
1857f402 301install built/busybox.initrd $RPM_BUILD_ROOT%{_libdir}/initrd/busybox
a71afd72 302%endif
34ec6041 303
63de0802
JB
304%if %{with dynamic}
305install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,%{_libdir}/busybox}
b7f899e9 306install busybox.links $RPM_BUILD_ROOT%{_libdir}/busybox
bf1f4257 307install docs/busybox.1 $RPM_BUILD_ROOT%{_mandir}/man1
ee61dafa 308
d635bde0 309# install links to busybox binary, when linkfl is defined
4a69c6c5 310%if %{with linkfl}
2678f462 311%{__make} install \
5a7abf9a 312 PREFIX=$RPM_BUILD_ROOT
4a69c6c5
MM
313%else
314install busybox $RPM_BUILD_ROOT%{_bindir}
315%endif
63de0802 316%endif
d635bde0 317
ee61dafa
MM
318%clean
319rm -rf $RPM_BUILD_ROOT
320
63de0802 321%if %{with dynamic}
ee61dafa
MM
322%files
323%defattr(644,root,root,755)
a230e0df 324%doc AUTHORS README .config
d635bde0 325
4a69c6c5 326%if %{with linkfl}
77109ddb 327%attr(755,root,root) /bin/*
d635bde0 328%attr(755,root,root) /sbin/*
329%attr(755,root,root) %{_bindir}/*
330%attr(755,root,root) %{_sbindir}/*
4a69c6c5
MM
331%else
332%attr(755,root,root) %{_bindir}/busybox
d635bde0 333%endif
334
65512310 335%{_libdir}/busybox
77109ddb 336%{_mandir}/man1/busybox.1*
63de0802 337%endif
bb4ca08e 338
4a69c6c5 339%if %{with static}
34ec6041
JB
340%files static
341%defattr(644,root,root,755)
342%attr(755,root,root) %{_bindir}/busybox.static
343%endif
52db7bd4
MM
344
345%if %{with initrd}
346%files initrd
347%defattr(644,root,root,755)
1857f402 348%attr(755,root,root) %{_libdir}/initrd/busybox
52db7bd4 349%endif
This page took 0.251916 seconds and 4 git commands to generate.