summaryrefslogtreecommitdiff
path: root/community/tinyssh/APKBUILD
blob: 12432672de1f51f31fd770b3eba8d76f188d64a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=tinyssh
pkgver=20161101
pkgrel=2
pkgdesc="Small SSH server using NaCl / TweetNaCl (no dependency on OpenSSL)"
url="https://tinyssh.org/"
arch="all"
license="CC0 1.0"
makedepends="libsodium-dev"
options="!check"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/janmojzis/$pkgname/archive/$pkgver.tar.gz
	$pkgname.initd
	$pkgname.confd
	"
builddir="$srcdir"/$pkgname-$pkgver

build() {
	cd "$builddir"
	export LIBS="-lsodium"
	export CFLAGS="$CFLAGS -I/usr/include/sodium"
	export LDFLAGS="-L/usr/lib"
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make install DESTDIR="${pkgdir}"

	mkdir -p "$pkgdir"/etc/$pkgname
	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/tinysshd
	install -m644 -D "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/tinysshd

	# post-install message
	mkdir -p "$pkgdir/usr/share/doc/$pkgname"
	cat > $pkgdir/usr/share/doc/$pkgname/README.alpine <<EOF
TinySSH can be run in 3 different ways:
--------------------------------------
(1) /etc/init.d/tinysshd (requires tcpserver & takes care of key generation)

(2) via inetd (you will need to 'tinysshd-makekeys <dir>' 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)

Stealth SSH with FWKNOP: https://it-offshore.co.uk/security/53-stealth-your-ssh-port-ssh-into-lxc-containers
EOF
}

sha512sums="684aac5bf8f8713582bc4a0459680f7b9f32ea6bfa7896c2e48b8431ff5e1f4cf067d055986ecfa988edd32cea13694c1621a86d0b9652fce45954284cf1eafd  tinyssh-20161101.tar.gz
4bba2c283e1c266734d26647b4c400c2fce258cd9957b41f637a5e875ce995b4cdef9eeea147178174facc311fc6e23a6ebcf10b05fb75222582605dc9b1fde5  tinyssh.initd
7c6282a6ae972d83d3e624530cac4958adee1e2313d0e44aff38c94bde1a3f549a536ec80e594d44c29a6a981919dd30322e8d8511626fdb6493c98587047392  tinyssh.confd"