aboutsummaryrefslogtreecommitdiffstats
path: root/net-vpn/openvpn-nl/openvpn-nl-2.4.12.ebuild
blob: 8487b715b5009aea2e861314e06656095f78ccad (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/${PV}/${PN}-src-${PV}.tar.gz https://code.pa4wdh.nl.eu.org/distfiles/${PN}-src-${PV}.tar.gz"

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

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

CONFIG_CHECK="~TUN"

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

src_prepare() {
	eapply_user
}

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

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

src_install() {
	newsbin ${WORKDIR}/${P}/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}/${P}/openvpn/doc/openvpn.8 openvpn-nl.8
}