aboutsummaryrefslogtreecommitdiffstats
path: root/main/strongswan/APKBUILD
blob: 910b01e4e0ea5692b57d097338a7186e70c45a78 (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.1.3
pkgrel=0
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

	# see http://wiki.strongswan.org/issues/516 for _GNU_SOURCE
	CFLAGS="$CFLAGS -D_GNU_SOURCE"\
	./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-attr-sql \
		--enable-dhcp \
		--enable-openssl \
		--enable-unity \
		--enable-ha \
		--enable-cmd \
		--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="1d1c108775242743cd8699215b2918c3  strongswan-5.1.3.tar.bz2
fb9822512d02f521af8812db22a5175e  strongswan.initd"
sha256sums="84e46d5ce801e1b874e2bfba8d21dbd78b432e23b7fb1f4f2d637359e7a183a8  strongswan-5.1.3.tar.bz2
e4add8941d545930bba43d7d3af302bc436d7c0264a2796480226567e2b12e54  strongswan.initd"
sha512sums="05f4afbf778de54c593692a8117a5fae05c0539cdb7545bc53657deb32d09bec7e0aef07d509dc682af15d57adf569242715447bc1a87785c1f80a21076cb8cb  strongswan-5.1.3.tar.bz2
2f2936865e494a9454329867acfb71ca323f90dec526a97f7d0c18422deb54205f81f9f592ed6c3b474fe5e954ebcb90eed0311e52fa3a86a982d80ba9a45be8  strongswan.initd"