]>
Commit | Line | Data |
---|---|---|
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 | 32 | Summary: Set of common Unix utilities for embeded systems |
718bff43 ER |
33 | Summary(pl.UTF-8): Zestaw narzędzi uniksowych dla systemów wbudowanych |
34 | Summary(pt_BR.UTF-8): BusyBox é um conjunto de utilitários UNIX em um único binário | |
ee61dafa | 35 | Name: busybox |
586f52e3 | 36 | # stable line only |
bef59233 | 37 | Version: 1.15.3 |
fb09982a | 38 | Release: 1 |
ee61dafa | 39 | License: GPL |
d79d7625 | 40 | Group: Applications |
693dc2a0 | 41 | Source0: http://www.busybox.net/downloads/%{name}-%{version}.tar.bz2 |
bef59233 | 42 | # Source0-md5: 6059ac9456de6fb18dc8ee4cd0ec9240 |
4f8fe04f AM |
43 | Source1: %{name}.config |
44 | Source2: %{name}-initrd.config | |
8f98fac8 | 45 | %{?with_altconfig:Source3: %{cfgfile}} |
b2b9509f | 46 | Patch1: %{name}-logconsole.patch |
47 | Patch2: %{name}-printf-gettext.patch | |
48 | Patch3: %{name}-loadfont.patch | |
29a4a582 JR |
49 | Patch4: %{name}-kernel_headers.patch |
50 | Patch5: %{name}-insmod-morearchs.patch | |
51 | Patch6: %{name}-dhcp.patch | |
52 | Patch7: %{name}-fix_64_archs.patch | |
29a4a582 | 53 | Patch9: %{name}-ash-export-PATH.patch |
87902b66 | 54 | URL: http://www.busybox.net/ |
255676bf | 55 | BuildRequires: gcc >= 3.2 |
839c36a5 | 56 | BuildRequires: perl-tools-pod |
02cf2722 | 57 | BuildRequires: rpmbuild(macros) >= 1.333 |
ef0df9c1 | 58 | %if %{with initrd} || %{with static} |
6f6b5afa | 59 | %if %{with dietlibc} |
1735ff25 | 60 | BuildRequires: dietlibc-static |
6f6b5afa | 61 | %else |
62 | %if %{with glibc} | |
1735ff25 | 63 | BuildRequires: glibc-static |
6f6b5afa | 64 | %else |
9922ba41 | 65 | %if "%{_target_base_arch}" != "%{_arch}" |
66 | BuildRequires: cross%{_target_base_arch}-uClibc-static | |
9a45af3a | 67 | %else |
9922ba41 | 68 | %ifarch ppc %{x8664} |
c574afd9 | 69 | BuildRequires: uClibc-static >= 3:0.9.30.1 |
9922ba41 | 70 | %else |
c574afd9 | 71 | BuildRequires: 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 |
80 | BuildRoot: %{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 | 93 | BusyBox combines tiny versions of many common UNIX utilities into a |
94 | single small executable. It provides minimalist replacements for most | |
95 | of the utilities you usually find in fileutils, shellutils, findutils, | |
96 | textutils, grep, gzip, tar, etc. BusyBox provides a fairly complete | |
97 | POSIX environment for any small or embedded system. The utilities in | |
98 | BusyBox generally have fewer options than their full-featured GNU | |
99 | cousins; however, the options that are included provide the expected | |
100 | functionality and behave very much like their GNU counterparts. | |
101 | ||
102 | BusyBox has been written with size-optimization and limited resources | |
103 | in mind. It is also extremely modular so you can easily include or | |
104 | exclude commands (or features) at compile time. This makes it easy to | |
105 | customize your embedded systems. To create a working system, just add | |
106 | a kernel, a shell (such as ash), and an editor (such as elvis-tiny or | |
107 | ae). | |
ee61dafa | 108 | |
c499e458 JR |
109 | %description -l pl.UTF-8 |
110 | BusyBox składa małe wersje wielu narzędzi uniksowych w jeden mały plik | |
111 | wykonywalny. Zapewnia minimalne zastępniki większości narzędzi | |
b7f899e9 | 112 | zawartych w pakietach fileutils, shellutils, findutils, grep, gzip, |
c499e458 JR |
113 | tar itp. BusyBox daje w miarę kompletne środowisko POSIX dla małych |
114 | lub wbudowanych systemów. Narzędzia mają mniej opcji niż ich pełne | |
115 | odpowiedniki GNU, ale mają podstawową funkcjonalność. Do działającego | |
b7f899e9 JB |
116 | systemu 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 |
120 | BusyBox combina versões reduzidas de muitos utilitários UNIX num único | |
121 | executável, fornecendo substitutos minimalistas para muitos dos | |
122 | executáveis encontrados em pacotes como fileutils, shellutils, | |
123 | findutils, textutils, grep, gzip, tar, etc. Os utilitários do BusyBox | |
124 | em geral têm menos opções que os utilitários GNU, mas as opções | |
68092394 | 125 | implementadas comportam-se de maneira similar aos equivalentes GNU. |
126 | ||
34ec6041 JB |
127 | %package static |
128 | Summary: Static busybox | |
718bff43 | 129 | Summary(pl.UTF-8): Statycznie skonsolidowany busybox |
34ec6041 | 130 | Group: Applications |
34ec6041 JB |
131 | |
132 | %description static | |
133 | Static busybox. | |
134 | ||
c499e458 | 135 | %description static -l pl.UTF-8 |
dfafd31f | 136 | Statycznie skonsolidowany busybox. |
34ec6041 | 137 | |
52db7bd4 MM |
138 | %package initrd |
139 | Summary: Static busybox for initrd | |
718bff43 | 140 | Summary(pl.UTF-8): Statycznie skonsolidowany busybox dla initrd |
52db7bd4 | 141 | Group: Applications |
8a586e0d | 142 | Conflicts: geninitrd < 10000.10 |
52db7bd4 MM |
143 | |
144 | %description initrd | |
145 | Static busybox for initrd. | |
146 | ||
c499e458 | 147 | %description initrd -l pl.UTF-8 |
dfafd31f | 148 | Statycznie 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 | 162 | install -d built |
52db7bd4 | 163 | %if %{with initrd} |
4f8fe04f AM |
164 | install %{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 | 185 | mv -f busybox built/busybox.initrd |
52db7bd4 | 186 | %{__make} clean |
52db7bd4 MM |
187 | %endif |
188 | ||
13fc95fb | 189 | |
1735ff25 MM |
190 | %if %{with altconfig} |
191 | install %{SOURCE3} .config | |
13fc95fb ER |
192 | %else |
193 | install %{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 | 217 | mv -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 |
231 | rm -rf $RPM_BUILD_ROOT | |
17f25024 | 232 | install -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} |
236 | install -d $RPM_BUILD_ROOT%{_libdir}/initrd | |
3bdca86e | 237 | install built/busybox.initrd $RPM_BUILD_ROOT%{_libdir}/initrd/initrd-busybox |
a71afd72 | 238 | %endif |
34ec6041 | 239 | |
b7f899e9 JB |
240 | install busybox.links $RPM_BUILD_ROOT%{_libdir}/busybox |
241 | install docs/BusyBox.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
65512310 | 242 | echo ".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 |
249 | install busybox $RPM_BUILD_ROOT%{_bindir} | |
250 | %endif | |
d635bde0 | 251 | |
ee61dafa MM |
252 | %clean |
253 | rm -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 |