summaryrefslogtreecommitdiff
path: root/user/openvpn/APKBUILD
blob: f12d0af5b78c0a7b82ad57eaa2d2aa93d6329b1b (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
75
76
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Lee Starnes <lee@canned-death.us>
pkgname=openvpn
pkgver=2.6.6
pkgrel=0
pkgdesc="A robust, and highly configurable VPN (Virtual Private Network)"
url="https://openvpn.net/"
arch="all"
license="GPL-2.0-only WITH openvpn-openssl-exception"
depends="iproute2 lz4-libs"
makedepends="libcap-ng-dev linux-headers linux-pam-dev lz4-dev lzo-dev openssl-dev"
subpackages="$pkgname-doc $pkgname-dev $pkgname-auth-pam:pam $pkgname-openrc"
install="$pkgname.pre-install"
source="https://swupdate.openvpn.net/community/releases/$pkgname-$pkgver.tar.gz
	openvpn.initd
	openvpn.confd
	openvpn.up
	openvpn.down
	"

# secfixes:
#   2.5.6-r0:
#     - CVE-2022-0547
#     - CVE-2021-3606
#     - CVE-2020-15078
#   2.4.11-r0:
#     - CVE-2020-15078
#   2.4.9-r0:
#     - CVE-2020-11810

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

check() {
	make check
}

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

	# 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="f4c528fff6ed130d135d3d5d95dd73b1a9c8eb780b8fbfa30e12107795c1d01a6aaf8940e5b92f4968ddc59a2deb59905ff714632e512444a2f5b0df0dde3cba  openvpn-2.6.6.tar.gz
3594937d4cc9d7b87ac6a3af433f651ed9695f41586994f9d9789554fbe3f87f054b997b89486eda4ae0b852d816aac9007222168d585910aa9f255073324bd9  openvpn.initd
6b2353aca9df7f43044e4e37990491b4ba077e259ebe13b8f2eb43e35ca7a617c1a65c5bfb8ab05e87cf12c4444184ae064f01f9abbb3c023dbbc07ff3f9c84e  openvpn.confd
cdb73c9a5b1eb56e9cbd29955d94297ce5a87079419cd626d6a0b6680d88cbf310735a53f794886df02030b687eaea553c7c569a8ea1282a149441add1c65760  openvpn.up
4456880d5c2db061219ba94e4052786700efa5e685f03b0d12d75a6023e3c0fc7b5242cc3d2bd3988e42fcd99701ab13a6257b1a0943b812318d30c64843ad27  openvpn.down"