]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | Summary: Set of common unix utils for embeded systems | |
3 | Name: busybox | |
4 | Version: 1.12.1 | |
5 | Release: 1 | |
6 | License: GPL | |
7 | Group: Applications | |
8 | Source0: http://www.busybox.net/downloads/%{name}-%{version}.tar.bz2 | |
9 | # Source0-md5: dc2e5e00d6fee8229ae92884c68733a7 | |
10 | Source1: %{name}-initrd.config | |
11 | Source2: %{name}-system.config | |
12 | Patch0: %{name}-grep.patch | |
13 | Patch1: %{name}-modprobe.patch | |
14 | Patch2: %{name}-standalone.patch | |
15 | Patch3: %{name}-vi.patch | |
16 | Patch4: %{name}-lineedit.patch | |
17 | Patch5: %{name}-basename.patch | |
18 | Patch6: %{name}-login.patch | |
19 | URL: http://www.busybox.net/ | |
20 | BuildRequires: gcc >= 3.2 | |
21 | BuildRequires: perl-tools-pod | |
22 | BuildRequires: rpmbuild(macros) >= 1.333 | |
23 | BuildRequires: uClibc-static >= 2:0.9.21 | |
24 | #ExclusiveArch: i586 | |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
27 | %define _bindir /bin | |
28 | %define _initrd_bindir /bin | |
29 | ||
30 | %if "%{_target_base_arch}" != "%{_arch}" | |
31 | %define CrossOpts CROSS="%{_target_cpu}-pld-linux-" | |
32 | %else | |
33 | %define CrossOpts %{nil} | |
34 | %endif | |
35 | ||
36 | %description | |
37 | BusyBox combines tiny versions of many common UNIX utilities into a | |
38 | single small executable. It provides minimalist replacements for most | |
39 | of the utilities you usually find in fileutils, shellutils, findutils, | |
40 | textutils, grep, gzip, tar, etc. BusyBox provides a fairly complete | |
41 | POSIX environment for any small or embedded system. The utilities in | |
42 | BusyBox generally have fewer options than their full-featured GNU | |
43 | cousins; however, the options that are included provide the expected | |
44 | functionality and behave very much like their GNU counterparts. | |
45 | ||
46 | BusyBox has been written with size-optimization and limited resources | |
47 | in mind. It is also extremely modular so you can easily include or | |
48 | exclude commands (or features) at compile time. This makes it easy to | |
49 | customize your embedded systems. To create a working system, just add | |
50 | a kernel, a shell (such as ash), and an editor (such as elvis-tiny or | |
51 | ae). | |
52 | ||
53 | %package CRI-initrd | |
54 | Summary: Busybox for CRI initrd images | |
55 | Group: Applications | |
56 | Conflicts: geninitrd < 3075 | |
57 | ||
58 | %description CRI-initrd | |
59 | Busybox for CRI initrd images. | |
60 | ||
61 | %package CRI-system | |
62 | Summary: Busybox for CRI system images | |
63 | Group: Applications | |
64 | Conflicts: geninitrd < 3075 | |
65 | ||
66 | %description CRI-system | |
67 | Busybox for CRI system images. | |
68 | ||
69 | %prep | |
70 | %setup -q | |
71 | %patch0 -p1 | |
72 | %patch1 -p1 | |
73 | %patch2 -p1 | |
74 | %patch3 -p1 | |
75 | %patch4 -p1 | |
76 | %patch5 -p1 | |
77 | %patch6 -p1 | |
78 | ||
79 | %build | |
80 | install -d built | |
81 | install %{SOURCE1} .config | |
82 | %{__make} oldconfig | |
83 | %{__make} \ | |
84 | CROSS_CFLAGS="%{rpmcflags} -Os -D_BSD_SOURCE" \ | |
85 | LDFLAGS="%{ld_rpmldflags} -static" \ | |
86 | %if "%{_target_base_arch}" != "%{_arch}" | |
87 | CROSS="%{_target_cpu}-uclibc-" \ | |
88 | %endif | |
89 | CC="%{_target_cpu}-uclibc-gcc" | |
90 | ||
91 | mv -f busybox built/busybox.initrd | |
92 | %{__make} clean | |
93 | ||
94 | install %{SOURCE2} .config | |
95 | %{__make} oldconfig | |
96 | %{__make} \ | |
97 | CROSS_CFLAGS="%{rpmcflags} -Os -D_BSD_SOURCE" \ | |
98 | LDFLAGS="%{ld_rpmldflags} -static" \ | |
99 | %if "%{_target_base_arch}" != "%{_arch}" | |
100 | CROSS="%{_target_cpu}-uclibc-" \ | |
101 | %endif | |
102 | CC="%{_target_cpu}-uclibc-gcc" | |
103 | ||
104 | mv -f busybox built/busybox.system | |
105 | %{__make} clean | |
106 | ||
107 | ||
108 | %install | |
109 | rm -rf $RPM_BUILD_ROOT | |
110 | install -d $RPM_BUILD_ROOT%{_bindir} | |
111 | ||
112 | install built/busybox.initrd $RPM_BUILD_ROOT%{_bindir} | |
113 | install built/busybox.system $RPM_BUILD_ROOT%{_bindir} | |
114 | ||
115 | %clean | |
116 | rm -rf $RPM_BUILD_ROOT | |
117 | ||
118 | %files CRI-initrd | |
119 | %defattr(644,root,root,755) | |
120 | %attr(755,root,root) %{_bindir}/busybox.initrd | |
121 | ||
122 | %files CRI-system | |
123 | %defattr(644,root,root,755) | |
124 | %attr(755,root,root) %{_bindir}/busybox.system |