Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-vpn/openvpn/
Date: Fri, 22 Feb 2019 18:31:35
Message-Id: 1550860280.7a6a14a073a1a889d4062836925915df68f84c74.williamh@gentoo
1 commit: 7a6a14a073a1a889d4062836925915df68f84c74
2 Author: William Hubbs <william.hubbs <AT> sony <DOT> com>
3 AuthorDate: Fri Feb 22 18:07:04 2019 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 22 18:31:20 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a6a14a0
7
8 net-vpn/openvpn: 2.4.7 bump
9
10 Copyright: Sony Interactive Entertainment Inc.
11 Package-Manager: Portage-2.3.51, Repoman-2.3.12
12 Signed-off-by: William Hubbs <williamh <AT> gentoo.org>
13
14 net-vpn/openvpn/Manifest | 1 +
15 net-vpn/openvpn/openvpn-2.4.7.ebuild | 158 +++++++++++++++++++++++++++++++++++
16 2 files changed, 159 insertions(+)
17
18 diff --git a/net-vpn/openvpn/Manifest b/net-vpn/openvpn/Manifest
19 index c92708270b1..c8d11c05c86 100644
20 --- a/net-vpn/openvpn/Manifest
21 +++ b/net-vpn/openvpn/Manifest
22 @@ -1,2 +1,3 @@
23 DIST mock_msg.h 1356 BLAKE2B da7585cfeee89c0a4d3aa6326de6e2324804ed2a57a0e8bf7c2e51b25a91a8e1fcf9d29bba90fe58e40bf0197793a76fc1e83d8b6d677228cdc5e5333253b1a3 SHA512 930775a5837bc7f97a26817ea028782d555e0e71ba06b04c39941f4c01bbc3ca0a5dc63bcf19dc694e0e746b3a382f22daf6a6373a3443c5afd7398cbaaef6ea
24 DIST openvpn-2.4.6.tar.gz 1431971 BLAKE2B 1ab0746a845fc56bf738c1730cc187c27f61d5bb763df149640978f0bf87450a01e3e40372265440f1aae4e1c58b6d9a1ee1f2aade970d19fd8e8813e0b487a7 SHA512 cdd70bfd03177bc6cb70d0d614e40389df00816b7097740b4cda9d7bee094d1463fdb5afeaf604c52c7b3167d1edb098a2e095e131a8b9fed0ed8b29da90cbe8
25 +DIST openvpn-2.4.7.tar.gz 998094 BLAKE2B 90f91d74279a547b49704cd14d9ac3dde26c522cd77eb851ea603addb1b220eda9be4de6cf5d74fe7717f34b3ff5fc802ca977a1402c5ed75616139d449fceb0 SHA512 ba9bc08c02fad85ba05c27488b0bfcb3540ba9c625c42334e24cb1d5e253b91c518c02641d755e03b8747ae8c2ebd340c55d51f7aedbbf2550ee4e4b79823c9c
26
27 diff --git a/net-vpn/openvpn/openvpn-2.4.7.ebuild b/net-vpn/openvpn/openvpn-2.4.7.ebuild
28 new file mode 100644
29 index 00000000000..486507300fe
30 --- /dev/null
31 +++ b/net-vpn/openvpn/openvpn-2.4.7.ebuild
32 @@ -0,0 +1,158 @@
33 +# Copyright 1999-2019 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=6
37 +
38 +inherit autotools flag-o-matic user systemd linux-info
39 +
40 +DESCRIPTION="Robust and highly flexible tunneling application compatible with many OSes"
41 +SRC_URI="https://github.com/OpenVPN/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
42 + test? ( https://raw.githubusercontent.com/OpenVPN/${PN}/v${PV}/tests/unit_tests/${PN}/mock_msg.h )"
43 +HOMEPAGE="https://openvpn.net/"
44 +
45 +LICENSE="GPL-2"
46 +SLOT="0"
47 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
48 +
49 +IUSE="down-root examples inotify iproute2 libressl lz4 +lzo mbedtls pam"
50 +IUSE+=" pkcs11 +plugins selinux +ssl static systemd test userland_BSD"
51 +
52 +REQUIRED_USE="static? ( !plugins !pkcs11 )
53 + mbedtls? ( ssl !libressl )
54 + pkcs11? ( ssl )
55 + !plugins? ( !pam !down-root )
56 + inotify? ( plugins )"
57 +
58 +CDEPEND="
59 + kernel_linux? (
60 + iproute2? ( sys-apps/iproute2[-minimal] )
61 + !iproute2? ( >=sys-apps/net-tools-1.60_p20160215155418 )
62 + )
63 + pam? ( virtual/pam )
64 + ssl? (
65 + !mbedtls? (
66 + !libressl? ( >=dev-libs/openssl-0.9.8:0= )
67 + libressl? ( dev-libs/libressl:0= )
68 + )
69 + mbedtls? ( net-libs/mbedtls )
70 + )
71 + lz4? ( app-arch/lz4 )
72 + lzo? ( >=dev-libs/lzo-1.07 )
73 + pkcs11? ( >=dev-libs/pkcs11-helper-1.11 )
74 + systemd? ( sys-apps/systemd )"
75 +DEPEND="${CDEPEND}
76 + test? ( dev-util/cmocka )"
77 +RDEPEND="${CDEPEND}
78 + selinux? ( sec-policy/selinux-openvpn )"
79 +
80 +CONFIG_CHECK="~TUN"
81 +
82 +PATCHES=(
83 + "${FILESDIR}/${PN}-external-cmocka.patch"
84 + "${FILESDIR}/${PN}-2.4.5-libressl-macro-fix.patch"
85 +)
86 +
87 +pkg_setup() {
88 + linux-info_pkg_setup
89 +}
90 +
91 +src_prepare() {
92 + default
93 + eautoreconf
94 +
95 + if use test; then
96 + cp "${DISTDIR}/mock_msg.h" tests/unit_tests/${PN} || die
97 + fi
98 +}
99 +
100 +src_configure() {
101 + use static && append-ldflags -Xcompiler -static
102 + SYSTEMD_UNIT_DIR=$(systemd_get_systemunitdir) \
103 + TMPFILES_DIR="/usr/lib/tmpfiles.d" \
104 + IFCONFIG=/bin/ifconfig \
105 + ROUTE=/bin/route \
106 + econf \
107 + $(usex mbedtls '--with-crypto-library=mbedtls' '') \
108 + $(use_enable inotify async-push) \
109 + $(use_enable ssl crypto) \
110 + $(use_enable lz4) \
111 + $(use_enable lzo) \
112 + $(use_enable pkcs11) \
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 test tests) \
118 + $(use_enable systemd)
119 +}
120 +
121 +src_test() {
122 + make check || die "top-level tests failed"
123 + pushd tests/unit_tests > /dev/null || die
124 + make check || die "unit tests failed"
125 + popd > /dev/null || die
126 +}
127 +
128 +src_install() {
129 + default
130 + find "${ED}/usr" -name '*.la' -delete
131 + # install documentation
132 + dodoc AUTHORS ChangeLog PORTS README README.IPv6
133 +
134 + # Install some helper scripts
135 + keepdir /etc/openvpn
136 + exeinto /etc/openvpn
137 + doexe "${FILESDIR}/up.sh"
138 + doexe "${FILESDIR}/down.sh"
139 +
140 + # Install the init script and config file
141 + newinitd "${FILESDIR}/${PN}-2.1.init" openvpn
142 + newconfd "${FILESDIR}/${PN}-2.1.conf" openvpn
143 +
144 + # install examples, controlled by the respective useflag
145 + if use examples ; then
146 + # dodoc does not supportly support directory traversal, #15193
147 + insinto /usr/share/doc/${PF}/examples
148 + doins -r sample contrib
149 + fi
150 +}
151 +
152 +pkg_postinst() {
153 + # Add openvpn user so openvpn servers can drop privs
154 + # Clients should run as root so they can change ip addresses,
155 + # dns information and other such things.
156 + enewgroup openvpn
157 + enewuser openvpn "" "" "" openvpn
158 +
159 + if use x64-macos; then
160 + elog "You might want to install tuntaposx for TAP interface support:"
161 + elog "http://tuntaposx.sourceforge.net"
162 + fi
163 +
164 + elog "The openvpn init script expects to find the configuration file"
165 + elog "openvpn.conf in /etc/openvpn along with any extra files it may need."
166 + elog ""
167 + elog "To create more VPNs, simply create a new .conf file for it and"
168 + elog "then create a symlink to the openvpn init script from a link called"
169 + elog "openvpn.newconfname - like so"
170 + elog " cd /etc/openvpn"
171 + elog " ${EDITOR##*/} foo.conf"
172 + elog " cd /etc/init.d"
173 + elog " ln -s openvpn openvpn.foo"
174 + elog ""
175 + elog "You can then treat openvpn.foo as any other service, so you can"
176 + elog "stop one vpn and start another if you need to."
177 +
178 + if grep -Eq "^[ \t]*(up|down)[ \t].*" "${ROOT}/etc/openvpn"/*.conf 2>/dev/null ; then
179 + ewarn ""
180 + ewarn "WARNING: If you use the remote keyword then you are deemed to be"
181 + ewarn "a client by our init script and as such we force up,down scripts."
182 + ewarn "These scripts call /etc/openvpn/\$SVCNAME-{up,down}.sh where you"
183 + ewarn "can move your scripts to."
184 + fi
185 +
186 + if use plugins ; then
187 + einfo ""
188 + einfo "plugins have been installed into /usr/$(get_libdir)/${PN}/plugins"
189 + fi
190 +}