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