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