Mail archive
alpine-aports

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

From: Sören Tempel <soeren+git_at_soeren-tempel.net>
Date: Mon, 15 Feb 2016 23:28:18 +0100

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).

The ssh package is only been provided for compatibility reason.
---
 main/dropbear/APKBUILD | 54 ++++++++++++++++++++++++++++++--------------------
 1 file changed, 32 insertions(+), 22 deletions(-)
diff --git a/main/dropbear/APKBUILD b/main/dropbear/APKBUILD
index f0bc5b8..58ed0bc 100644
--- a/main/dropbear/APKBUILD
+++ b/main/dropbear/APKBUILD
_at_@ -3,7 +3,7 @@
 # Maintainer: Natanael Copa <ncopa_at_alpinelinux.org>
 pkgname=dropbear
 pkgver=2015.71
-pkgrel=1
+pkgrel=2
 pkgdesc="small SSH 2 client/server designed for small memory environments"
 url="http://matt.ucc.asn.au/dropbear/dropbear.html"
 arch="all"
_at_@ -11,7 +11,11 @@ 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
_at_@ -19,7 +23,7 @@ source="http://matt.ucc.asn.au/dropbear/releases/${pkgname}-${pkgver}.tar.bz2
 	dropbear-options_sftp-server_path.patch"
 
 _builddir="$srcdir"/$pkgname-$pkgver
-_progs="dropbear dbclient dropbearkey dropbearconvert scp ssh"
+_progs="dropbear dropbearkey dbclient dropbearconvert scp"
 
 prepare() {
 	cd "$_builddir"
_at_@ -42,39 +46,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
-	install -D -m755 "$srcdir"/dropbear.initd \
+	make PROGRAMS="$_progs" DESTDIR="$pkgdir" \
+		-C "$_builddir" install || return 1
+
+	install -Dm755 "$srcdir"/dropbear.initd \
 		"$pkgdir"/etc/init.d/dropbear || return 1
-	install -D -m644 "$srcdir"/dropbear.confd \
+	install -Dm644 "$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 command"
+	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="2ccc0a2f3e37ca221db12c5af6a88137  dropbear-2015.71.tar.bz2
-- 
2.7.1
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Mon Feb 15 2016 - 23:28:18 GMT