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