Subject: [alpine-aports] [PATCH] main/dropbear: add ssh command in -ssh subpackage

From: Valery Kartel <[email-masked]>
Date: Mon, 8 Feb 2016 14:25:59 +0200

---
 main/dropbear/APKBUILD | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/main/dropbear/APKBUILD b/main/dropbear/APKBUILD
index 2829344..f0bc5b8 100644
--- a/main/dropbear/APKBUILD
+++ b/main/dropbear/APKBUILD
@@ -3,7 +3,7 @@
 # Maintainer: Natanael Copa <[email-masked]>
 pkgname=dropbear
 pkgver=2015.71
-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,7 +11,7 @@ license="MIT"
 depends=""
 depends_dev=""
 makedepends="zlib-dev linux-headers"
-subpackages="$pkgname-doc $pkgname-scp:_scp"
+subpackages="$pkgname-doc $pkgname-scp:_scp $pkgname-ssh:_ssh"
 source="http://matt.ucc.asn.au/dropbear/releases/${pkgname}-${pkgver}.tar.bz2
 	dropbear.initd
 	dropbear.confd
@@ -19,7 +19,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"
+_progs="dropbear dbclient dropbearkey dropbearconvert scp ssh"
 
 prepare() {
 	cd "$_builddir"
@@ -69,6 +69,14 @@ _scp() {
 	mv "$pkgdir"/usr/bin/scp "$subpkgdir"/usr/bin/
 }
 
+_ssh() {
+	pkgdesc="Dropbear ssh command"
+	depends="dropbear !openssh-client"
+	arch="noarch"
+	mkdir -p "$subpkgdir"/usr/bin
+	mv "$pkgdir"/usr/bin/ssh "$subpkgdir"/usr/bin/
+}
+
 md5sums="2ccc0a2f3e37ca221db12c5af6a88137  dropbear-2015.71.tar.bz2
 4299b86af9f2903f19477538e22ece30  dropbear.initd
 af73c487e2be37d65d0e8bf80489357e  dropbear.confd
-- 
2.7.0

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

---

From: Sören Tempel <[email-masked]>
Date: Wed, 10 Feb 2016 12:38:37 +0100

> +	mv "$pkgdir"/usr/bin/ssh "$subpkgdir"/usr/bin/

I like the idea of having -ssh and -scp subpackages for dropbear,
however, correct me if I am wrong but the `/usr/bin/ssh` is just a
symlink to dropbear multi (so is `/usr/bin/scp`) does it really make
sense to have subpackages for symlinks? Wouldn't it make more sense to
not use the multicall binary if we want to split this package into
multiple subpackages?

Sören.

---

---

From: Valery Kartel <[email-masked]>
Date: Wed, 10 Feb 2016 18:49:10 +0200

I just add ssh exactly like scp. I think it's better to include it all to
main package and allow opennssh-client to replace it with own binaries. In
other words, made it like busybox with symlinks, that are replaced by
linux-utils, coreutils etc.