Subject: [alpine-aports] [PATCH] main/dropbear: split into subpackages, dont use multicall binary

From: Sören Tempel <[email-masked]>
Date: Thu, 11 Aug 2016 15:24:15 +0200

The dropbear package now only contains dropbear (the server) and
dropbearkey (the key generator). All other programs have been split
into subpackages. Previously we have simply been shipping symlinks in
subpackages which still needed the multicall binary from the dropbear
package (which is stupid imho).
---
 main/dropbear/APKBUILD | 64 +++++++++++++++++++++++++-------------------------
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/main/dropbear/APKBUILD b/main/dropbear/APKBUILD
index 8cb0819..e6e5283 100644
--- a/main/dropbear/APKBUILD
+++ b/main/dropbear/APKBUILD
@@ -3,7 +3,7 @@
 # Maintainer: Natanael Copa <[email-masked]>
 pkgname=dropbear
 pkgver=2016.74
-pkgrel=0
+pkgrel=1
 pkgdesc="small SSH 2 client/server designed for small memory environments"
 url="http://matt.ucc.asn.au/dropbear/dropbear.html"
 arch="all"
@@ -11,28 +11,22 @@ license="MIT"
 depends=""
 depends_dev=""
 makedepends="zlib-dev linux-headers"
-subpackages="$pkgname-doc $pkgname-scp:_scp $pkgname-ssh:_ssh"
+subpackages="$pkgname-doc
+	$pkgname-convert:_convert
+	$pkgname-dbclient:_dbclient
+	$pkgname-ssh:_ssh
+	$pkgname-scp:_scp"
 source="http://matt.ucc.asn.au/dropbear/releases/${pkgname}-${pkgver}.tar.bz2
 	dropbear.initd
 	dropbear.confd
 	dropbear-0.53.1-static_build_fix.patch
 	dropbear-options_sftp-server_path.patch"
 
-_builddir="$srcdir"/$pkgname-$pkgver
-_progs="dropbear dbclient dropbearkey dropbearconvert scp ssh"
-
-prepare() {
-	cd "$_builddir"
-	update_config_sub || return 1
-	for i in $source; do
-		case $i in
-		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
-		esac
-	done
-}
+builddir="$srcdir"/$pkgname-$pkgver
+_progs="dropbear dropbearkey dbclient dropbearconvert scp"
 
 build() {
-	cd "$_builddir"
+	cd "$builddir"
 	./configure \
 		--build=$CBUILD \
 		--host=$CHOST \
@@ -42,39 +36,45 @@ build() {
 		--infodir=/usr/share/info \
 		--localstatedir=/var \
 		|| return 1
-	make PROGRAMS="$_progs" MULTI=1 || return 1
+	make PROGRAMS="$_progs" || return 1
 }
 
 package() {
-	cd "$_builddir"
-	make MULTI=1 DESTDIR="$pkgdir" install || return 1
-	mkdir "$pkgdir"/usr/sbin/
-	for i in $_progs; do
-		case $i in
-		dropbear) ln -s ../bin/dropbearmulti "$pkgdir"/usr/sbin/$i;;
-		*) ln -s dropbearmulti "$pkgdir"/usr/bin/$i;;
-		esac
-	done
+	make PROGRAMS="$_progs" DESTDIR="$pkgdir" \
+		-C "$builddir" install || return 1
+
 	install -D -m755 "$srcdir"/dropbear.initd \
 		"$pkgdir"/etc/init.d/dropbear || return 1
 	install -D -m644 "$srcdir"/dropbear.confd \
 		"$pkgdir"/etc/conf.d/dropbear || return 1
 }
 
+_convert() {
+	pkgdesc="$pkgname dropbearconvert command"
+	depends=""
+	mkdir -p "$subpkgdir"/usr/bin
+	mv "$pkgdir"/usr/bin/dropbearconvert "$subpkgdir"/usr/bin/
+}
+
+_dbclient() {
+	pkgdesc="$pkgname dbclient command"
+	depends=""
+	mkdir -p "$subpkgdir"/usr/bin
+	mv "$pkgdir"/usr/bin/dbclient "$subpkgdir"/usr/bin/
+}
+
 _scp() {
-	pkgdesc="Dropbear scp support"
-	depends="dropbear !openssh-client"
-	arch="noarch"
+	pkgdesc="$pkgname scp support"
+	depends="!openssh-client"
 	mkdir -p "$subpkgdir"/usr/bin
 	mv "$pkgdir"/usr/bin/scp "$subpkgdir"/usr/bin/
 }
 
 _ssh() {
-	pkgdesc="Dropbear ssh command"
-	depends="dropbear !openssh-client"
-	arch="noarch"
+	pkgdesc="$pkgname ssh command (compatibility symlink for dbclient)"
+	depends="dropbear-dbclient !openssh-client"
 	mkdir -p "$subpkgdir"/usr/bin
-	mv "$pkgdir"/usr/bin/ssh "$subpkgdir"/usr/bin/
+	ln -s /usr/bin/dbclient "$subpkgdir"/usr/bin/ssh
 }
 
 md5sums="9ad0172731e0f16623937804643b5bd8  dropbear-2016.74.tar.bz2
-- 
2.9.1

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