]> git.pld-linux.org Git - packages/busybox.git/blame - busybox.spec
- up to 1.26.2; enable more features 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
19%bcond_with dietlibc # build dietlibc-based initrd and static versions
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
4ec69b2b
JR
33%define with_glibc 1
34%endif
35%ifarch x32
36# until uClibc builds on x32
37%undefine with_static
1735ff25 38%endif
dce89576 39Summary: Set of common Unix utilities for embeded systems
718bff43
ER
40Summary(pl.UTF-8): Zestaw narzędzi uniksowych dla systemów wbudowanych
41Summary(pt_BR.UTF-8): BusyBox é um conjunto de utilitários UNIX em um único binário
ee61dafa 42Name: busybox
586f52e3 43# stable line only
aa5e93d3 44Version: 1.26.2
4b24ae19 45Release: 1
bbbc183d 46License: GPL v2
d79d7625 47Group: Applications
693dc2a0 48Source0: http://www.busybox.net/downloads/%{name}-%{version}.tar.bz2
aa5e93d3 49# Source0-md5: bb59d25ee2643db20f212eec539429f1
4f8fe04f
AM
50Source1: %{name}.config
51Source2: %{name}-initrd.config
8f98fac8 52%{?with_altconfig:Source3: %{cfgfile}}
aad3a7f3 53Patch0: x32.patch
b2b9509f 54Patch1: %{name}-logconsole.patch
55Patch2: %{name}-printf-gettext.patch
56Patch3: %{name}-loadfont.patch
29a4a582
JR
57Patch4: %{name}-kernel_headers.patch
58Patch5: %{name}-insmod-morearchs.patch
59Patch6: %{name}-dhcp.patch
60Patch7: %{name}-fix_64_archs.patch
29a4a582 61Patch9: %{name}-ash-export-PATH.patch
87902b66 62URL: http://www.busybox.net/
255676bf 63BuildRequires: gcc >= 3.2
839c36a5 64BuildRequires: perl-tools-pod
d41f35db 65BuildRequires: rpmbuild(macros) >= 1.652
ef0df9c1 66%if %{with initrd} || %{with static}
6f6b5afa 67 %if %{with dietlibc}
1735ff25 68BuildRequires: dietlibc-static
6f6b5afa 69 %else
70 %if %{with glibc}
1735ff25 71BuildRequires: glibc-static
6f6b5afa 72 %else
cbbddfaa 73%if "%{_target_base_arch}" != "%{_host_base_arch}"
9922ba41 74BuildRequires: cross%{_target_base_arch}-uClibc-static
9a45af3a 75%else
9922ba41 76 %ifarch ppc %{x8664}
c574afd9 77BuildRequires: uClibc-static >= 3:0.9.30.1
9922ba41 78 %else
c574afd9 79BuildRequires: uClibc-static >= 3:0.9.30.1
9922ba41 80 %endif
9a45af3a 81%endif
6f6b5afa 82 %endif
83 %endif
1735ff25 84%endif
a54ace54 85%{?with_sh_prov:Provides: /bin/sh}
2678f462
JB
86%{?with_fileutl_prov:Provides: fileutils}
87%{?with_grep_prov:Provides: grep}
0f80cc3e 88Provides: busybox-implementation = %{version}-%{release}
ee61dafa
MM
89BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
90
e7982b05 91%define _bindir /bin
fc11b50f 92
cbbddfaa 93%if "%{_target_base_arch}" != "%{_host_base_arch}"
9922ba41 94 %define CrossOpts CROSS="%{_target_cpu}-pld-linux-"
95%else
96 %define CrossOpts %{nil}
97%endif
98
558ca139
JR
99%define filterout_ld -Wl,-z,(combreloc|relro)
100
ee61dafa 101%description
65512310 102BusyBox combines tiny versions of many common UNIX utilities into a
103single small executable. It provides minimalist replacements for most
104of the utilities you usually find in fileutils, shellutils, findutils,
105textutils, grep, gzip, tar, etc. BusyBox provides a fairly complete
106POSIX environment for any small or embedded system. The utilities in
107BusyBox generally have fewer options than their full-featured GNU
108cousins; however, the options that are included provide the expected
109functionality and behave very much like their GNU counterparts.
110
111BusyBox has been written with size-optimization and limited resources
112in mind. It is also extremely modular so you can easily include or
113exclude commands (or features) at compile time. This makes it easy to
114customize your embedded systems. To create a working system, just add
115a kernel, a shell (such as ash), and an editor (such as elvis-tiny or
116ae).
ee61dafa 117
c499e458
JR
118%description -l pl.UTF-8
119BusyBox składa małe wersje wielu narzędzi uniksowych w jeden mały plik
120wykonywalny. Zapewnia minimalne zastępniki większości narzędzi
b7f899e9 121zawartych w pakietach fileutils, shellutils, findutils, grep, gzip,
c499e458
JR
122tar itp. BusyBox daje w miarę kompletne środowisko POSIX dla małych
123lub wbudowanych systemów. Narzędzia mają mniej opcji niż ich pełne
124odpowiedniki GNU, ale mają podstawową funkcjonalność. Do działającego
b7f899e9
JB
125systemu potrzeba jeszcze tylko kernela, shella (np. ash) oraz edytora
126(np. elvis-tiny albo ae).
127
c499e458
JR
128%description -l pt_BR.UTF-8
129BusyBox combina versões reduzidas de muitos utilitários UNIX num único
130executável, fornecendo substitutos minimalistas para muitos dos
131executáveis encontrados em pacotes como fileutils, shellutils,
132findutils, textutils, grep, gzip, tar, etc. Os utilitários do BusyBox
133em geral têm menos opções que os utilitários GNU, mas as opções
68092394 134implementadas comportam-se de maneira similar aos equivalentes GNU.
135
34ec6041
JB
136%package static
137Summary: Static busybox
718bff43 138Summary(pl.UTF-8): Statycznie skonsolidowany busybox
34ec6041 139Group: Applications
34ec6041
JB
140
141%description static
142Static busybox.
143
c499e458 144%description static -l pl.UTF-8
dfafd31f 145Statycznie skonsolidowany busybox.
34ec6041 146
52db7bd4
MM
147%package initrd
148Summary: Static busybox for initrd
718bff43 149Summary(pl.UTF-8): Statycznie skonsolidowany busybox dla initrd
11aa4d91 150Group: Base
1857f402 151Conflicts: geninitrd < 10000.20
0f80cc3e 152Provides: busybox-implementation = %{version}-%{release}
52db7bd4
MM
153
154%description initrd
155Static busybox for initrd.
156
c499e458 157%description initrd -l pl.UTF-8
dfafd31f 158Statycznie skonsolidowany busybox dla initrd.
52db7bd4 159
ee61dafa 160%prep
693dc2a0 161%setup -q
aad3a7f3 162%patch0 -p1
0b555ee8
JB
163%patch1 -p1
164%patch2 -p1
a54ace54 165#%patch3 -p1
0cf45dc5 166%patch4 -p1
0b555ee8 167%patch5 -p1
5a7abf9a 168%patch6 -p1
0b555ee8 169%patch7 -p1
586f52e3 170%patch9 -p1
ea0cda84 171
ee61dafa 172%build
839c36a5 173install -d built
52db7bd4 174%if %{with initrd}
4f8fe04f
AM
175install %{SOURCE2} .config
176%{__make} oldconfig
52db7bd4 177%{__make} \
91a4c8e3 178 %{?with_verbose:V=1} \
95f61a42 179 CROSS_CFLAGS="%{rpmcflags} -Os -D_BSD_SOURCE" \
63de0802 180 LDFLAGS="%{rpmldflags} -static" \
27ca3ce9 181%if %{with dietlibc}
52db7bd4 182 LIBRARIES="-lrpc" \
661e2e64 183 CC="diet %{__cc}"
1735ff25
MM
184%else
185%if %{with glibc}
9922ba41 186 %{CrossOpts} \
1735ff25 187 CC="%{__cc}"
27ca3ce9 188%else
cbbddfaa 189 %if "%{_target_base_arch}" != "%{_host_base_arch}"
9922ba41 190 CROSS="%{_target_cpu}-uclibc-" \
a54ace54 191 %endif
27ca3ce9
AM
192 CC="%{_target_cpu}-uclibc-gcc"
193%endif
1735ff25
MM
194%endif
195
839c36a5 196mv -f busybox built/busybox.initrd
52db7bd4 197%{__make} clean
52db7bd4
MM
198%endif
199
1735ff25
MM
200%if %{with altconfig}
201install %{SOURCE3} .config
13fc95fb
ER
202%else
203install %{SOURCE1} .config
1735ff25
MM
204%endif
205
4a69c6c5 206%if %{with static}
4f8fe04f 207%{__make} oldconfig
6f6b5afa 208%{__make} \
91a4c8e3 209 %{?with_verbose:V=1} \
ef0df9c1 210 CROSS_CFLAGS="%{rpmcflags} -Os -D_BSD_SOURCE" \
63de0802 211 LDFLAGS="%{rpmldflags} -static" \
ef0df9c1
JR
212%if %{with dietlibc}
213 LIBRARIES="-lrpc" \
661e2e64 214 CC="diet %{__cc}"
ef0df9c1
JR
215%else
216%if %{with glibc}
217 %{CrossOpts} \
52db7bd4 218 CC="%{__cc}"
ef0df9c1 219%else
cbbddfaa 220 %if "%{_target_base_arch}" != "%{_host_base_arch}"
ef0df9c1 221 CROSS="%{_target_cpu}-uclibc-" \
a54ace54 222 %endif
ef0df9c1
JR
223 CC="%{_target_cpu}-uclibc-gcc"
224%endif
225%endif
226
839c36a5 227mv -f busybox built/busybox.static
2481202a 228%{__make} clean
34ec6041 229%endif
2481202a 230
63de0802 231%if %{with dynamic}
b5011fd7 232%{__make} oldconfig
b7f899e9 233%{__make} \
91a4c8e3 234 %{?with_verbose:V=1} \
9922ba41 235 %{CrossOpts} \
b7f899e9 236 CFLAGS_EXTRA="%{rpmcflags}" \
63de0802 237 LDFLAGS="%{rpmldflags}" \
f5ad7fd6 238 CC="%{__cc}"
bf1f4257 239%{__make} busybox.links docs/busybox.1
63de0802 240%endif
4e2ab1f5 241
ee61dafa
MM
242%install
243rm -rf $RPM_BUILD_ROOT
b7f899e9 244
63de0802
JB
245%if %{with static}
246install -d $RPM_BUILD_ROOT%{_bindir}
247install built/busybox.static $RPM_BUILD_ROOT%{_bindir}
248%endif
249
a71afd72
JR
250%if %{with initrd}
251install -d $RPM_BUILD_ROOT%{_libdir}/initrd
1857f402 252install built/busybox.initrd $RPM_BUILD_ROOT%{_libdir}/initrd/busybox
a71afd72 253%endif
34ec6041 254
63de0802
JB
255%if %{with dynamic}
256install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,%{_libdir}/busybox}
b7f899e9 257install busybox.links $RPM_BUILD_ROOT%{_libdir}/busybox
bf1f4257 258install docs/busybox.1 $RPM_BUILD_ROOT%{_mandir}/man1
ee61dafa 259
d635bde0 260# install links to busybox binary, when linkfl is defined
4a69c6c5 261%if %{with linkfl}
2678f462 262%{__make} install \
5a7abf9a 263 PREFIX=$RPM_BUILD_ROOT
4a69c6c5
MM
264%else
265install busybox $RPM_BUILD_ROOT%{_bindir}
266%endif
63de0802 267%endif
d635bde0 268
ee61dafa
MM
269%clean
270rm -rf $RPM_BUILD_ROOT
271
63de0802 272%if %{with dynamic}
ee61dafa
MM
273%files
274%defattr(644,root,root,755)
a230e0df 275%doc AUTHORS README .config
d635bde0 276
4a69c6c5 277%if %{with linkfl}
77109ddb 278%attr(755,root,root) /bin/*
d635bde0 279%attr(755,root,root) /sbin/*
280%attr(755,root,root) %{_bindir}/*
281%attr(755,root,root) %{_sbindir}/*
4a69c6c5
MM
282%else
283%attr(755,root,root) %{_bindir}/busybox
d635bde0 284%endif
285
65512310 286%{_libdir}/busybox
77109ddb 287%{_mandir}/man1/busybox.1*
63de0802 288%endif
bb4ca08e 289
4a69c6c5 290%if %{with static}
34ec6041
JB
291%files static
292%defattr(644,root,root,755)
293%attr(755,root,root) %{_bindir}/busybox.static
294%endif
52db7bd4
MM
295
296%if %{with initrd}
297%files initrd
298%defattr(644,root,root,755)
1857f402 299%attr(755,root,root) %{_libdir}/initrd/busybox
52db7bd4 300%endif
This page took 0.094448 seconds and 4 git commands to generate.