X-Original-To: alpine-aports@mail.alpinelinux.org Delivered-To: alpine-aports@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id 809DADC055F for ; Wed, 15 Jul 2015 20:44:22 +0000 (UTC) Received: from apollo.thewebhostserver.com (apollomail.thewebhostserver.com [46.23.65.248]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 4415ADC0210 for ; Wed, 15 Jul 2015 20:44:21 +0000 (UTC) Received: from [81.4.121.188] (port=52400 helo=localhost.localdomain) by apollo.thewebhostserver.com with esmtpsa (TLSv1.2:AES128-SHA256:128) (Exim 4.85) (envelope-from ) id 1ZFTXN-003nKg-Sx; Wed, 15 Jul 2015 21:44:17 +0100 From: Stuart Cardall To: alpine-aports@lists.alpinelinux.org Cc: Stuart Cardall Subject: [alpine-aports] [PATCH] testing/tinyssh: new aport (revised) Date: Wed, 15 Jul 2015 20:43:51 +0000 Message-Id: <1436993031-2383-1-git-send-email-developer@it-offshore.co.uk> X-Mailer: git-send-email 2.4.5 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - apollo.thewebhostserver.com X-AntiAbuse: Original Domain - lists.alpinelinux.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - it-offshore.co.uk X-Get-Message-Sender-Via: apollo.thewebhostserver.com: authenticated_id: developer@it-offshore.co.uk X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: ClamAV using ClamSMTP X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: post-install script removed it also links now against libsodium (used with dnscrypt-proxy) & not the author's internal crypt library. --- testing/tinyssh/APKBUILD | 69 +++++++++++++++++++++++++++++++++++++++++++ testing/tinyssh/tinyssh.confd | 8 +++++ testing/tinyssh/tinyssh.initd | 43 +++++++++++++++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 testing/tinyssh/APKBUILD create mode 100644 testing/tinyssh/tinyssh.confd create mode 100644 testing/tinyssh/tinyssh.initd diff --git a/testing/tinyssh/APKBUILD b/testing/tinyssh/APKBUILD new file mode 100644 index 0000000..f994e49 --- /dev/null +++ b/testing/tinyssh/APKBUILD @@ -0,0 +1,69 @@ +# Contributor: Stuart Cardall +# Maintainer: Stuart Cardall +pkgname=tinyssh +pkgver=20150501 +pkgrel=0 +pkgdesc="Small SSH server using NaCl / TweetNaCl (no dependency on OpenSSL)" +url="http://tinyssh.org/" +arch="all" +license="CC0 1.0" +depends_dev="libsodium-dev" +makedepends="$depends_dev" +subpackages="$pkgname-doc" +source="$pkgname-$pkgver.tar.bz2::http://mojzis.com/software/$pkgname/$pkgname-$pkgver.tar.bz2 + $pkgname.initd + $pkgname.confd + " + +_builddir="$srcdir"/$pkgname-$pkgver +prepare() { + local i + cd "$_builddir" + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac + done +} + +build() { + cd "$_builddir" + export LIBS="-lsodium" + export CFLAGS="$CFLAGS -I/usr/include/sodium" + export LDFLAGS="-L/usr/lib" + make || return 1 +} + +package() { + cd "$_builddir" + make install DESTDIR="${pkgdir}" || return 1 + mkdir -p "$pkgdir"/etc/$pkgname + install -m755 -D "$srcdir"/$pkgname.initd \ + "$pkgdir"/etc/init.d/tinysshd || return 1 + install -m644 -D "$srcdir"/$pkgname.confd \ + "$pkgdir"/etc/conf.d/tinysshd || return 1 + # post-install message + mkdir -p "$pkgdir/usr/share/doc/$pkgname" + cat > $pkgdir/usr/share/doc/$pkgname/README.alpine <' manually): + +echo '22 stream tcp nowait root /usr/sbin/tinysshd tinysshd -l -v /etc/tinyssh/sshkeys' >> /etc/inetd.conf +rc-service inetd start + +(3) Using runit with either (1) or (2) +EOF +} + +md5sums="0e8b4add3fa6c4481e7b8159aca75b2f tinyssh-20150501.tar.bz2 +78ec724804035bae29e1c47abec737d8 tinyssh.initd +83e705f0f71db5ae0d8530edafa63497 tinyssh.confd" +sha256sums="ccaee75ee04252c7e7db1e06e74e4c55b53911c310a0dc5e1288c0feb73a1470 tinyssh-20150501.tar.bz2 +b3584c463f6ba0de6a5fe2e28fb98cd8ef65a55f17a0f4c877f61f54019ef34c tinyssh.initd +c6c67395e7230d75077734f0b08d5f8c76f11aaef27878b013b7bd68dd7ba774 tinyssh.confd" +sha512sums="780e4aa87fc5afbd0818f1c815c0e95a9ec5b096efedbc49d54492195725bbdf3fe860cc4b84a5e9b15b9b568fd0398e48601da3af22b3dfd64e4214d4797fbe tinyssh-20150501.tar.bz2 +d10f995c6687e706453e51d06b3466427d476036efdbd86db2f9330281e46049bf2e3698208524b3f70cdbd30373f5bf46c7164dd626d22b3fa9a75ca5d8d478 tinyssh.initd +4513bd0d43ef0825fbd77365a8a7adefcd99211102df76003becf7e3a09a47ad9bbd16a68c3fadfb7868e0562f8d42a26106b7582cb70490a7e52a7d1e6110e9 tinyssh.confd" diff --git a/testing/tinyssh/tinyssh.confd b/testing/tinyssh/tinyssh.confd new file mode 100644 index 0000000..d7ba22a --- /dev/null +++ b/testing/tinyssh/tinyssh.confd @@ -0,0 +1,8 @@ +# TinySSH conf.d file for Alpine Linux + +# Specify daemon options here: +# OPTIONS="-l -v" + +# override config directory / port here: +# CONFDIR=/etc/tinyssh +# PORT=22 diff --git a/testing/tinyssh/tinyssh.initd b/testing/tinyssh/tinyssh.initd new file mode 100644 index 0000000..364ffb2 --- /dev/null +++ b/testing/tinyssh/tinyssh.initd @@ -0,0 +1,43 @@ +#!/sbin/openrc-run +# Alpine Linux init.d for TinySSH +# Copyright 2015 Stuart Cardall (developer@it-offshore.co.uk) +# Distributed under the terms of the GNU General Public License, v2 or later # + +name=tinysshd +daemon=/usr/sbin/$name +keygen=$daemon-makekey +CONFDIR=${CONFDIR:-/etc/tinyssh} +keydir=${CONFDIR}/sshkeys +OPTIONS=${OPTIONS:-\-v -l} +PORT=${PORT:-22} +pidfile=/var/run/$name.pid +server_opts="-HRDl0 0.0.0.0 ${PORT} $daemon ${OPTIONS} $keydir" + +depend() { + use net + after logger firewall +} + +checkconfig() { + checkpath --directory ${CONFDIR} + eval $keygen $keydir 2>/dev/null + # tinyssh also runs from inetd without tcpserver + if [ ! -f /usr/bin/tcpserver ]; then + apk add --quiet ucspi-tcp + fi +} + +start() { + checkconfig + ebegin "Starting ${name}" + start-stop-daemon --start --make-pidfile --background --pidfile $pidfile \ + --exec tcpserver -- $server_opts + eend $? +} + +stop() { + ebegin "Stopping ${name}" + start-stop-daemon --stop --quiet \ + --pidfile $pidfile + eend $? +} -- 2.4.5 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---