Patches for aports can be sent to this list

1

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

Sören Tempel
Details
Message ID
<1455575298-29434-1-git-send-email-soeren+git@soeren-tempel.net>
Sender timestamp
1455575298
DKIM signature
missing
Download raw message
Patch: +32 -22
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
@@ -3,7 +3,7 @@
 # Maintainer: Natanael Copa <ncopa@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"
@@ -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
@@ -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"
@@ -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@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Isaac Dunham
Details
Message ID
<20160216022556.GA5320@newbook>
In-Reply-To
<1455575298-29434-1-git-send-email-soeren+git@soeren-tempel.net> (view parent)
Sender timestamp
1455589557
DKIM signature
missing
Download raw message
On Mon, Feb 15, 2016 at 11:28:18PM +0100, Sören Tempel wrote:
> 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).


dropbearconvert is also included, as is dbclient (alternate name for 'ssh')
...
I think you're right about shipping symlinks in multiple packages being
stupid, but IMHO a better approach would be to move towards the busybox
packaging (although I'm not sure what the "right" approach is.)

Thanks,
Isaac Dunham



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---