aboutsummaryrefslogtreecommitdiffstats
path: root/main/openvpn/APKBUILD
blob: e4e0c2514e2eb2339576d00176bcca9f5cdefd67 (plain) (blame)
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
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=openvpn
pkgver=2.5.2
pkgrel=0
pkgdesc="Robust, and highly configurable VPN (Virtual Private Network)"
url="https://openvpn.net/"
arch="all"
license="custom"
subpackages="$pkgname-doc $pkgname-dev $pkgname-openrc $pkgname-auth-pam:pam"
depends="iproute2"
depends_dev="openssl-dev" # openvpn-plugin.h includes openssl/x509.h
makedepends="$depends_dev lzo-dev linux-pam-dev linux-headers"
install="$pkgname.pre-install"
source="https://swupdate.openvpn.net/community/releases/openvpn-$pkgver.tar.xz
	openvpn.initd
	openvpn.confd
	openvpn.up
	openvpn.down
	"

# secfixes:
#   2.4.9-r0:
#     - CVE-2020-11810
#   2.4.6-r0:
#     - CVE-2018-9336

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--sysconfdir=/etc/openvpn \
		--enable-iproute2 \
		--enable-x509-alt-username
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	install -D -m644 doc/openvpn.8 "$pkgdir"/usr/share/man/man8/openvpn.8

	# install samples
	mkdir -p "$pkgdir"/usr/share/doc/$pkgname/samples
	cp -a sample/sample-* "$pkgdir"/usr/share/doc/$pkgname/samples
	install -D -m644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING

	# install init.d and conf.d
	install -Dm755 "$srcdir"/openvpn.initd "$pkgdir"/etc/init.d/openvpn
	install -Dm644 "$srcdir"/openvpn.confd "$pkgdir"/etc/conf.d/openvpn

	# install up and down scripts
	install -Dm755 "$srcdir"/openvpn.up "$pkgdir"/etc/openvpn/up.sh
	install -Dm755 "$srcdir"/openvpn.down "$pkgdir"/etc/openvpn/down.sh
}

pam() {
	pkgdesc="OpenVPN plugin for PAM authentication"
	mkdir -p "$subpkgdir"/usr/lib/openvpn/plugins
	mv "$pkgdir"/usr/lib/openvpn/plugins/*-auth-pam* \
		"$subpkgdir"/usr/lib/openvpn/plugins/
}

sha512sums="ae2cac00ae4b9e06e7e70b268ed47d36bbb45409650175e507d5bfa12b0a4f24bccc64f2494d1563f9269c8076d0f753a492f01ea33ce376ba00b7cdcb5c7bd0  openvpn-2.5.2.tar.xz
111a1ce79bdb41b8a03c0d43f1fd87de8a0d5592a8b1bd878113af79adce3d0a3109badd92b5af9a0f80b6585473a1e01638f7e78e6baa8aac439f0708bc2a72  openvpn.initd
1f14d4bd7a4a026c276af048ce647501c15358c6b0d184e95c49be5b8184188c8edafb76ed94835cdbb314187ee3b5b3ccd852e3a47add0599814c402309bece  openvpn.confd
cdb73c9a5b1eb56e9cbd29955d94297ce5a87079419cd626d6a0b6680d88cbf310735a53f794886df02030b687eaea553c7c569a8ea1282a149441add1c65760  openvpn.up
4456880d5c2db061219ba94e4052786700efa5e685f03b0d12d75a6023e3c0fc7b5242cc3d2bd3988e42fcd99701ab13a6257b1a0943b812318d30c64843ad27  openvpn.down"