commit:     a6703cb464ead520b9556916a1b6112196914349
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 15 18:52:28 2021 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Thu Apr 15 18:54:00 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6703cb4

net-vpn/openvpn: minor improvements

* enable lz4 USE by default (pipular option)
* improve postinst to include systemd instructions

Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-vpn/openvpn/openvpn-2.4.9.ebuild    | 44 ++++++++++++++++++++++-----------
 net-vpn/openvpn/openvpn-2.5.0-r1.ebuild | 44 ++++++++++++++++++++++-----------
 net-vpn/openvpn/openvpn-2.5.1-r1.ebuild |  8 +++---
 net-vpn/openvpn/openvpn-9999.ebuild     | 44 ++++++++++++++++++++++-----------
 4 files changed, 94 insertions(+), 46 deletions(-)

diff --git a/net-vpn/openvpn/openvpn-2.4.9.ebuild 
b/net-vpn/openvpn/openvpn-2.4.9.ebuild
index 9ee9208aa81..6d6d5d7a02d 100644
--- a/net-vpn/openvpn/openvpn-2.4.9.ebuild
+++ b/net-vpn/openvpn/openvpn-2.4.9.ebuild
@@ -13,7 +13,7 @@ LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 ~sparc x86 
~amd64-linux ~x86-linux"
 
-IUSE="down-root examples inotify iproute2 libressl lz4 +lzo mbedtls pam"
+IUSE="down-root examples inotify iproute2 libressl +lz4 +lzo mbedtls pam"
 IUSE+=" pkcs11 +plugins selinux +ssl systemd test userland_BSD"
 
 RESTRICT="!test? ( test )"
@@ -128,19 +128,35 @@ pkg_postinst() {
                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."
-       elog ""
-       elog "To create more VPNs, simply create a new .conf file for it and"
-       elog "then create a symlink to the openvpn init script from a link 
called"
-       elog "openvpn.newconfname - like so"
-       elog "   cd /etc/openvpn"
-       elog "   ${EDITOR##*/} foo.conf"
-       elog "   cd /etc/init.d"
-       elog "   ln -s openvpn openvpn.foo"
-       elog ""
-       elog "You can then treat openvpn.foo as any other service, so you can"
-       elog "stop one vpn and start another if you need to."
+       if systemd_is_booted ||  has_version sys-apps/systemd; then
+               elog "In order to use OpenVPN with systemd please use the 
correct systemd service file."
+               elog  ""
+               elog "server:"
+               elog ""
+               elog "- Place your server configuration file in 
/etc/openvpn/server"
+               elog "- Use the openvpn-server@.service like so"
+               elog "systemctl start openvpn-server@{Server-config}"
+               elog ""
+               elog "client:"
+               elog ""
+               elog "- Place your client configuration file in 
/etc/openvpn/client"
+               elog "- Use the openvpn-client@.service like so:"
+               elog "systemctl start openvpn-client@{Client-config}"
+       else
+               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."
+               elog ""
+               elog "To create more VPNs, simply create a new .conf file for 
it and"
+               elog "then create a symlink to the openvpn init script from a 
link called"
+               elog "openvpn.newconfname - like so"
+               elog "   cd /etc/openvpn"
+               elog "   ${EDITOR##*/} foo.conf"
+               elog "   cd /etc/init.d"
+               elog "   ln -s openvpn openvpn.foo"
+               elog ""
+               elog "You can then treat openvpn.foo as any other service, so 
you can"
+               elog "stop one vpn and start another if you need to."
+       fi
 
        if grep -Eq "^[ \t]*(up|down)[ \t].*" "${ROOT}/etc/openvpn"/*.conf 
2>/dev/null ; then
                ewarn ""

diff --git a/net-vpn/openvpn/openvpn-2.5.0-r1.ebuild 
b/net-vpn/openvpn/openvpn-2.5.0-r1.ebuild
index fe802877755..2744ace9271 100644
--- a/net-vpn/openvpn/openvpn-2.5.0-r1.ebuild
+++ b/net-vpn/openvpn/openvpn-2.5.0-r1.ebuild
@@ -13,7 +13,7 @@ LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc 
~x86 ~amd64-linux ~x86-linux"
 
-IUSE="down-root examples inotify iproute2 libressl lz4 +lzo mbedtls +openssl"
+IUSE="down-root examples inotify iproute2 libressl +lz4 +lzo mbedtls +openssl"
 IUSE+=" pam pkcs11 +plugins selinux systemd test userland_BSD"
 
 RESTRICT="!test? ( test )"
@@ -127,19 +127,35 @@ pkg_postinst() {
                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."
-       elog ""
-       elog "To create more VPNs, simply create a new .conf file for it and"
-       elog "then create a symlink to the openvpn init script from a link 
called"
-       elog "openvpn.newconfname - like so"
-       elog "   cd /etc/openvpn"
-       elog "   ${EDITOR##*/} foo.conf"
-       elog "   cd /etc/init.d"
-       elog "   ln -s openvpn openvpn.foo"
-       elog ""
-       elog "You can then treat openvpn.foo as any other service, so you can"
-       elog "stop one vpn and start another if you need to."
+       if systemd_is_booted ||  has_version sys-apps/systemd; then
+               elog "In order to use OpenVPN with systemd please use the 
correct systemd service file."
+               elog  ""
+               elog "server:"
+               elog ""
+               elog "- Place your server configuration file in 
/etc/openvpn/server"
+               elog "- Use the openvpn-server@.service like so"
+               elog "systemctl start openvpn-server@{Server-config}"
+               elog ""
+               elog "client:"
+               elog ""
+               elog "- Place your client configuration file in 
/etc/openvpn/client"
+               elog "- Use the openvpn-client@.service like so:"
+               elog "systemctl start openvpn-client@{Client-config}"
+       else
+               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."
+               elog ""
+               elog "To create more VPNs, simply create a new .conf file for 
it and"
+               elog "then create a symlink to the openvpn init script from a 
link called"
+               elog "openvpn.newconfname - like so"
+               elog "   cd /etc/openvpn"
+               elog "   ${EDITOR##*/} foo.conf"
+               elog "   cd /etc/init.d"
+               elog "   ln -s openvpn openvpn.foo"
+               elog ""
+               elog "You can then treat openvpn.foo as any other service, so 
you can"
+               elog "stop one vpn and start another if you need to."
+       fi
 
        if grep -Eq "^[ \t]*(up|down)[ \t].*" "${ROOT}/etc/openvpn"/*.conf 
2>/dev/null ; then
                ewarn ""

diff --git a/net-vpn/openvpn/openvpn-2.5.1-r1.ebuild 
b/net-vpn/openvpn/openvpn-2.5.1-r1.ebuild
index 990ee902239..5d4782a0359 100644
--- a/net-vpn/openvpn/openvpn-2.5.1-r1.ebuild
+++ b/net-vpn/openvpn/openvpn-2.5.1-r1.ebuild
@@ -150,10 +150,10 @@ pkg_postinst() {
                elog "To create more VPNs, simply create a new .conf file for 
it and"
                elog "then create a symlink to the openvpn init script from a 
link called"
                elog "openvpn.newconfname - like so"
-               elog "   cd /etc/openvpn"
-               elog "   ${EDITOR##*/} foo.conf"
-               elog "   cd /etc/init.d"
-               elog "   ln -s openvpn openvpn.foo"
+               elog "   cd /etc/openvpn"
+               elog "   ${EDITOR##*/} foo.conf"
+               elog "   cd /etc/init.d"
+               elog "   ln -s openvpn openvpn.foo"
                elog ""
                elog "You can then treat openvpn.foo as any other service, so 
