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