busybox.spec 6.09 KB
Newer Older
1 2
Summary: Single binary providing simplified versions of system commands
Name: busybox
3
Version: 1.29.3
4 5 6
Release: 1
License: GPLv2
Group: System/Shells
7
Source0: http://www.busybox.net/downloads/%{name}-%{version}.tar.bz2
8
Source1: rpm/udhcpd.service
9
Source2: busybox-static.config
10 11
Source3: busybox-sailfish.config
Patch0:  0001-Copy-extended-attributes-if-p-flag-is-provided-to-cp.patch
Islam Amer's avatar
Islam Amer committed
12
URL: https://github.com/mer-packages/busybox 
13

14 15 16
Obsoletes: time <= 1.7
Provides: time > 1.7

17
# Providing only part of iputils, but should be enough for us. 
18 19 20
Obsoletes: iputils <= 20101006
Provides: iputils > 20101006

21 22
BuildRequires: glibc-static

23 24 25 26 27 28 29 30 31 32 33 34
%define debug_package %{nil}

%package docs
Group: Documentation
Summary: Busybox Documentation

%description
Busybox is a single binary which includes versions of a large number
of system commands, including a shell.  This package can be very
useful for recovering from certain types of system failures,
particularly those involving broken shared libraries.

35 36 37 38 39 40 41 42 43 44 45
%package static
Group: System Environment/Shells
Summary: Statically linked version of busybox

%description static
Busybox is a single binary which includes versions of a large number
of system commands, including a shell.  This package can be very
useful for recovering from certain types of system failures,
particularly those involving broken shared libraries. This package provides
a statically linked version of Busybox.

46
%package symlinks-dosfstools
47
Requires: %{name} = %{version}-%{release}
48 49 50 51 52 53 54 55 56 57
Group: System/Shells
Summary: Busybox replacements for dosfstools

%description symlinks-dosfstools
Busybox is a single binary which includes versions of a large number
of system commands, including a shell.  This package can be very
useful for recovering from certain types of system failures,
particularly those involving broken shared libraries. This
is the symlinks implementing part of dosfstools.

58
%package symlinks-gzip
59
Requires: %{name} = %{version}-%{release}
60 61
Group: System/Shells
Summary: Busybox replacements for gzip
62 63
Provides: gzip = %{version}
Obsoletes: gzip <= 1.5
64 65 66 67 68 69 70 71

%description symlinks-gzip
Busybox is a single binary which includes versions of a large number
of system commands, including a shell.  This package can be very
useful for recovering from certain types of system failures,
particularly those involving broken shared libraries. This
is the symlinks implementing gzip replacements.

72
%package symlinks-dhcp
73
Requires: %{name} = %{version}-%{release}
74 75 76 77 78 79 80 81 82 83
Group: System/Shells
Summary: Busybox dhcp utilities

%description symlinks-dhcp
Busybox is a single binary which includes versions of a large number
of system commands, including a shell.  This package can be very
useful for recovering from certain types of system failures,
particularly those involving broken shared libraries. This contains
the symlinks implementing the dhcp utilities (udhcpc/udhcpcd).

84
%package symlinks-diffutils
85
Requires: %{name} = %{version}-%{release}
86 87 88 89 90 91 92 93 94 95 96 97 98
Group: System/Shells
Summary: Busybox replacements for diffutils
Provides: diffutils = %{version}
Obsoletes: diffutils <= 2.8.1

%description symlinks-diffutils
Busybox is a single binary which includes versions of a large number
of system commands, including a shell.  This package can be very
useful for recovering from certain types of system failures,
particularly those involving broken shared libraries. This
is the symlinks implementing part of diffutils replacements.

%package symlinks-findutils
99
Requires: %{name} = %{version}-%{release}
100 101 102 103 104 105 106 107 108 109 110 111 112
Group: System/Shells
Summary: Busybox replacements for findutils
Provides: findutils = %{version}
Obsoletes: findutils <= 4.2.31

%description symlinks-findutils
Busybox is a single binary which includes versions of a large number
of system commands, including a shell.  This package can be very
useful for recovering from certain types of system failures,
particularly those involving broken shared libraries. This
is the symlinks implementing findutils replacements.

%package symlinks-grep
113
Requires: %{name} = %{version}-%{release}
114 115 116 117 118 119 120 121 122 123 124 125
Group: System/Shells
Summary: Busybox replacements for grep
Provides: grep = %{version}
Obsoletes: grep <= 2.5.1a

%description symlinks-grep
Busybox is a single binary which includes versions of a large number
of system commands, including a shell.  This package can be very
useful for recovering from certain types of system failures,
particularly those involving broken shared libraries. This
is the symlinks implementing grep, egrep and fgrep replacements.

126 127 128 129
%description docs
Busybox documentation and user guides

%prep
130 131
%setup -q -n %{name}-%{version}/upstream
%patch0 -p1
132 133

%build
134 135 136 137 138 139 140 141 142 143 144 145
# TODO: This config should be synced with the dynamic config at some point
# currently the features differ quite a bit
cp %{SOURCE2} .config
yes "" | make oldconfig
make %{?jobs:-j%jobs}
cp busybox busybox-static

# clean any leftovers from static build
make clean
make distclean

# Build dynamic version
146
cp %{SOURCE3} .config
147 148 149 150 151 152
yes "" | make oldconfig
make %{_smp_mflags}
make busybox.links
cat >> busybox.links << EOF
/usr/bin/gzip
/usr/bin/gunzip
153
/usr/sbin/udhcpc
154
/bin/find
155 156 157 158 159 160
EOF

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/bin
install -m 755 busybox %{buildroot}/bin/busybox
161
install -m 644 -D %{SOURCE1} %{buildroot}/lib/systemd/system/udhcpd.service
162
applets/install.sh %{buildroot} --symlinks
163
rm -f %{buildroot}/sbin/udhcpc
164

165 166
install -m 755 busybox-static %{buildroot}/bin/busybox-static

167 168 169 170
%files
%defattr(-,root,root,-)
%doc LICENSE
/bin/busybox
171 172 173 174 175 176
/bin/ping
/bin/ping6
/usr/bin/time
/usr/bin/traceroute
/usr/bin/traceroute6
/usr/sbin/arping
177

178 179 180 181
%files static
%defattr(-,root,root,-)
/bin/busybox-static

182
%files docs
183
%defattr(-,root,root,-)
184 185
%doc LICENSE docs/busybox.net/*.html

186 187 188 189 190
%files symlinks-dosfstools
%defattr(-,root,root,-)
/sbin/mkdosfs
/sbin/mkfs.vfat

191
%files symlinks-gzip
192
%defattr(-,root,root,-)
193 194 195 196 197
/bin/gunzip
/usr/bin/gunzip
/bin/gzip
/usr/bin/gzip
/bin/zcat
198 199 200 201 202

%files symlinks-dhcp
%defattr(-,root,root,-)
/usr/sbin/udhcpc
/usr/sbin/udhcpd
203
/lib/systemd/system/udhcpd.service
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220

%files symlinks-diffutils
%defattr(-,root,root,-)
/usr/bin/diff
/usr/bin/cmp

%files symlinks-findutils
%defattr(-,root,root,-)
/bin/find
/usr/bin/find
/usr/bin/xargs

%files symlinks-grep
%defattr(-,root,root,-)
/bin/grep
/bin/egrep
/bin/fgrep