you can"
                elog "stop one vpn and start another if you need to."

diff --git a/net-vpn/openvpn/openvpn-9999.ebuild 
b/net-vpn/openvpn/openvpn-9999.ebuild
index befc78d0d7b..b2945c23a0f 100644
--- a/net-vpn/openvpn/openvpn-9999.ebuild
+++ b/net-vpn/openvpn/openvpn-9999.ebuild
@@ -14,7 +14,7 @@ LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS=""
 
-IUSE="down-root examples inotify iproute2 libressl lz4 +lzo mbedtls pam"
+IUSE="down-root examples inotify iproute2 libressl +lz4 +lzo mbedtls pam"
 IUSE+=" pkcs11 +plugins selinux +ssl systemd test userland_BSD"
 
 RESTRICT="!test? ( test )"
@@ -118,19 +118,35 @@ pkg_postinst() {
                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."
-       elog ""
-       elog "To create more VPNs, simply create a new .conf file for it and"
-       elog "then create a symlink to the openvpn init script from a link 
called"
-       elog "openvpn.newconfname - like so"
-       elog "   cd /etc/openvpn"
-       elog "   ${EDITOR##*/} foo.conf"
-       elog "   cd /etc/init.d"
-       elog "   ln -s openvpn openvpn.foo"
-       elog ""
-       elog "You can then treat openvpn.foo as any other service, so you can"
-       elog "stop one vpn and start another if you need to."
+       if systemd_is_booted ||  has_version sys-apps/systemd; then
+               elog "In order to use OpenVPN with systemd please use the 
correct systemd service file."
+               elog  ""
+               elog "server:"
+               elog ""
+               elog "- Place your server configuration file in 
/etc/openvpn/server"
+               elog "- Use the openvpn-server@.service like so"
+               elog "systemctl start openvpn-server@{Server-config}"
+               elog ""
+               elog "client:"
+               elog ""
+               elog "- Place your client configuration file in 
/etc/openvpn/client"
+               elog "- Use the openvpn-client@.service like so:"
+               elog "systemctl start openvpn-client@{Client-config}"
+       else
+               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."
+               elog ""
+               elog "To create more VPNs, simply create a new .conf file for 
it and"
+               elog "then create a symlink to the openvpn init script from a 
link called"
+               elog "openvpn.newconfname - like so"
+               elog "   cd /etc/openvpn"
+               elog "   ${EDITOR##*/} foo.conf"
+               elog "   cd /etc/init.d"
+               elog "   ln -s openvpn openvpn.foo"
+               elog ""
+               elog "You can then treat openvpn.foo as any other service, so 
you can"
+               elog "stop one vpn and start another if you need to."
+       fi
 
        if grep -Eq "^[ \t]*(up|down)[ \t].*" "${ROOT}/etc/openvpn"/*.conf 
2>/dev/null ; then
                ewarn ""

Reply via email to