aboutsummaryrefslogtreecommitdiffstats
path: root/testing/fwknop/APKBUILD
blob: 8e89f9b0d0a58cfd4e98825596113c280ade9fa2 (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
63
64
65
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=fwknop
pkgver=2.6.6
pkgrel=1
pkgdesc="A Single Packet Authorization (SPA) implementation"
url="http://www.cipherdyne.org/fwknop/"
arch="all"
license="GPL2"
depends="iptables"
depends_dev=""
makedepends="$depends_dev libpcap-dev iptables gpgme-dev"
install=""
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs $pkgname-server"
source="http://cipherdyne.org/fwknop/download/fwknop-$pkgver.tar.gz
		fwknopd.initd"

_builddir="$srcdir"/fwknop-$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"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--with-gpgme \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	install -Dm755 "$srcdir"/fwknopd.initd "$pkgdir"/etc/init.d/fwknopd
	echo "# If using gnupg2 see http://www.gnupg.org/faq/GnuPG-FAQ.html#how-can-i-use-gnupg-in-an-automated-environment" >> "$pkgdir"/etc/fwknop/access.conf
	echo "# & sign the client public key on the server with a normal key which has a password" >> "$pkgdir"/etc/fwknop/access.conf
	echo "# disable GPG_DECRYPT_PW & enable the following variable:" >> "$pkgdir"/etc/fwknop/access.conf
	echo "#GPG_ALLOW_NO_PW: Y;" >> "$pkgdir"/etc/fwknop/access.conf
}

server() {
	pkgdesc="A Single Packet Authorization (SPA) server"
	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/sbin "$subpkgdir"/usr/ \
		&& mv "$pkgdir"/etc "$subpkgdir"/
}

md5sums="5f147499d7cb7df280f0ed1356f242f6  fwknop-2.6.6.tar.gz
db52540eb534e34e839988f0d33d3abd  fwknopd.initd"
sha256sums="bb1d6613c5df7d0723b1a1100ed5cf195677a314d64b50433da90882a491b074  fwknop-2.6.6.tar.gz
ac9da6eaf36eba551654efceab2f8c8f92cd0a7b4e308e8d6bfa87195d4a9c78  fwknopd.initd"
sha512sums="903866c646521f89307b817012bf89353ca5f2b858e34a8a6db5444e6c4cf3df31ff8ac8a08ec1a7d9e36a7fa71cfae9e231bb014499c237db19d4f8cf1ea9d7  fwknop-2.6.6.tar.gz
e3558c4a1579ea66b19451acc476f3cfec782b052f6d96a57ffc520169db755739e2bf3a815802cc5958a7b2fdeb9b39cf2182e5d89882cf4502985401352465  fwknopd.initd"