Gentoo Archives: gentoo-commits

From: Mikle Kolyada <zlogene@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/
Date: Tue, 29 May 2018 14:31:05
Message-Id: 1527604253.ecfe5ca5eabd31d816540bb5e70d204c819d2c14.zlogene@gentoo
1 commit: ecfe5ca5eabd31d816540bb5e70d204c819d2c14
2 Author: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 29 14:29:48 2018 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Tue May 29 14:30:53 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ecfe5ca5
7
8 sys-apps/busybox: Version bump
9
10 Package-Manager: Portage-2.3.24, Repoman-2.3.6
11
12 sys-apps/busybox/Manifest | 1 +
13 sys-apps/busybox/busybox-1.28.4.ebuild | 329 +++++++++++++++++++++++++++++++++
14 2 files changed, 330 insertions(+)
15
16 diff --git a/sys-apps/busybox/Manifest b/sys-apps/busybox/Manifest
17 index 5573bd68092..6958ccd0259 100644
18 --- a/sys-apps/busybox/Manifest
19 +++ b/sys-apps/busybox/Manifest
20 @@ -1,3 +1,4 @@
21 DIST busybox-1.28.0.tar.bz2 2261831 BLAKE2B 9cbb133d59711dde90ef5b20bfd4b892e34565103eaa64b2000b042bd2b9b234df14b5e8b74f7cf8f9071b907e1b9eff556e852bb921088d81548473430d3acf SHA512 346a71d44e6c4e1889ac12ae52320cb0c3d0c45c2b4b49fc4e3c0bb25f427707d8075150d545906f414b9f4e5b6d8f1a3afe8cdc31f6a64e06c62b400d7d129b
22 DIST busybox-1.28.1.tar.bz2 2260551 BLAKE2B 5dbe7d4fe63ff187bb1458368891c570016cd67406b7e1e4f675555d969c8655d258a0f6b3ba0ac26cc65739d65694f9042d00d9920ee610a6f79f62fb9bfb5d SHA512 c2d551eb70210d63d891614f4469ad3ec151dbd10fce96b2355dd1f2ea43a32ed08cc8f1d1ab361fb547199a19902d17a2935b839aeee2e1c3c8a1ed012db732
23 DIST busybox-1.28.3.tar.bz2 2260586 BLAKE2B f2fec31ab1c6e6b865cea20a2819f58cb8e4c789051a8fdc8c8ca43367049fa9038e07f3fe806ba7abd90cb6a6aefdb0d095afb68119c11e94240647da6d48ce SHA512 0e87019d9d1179bc072a5ef9752d7342747e311db13c0b0dfa9f380a1e3ad1c265cca118d41f86829629ec5c8eb3e83985421c6f3ea6c8a9991b92ed301a4982
24 +DIST busybox-1.28.4.tar.bz2 2263342 BLAKE2B f35c81e67136d888a998f41b1418589e4bddaacde25d55eb509822a13ab93d351dcda6b147794a47e3c3c5c4141e9d8cc834ed239e0afba176f08bf3cb55b911 SHA512 92471617fcf3c1e28b468f3de2c83a1041f5ba5106580cc791e9c4cd602b7ccffabc51ce0807881ed734a89c3089113048265d6659a4d595528bd9150288d2ed
25
26 diff --git a/sys-apps/busybox/busybox-1.28.4.ebuild b/sys-apps/busybox/busybox-1.28.4.ebuild
27 new file mode 100644
28 index 00000000000..ea0b4ce81fb
29 --- /dev/null
30 +++ b/sys-apps/busybox/busybox-1.28.4.ebuild
31 @@ -0,0 +1,329 @@
32 +# Copyright 1999-2018 Gentoo Foundation
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
36 +
37 +EAPI=6
38 +
39 +inherit flag-o-matic savedconfig toolchain-funcs
40 +
41 +DESCRIPTION="Utilities for rescue and embedded systems"
42 +HOMEPAGE="https://www.busybox.net/"
43 +if [[ ${PV} == "9999" ]] ; then
44 + MY_P=${P}
45 + EGIT_REPO_URI="https://git.busybox.net/busybox"
46 + inherit git-r3
47 +else
48 + MY_P=${PN}-${PV/_/-}
49 + SRC_URI="https://www.busybox.net/downloads/${MY_P}.tar.bz2"
50 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
51 +fi
52 +
53 +LICENSE="GPL-2" # GPL-2 only
54 +SLOT="0"
55 +IUSE="debug ipv6 livecd make-symlinks math mdev pam selinux sep-usr static syslog systemd"
56 +REQUIRED_USE="pam? ( !static )"
57 +RESTRICT="test"
58 +
59 +COMMON_DEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
60 + pam? ( sys-libs/pam )"
61 +DEPEND="${COMMON_DEPEND}
62 + static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
63 + >=sys-kernel/linux-headers-2.6.39"
64 +RDEPEND="${COMMON_DEPEND}
65 + mdev? ( !<sys-apps/openrc-0.13 )"
66 +
67 +S=${WORKDIR}/${MY_P}
68 +
69 +busybox_config_option() {
70 + local flag=$1 ; shift
71 + if [[ ${flag} != [yn] && ${flag} != \"* ]] ; then
72 + busybox_config_option $(usex ${flag} y n) "$@"
73 + return
74 + fi
75 + local expr
76 + while [[ $# -gt 0 ]] ; do
77 + case ${flag} in
78 + y) expr="s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" ;;
79 + n) expr="s:CONFIG_$1=y:# CONFIG_$1 is not set:g" ;;
80 + *) expr="s:.*\<CONFIG_$1\>.*:CONFIG_$1=${flag}:g" ;;
81 + esac
82 + sed -i -e "${expr}" .config || die
83 + einfo "$(grep "CONFIG_$1[= ]" .config || echo "Could not find CONFIG_$1 ...")"
84 + shift
85 + done
86 +}
87 +
88 +busybox_config_enabled() {
89 + local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
90 + case ${val} in
91 + "") return 1 ;;
92 + y) return 0 ;;
93 + *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
94 + esac
95 +}
96 +
97 +# patches go here!
98 +PATCHES=(
99 + "${FILESDIR}"/${PN}-1.26.2-bb.patch
100 + # "${FILESDIR}"/${P}-*.patch
101 +)
102 +
103 +src_prepare() {
104 + default
105 + unset KBUILD_OUTPUT #88088
106 + append-flags -fno-strict-aliasing #310413
107 + use ppc64 && append-flags -mminimal-toc #130943
108 +
109 + cp "${FILESDIR}"/ginit.c init/ || die
110 +
111 + # flag cleanup
112 + sed -i -r \
113 + -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
114 + Makefile.flags || die
115 + #sed -i '/bbsh/s:^//::' include/applets.h
116 + sed -i '/^#error Aborting compilation./d' applets/applets.c || die
117 + use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
118 + sed -i \
119 + -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
120 + -e "/^AR\>/s:=.*:= $(tc-getAR):" \
121 + -e "/^CC\>/s:=.*:= $(tc-getCC):" \
122 + -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
123 + -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
124 + Makefile || die
125 + sed -i \
126 + -e 's:-static-libgcc::' \
127 + Makefile.flags || die
128 +}
129 +
130 +src_configure() {
131 + # check for a busybox config before making one of our own.
132 + # if one exist lets return and use it.
133 +
134 + restore_config .config
135 + if [ -f .config ]; then
136 + yes "" | emake -j1 -s oldconfig >/dev/null
137 + return 0
138 + else
139 + ewarn "Could not locate user configfile, so we will save a default one"
140 + fi
141 +
142 + # setup the config file
143 + emake -j1 -s allyesconfig >/dev/null
144 + # nommu forces a bunch of things off which we want on #387555
145 + busybox_config_option n NOMMU
146 + sed -i '/^#/d' .config
147 + yes "" | emake -j1 -s oldconfig >/dev/null
148 +
149 + # now turn off stuff we really don't want
150 + busybox_config_option n DMALLOC
151 + busybox_config_option n FEATURE_2_4_MODULES #607548
152 + busybox_config_option n FEATURE_SUID_CONFIG
153 + busybox_config_option n BUILD_AT_ONCE
154 + busybox_config_option n BUILD_LIBBUSYBOX
155 + busybox_config_option n FEATURE_CLEAN_UP
156 + busybox_config_option n MONOTONIC_SYSCALL
157 + busybox_config_option n USE_PORTABLE_CODE
158 + busybox_config_option n WERROR
159 + # triming the BSS size may be dangerous
160 + busybox_config_option n FEATURE_USE_BSS_TAIL
161 +
162 + # These cause trouble with musl.
163 + if use elibc_musl; then
164 + busybox_config_option n FEATURE_UTMP
165 + busybox_config_option n EXTRA_COMPAT
166 + busybox_config_option n FEATURE_VI_REGEX_SEARCH
167 + fi
168 +
169 + # If these are not set and we are using a uclibc/busybox setup
170 + # all calls to system() will fail.
171 + busybox_config_option y ASH
172 + busybox_config_option y SH_IS_ASH
173 + busybox_config_option n HUSH
174 + busybox_config_option n SH_IS_HUSH
175 +
176 + busybox_config_option '"/run"' PID_FILE_PATH
177 + busybox_config_option '"/run/ifstate"' IFUPDOWN_IFSTATE_PATH
178 +
179 + # disable ipv6 applets
180 + if ! use ipv6; then
181 + busybox_config_option n FEATURE_IPV6
182 + busybox_config_option n TRACEROUTE6
183 + busybox_config_option n PING6
184 + busybox_config_option n UDHCPC6
185 + fi
186 +
187 + busybox_config_option pam PAM
188 + busybox_config_option static STATIC
189 + busybox_config_option syslog {K,SYS}LOGD LOGGER
190 + busybox_config_option systemd FEATURE_SYSTEMD
191 + busybox_config_option math FEATURE_AWK_LIBM
192 +
193 + # disable features that uClibc doesn't (yet?) provide.
194 + if use elibc_uclibc; then
195 + busybox_config_option n FEATURE_SYNC_FANCY #567598
196 + busybox_config_option n NSENTER
197 + fi
198 +
199 + # all the debug options are compiler related, so punt them
200 + busybox_config_option n DEBUG_SANITIZE
201 + busybox_config_option n DEBUG
202 + busybox_config_option y NO_DEBUG_LIB
203 + busybox_config_option n DMALLOC
204 + busybox_config_option n EFENCE
205 + busybox_config_option $(usex debug y n) TFTP_DEBUG
206 +
207 + busybox_config_option selinux SELINUX
208 +
209 + # this opt only controls mounting with <linux-2.6.23
210 + busybox_config_option n FEATURE_MOUNT_NFS
211 +
212 + # default a bunch of uncommon options to off
213 + local opt
214 + for opt in \
215 + ADD_SHELL \
216 + BEEP BOOTCHARTD \
217 + CRONTAB \
218 + DC DEVFSD DNSD DPKG{,_DEB} \
219 + FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
220 + FEATURE_DEVFS \
221 + HOSTID HUSH \
222 + INETD INOTIFYD IPCALC \
223 + LOCALE_SUPPORT LOGNAME LPD \
224 + MAKEMIME MKFS_MINIX MSH \
225 + OD \
226 + RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
227 + SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
228 + TASKSET TCPSVD \
229 + RPM RPM2CPIO \
230 + UDPSVD UUDECODE UUENCODE
231 + do
232 + busybox_config_option n ${opt}
233 + done
234 +
235 + emake -j1 oldconfig > /dev/null
236 +}
237 +
238 +src_compile() {
239 + unset KBUILD_OUTPUT #88088
240 + export SKIP_STRIP=y
241 +
242 + emake V=1 busybox
243 +}
244 +
245 +src_install() {
246 + unset KBUILD_OUTPUT #88088
247 + save_config .config
248 +
249 + into /
250 + dodir /bin
251 + if use sep-usr ; then
252 + # install /ginit to take care of mounting stuff
253 + exeinto /
254 + newexe busybox_unstripped ginit
255 + dosym /ginit /bin/bb
256 + dosym bb /bin/busybox
257 + else
258 + newbin busybox_unstripped busybox
259 + dosym busybox /bin/bb
260 + fi
261 + if use mdev ; then
262 + dodir /$(get_libdir)/mdev/
263 + use make-symlinks || dosym /bin/bb /sbin/mdev
264 + cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
265 +
266 + exeinto /$(get_libdir)/mdev/
267 + doexe "${FILESDIR}"/mdev/*
268 +
269 + newinitd "${FILESDIR}"/mdev.initd mdev
270 + fi
271 + if use livecd ; then
272 + dosym busybox /bin/vi
273 + fi
274 +
275 + # add busybox daemon's, bug #444718
276 + if busybox_config_enabled FEATURE_NTPD_SERVER; then
277 + newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
278 + newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
279 + fi
280 + if busybox_config_enabled SYSLOGD; then
281 + newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
282 + newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
283 + fi
284 + if busybox_config_enabled KLOGD; then
285 + newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
286 + newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
287 + fi
288 + if busybox_config_enabled WATCHDOG; then
289 + newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
290 + newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
291 + fi
292 + if busybox_config_enabled UDHCPC; then
293 + local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
294 + exeinto "${path%/*}"
295 + newexe examples/udhcp/simple.script "${path##*/}"
296 + fi
297 + if busybox_config_enabled UDHCPD; then
298 + insinto /etc
299 + doins examples/udhcp/udhcpd.conf
300 + fi
301 +
302 + # bundle up the symlink files for use later
303 + emake DESTDIR="${ED}" install
304 + rm _install/bin/busybox
305 + # for compatibility, provide /usr/bin/env
306 + mkdir -p _install/usr/bin
307 + ln -s /bin/env _install/usr/bin/env
308 + tar cf busybox-links.tar -C _install . || : #;die
309 + insinto /usr/share/${PN}
310 + use make-symlinks && doins busybox-links.tar
311 +
312 + dodoc AUTHORS README TODO
313 +
314 + cd docs
315 + docinto txt
316 + dodoc *.txt
317 + docinto pod
318 + dodoc *.pod
319 + docinto html
320 + dodoc *.html
321 +
322 + cd ../examples
323 + docinto examples
324 + dodoc inittab depmod.pl *.conf *.script undeb unrpm
325 +}
326 +
327 +pkg_preinst() {
328 + if use make-symlinks && [[ ! ${VERY_BRAVE_OR_VERY_DUMB} == "yes" ]] && [[ ${ROOT} == "/" ]] ; then
329 + ewarn "setting USE=make-symlinks and emerging to / is very dangerous."
330 + ewarn "it WILL overwrite lots of system programs like: ls bash awk grep (bug 60805 for full list)."
331 + ewarn "If you are creating a binary only and not merging this is probably ok."
332 + ewarn "set env VERY_BRAVE_OR_VERY_DUMB=yes if this is really what you want."
333 + die "silly options will destroy your system"
334 + fi
335 +
336 + if use make-symlinks ; then
337 + mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
338 + fi
339 +}
340 +
341 +pkg_postinst() {
342 + savedconfig_pkg_postinst
343 +
344 + if use make-symlinks ; then
345 + cd "${T}" || die
346 + mkdir _install
347 + tar xf busybox-links.tar -C _install || die
348 + cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
349 + fi
350 +
351 + if use sep-usr ; then
352 + elog "In order to use the sep-usr support, you have to update your"
353 + elog "kernel command line. Add the option:"
354 + elog " init=/ginit"
355 + elog "To launch a different init than /sbin/init, use:"
356 + elog " init=/ginit /sbin/yourinit"
357 + elog "To get a rescue shell, you may boot with:"
358 + elog " init=/ginit bb"
359 + fi
360 +}