diff -Naru a/files/openvpn-2.1.conf b/files/openvpn-2.1.conf --- a/files/openvpn-2.1.conf 2013-04-17 21:53:35.649008025 +0000 +++ b/files/openvpn-2.1.conf 2013-04-17 22:15:15.151246596 +0000 @@ -16,3 +16,10 @@ # In other words, unless you understand service dependencies and are a # competent shell scripter, don't set this. RE_ENTER="no" + +# OpenVPN is built with a static reference to the iproute2 'ip' program. +# The initscript is able to dynamically determine the correct location based on +# the environment $PATH. Most people will want to let the init script determine +# this location, but if you would rather use the hard-coded path detected at +# build-time, set this to "no" here. +DETECT_IPROUTE2="yes" diff -Naru a/files/openvpn-2.1.init b/files/openvpn-2.1.init --- a/files/openvpn-2.1.init 2013-04-17 21:53:35.657008590 +0000 +++ b/files/openvpn-2.1.init 2013-04-17 22:21:14.369752630 +0000 @@ -72,6 +72,17 @@ if ! grep -q "^[ ]*cd[ ].*" "${VPNCONF}" ; then args="${args} --cd ${VPNDIR}" fi + + # Under Linux, locate the 'ip' command to pass to --iproute + # See bug #407195 + if [ $(uname -s) = "Linux" ] && [ "${DETECT_IPROUTE2:-yes}" = "yes" ]; then + local ip_bin="$(which ip)" + if [ $? -ne 0 ]; then + eerror "Unable to locate the 'ip' binary in your PATH" + return 1 + fi + args="${args} --iproute $ip_bin" + fi # We mark the service as inactive and then start it. # When we get an authenticated packet from the peer then we run our script diff -Naru a/openvpn-2.2.2.ebuild b/openvpn-2.2.2.ebuild --- a/openvpn-2.2.2.ebuild 2013-04-17 21:53:35.675009868 +0000 +++ b/openvpn-2.2.2.ebuild 2013-04-17 22:52:04.315354217 +0000 @@ -13,11 +13,11 @@ LICENSE="GPL-2" SLOT="0" KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux" -IUSE="examples iproute2 minimal pam passwordsave selinux +ssl static pkcs11 userland_BSD" +IUSE="examples minimal pam passwordsave selinux +ssl static pkcs11 userland_BSD" DEPEND=">=dev-libs/lzo-1.07 kernel_linux? ( - iproute2? ( sys-apps/iproute2[-minimal] ) !iproute2? ( sys-apps/net-tools ) + sys-apps/iproute2[-minimal] ) !minimal? ( pam? ( virtual/pam ) ) selinux? ( sec-policy/selinux-openvpn ) @@ -50,11 +50,13 @@ myconf="$(use_enable pkcs11)" fi + # We require iproute2 under Linux, see Bug #407195 + use kernel_linux && myconf="${myconf} --enable-iproute2" + econf ${myconf} \ $(use_enable passwordsave password-save) \ $(use_enable ssl) \ $(use_enable ssl crypto) \ - $(use_enable iproute2) \ --docdir="${EPREFIX}/usr/share/doc/${PF}" } diff -Naru a/openvpn-2.3.0.ebuild b/openvpn-2.3.0.ebuild --- a/openvpn-2.3.0.ebuild 2013-04-17 21:53:35.696011364 +0000 +++ b/openvpn-2.3.0.ebuild 2013-04-17 22:48:36.886564182 +0000 @@ -13,14 +13,14 @@ LICENSE="GPL-2" SLOT="0" KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~x86-linux" -IUSE="examples down-root iproute2 pam passwordsave pkcs11 +plugins selinux +ssl +lzo static userland_BSD" +IUSE="examples down-root pam passwordsave pkcs11 +plugins selinux +ssl +lzo static userland_BSD" REQUIRED_USE="static? ( !plugins !pkcs11 ) !plugins? ( !pam !down-root )" DEPEND=" kernel_linux? ( - iproute2? ( sys-apps/iproute2[-minimal] ) !iproute2? ( sys-apps/net-tools ) + sys-apps/iproute2[-minimal] ) pam? ( virtual/pam ) selinux? ( sec-policy/selinux-openvpn ) @@ -35,7 +35,12 @@ src_configure() { use static && LDFLAGS="${LDFLAGS} -Xcompiler -static" - econf \ + + # We require iproute2 under Linux, see Bug #407195 + local myconf + use kernel_linux && myconf="--enable-iproute2" + + econf ${myconf} \ --docdir="${EPREFIX}/usr/share/doc/${PF}" \ --with-plugindir="${ROOT}/usr/$(get_libdir)/$PN" \ $(use_enable passwordsave password-save) \ @@ -44,7 +49,6 @@ $(use_enable lzo) \ $(use_enable pkcs11) \ $(use_enable plugins) \ - $(use_enable iproute2) \ $(use_enable pam plugin-auth-pam) \ $(use_enable down-root plugin-down-root) } diff -Naru a/openvpn-9999.ebuild b/openvpn-9999.ebuild --- a/openvpn-9999.ebuild 2013-04-17 21:53:35.696011364 +0000 +++ b/openvpn-9999.ebuild 2013-04-17 22:52:34.253488700 +0000 @@ -13,14 +13,14 @@ LICENSE="GPL-2" SLOT="0" KEYWORDS="" -IUSE="examples down-root iproute2 pam passwordsave pkcs11 +plugins selinux +ssl +lzo static userland_BSD" +IUSE="examples down-root pam passwordsave pkcs11 +plugins selinux +ssl +lzo static userland_BSD" REQUIRED_USE="static? ( !plugins !pkcs11 ) !plugins? ( !pam !down-root )" DEPEND=" kernel_linux? ( - iproute2? ( sys-apps/iproute2[-minimal] ) !iproute2? ( sys-apps/net-tools ) + sys-apps/iproute2[-minimal] ) pam? ( virtual/pam ) selinux? ( sec-policy/selinux-openvpn ) @@ -35,7 +35,12 @@ src_configure() { use static && LDFLAGS="${LDFLAGS} -Xcompiler -static" - econf \ + + # We require iproute2 under Linux, see Bug #407195 + local myconf + use kernel_linux && myconf="--enable-iproute2" + + econf ${myconf} \ --docdir="${EPREFIX}/usr/share/doc/${PF}" \ --with-plugindir="${ROOT}/usr/$(get_libdir)/$PN" \ $(use_enable passwordsave password-save) \ @@ -44,7 +49,6 @@ $(use_enable lzo) \ $(use_enable pkcs11) \ $(use_enable plugins) \ - $(use_enable iproute2) \ $(use_enable pam plugin-auth-pam) \ $(use_enable down-root plugin-down-root) }