# 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 }