aboutsummaryrefslogtreecommitdiffstats
path: root/testing/sslh/APKBUILD
blob: 27a445dd57d903305efa367a0fb51f5013830bec (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
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=sslh
pkgver=1.19c
pkgrel=2
pkgdesc="Applicative Protocol Multiplexer (e.g. share SSH and HTTPS on the same port) "
url="http://www.rutschle.net/tech/sslh/README.html"
arch="all !aarch64"  # limited by valgrind
license="GPL-2.0-or-later"
makedepends="libconfig-dev libcap-dev pcre-dev perl perl-io-socket-inet6 lcov valgrind"
subpackages="$pkgname-doc"
options=
source="http://www.rutschle.net/tech/$pkgname/$pkgname-v$pkgver.tar.gz
	generate-version.patch
	$pkgname.conf
	$pkgname.initd
	$pkgname.confd"
builddir="$srcdir/$pkgname-v$pkgver"

build() {
	cd "$builddir"
	export CFLAGS="$CFLAGS -std=gnu99"
	make ENABLE_REGEX=1 USELIBPCRE=1 USELIBCONFIG=1 USELIBCAP=1
}

check() {
	cd "$builddir"
	sed -i'.dist' -e '/_address =/s/ip6-localhost/localhost/' ./t
	make test
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" PREFIX=/usr install

	install -p sslh-select "$pkgdir/usr/sbin/sslh-select"
	mv "$pkgdir/usr/sbin/sslh" "$pkgdir/usr/sbin/sslh-fork"
	ln -s sslh-fork "$pkgdir/usr/sbin/sslh"

	install -D -m755 "$srcdir/$pkgname.initd" \
		"$pkgdir/etc/init.d/$pkgname"
	install -D -m644 "$srcdir/$pkgname.confd" \
		"$pkgdir/etc/conf.d/$pkgname"
	install -D -m644 "$srcdir/$pkgname.conf" \
		"$pkgdir/etc/$pkgname/$pkgname.conf"
	mv scripts/fail2ban "$pkgdir/etc/$pkgname/"
}

doc() {
	default_doc
	cd "$builddir"
	install -Dm 644 basic.cfg "$subpkgdir/usr/share/doc/$pkgname/basic.cfg"
	install -Dm 644 example.cfg "$subpkgdir/usr/share/doc/$pkgname/example.cfg"
}

sha512sums="14529f1fc1488b10e660fa85f5d8bb642a0e119a15ca44d492793153447c9414ade5a1925fbbedd19c5d26662aa1bafd9743ab5ca11324632269110406fa8ce9  sslh-v1.19c.tar.gz
66aa10eb497a8c44e7b852476b8fb9af05d6d786da76557f4b77799f871884531ac98f71313d7d449396fb02205b5a6248e957cecee7efaf7d17d69850dc88cf  generate-version.patch
dd2231677d3e3f371ef643ebb9b9e31effc058ac7b430fe17dfb801b23040c6bde7b6c7c6b0ff6757607207a506096334b0a8e7ce83c884d483717c338a3499c  sslh.conf
ba0a0fe8785ab9963d4dc11c39d6cbd41fe14d1e8f6d61eb0bf6eb2855e4f2de119b76f82894f3d52a91467ee83f4bd805d8eafc3c7da7b5a4f630cc4a241462  sslh.initd
580114cef9356d66ec1e6c306837d44dc3098e8f3f805eda20c5d8f81f087bf295b25801ee64ee2bc667ce7324f510ff6f4fc7e222d1431ec3d4e82bbcfb160f  sslh.confd"