Gentoo Archives: gentoo-commits

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