Subject: [alpine-aports] [PATCH] main/busybox: split package into core and suid subpackages

From: Christian Kampka <[email-masked]>
Date: Mon, 26 Oct 2015 14:48:24 +0100

---
 main/alpine-base/APKBUILD    |  2 +-
 main/busybox/APKBUILD        | 18 +++++++++++++-----
 main/busybox/busybox.trigger |  3 +--
 3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/main/alpine-base/APKBUILD b/main/alpine-base/APKBUILD
index 834d763..cb55dd3 100644
--- a/main/alpine-base/APKBUILD
+++ b/main/alpine-base/APKBUILD
@@ -7,7 +7,7 @@ pkgdesc="Meta package for minimal alpine base"
 url="http://alpinelinux.org"
 arch="noarch"
 license="GPL"
-depends="alpine-baselayout alpine-conf apk-tools busybox busybox-initscripts
+depends="alpine-baselayout alpine-conf apk-tools busybox busybox-suid busybox-initscripts
 	openrc libc-utils alpine-keys"
 makedepends=""
 install=""
diff --git a/main/busybox/APKBUILD b/main/busybox/APKBUILD
index c548540..bd0780d 100644
--- a/main/busybox/APKBUILD
+++ b/main/busybox/APKBUILD
@@ -2,15 +2,13 @@
 # Maintainer: Natanael Copa <[email-masked]>
 pkgname=busybox
 pkgver=1.23.2
-pkgrel=9
+pkgrel=10
 pkgdesc="Size optimized toolbox of many common UNIX utilities"
 url=http://busybox.net
 arch="all"
 license="GPL2"
-depends=
 makedepends="linux-headers"
-install="$pkgname.post-install $pkgname.post-upgrade"
-subpackages="$pkgname-static"
+subpackages="$pkgname-static $pkgname-suid"
 options="suid"
 triggers="busybox.trigger=/bin:/usr/bin:/sbin:/usr/sbin:/lib/modules/*"
 source="http://busybox.net/downloads/$pkgname-$pkgver.tar.bz2
@@ -41,6 +39,7 @@ _sdir="$srcdir"/$pkgname-$pkgver
 _staticdir="$srcdir"/build-static
 _dyndir="$srcdir"/build-dynamic
 _config="$srcdir"/busyboxconfig
+
 prepare() {
 	mkdir -p "$_staticdir" "$_dyndir"
 	#patches
@@ -92,7 +91,6 @@ package() {
 		"$pkgdir"/var/cache/misc "$pkgdir"/bin "$pkgdir"/sbin
 	chmod 1777 "$pkgdir"/tmp
 	install -m755 busybox "$pkgdir"/bin/busybox || return 1
-	install -m4111 bbsuid "$pkgdir"/bin/bbsuid || return 1
 	# we need /bin/sh to be able to execute post-install
 	ln -s /bin/busybox "$pkgdir"/bin/sh
 
@@ -114,6 +112,16 @@ package() {
 		"$pkgdir"/etc/udhcpd.conf || return 1
 }
 
+suid() {
+	pkgdesc="suid binaries of Busybox"
+	depends="${pkgname}"
+	triggers="busybox-suid.trigger=/bin:/usr/bin:/sbin:/usr/sbin"
+
+	cd "$_dyndir"
+	mkdir -p "$subpkgdir"/bin
+	install -m4111 bbsuid "$subpkgdir"/bin/bbsuid || return 1
+}
+
 static() {
 	pkgdesc="Statically linked Busybox"
 	mkdir -p "$subpkgdir"/bin
diff --git a/main/busybox/busybox.trigger b/main/busybox/busybox.trigger
index 39cc6b4..c9f9059 100644
--- a/main/busybox/busybox.trigger
+++ b/main/busybox/busybox.trigger
@@ -14,7 +14,6 @@ for i in "$@"; do
 done
 
 if [ -n "$do_bb_install" ]; then
-	/bin/bbsuid --install
+	[ -e /bin/bbsuid ] && /bin/bbsuid --install
 	/bin/busybox --install -s
 fi
-
-- 
2.6.1

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---