1 |
commit: 123e5fa4fba33de444a52d19752b9c0b2bbd7278 |
2 |
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Dec 3 02:44:17 2016 +0000 |
4 |
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Dec 3 02:48:07 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=123e5fa4 |
7 |
|
8 |
net-misc/openvpn: Version bump to 2.4_rc1 |
9 |
|
10 |
Package-Manager: portage-2.3.2 |
11 |
|
12 |
net-misc/openvpn/Manifest | 2 + |
13 |
.../openvpn/files/openvpn-external-cmocka.patch | 62 ++++++++ |
14 |
net-misc/openvpn/metadata.xml | 3 +- |
15 |
net-misc/openvpn/openvpn-2.4_rc1.ebuild | 159 +++++++++++++++++++++ |
16 |
4 files changed, 225 insertions(+), 1 deletion(-) |
17 |
|
18 |
diff --git a/net-misc/openvpn/Manifest b/net-misc/openvpn/Manifest |
19 |
index 0ee7d1f..af321bc 100644 |
20 |
--- a/net-misc/openvpn/Manifest |
21 |
+++ b/net-misc/openvpn/Manifest |
22 |
@@ -1,2 +1,4 @@ |
23 |
+DIST mock_msg.h 1356 SHA256 d6c56a423753c0b938a5dc32c978984eebb97243a2671a1652440093f67d61fb SHA512 930775a5837bc7f97a26817ea028782d555e0e71ba06b04c39941f4c01bbc3ca0a5dc63bcf19dc694e0e746b3a382f22daf6a6373a3443c5afd7398cbaaef6ea WHIRLPOOL 4cce848abc141e9d39cca1f8a0c9d11c0819d8a6e640c541968df491d2a6c3c0746233742418ee43c8bbc6ef19028a41159efae2922bcc719bd86442da05df86 |
24 |
DIST openvpn-2.3.12.tar.gz 1235262 SHA256 f5d39b8c55f75b0aab943059b20571452b494146d997b12d48ce9bd753c01cff SHA512 8de40e9177268cce64906915ddc0d23381b4040ed00e6eefe4784b04d48f50d5c5ce9e99886eb18fe45d22c5c047478b9aa942e4c4eeaf115cc443a1d3ebe631 WHIRLPOOL 4adeb0da83a4fbff27bc90a3941b593f97dfdc3f50c3ccf10c113293bb0e4f85ead680b53645a2a078f907026549c8dbf068dcc64c9f89b6a967b3eb919f2c8c |
25 |
DIST openvpn-2.3.13.tar.gz 1237826 SHA256 0e017211bf2a0607b1dda5e8e3f710b4c54aa5a63e1f89a8b17054abee20fa86 SHA512 72e979f2e3e10d2aec6cb8a8bda97bc15bbf3a4e392ae13a5ebc7d0553c174801d2d93ccd2087e16ac0cbd6527a93dd66a4823be658d5730a9391c7a8bce2294 WHIRLPOOL f896e91341eee512a941efb58b2fa42b88181870f17d54ae08ad8fb848ab09e922e9678d0d6325fd57b54c5dd9848fda0cc820ec692dcbe58db96e14186b7641 |
26 |
+DIST openvpn-2.4_rc1.tar.gz 1360801 SHA256 97ba64983531f5e27771a338518f9084a218442f5463ad055f4ceae9f523eb91 SHA512 ae531ac7e6bb6fd3323a0a7f3cef57b94a3f120fd33385c6d4528f6b831fd6f0c567616d0e048dd45fbe20829bd1432483798d82382eaa99fe0f14f93448c0b0 WHIRLPOOL 4f8d4df0c614705f9d9f3030d28be88705ab3dafaf0a86b4fb27727b84409e3235f6c0cf44bc5985e7316a3307f20e1197df3208551a2b06db18d733251ec2b5 |
27 |
|
28 |
diff --git a/net-misc/openvpn/files/openvpn-external-cmocka.patch b/net-misc/openvpn/files/openvpn-external-cmocka.patch |
29 |
new file mode 100644 |
30 |
index 00000000..eecc507 |
31 |
--- /dev/null |
32 |
+++ b/net-misc/openvpn/files/openvpn-external-cmocka.patch |
33 |
@@ -0,0 +1,62 @@ |
34 |
+diff --git a/configure.ac b/configure.ac |
35 |
+index f4073d0..9afcc90 100644 |
36 |
+--- a/configure.ac |
37 |
++++ b/configure.ac |
38 |
+@@ -1211,6 +1211,21 @@ if test "${enable_async_push}" = "yes"; then |
39 |
+ ) |
40 |
+ fi |
41 |
+ |
42 |
++AC_ARG_ENABLE( |
43 |
++ [tests], |
44 |
++ AS_HELP_STRING([--enable-tests], [enable unit tests @<:@default=no@:>@]) |
45 |
++) |
46 |
++ |
47 |
++if test "${enable_tests}" = "yes"; then |
48 |
++ PKG_CHECK_MODULES([CMOCKA], [cmocka]) |
49 |
++ TEST_CFLAGS="${CMOCKA_CFLAGS}" |
50 |
++ TEST_LDFLAGS="${CMOCKA_LIBS}" |
51 |
++ AC_SUBST([TEST_CFLAGS]) |
52 |
++ AC_SUBST([TEST_LDFLAGS]) |
53 |
++fi |
54 |
++AM_CONDITIONAL([ENABLE_TESTS], [test "${enable_tests}" = "yes"]) |
55 |
++AM_CONDITIONAL([CMOCKA_INITIALIZED], [false]) |
56 |
++ |
57 |
+ CONFIGURE_DEFINES="`set | grep '^enable_.*=' ; set | grep '^with_.*='`" |
58 |
+ AC_DEFINE_UNQUOTED([CONFIGURE_DEFINES], ["`echo ${CONFIGURE_DEFINES}`"], [Configuration settings]) |
59 |
+ |
60 |
+@@ -1257,28 +1272,6 @@ AC_SUBST([VENDOR_SRC_ROOT]) |
61 |
+ AC_SUBST([VENDOR_BUILD_ROOT]) |
62 |
+ AC_SUBST([VENDOR_DIST_ROOT]) |
63 |
+ |
64 |
+-TEST_LDFLAGS="-lcmocka -L\$(abs_top_builddir)/vendor/dist/lib -Wl,-rpath,\$(abs_top_builddir)/vendor/dist/lib" |
65 |
+-TEST_CFLAGS="-I\$(top_srcdir)/include -I\$(abs_top_builddir)/vendor/dist/include" |
66 |
+- |
67 |
+-AC_SUBST([TEST_LDFLAGS]) |
68 |
+-AC_SUBST([TEST_CFLAGS]) |
69 |
+- |
70 |
+-# Check if cmake is available and cmocka git submodule is initialized, |
71 |
+-# needed for unit testing |
72 |
+-AC_CHECK_PROGS([CMAKE], [cmake]) |
73 |
+-if test -n "${CMAKE}"; then |
74 |
+- if test -f "${srcdir}/vendor/cmocka/CMakeLists.txt"; then |
75 |
+- AM_CONDITIONAL([CMOCKA_INITIALIZED], [true]) |
76 |
+- else |
77 |
+- AM_CONDITIONAL([CMOCKA_INITIALIZED], [false]) |
78 |
+- AC_MSG_RESULT([!! WARNING !! The cmoka git submodule has not been initialized or updated. Unit testing cannot be performed.]) |
79 |
+- fi |
80 |
+-else |
81 |
+- AC_MSG_RESULT([!! WARNING !! CMake is NOT available. Unit testing cannot be performed.]) |
82 |
+- AM_CONDITIONAL([CMOCKA_INITIALIZED], [false]) |
83 |
+-fi |
84 |
+- |
85 |
+- |
86 |
+ AC_CONFIG_FILES([ |
87 |
+ version.sh |
88 |
+ Makefile |
89 |
+diff --git a/tests/unit_tests/Makefile.am b/tests/unit_tests/Makefile.am |
90 |
+index 31d37b8..4b7fb41 100644 |
91 |
+--- a/tests/unit_tests/Makefile.am |
92 |
++++ b/tests/unit_tests/Makefile.am |
93 |
+@@ -3 +3 @@ AUTOMAKE_OPTIONS = foreign |
94 |
+-if CMOCKA_INITIALIZED |
95 |
++if ENABLE_TESTS |
96 |
|
97 |
diff --git a/net-misc/openvpn/metadata.xml b/net-misc/openvpn/metadata.xml |
98 |
index eadf721..d6c211a 100644 |
99 |
--- a/net-misc/openvpn/metadata.xml |
100 |
+++ b/net-misc/openvpn/metadata.xml |
101 |
@@ -15,7 +15,8 @@ networks using an encrypted tunnel.</longdescription> |
102 |
<use> |
103 |
<flag name="down-root">Enable the down-root plugin</flag> |
104 |
<flag name="iproute2">Enabled iproute2 support instead of net-tools</flag> |
105 |
- <flag name="passwordsave">Enables openvpn to save passwords</flag> |
106 |
+ <flag name="lz4">Enable LZ4 support</flag> |
107 |
+ <flag name="mbedtls">Use mbed TLS instead of OpenSSL</flag> |
108 |
<flag name="polarssl">Use PolarSSL instead of OpenSSL</flag> |
109 |
<flag name="pkcs11">Enable PKCS#11 smartcard support</flag> |
110 |
<flag name="plugins">Enable the OpenVPN plugin system</flag> |
111 |
|
112 |
diff --git a/net-misc/openvpn/openvpn-2.4_rc1.ebuild b/net-misc/openvpn/openvpn-2.4_rc1.ebuild |
113 |
new file mode 100644 |
114 |
index 00000000..36b3849 |
115 |
--- /dev/null |
116 |
+++ b/net-misc/openvpn/openvpn-2.4_rc1.ebuild |
117 |
@@ -0,0 +1,159 @@ |
118 |
+# Copyright 1999-2016 Gentoo Foundation |
119 |
+# Distributed under the terms of the GNU General Public License v2 |
120 |
+# $Id$ |
121 |
+ |
122 |
+EAPI=6 |
123 |
+ |
124 |
+inherit autotools flag-o-matic user systemd linux-info |
125 |
+ |
126 |
+DESCRIPTION="Robust and highly flexible tunneling application compatible with many OSes" |
127 |
+SRC_URI="http://swupdate.openvpn.net/community/releases/${P}.tar.gz |
128 |
+ test? ( https://raw.githubusercontent.com/OpenVPN/${PN}/v${PV}/tests/unit_tests/${PN}/mock_msg.h )" |
129 |
+HOMEPAGE="http://openvpn.net/" |
130 |
+ |
131 |
+LICENSE="GPL-2" |
132 |
+SLOT="0" |
133 |
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux" |
134 |
+ |
135 |
+IUSE="down-root examples inotify iproute2 libressl lz4 +lzo mbedtls pam" |
136 |
+IUSE+=" pkcs11 +plugins polarssl selinux +ssl static systemd test userland_BSD" |
137 |
+ |
138 |
+REQUIRED_USE="static? ( !plugins !pkcs11 ) |
139 |
+ lzo? ( !lz4 ) |
140 |
+ pkcs11? ( ssl ) |
141 |
+ mbedtls? ( ssl !libressl ) |
142 |
+ pkcs11? ( ssl ) |
143 |
+ !plugins? ( !pam !down-root )" |
144 |
+ |
145 |
+CDEPEND=" |
146 |
+ kernel_linux? ( |
147 |
+ iproute2? ( sys-apps/iproute2[-minimal] ) |
148 |
+ !iproute2? ( sys-apps/net-tools ) |
149 |
+ ) |
150 |
+ pam? ( virtual/pam ) |
151 |
+ ssl? ( |
152 |
+ !mbedtls? ( |
153 |
+ !libressl? ( >=dev-libs/openssl-0.9.8:* ) |
154 |
+ libressl? ( dev-libs/libressl ) |
155 |
+ ) |
156 |
+ mbedtls? ( net-libs/mbedtls ) |
157 |
+ ) |
158 |
+ lzo? ( app-arch/lz4 ) |
159 |
+ pkcs11? ( >=dev-libs/pkcs11-helper-1.11 ) |
160 |
+ systemd? ( sys-apps/systemd )" |
161 |
+DEPEND="${CDEPEND} |
162 |
+ test? ( dev-util/cmocka )" |
163 |
+RDEPEND="${CDEPEND} |
164 |
+ selinux? ( sec-policy/selinux-openvpn )" |
165 |
+ |
166 |
+CONFIG_CHECK="~TUN" |
167 |
+ |
168 |
+PATCHES=( |
169 |
+ "${FILESDIR}/${PN}-external-cmocka.patch" |
170 |
+) |
171 |
+ |
172 |
+pkg_setup() { |
173 |
+ linux-info_pkg_setup |
174 |
+} |
175 |
+ |
176 |
+src_prepare() { |
177 |
+ default |
178 |
+ eautoreconf |
179 |
+ |
180 |
+ if use test; then |
181 |
+ cp "${DISTDIR}/mock_msg.h" tests/unit_tests/${PN} || die |
182 |
+ fi |
183 |
+} |
184 |
+ |
185 |
+src_configure() { |
186 |
+ use static && append-ldflags -Xcompiler -static |
187 |
+ econf \ |
188 |
+ --with-plugindir="${ROOT}/usr/$(get_libdir)/$PN" \ |
189 |
+ $(usex mbedtls 'with-crypto-library' 'mbedtls' '' '') \ |
190 |
+ $(use_enable inotify async-push) \ |
191 |
+ $(use_enable ssl crypto) \ |
192 |
+ $(use_enable lz4) \ |
193 |
+ $(use_enable lzo) \ |
194 |
+ $(use_enable pkcs11) \ |
195 |
+ $(use_enable plugins) \ |
196 |
+ $(use_enable iproute2) \ |
197 |
+ $(use_enable pam plugin-auth-pam) \ |
198 |
+ $(use_enable down-root plugin-down-root) \ |
199 |
+ $(use_enable test tests) \ |
200 |
+ $(use_enable systemd) |
201 |
+} |
202 |
+ |
203 |
+src_test() { |
204 |
+ make check || die "top-level tests failed" |
205 |
+ pushd tests/unit_tests > /dev/null || die |
206 |
+ make check || die "unit tests failed" |
207 |
+ popd > /dev/null || die |
208 |
+} |
209 |
+ |
210 |
+src_install() { |
211 |
+ default |
212 |
+ find "${ED}/usr" -name '*.la' -delete |
213 |
+ # install documentation |
214 |
+ dodoc AUTHORS ChangeLog PORTS README README.IPv6 |
215 |
+ |
216 |
+ # Install some helper scripts |
217 |
+ keepdir /etc/openvpn |
218 |
+ exeinto /etc/openvpn |
219 |
+ doexe "${FILESDIR}/up.sh" |
220 |
+ doexe "${FILESDIR}/down.sh" |
221 |
+ |
222 |
+ # Install the init script and config file |
223 |
+ newinitd "${FILESDIR}/${PN}-2.1.init" openvpn |
224 |
+ newconfd "${FILESDIR}/${PN}-2.1.conf" openvpn |
225 |
+ |
226 |
+ # install examples, controlled by the respective useflag |
227 |
+ if use examples ; then |
228 |
+ # dodoc does not supportly support directory traversal, #15193 |
229 |
+ insinto /usr/share/doc/${PF}/examples |
230 |
+ doins -r sample contrib |
231 |
+ fi |
232 |
+ |
233 |
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfile ${PN}.conf |
234 |
+ systemd_newunit distro/systemd/openvpn-client@.service openvpn-client@.service |
235 |
+ systemd_newunit distro/systemd/openvpn-server@.service openvpn-server@.service |
236 |
+} |
237 |
+ |
238 |
+pkg_postinst() { |
239 |
+ # Add openvpn user so openvpn servers can drop privs |
240 |
+ # Clients should run as root so they can change ip addresses, |
241 |
+ # dns information and other such things. |
242 |
+ enewgroup openvpn |
243 |
+ enewuser openvpn "" "" "" openvpn |
244 |
+ |
245 |
+ if [ path_exists -o "${ROOT}/etc/openvpn/*/local.conf" ] ; then |
246 |
+ ewarn "WARNING: The openvpn init script has changed" |
247 |
+ ewarn "" |
248 |
+ fi |
249 |
+ |
250 |
+ elog "The openvpn init script expects to find the configuration file" |
251 |
+ elog "openvpn.conf in /etc/openvpn along with any extra files it may need." |
252 |
+ elog "" |
253 |
+ elog "To create more VPNs, simply create a new .conf file for it and" |
254 |
+ elog "then create a symlink to the openvpn init script from a link called" |
255 |
+ elog "openvpn.newconfname - like so" |
256 |
+ elog " cd /etc/openvpn" |
257 |
+ elog " ${EDITOR##*/} foo.conf" |
258 |
+ elog " cd /etc/init.d" |
259 |
+ elog " ln -s openvpn openvpn.foo" |
260 |
+ elog "" |
261 |
+ elog "You can then treat openvpn.foo as any other service, so you can" |
262 |
+ elog "stop one vpn and start another if you need to." |
263 |
+ |
264 |
+ if grep -Eq "^[ \t]*(up|down)[ \t].*" "${ROOT}/etc/openvpn"/*.conf 2>/dev/null ; then |
265 |
+ ewarn "" |
266 |
+ ewarn "WARNING: If you use the remote keyword then you are deemed to be" |
267 |
+ ewarn "a client by our init script and as such we force up,down scripts." |
268 |
+ ewarn "These scripts call /etc/openvpn/\$SVCNAME-{up,down}.sh where you" |
269 |
+ ewarn "can move your scripts to." |
270 |
+ fi |
271 |
+ |
272 |
+ if use plugins ; then |
273 |
+ einfo "" |
274 |
+ einfo "plugins have been installed into /usr/$(get_libdir)/${PN}" |
275 |
+ fi |
276 |
+} |