Subject: [alpine-devel] new aport dropbear

From: "Carlo Landmeter" <[email-masked]>
Date: Tue, 20 Jan 2009 18:13:27 +0000

Natanael,

I have created this aport inside extra. If it should go in testing please move.
I have "stolen" the initd file from gentoo so i left the header. if you want to remove it go ahead.

Carlo.

From 6d0190b2feaff0a659ceb9ed0168bf4f85e057c2 Mon Sep 17 00:00:00 2001
From: root <root@guest1.(none)>
Date: Tue, 20 Jan 2009 17:59:17 +0000
Subject: [PATCH] extra/dropbear new aport

---
 extra/dropbear/APKBUILD       |   36 ++++++++++++++++++++++++++++++++++++
 extra/dropbear/dropbear.confd |    6 ++++++
 extra/dropbear/dropbear.initd |   36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 78 insertions(+), 0 deletions(-)
 create mode 100644 extra/dropbear/APKBUILD
 create mode 100644 extra/dropbear/dropbear.confd
 create mode 100644 extra/dropbear/dropbear.initd

diff --git a/extra/dropbear/APKBUILD b/extra/dropbear/APKBUILD
new file mode 100644
index 0000000..6398e50
--- /dev/null
+++ b/extra/dropbear/APKBUILD
@@ -0,0 +1,36 @@
+# Contributor: Carlo Landmeter <clandmeter at gmail>
+pkgname=dropbear
+pkgver=0.52
+pkgrel=0
+pkgdesc="small SSH 2 client/server designed for small memory environments"
+url="http://matt.ucc.asn.au/dropbear/dropbear.html"
+license='MIT'
+depends="zlib"
+makedepends="zlib-dev"
+source="http://matt.ucc.asn.au/dropbear/releases/${pkgname}-${pkgver}.tar.bz2
+dropbear.initd
+dropbear.confd"
+
+build() {
+        cd "$srcdir/$pkgname-$pkgver"
+
+        ./configure --prefix=/usr \
+        --disable-lastlog
+        progs="dbclient dropbearkey dropbearconvert scp"
+        make PROGRAMS="dropbear ${progs}" MULTI=1 || return 1
+        install -Dm755 "$srcdir/$pkgname-$pkgver"/dropbearmulti "$pkgdir"/usr/bin/dropbearmulti
+        for i in ${progs}; do
+          msg "linking ${i##*/}"
+          ln -s "$srcdir/$pkgname-$pkgver"/dropbearmulti "$pkgdir"/usr/bin/"$i"
+        done
+	msg "linking dropbear"
+	mkdir -p "$pkgdir"/usr/sbin
+	ln -s "$srcdir/$pkgname-$pkgver"/dropbearmulti "$pkgdir"/usr/sbin/dropbear
+        install -D -m755 "$srcdir"/dropbear.initd "$pkgdir"/etc/init.d/dropbear
+        install -D -m644 "$srcdir"/dropbear.confd "$pkgdir"/etc/conf.d/dropbear
+}
+
+md5sums="a1fc7adf601bca53330a792a9c873439  dropbear-0.52.tar.bz2
+34fea1c967596ebcd6d10d38444f2b92  dropbear.initd
+af73c487e2be37d65d0e8bf80489357e  dropbear.confd"
+
diff --git a/extra/dropbear/dropbear.confd b/extra/dropbear/dropbear.confd
new file mode 100644
index 0000000..555f275
--- /dev/null
+++ b/extra/dropbear/dropbear.confd
@@ -0,0 +1,6 @@
+# /etc/conf.d/dropbear: config file for /etc/init.d/dropbear
+
+# see `dropbear -h` for more information
+# -w disables root logins
+# -p # changes the port number to listen on
+DROPBEAR_OPTS=""
diff --git a/extra/dropbear/dropbear.initd b/extra/dropbear/dropbear.initd
new file mode 100644
index 0000000..afdee8c
--- /dev/null
+++ b/extra/dropbear/dropbear.initd
@@ -0,0 +1,36 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dropbear/files/dropbear.init.d,v 1.2 2004/07/14 23:57:35 agriffis Exp $
+
+depend() {
+	use logger dns
+	need net
+}
+
+check_config() {
+	if [ ! -e /etc/dropbear/ ] ; then
+		mkdir /etc/dropbear/
+	fi
+	if [ ! -e /etc/dropbear/dropbear_dss_host_key ] ; then
+		einfo "Generating DSS-Hostkey..."
+		/usr/bin/dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
+	fi
+	if [ ! -e /etc/dropbear/dropbear_rsa_host_key ] ; then
+		einfo "Generating RSA-Hostkey..."
+		/usr/bin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
+	fi
+}
+
+start() {
+	check_config || return 1
+	ebegin "Starting dropbear"
+	/usr/sbin/dropbear ${DROPBEAR_OPTS}
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping dropbear"
+	start-stop-daemon --stop --pidfile /var/run/dropbear.pid
+	eend $?
+}
-- 
1.6.1

---

From: Natanael Copa <[email-masked]>
Date: Wed, 21 Jan 2009 14:21:40 +0100

> I have created this aport inside extra. If it should go in testing

It looks ok and does no things that could directly put things in danger.
extra is good.

> you want to remove it go ahead.

no, thats the way to do it :)

> 
> Carlo.
> 
> 
> 
> 
> 
> 
> 
> 
> differences
> between files
> attachment
> (0001-extra-dropbear-new-aport.patch)
> 
        ^^^^
Please configure your git.

git config --global user.name ...
git config --global user.email ...

> Subject: [PATCH] extra/dropbear new aport

I took the liberty to manually edit the patch and set your name and
email before i commited.

Thanks!

-nc

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

---

From: Natanael Copa <[email-masked]>
Date: Wed, 21 Jan 2009 14:25:23 +0100

> I have "stolen" the initd file from gentoo so i left the header. if you want to remove it go ahead.

nclab01:~/aports/extra/dropbear$ tar -ztf dropbear-0.52-r0.apk | grep scp
usr/bin/scp
nclab01:~/aports/extra/dropbear$ apk info -L openssh | grep scp
usr/bin/scp

I wonder if we could rename the dropbear scp to dbscp so it does not conflict with openssh?

-nc

---