Gentoo Archives: gentoo-commits

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