summaryrefslogtreecommitdiffstats
path: root/main/strongswan/APKBUILD
blob: 4d20df116f3124c69b3d92bf2f18b623b4e52f8b (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Contributor: Jesse Young <jlyo@jlyo.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=strongswan
pkgver=5.2.0
pkgrel=1
pkgdesc="IPsec-based VPN solution focused on security and ease of use, supporting IKEv1/IKEv2 and MOBIKE"
url="http://www.strongswan.org/"
arch="all"
license="GPL-2 RSA-MD5 RSA-PKCS11 DES"
depends="iproute2 openssl"
depends_dev="sqlite-dev openssl-dev curl-dev gmp-dev"
makedepends="$depends_dev"
install=""
subpackages="$pkgname-doc"
source="http://download.strongswan.org/$pkgname-$pkgver.tar.bz2
	strongswan.initd"

_builddir="$srcdir/$pkgname-$pkgver"
prepare() {
	local i
	cd "$srcdir/$pkgname-$pkgver"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -Np1 -i "$srcdir"/$i || return 1;;
		esac
	done
	# the headers they ship conflicts with the real thing.
	rm -r src/include/linux
}

build() {
	cd "$_builddir"

	# notes about configuration:
	# - try to keep options in ./configure --help order
	# - apk depends on openssl, so we use that
	# - openssl provides ciphers, randomness, etc
	#   -> disable all redundant in-tree copies

	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--libexecdir=/usr/lib \
		--with-ipsecdir=/usr/lib/strongswan \
		--enable-curl \
		--disable-ldap \
		--disable-aes \
		--disable-des \
		--disable-rc2 \
		--disable-md5 \
		--disable-sha1 \
		--disable-sha2 \
		--enable-gmp \
		--disable-hmac \
		--disable-mysql \
		--enable-sqlite \
		--enable-eap-sim \
		--enable-eap-sim-file \
		--enable-eap-aka \
		--enable-eap-aka-3gpp2 \
		--enable-eap-simaka-pseudonym \
		--enable-eap-simaka-reauth \
		--enable-eap-identity \
		--enable-eap-md5 \
		--disable-eap-gtc \
		--enable-eap-mschapv2 \
		--enable-eap-radius \
		--enable-xauth-eap \
		--enable-farp \
		--enable-vici \
		--enable-attr-sql \
		--enable-dhcp \
		--enable-openssl \
		--enable-unity \
		--enable-ha \
		--enable-cmd \
		--enable-swanctl \
		--enable-shared \
		--disable-static \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	install -m755 -D "$srcdir/$pkgname.initd" \
		"$pkgdir/etc/init.d/$pkgname"
	rm "$pkgdir"/usr/lib/ipsec/plugins/*.la || return 1
	rm "$pkgdir"/usr/lib/ipsec/*.la || return 1
}

md5sums="5cee4ee1a6ccb74400758b3ace54d46e  strongswan-5.2.0.tar.bz2
fb9822512d02f521af8812db22a5175e  strongswan.initd"
sha256sums="b00c30bd2e60ff2e5fc85f54bbad54fe246585812fdf212dbe777a5258da26ce  strongswan-5.2.0.tar.bz2
e4add8941d545930bba43d7d3af302bc436d7c0264a2796480226567e2b12e54  strongswan.initd"
sha512sums="6d92d367c96b717edce9dd2cfdfcb17c3ffadebd54ae270c0a29d8c0b9251625676f02d7a93c5fe7b42cb1822d5e532053641c4d37de443c3d560912807dfcc0  strongswan-5.2.0.tar.bz2
2f2936865e494a9454329867acfb71ca323f90dec526a97f7d0c18422deb54205f81f9f592ed6c3b474fe5e954ebcb90eed0311e52fa3a86a982d80ba9a45be8  strongswan.initd"