aboutsummaryrefslogtreecommitdiffstats
path: root/net-vpn/openvpn-nl/openvpn-nl-2.4.7.ebuild
blob: f1ad7a3a79d702e2a5050edfac9e6f0c44a006e7 (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
# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

DESCRIPTION="Modified version of OpenVPN with mbedtls and pkcs11 support"
HOMEPAGE="https://openvpn.fox-it.com"
SRC_URI="https://openvpn.fox-it.com/repos/source/2.4.7-nl1/openvpn-nl-src-2.4.7-nl1.tar.gz https://code.pa4wdh.nl.eu.org/distfiles/${PN}-src-${PV}-nl1.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="cpu_flags_x86_aes"

DEPEND=""
RDEPEND="${DEPEND}"
BDEPEND=""

CONFIG_CHECK="~TUN"

src_unpack() {
	unpack ${A}
	mv openvpn-nl openvpn-nl-2.4.7
}

src_prepare() {
	eapply_user
}

src_configure() {
	if use cpu_flags_x86_aes; then
		einfo "Enabling AES-NI support"
		cd ${WORKDIR}/openvpn-nl-2.4.7/mbedtls
		scripts/config.pl set MBEDTLS_AESNI_C
	else
		einfo "Not enabling AES-NI support"
	fi
}

src_compile() {
	cd ${WORKDIR}/openvpn-nl-2.4.7
	./build-openvpn-nl.sh
}

src_install() {
	newsbin ${WORKDIR}/openvpn-nl-2.4.7/build-openvpn-nl/src/openvpn/openvpn openvpn-nl
	newinitd "${FILESDIR}/openvpn-nl.init" openvpn-nl
	newconfd "${FILESDIR}/openvpn-nl.conf" openvpn-nl

	exeinto /etc/openvpn-nl
	doexe "${FILESDIR}/up.sh"
	doexe "${FILESDIR}/down.sh"

	newman ${WORKDIR}/openvpn-nl-2.4.7/openvpn/doc/openvpn.8 openvpn-nl.8
}