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: Sun, 13 Jan 2019 05:02:08
Message-Id: 1547355665.9712201ffd00d11e4f3392c8012fd306f1b3ff5c.zlogene@gentoo
1 commit: 9712201ffd00d11e4f3392c8012fd306f1b3ff5c
2 Author: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 13 05:01:05 2019 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 13 05:01:05 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9712201f
7
8 sys-apps/busybox: Version bump (v1.30.0)
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.0.ebuild | 333 +++++++++++++++++++++++++++++++++
15 2 files changed, 334 insertions(+)
16
17 diff --git a/sys-apps/busybox/Manifest b/sys-apps/busybox/Manifest
18 index 7deb255a217..9e14b4f10c4 100644
19 --- a/sys-apps/busybox/Manifest
20 +++ b/sys-apps/busybox/Manifest
21 @@ -1,2 +1,3 @@
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
26 diff --git a/sys-apps/busybox/busybox-1.30.0.ebuild b/sys-apps/busybox/busybox-1.30.0.ebuild
27 new file mode 100644
28 index 00000000000..f091f9def62
29 --- /dev/null
30 +++ b/sys-apps/busybox/busybox-1.30.0.ebuild
31 @@ -0,0 +1,333 @@
32 +# Copyright 1999-2019 Gentoo Authors
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=""
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 + # glibc-2.26 and later does not ship RPC implientation
213 + busybox_config_option n FEATURE_HAVE_RPC
214 + busybox_config_option n FEATURE_INETD_RPC
215 +
216 + # default a bunch of uncommon options to off
217 + local opt
218 + for opt in \
219 + ADD_SHELL \
220 + BEEP BOOTCHARTD \
221 + CRONTAB \
222 + DC DEVFSD DNSD DPKG{,_DEB} \
223 + FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
224 + FEATURE_DEVFS \
225 + HOSTID HUSH \
226 + INETD INOTIFYD IPCALC \
227 + LOCALE_SUPPORT LOGNAME LPD \
228 + MAKEMIME MKFS_MINIX MSH \
229 + OD \
230 + RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
231 + SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
232 + TASKSET TCPSVD \
233 + RPM RPM2CPIO \
234 + UDPSVD UUDECODE UUENCODE
235 + do
236 + busybox_config_option n ${opt}
237 + done
238 +
239 + emake -j1 oldconfig > /dev/null
240 +}
241 +
242 +src_compile() {
243 + unset KBUILD_OUTPUT #88088
244 + export SKIP_STRIP=y
245 +
246 + emake V=1 busybox
247 +}
248 +
249 +src_install() {
250 + unset KBUILD_OUTPUT #88088
251 + save_config .config
252 +
253 + into /
254 + dodir /bin
255 + if use sep-usr ; then
256 + # install /ginit to take care of mounting stuff
257 + exeinto /
258 + newexe busybox_unstripped ginit
259 + dosym /ginit /bin/bb
260 + dosym bb /bin/busybox
261 + else
262 + newbin busybox_unstripped busybox
263 + dosym busybox /bin/bb
264 + fi
265 + if use mdev ; then
266 + dodir /$(get_libdir)/mdev/
267 + use make-symlinks || dosym /bin/bb /sbin/mdev
268 + cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
269 +
270 + exeinto /$(get_libdir)/mdev/
271 + doexe "${FILESDIR}"/mdev/*
272 +
273 + newinitd "${FILESDIR}"/mdev.initd mdev
274 + fi
275 + if use livecd ; then
276 + dosym busybox /bin/vi
277 + fi
278 +
279 + # add busybox daemon's, bug #444718
280 + if busybox_config_enabled FEATURE_NTPD_SERVER; then
281 + newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
282 + newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
283 + fi
284 + if busybox_config_enabled SYSLOGD; then
285 + newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
286 + newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
287 + fi
288 + if busybox_config_enabled KLOGD; then
289 + newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
290 + newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
291 + fi
292 + if busybox_config_enabled WATCHDOG; then
293 + newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
294 + newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
295 + fi
296 + if busybox_config_enabled UDHCPC; then
297 + local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
298 + exeinto "${path%/*}"
299 + newexe examples/udhcp/simple.script "${path##*/}"
300 + fi
301 + if busybox_config_enabled UDHCPD; then
302 + insinto /etc
303 + doins examples/udhcp/udhcpd.conf
304 + fi
305 +
306 + # bundle up the symlink files for use later
307 + emake DESTDIR="${ED}" install
308 + rm _install/bin/busybox
309 + # for compatibility, provide /usr/bin/env
310 + mkdir -p _install/usr/bin
311 + ln -s /bin/env _install/usr/bin/env
312 + tar cf busybox-links.tar -C _install . || : #;die
313 + insinto /usr/share/${PN}
314 + use make-symlinks && doins busybox-links.tar
315 +
316 + dodoc AUTHORS README TODO
317 +
318 + cd docs
319 + docinto txt
320 + dodoc *.txt
321 + docinto pod
322 + dodoc *.pod
323 + docinto html
324 + dodoc *.html
325 +
326 + cd ../examples
327 + docinto examples
328 + dodoc inittab depmod.pl *.conf *.script undeb unrpm
329 +}
330 +
331 +pkg_preinst() {
332 + if use make-symlinks && [[ ! ${VERY_BRAVE_OR_VERY_DUMB} == "yes" ]] && [[ ${ROOT} == "/" ]] ; then
333 + ewarn "setting USE=make-symlinks and emerging to / is very dangerous."
334 + ewarn "it WILL overwrite lots of system programs like: ls bash awk grep (bug 60805 for full list)."
335 + ewarn "If you are creating a binary only and not merging this is probably ok."
336 + ewarn "set env VERY_BRAVE_OR_VERY_DUMB=yes if this is really what you want."
337 + die "silly options will destroy your system"
338 + fi
339 +
340 + if use make-symlinks ; then
341 + mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
342 + fi
343 +}
344 +
345 +pkg_postinst() {
346 + savedconfig_pkg_postinst
347 +
348 + if use make-symlinks ; then
349 + cd "${T}" || die
350 + mkdir _install
351 + tar xf busybox-links.tar -C _install || die
352 + cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
353 + fi
354 +
355 + if use sep-usr ; then
356 + elog "In order to use the sep-usr support, you have to update your"
357 + elog "kernel command line. Add the option:"
358 + elog " init=/ginit"
359 + elog "To launch a different init than /sbin/init, use:"
360 + elog " init=/ginit /sbin/yourinit"
361 + elog "To get a rescue shell, you may boot with:"
362 + elog " init=/ginit bb"
363 + fi
364 +}