# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=6
+EAPI=7
-inherit autotools flag-o-matic user systemd linux-info git-r3
+inherit autotools flag-o-matic systemd linux-info git-r3
DESCRIPTION="Robust and highly flexible tunneling application compatible with many OSes"
EGIT_REPO_URI="https://github.com/OpenVPN/${PN}.git"
IUSE+=" pkcs11 +plugins selinux +ssl systemd test userland_BSD"
RESTRICT="!test? ( test )"
-REQUIRED_USE="lzo? ( !lz4 )
+REQUIRED_USE="pkcs11? ( ssl )
!plugins? ( !pam !down-root )
- inotify? ( plugins )"
+ inotify? ( plugins )
+"
CDEPEND="
kernel_linux? (
iproute2? ( sys-apps/iproute2[-minimal] )
- !iproute2? ( sys-apps/net-tools )
+ !iproute2? ( >=sys-apps/net-tools-1.60_p20160215155418 )
)
pam? ( sys-libs/pam )
ssl? (
lz4? ( app-arch/lz4 )
lzo? ( >=dev-libs/lzo-1.07 )
pkcs11? ( >=dev-libs/pkcs11-helper-1.11 )
- systemd? ( sys-apps/systemd )"
+ systemd? ( sys-apps/systemd )
+"
DEPEND="${CDEPEND}
- test? ( dev-util/cmocka )"
+ test? ( dev-util/cmocka )
+"
RDEPEND="${CDEPEND}
- selinux? ( sec-policy/selinux-openvpn )"
+ acct-group/openvpn
+ acct-user/openvpn
+ selinux? ( sec-policy/selinux-openvpn )
+"
CONFIG_CHECK="~TUN"
-PATCHES=(
- "${FILESDIR}/${PN}-2.5-external-cmocka.patch"
-)
-
pkg_setup() {
linux-info_pkg_setup
}
$(use_enable iproute2) \
$(use_enable pam plugin-auth-pam) \
$(use_enable down-root plugin-down-root) \
- $(use_enable test tests) \
$(use_enable systemd)
}
# install examples, controlled by the respective useflag
if use examples ; then
# dodoc does not supportly support directory traversal, #15193
- insinto /usr/share/doc/${PF}/examples
- doins -r sample contrib
+ docinto /usr/share/doc/${PF}/examples
+ dodoc -r sample contrib
fi
}
pkg_postinst() {
- # Add openvpn user so openvpn servers can drop privs
- # Clients should run as root so they can change ip addresses,
- # dns information and other such things.
- enewgroup openvpn
- enewuser openvpn "" "" "" openvpn
+ if use x64-macos; then
+ elog "You might want to install tuntaposx for TAP interface support:"
+ elog "http://tuntaposx.sourceforge.net"
+ fi
elog "The openvpn init script expects to find the configuration file"
elog "openvpn.conf in /etc/openvpn along with any extra files it may need."
if use plugins ; then
einfo ""
- einfo "plugins have been installed into /usr/$(get_libdir)/${PN}"
+ einfo "plugins have been installed into /usr/$(get_libdir)/${PN}/plugins"
fi
ewarn ""