Gentoo Archives: gentoo-commits

From: Mikle Kolyada <zlogene@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-vpn/openvpn/
Date: Thu, 15 Apr 2021 11:14:03
Message-Id: 1618485236.b9ace390cb345e03f1c7ef6a5a3d4b42bfff1201.zlogene@gentoo
1 commit: b9ace390cb345e03f1c7ef6a5a3d4b42bfff1201
2 Author: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
3 AuthorDate: Thu Apr 15 11:12:57 2021 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 15 11:13:56 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b9ace390
7
8 net-vpn/openvpn: Version bump (v2.5.1)
9
10 - non-maintainer commit (blame be)
11 - enable lz4 by default (quite popular option)
12 - improve postinst messages (add systemd)
13
14 Package-Manager: Portage-3.0.17, Repoman-3.0.2
15 Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
16
17 net-vpn/openvpn/Manifest | 1 +
18 net-vpn/openvpn/openvpn-2.5.1.ebuild | 174 +++++++++++++++++++++++++++++++++++
19 2 files changed, 175 insertions(+)
20
21 diff --git a/net-vpn/openvpn/Manifest b/net-vpn/openvpn/Manifest
22 index f363aa40fd1..c1b710300da 100644
23 --- a/net-vpn/openvpn/Manifest
24 +++ b/net-vpn/openvpn/Manifest
25 @@ -1,2 +1,3 @@
26 DIST openvpn-2.4.9.tar.gz 1000602 BLAKE2B 4a10ec76d1a816f9184dd33e4384623e011a1af40ea38ad56cc06f70ab2c911b6fd92cf8ffcd2ec3ab4179fef87feb187fc9df61c5bea92b1c69ee4113093866 SHA512 7683dfb93592968459f080a07ea750992b7444708cdb1a5aafc0118ab8528fc488f2b9fbd7d042e57ad1811303208875237ae9decf0bb4977c45cd30da53751b
27 DIST openvpn-2.5.0-r1.tar.gz 1815964 BLAKE2B cca1c1ec4fbfe0c337c14525cf706280c9d961c4bba992dfa0b13c9f96e00092864301138037485095716c746ef6ff3473a2085780b3ef77183bf4a6f1c602ae SHA512 3deb55973b87cc95c0437ab9ce6c43fdc246aa7e42e3e68bd6a5651deffa798b6750f625917cb2aaa2c82f0b3a0805bcf206a2aa8e2c735fd24e6bd38f736562
28 +DIST openvpn-2.5.1-r1.tar.gz 1827517 BLAKE2B 068af9313c9b2b93dcaa06f82ad66489154ce04973e323af07f38f209b4be77b7b785046aa31559a9f744b4b8c6976acd3e644d5a573f3c5511dc11f5bab3dce SHA512 eb85d14eeb383bed09670941451328db38feacc0b8b7b960840a3f465de83a7527de7d183e66344011da3a3655d558483c569d096b36964209a23418f89052e2
29
30 diff --git a/net-vpn/openvpn/openvpn-2.5.1.ebuild b/net-vpn/openvpn/openvpn-2.5.1.ebuild
31 new file mode 100644
32 index 00000000000..ce0ea90c92b
33 --- /dev/null
34 +++ b/net-vpn/openvpn/openvpn-2.5.1.ebuild
35 @@ -0,0 +1,174 @@
36 +# Copyright 1999-2021 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=7
40 +
41 +inherit autotools flag-o-matic systemd linux-info systemd
42 +
43 +DESCRIPTION="Robust and highly flexible tunneling application compatible with many OSes"
44 +SRC_URI="https://build.openvpn.net/downloads/releases/${P}.tar.gz -> ${P}-r1.tar.gz"
45 +HOMEPAGE="https://openvpn.net/"
46 +
47 +LICENSE="GPL-2"
48 +SLOT="0"
49 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
50 +
51 +IUSE="down-root examples inotify iproute2 libressl +lz4 +lzo mbedtls +openssl"
52 +IUSE+=" pam pkcs11 +plugins selinux systemd test userland_BSD"
53 +
54 +RESTRICT="!test? ( test )"
55 +REQUIRED_USE="
56 + ^^ ( openssl mbedtls )
57 + pkcs11? ( !mbedtls )
58 + !plugins? ( !pam !down-root )
59 + inotify? ( plugins )
60 +"
61 +
62 +CDEPEND="
63 + kernel_linux? (
64 + iproute2? ( sys-apps/iproute2[-minimal] )
65 + )
66 + lz4? ( app-arch/lz4 )
67 + lzo? ( >=dev-libs/lzo-1.07 )
68 + mbedtls? ( net-libs/mbedtls:= )
69 + openssl? (
70 + !libressl? ( >=dev-libs/openssl-0.9.8:0= )
71 + libressl? ( dev-libs/libressl:0= )
72 + )
73 + pam? ( sys-libs/pam )
74 + pkcs11? ( >=dev-libs/pkcs11-helper-1.11 )
75 + systemd? ( sys-apps/systemd )
76 +"
77 +DEPEND="${CDEPEND}
78 + test? ( dev-util/cmocka )
79 +"
80 +RDEPEND="${CDEPEND}
81 + acct-group/openvpn
82 + acct-user/openvpn
83 + selinux? ( sec-policy/selinux-openvpn )
84 +"
85 +
86 +PATCHES=(
87 + "${FILESDIR}/openvpn-2.5.0-auth-pam-missing-header.patch"
88 +)
89 +
90 +pkg_setup() {
91 + local CONFIG_CHECK="~TUN"
92 + linux-info_pkg_setup
93 +}
94 +
95 +src_prepare() {
96 + default
97 + eautoreconf
98 +}
99 +
100 +src_configure() {
101 + local -a myeconfargs
102 +
103 + if use libressl || ! use mbedtls; then
104 + myeconfargs+=(
105 + $(use_enable pkcs11)
106 + )
107 + fi
108 + myeconfargs+=(
109 + $(use_enable inotify async-push)
110 + --with-crypto-library=$(usex mbedtls mbedtls openssl)
111 + $(use_enable lz4)
112 + $(use_enable lzo)
113 + $(use_enable plugins)
114 + $(use_enable iproute2)
115 + $(use_enable pam plugin-auth-pam)
116 + $(use_enable down-root plugin-down-root)
117 + $(use_enable systemd)
118 + )
119 + SYSTEMD_UNIT_DIR=$(systemd_get_systemunitdir) \
120 + TMPFILES_DIR="/usr/lib/tmpfiles.d" \
121 + IPROUTE=$(usex iproute2 '/bin/ip' '') \
122 + econf "${myeconfargs[@]}"
123 +}
124 +
125 +src_test() {
126 + make check || die "top-level tests failed"
127 + pushd tests/unit_tests > /dev/null || die
128 + make check || die "unit tests failed"
129 + popd > /dev/null || die
130 +}
131 +
132 +src_install() {
133 + default
134 + find "${ED}/usr" -name '*.la' -delete
135 + # install documentation
136 + dodoc AUTHORS ChangeLog PORTS README README.IPv6
137 +
138 + # Install some helper scripts
139 + keepdir /etc/openvpn
140 + exeinto /etc/openvpn
141 + doexe "${FILESDIR}/up.sh"
142 + doexe "${FILESDIR}/down.sh"
143 +
144 + # Install the init script and config file
145 + newinitd "${FILESDIR}/${PN}-2.1.init" openvpn
146 + newconfd "${FILESDIR}/${PN}-2.1.conf" openvpn
147 +
148 + # install examples, controlled by the respective useflag
149 + if use examples ; then
150 + # dodoc does not supportly support directory traversal, #15193
151 + docinto /usr/share/doc/${PF}/examples
152 + dodoc -r sample contrib
153 + fi
154 +
155 + # https://bugs.gentoo.org/755680#c3
156 + doman doc/openvpn.8
157 +}
158 +
159 +pkg_postinst() {
160 + if use x64-macos; then
161 + elog "You might want to install tuntaposx for TAP interface support:"
162 + elog "http://tuntaposx.sourceforge.net"
163 + fi
164 +
165 + if systemd_is_booted || has_version sys-apps/systemd; then
166 + elog "In order to use OpenVPN with systemd please use the correct systemd service file."
167 + elog ""
168 + elog "server:"
169 + elog ""
170 + elog "- Place your server configuration file in /etc/openvpn/server"
171 + elog "- Use the openvpn-server@.service like so"
172 + elog "systemctl start openvpn-server@{Server-config}"
173 + elog ""
174 + elog "client:"
175 + elog ""
176 + elog "- Place your client configuration file in /etc/openvpn/client"
177 + elog "- Use the openvpn-client@.service like so:"
178 + elog "systemctl start openvpn-client@{Client-config}"
179 +
180 + else
181 +
182 + elog "The openvpn init script expects to find the configuration file"
183 + elog "openvpn.conf in /etc/openvpn along with any extra files it may need."
184 + elog ""
185 + elog "To create more VPNs, simply create a new .conf file for it and"
186 + elog "then create a symlink to the openvpn init script from a link called"
187 + elog "openvpn.newconfname - like so"
188 + elog " cd /etc/openvpn"
189 + elog " ${EDITOR##*/} foo.conf"
190 + elog " cd /etc/init.d"
191 + elog " ln -s openvpn openvpn.foo"
192 + elog ""
193 + elog "You can then treat openvpn.foo as any other service, so you can"
194 + elog "stop one vpn and start another if you need to."
195 + fi
196 +
197 + if grep -Eq "^[ \t]*(up|down)[ \t].*" "${ROOT}/etc/openvpn"/*.conf 2>/dev/null ; then
198 + ewarn ""
199 + ewarn "WARNING: If you use the remote keyword then you are deemed to be"
200 + ewarn "a client by our init script and as such we force up,down scripts."
201 + ewarn "These scripts call /etc/openvpn/\$SVCNAME-{up,down}.sh where you"
202 + ewarn "can move your scripts to."
203 + fi
204 +
205 + if use plugins ; then
206 + einfo ""
207 + einfo "plugins have been installed into /usr/$(get_libdir)/${PN}/plugins"
208 + fi
209 +}