1 |
commit: 91a1df51bd14d00b9dbbb7763826ebf62eb38a17 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Aug 31 21:21:44 2020 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Aug 31 21:25:24 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91a1df51 |
7 |
|
8 |
net-vpn/strongswan: drop old |
9 |
|
10 |
Package-Manager: Portage-3.0.4, Repoman-3.0.1 |
11 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
12 |
|
13 |
net-vpn/strongswan/Manifest | 2 - |
14 |
.../strongswan/files/strongswan-5.8.2-gcc-10.patch | 45 --- |
15 |
net-vpn/strongswan/strongswan-5.8.1.ebuild | 308 -------------------- |
16 |
net-vpn/strongswan/strongswan-5.8.2.ebuild | 310 --------------------- |
17 |
4 files changed, 665 deletions(-) |
18 |
|
19 |
diff --git a/net-vpn/strongswan/Manifest b/net-vpn/strongswan/Manifest |
20 |
index 82da10a5e07..d714fba7291 100644 |
21 |
--- a/net-vpn/strongswan/Manifest |
22 |
+++ b/net-vpn/strongswan/Manifest |
23 |
@@ -1,4 +1,2 @@ |
24 |
-DIST strongswan-5.8.1.tar.bz2 4517921 BLAKE2B 07a82309515a054b267a063fc0e2f49fd03d16b221b1ee26a33c8d367df140797320e1ef7007a39074e40c472022d941656b3ae93d2eb860152cdc5a5d3dbc8a SHA512 630d24643b3d61e931bb25cdd083ad3c55f92fe41f3fcd3198012eee486fb3b1a16dc3f80936162afb7da9e471d45d92b7d183a00153a558babb2a79e5f6813f |
25 |
-DIST strongswan-5.8.2.tar.bz2 4533402 BLAKE2B edbfa8dbe1ac00c140cfe9e906ac7aa1b6f3ddfd528dec84e7b1799e5ecdd0f6114679168ebcff9185c8abae78b46dfc43ddc4dabecd44f720285bd175d7a249 SHA512 423e7924acfe8a03ad7d4359ae9086fd516798fcf5eb948a27b52ea719f4d8954b83ea30ce94191ea1647616611df8a1215cb4d5c7ec48676624df6c41853e1d |
26 |
DIST strongswan-5.8.4.tar.bz2 4546240 BLAKE2B f58f53a17c02924a3ad75bfadd5956f62098c41468ec5fe8d51bf0f0465c8936d8ca846a41a0b6ff6ac24ccd2229e726d3ea2b48904abf5743bbe766e5f5f81c SHA512 15e866b0d6cc4ea94f17856b519d926ae08c15d3b62f675f62685d0722ca8fa26b46afb1ad1c866e9d5f347d77a747f57d0c6d7f6bd57762f37d7798f9e28103 |
27 |
DIST strongswan-5.9.0.tar.bz2 4568404 BLAKE2B daf5cce5cbe12253f9ad201d89323ab7d54ba7ff466685b84830737689e4d417fbb97d053d8c9f3de5acb6dee9a192ebae48ec0d4aa07ba3c8969ee6d8f06ab3 SHA512 b982ce7c3e940ad75ab71b02ce3e2813b41c6b098cde5b6f3f3513d095f409fe989ae6e38a31eff51c57423bf452c3610cd5cd8cd7f45ff932581d9859df1821 |
28 |
|
29 |
diff --git a/net-vpn/strongswan/files/strongswan-5.8.2-gcc-10.patch b/net-vpn/strongswan/files/strongswan-5.8.2-gcc-10.patch |
30 |
deleted file mode 100644 |
31 |
index a7be11729c7..00000000000 |
32 |
--- a/net-vpn/strongswan/files/strongswan-5.8.2-gcc-10.patch |
33 |
+++ /dev/null |
34 |
@@ -1,45 +0,0 @@ |
35 |
-https://bugs.gentoo.org/706408 |
36 |
-https://github.com/strongswan/strongswan/pull/163 |
37 |
- |
38 |
-From a1f73a67aed56628c4655caa1ae50a6a2e4ec639 Mon Sep 17 00:00:00 2001 |
39 |
-From: Sergei Trofimovich <slyfox@g.o> |
40 |
-Date: Sun, 26 Jan 2020 11:03:27 +0000 |
41 |
-Subject: [PATCH] swanctl: fix build failure against gcc-10 |
42 |
-MIME-Version: 1.0 |
43 |
-Content-Type: text/plain; charset=UTF-8 |
44 |
-Content-Transfer-Encoding: 8bit |
45 |
- |
46 |
-On gcc-10 (and gcc-9 -fno-common) build fails as: |
47 |
- |
48 |
-``` |
49 |
-libtool: link: gcc ... -o .libs/swanctl ... |
50 |
-ld: commands/load_authorities.o:strongswan/src/swanctl/./swanctl.h:33: |
51 |
- multiple definition of `swanctl_dir'; commands/load_all.o:strongswan/src/swanctl/./swanctl.h:33: first defined here |
52 |
-``` |
53 |
- |
54 |
-gcc-10 will change the default from -fcommon to fno-common: |
55 |
-https://gcc.gnu.org/PR85678. |
56 |
- |
57 |
-The error also happens if CFLAGS=-fno-common passed explicitly. |
58 |
- |
59 |
-Reported-by: Toralf Förster |
60 |
-Bug: https://bugs.gentoo.org/706408 |
61 |
-Signed-off-by: Sergei Trofimovich <slyfox@g.o> |
62 |
---- |
63 |
- src/swanctl/swanctl.h | 2 +- |
64 |
- 1 file changed, 1 insertion(+), 1 deletion(-) |
65 |
- |
66 |
---- a/src/swanctl/swanctl.h |
67 |
-+++ b/src/swanctl/swanctl.h |
68 |
-@@ -30,7 +30,7 @@ |
69 |
- /** |
70 |
- * Base directory for credentials and config |
71 |
- */ |
72 |
--char *swanctl_dir; |
73 |
-+extern char *swanctl_dir; |
74 |
- |
75 |
- /** |
76 |
- * Configuration file for connections, etc. |
77 |
--- |
78 |
-2.25.0 |
79 |
- |
80 |
|
81 |
diff --git a/net-vpn/strongswan/strongswan-5.8.1.ebuild b/net-vpn/strongswan/strongswan-5.8.1.ebuild |
82 |
deleted file mode 100644 |
83 |
index 168a76a9f0d..00000000000 |
84 |
--- a/net-vpn/strongswan/strongswan-5.8.1.ebuild |
85 |
+++ /dev/null |
86 |
@@ -1,308 +0,0 @@ |
87 |
-# Copyright 1999-2019 Gentoo Authors |
88 |
-# Distributed under the terms of the GNU General Public License v2 |
89 |
- |
90 |
-EAPI="7" |
91 |
-inherit linux-info systemd user |
92 |
- |
93 |
-DESCRIPTION="IPsec-based VPN solution, supporting IKEv1/IKEv2 and MOBIKE" |
94 |
-HOMEPAGE="https://www.strongswan.org/" |
95 |
-SRC_URI="https://download.strongswan.org/${P}.tar.bz2" |
96 |
- |
97 |
-LICENSE="GPL-2 RSA DES" |
98 |
-SLOT="0" |
99 |
-KEYWORDS="amd64 arm ppc ~ppc64 x86" |
100 |
-IUSE="+caps curl +constraints debug dhcp eap farp gcrypt +gmp ldap mysql networkmanager +non-root +openssl selinux sqlite systemd pam pkcs11" |
101 |
- |
102 |
-STRONGSWAN_PLUGINS_STD="led lookip systime-fix unity vici" |
103 |
-STRONGSWAN_PLUGINS_OPT="aesni blowfish ccm chapoly ctr forecast gcm ha ipseckey newhope ntru padlock rdrand save-keys unbound whitelist" |
104 |
-for mod in $STRONGSWAN_PLUGINS_STD; do |
105 |
- IUSE="${IUSE} +strongswan_plugins_${mod}" |
106 |
-done |
107 |
- |
108 |
-for mod in $STRONGSWAN_PLUGINS_OPT; do |
109 |
- IUSE="${IUSE} strongswan_plugins_${mod}" |
110 |
-done |
111 |
- |
112 |
-COMMON_DEPEND="!net-misc/openswan |
113 |
- gmp? ( >=dev-libs/gmp-4.1.5:= ) |
114 |
- gcrypt? ( dev-libs/libgcrypt:0 ) |
115 |
- caps? ( sys-libs/libcap ) |
116 |
- curl? ( net-misc/curl ) |
117 |
- ldap? ( net-nds/openldap ) |
118 |
- openssl? ( >=dev-libs/openssl-0.9.8:=[-bindist] ) |
119 |
- mysql? ( dev-db/mysql-connector-c:= ) |
120 |
- sqlite? ( >=dev-db/sqlite-3.3.1 ) |
121 |
- systemd? ( sys-apps/systemd ) |
122 |
- networkmanager? ( net-misc/networkmanager ) |
123 |
- pam? ( sys-libs/pam ) |
124 |
- strongswan_plugins_unbound? ( net-dns/unbound:= net-libs/ldns )" |
125 |
-DEPEND="${COMMON_DEPEND} |
126 |
- virtual/linux-sources |
127 |
- sys-kernel/linux-headers" |
128 |
-RDEPEND="${COMMON_DEPEND} |
129 |
- virtual/logger |
130 |
- sys-apps/iproute2 |
131 |
- !net-vpn/libreswan |
132 |
- selinux? ( sec-policy/selinux-ipsec )" |
133 |
- |
134 |
-UGID="ipsec" |
135 |
- |
136 |
-pkg_setup() { |
137 |
- linux-info_pkg_setup |
138 |
- |
139 |
- elog "Linux kernel version: ${KV_FULL}" |
140 |
- |
141 |
- if ! kernel_is -ge 2 6 16; then |
142 |
- eerror |
143 |
- eerror "This ebuild currently only supports ${PN} with the" |
144 |
- eerror "native Linux 2.6 IPsec stack on kernels >= 2.6.16." |
145 |
- eerror |
146 |
- fi |
147 |
- |
148 |
- if kernel_is -lt 2 6 34; then |
149 |
- ewarn |
150 |
- ewarn "IMPORTANT KERNEL NOTES: Please read carefully..." |
151 |
- ewarn |
152 |
- |
153 |
- if kernel_is -lt 2 6 29; then |
154 |
- ewarn "[ < 2.6.29 ] Due to a missing kernel feature, you have to" |
155 |
- ewarn "include all required IPv6 modules even if you just intend" |
156 |
- ewarn "to run on IPv4 only." |
157 |
- ewarn |
158 |
- ewarn "This has been fixed with kernels >= 2.6.29." |
159 |
- ewarn |
160 |
- fi |
161 |
- |
162 |
- if kernel_is -lt 2 6 33; then |
163 |
- ewarn "[ < 2.6.33 ] Kernels prior to 2.6.33 include a non-standards" |
164 |
- ewarn "compliant implementation for SHA-2 HMAC support in ESP and" |
165 |
- ewarn "miss SHA384 and SHA512 HMAC support altogether." |
166 |
- ewarn |
167 |
- ewarn "If you need any of those features, please use kernel >= 2.6.33." |
168 |
- ewarn |
169 |
- fi |
170 |
- |
171 |
- if kernel_is -lt 2 6 34; then |
172 |
- ewarn "[ < 2.6.34 ] Support for the AES-GMAC authentification-only" |
173 |
- ewarn "ESP cipher is only included in kernels >= 2.6.34." |
174 |
- ewarn |
175 |
- ewarn "If you need it, please use kernel >= 2.6.34." |
176 |
- ewarn |
177 |
- fi |
178 |
- fi |
179 |
- |
180 |
- if use non-root; then |
181 |
- enewgroup ${UGID} |
182 |
- enewuser ${UGID} -1 -1 -1 ${UGID} |
183 |
- fi |
184 |
-} |
185 |
- |
186 |
-src_configure() { |
187 |
- local myconf="" |
188 |
- |
189 |
- if use non-root; then |
190 |
- myconf="${myconf} --with-user=${UGID} --with-group=${UGID}" |
191 |
- fi |
192 |
- |
193 |
- # If a user has already enabled db support, those plugins will |
194 |
- # most likely be desired as well. Besides they don't impose new |
195 |
- # dependencies and come at no cost (except for space). |
196 |
- if use mysql || use sqlite; then |
197 |
- myconf="${myconf} --enable-attr-sql --enable-sql" |
198 |
- fi |
199 |
- |
200 |
- # strongSwan builds and installs static libs by default which are |
201 |
- # useless to the user (and to strongSwan for that matter) because no |
202 |
- # header files or alike get installed... so disabling them is safe. |
203 |
- if use pam && use eap; then |
204 |
- myconf="${myconf} --enable-eap-gtc" |
205 |
- else |
206 |
- myconf="${myconf} --disable-eap-gtc" |
207 |
- fi |
208 |
- |
209 |
- for mod in $STRONGSWAN_PLUGINS_STD; do |
210 |
- if use strongswan_plugins_${mod}; then |
211 |
- myconf+=" --enable-${mod}" |
212 |
- fi |
213 |
- done |
214 |
- |
215 |
- for mod in $STRONGSWAN_PLUGINS_OPT; do |
216 |
- if use strongswan_plugins_${mod}; then |
217 |
- myconf+=" --enable-${mod}" |
218 |
- fi |
219 |
- done |
220 |
- |
221 |
- econf \ |
222 |
- --disable-static \ |
223 |
- --enable-ikev1 \ |
224 |
- --enable-ikev2 \ |
225 |
- --enable-swanctl \ |
226 |
- --enable-socket-dynamic \ |
227 |
- $(use_enable curl) \ |
228 |
- $(use_enable constraints) \ |
229 |
- $(use_enable ldap) \ |
230 |
- $(use_enable debug leak-detective) \ |
231 |
- $(use_enable dhcp) \ |
232 |
- $(use_enable eap eap-sim) \ |
233 |
- $(use_enable eap eap-sim-file) \ |
234 |
- $(use_enable eap eap-simaka-sql) \ |
235 |
- $(use_enable eap eap-simaka-pseudonym) \ |
236 |
- $(use_enable eap eap-simaka-reauth) \ |
237 |
- $(use_enable eap eap-identity) \ |
238 |
- $(use_enable eap eap-md5) \ |
239 |
- $(use_enable eap eap-aka) \ |
240 |
- $(use_enable eap eap-aka-3gpp2) \ |
241 |
- $(use_enable eap md4) \ |
242 |
- $(use_enable eap eap-mschapv2) \ |
243 |
- $(use_enable eap eap-radius) \ |
244 |
- $(use_enable eap eap-tls) \ |
245 |
- $(use_enable eap eap-ttls) \ |
246 |
- $(use_enable eap xauth-eap) \ |
247 |
- $(use_enable eap eap-dynamic) \ |
248 |
- $(use_enable farp) \ |
249 |
- $(use_enable gmp) \ |
250 |
- $(use_enable gcrypt) \ |
251 |
- $(use_enable mysql) \ |
252 |
- $(use_enable networkmanager nm) \ |
253 |
- $(use_enable openssl) \ |
254 |
- $(use_enable pam xauth-pam) \ |
255 |
- $(use_enable pkcs11) \ |
256 |
- $(use_enable sqlite) \ |
257 |
- $(use_enable systemd) \ |
258 |
- $(use_with caps capabilities libcap) \ |
259 |
- --with-piddir=/run \ |
260 |
- --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \ |
261 |
- ${myconf} |
262 |
-} |
263 |
- |
264 |
-src_install() { |
265 |
- emake DESTDIR="${D}" install |
266 |
- |
267 |
- if ! use systemd; then |
268 |
- rm -rf "${ED}"/lib/systemd || die |
269 |
- fi |
270 |
- |
271 |
- doinitd "${FILESDIR}"/ipsec |
272 |
- |
273 |
- local dir_ugid |
274 |
- if use non-root; then |
275 |
- fowners ${UGID}:${UGID} \ |
276 |
- /etc/ipsec.conf \ |
277 |
- /etc/strongswan.conf |
278 |
- |
279 |
- dir_ugid="${UGID}" |
280 |
- else |
281 |
- dir_ugid="root" |
282 |
- fi |
283 |
- |
284 |
- diropts -m 0750 -o ${dir_ugid} -g ${dir_ugid} |
285 |
- dodir /etc/ipsec.d \ |
286 |
- /etc/ipsec.d/aacerts \ |
287 |
- /etc/ipsec.d/acerts \ |
288 |
- /etc/ipsec.d/cacerts \ |
289 |
- /etc/ipsec.d/certs \ |
290 |
- /etc/ipsec.d/crls \ |
291 |
- /etc/ipsec.d/ocspcerts \ |
292 |
- /etc/ipsec.d/private \ |
293 |
- /etc/ipsec.d/reqs |
294 |
- |
295 |
- dodoc NEWS README TODO |
296 |
- |
297 |
- # shared libs are used only internally and there are no static libs, |
298 |
- # so it's safe to get rid of the .la files |
299 |
- find "${D}" -name '*.la' -delete || die "Failed to remove .la files." |
300 |
-} |
301 |
- |
302 |
-pkg_preinst() { |
303 |
- has_version "<net-vpn/strongswan-4.3.6-r1" |
304 |
- upgrade_from_leq_4_3_6=$(( !$? )) |
305 |
- |
306 |
- has_version "<net-vpn/strongswan-4.3.6-r1[-caps]" |
307 |
- previous_4_3_6_with_caps=$(( !$? )) |
308 |
-} |
309 |
- |
310 |
-pkg_postinst() { |
311 |
- if ! use openssl && ! use gcrypt; then |
312 |
- elog |
313 |
- elog "${PN} has been compiled without both OpenSSL and libgcrypt support." |
314 |
- elog "Please note that this might effect availability and speed of some" |
315 |
- elog "cryptographic features. You are advised to enable the OpenSSL plugin." |
316 |
- elif ! use openssl; then |
317 |
- elog |
318 |
- elog "${PN} has been compiled without the OpenSSL plugin. This might effect" |
319 |
- elog "availability and speed of some cryptographic features. There will be" |
320 |
- elog "no support for Elliptic Curve Cryptography (Diffie-Hellman groups 19-21," |
321 |
- elog "25, 26) and ECDSA." |
322 |
- fi |
323 |
- |
324 |
- if [[ $upgrade_from_leq_4_3_6 == 1 ]]; then |
325 |
- chmod 0750 "${ROOT}"/etc/ipsec.d \ |
326 |
- "${ROOT}"/etc/ipsec.d/aacerts \ |
327 |
- "${ROOT}"/etc/ipsec.d/acerts \ |
328 |
- "${ROOT}"/etc/ipsec.d/cacerts \ |
329 |
- "${ROOT}"/etc/ipsec.d/certs \ |
330 |
- "${ROOT}"/etc/ipsec.d/crls \ |
331 |
- "${ROOT}"/etc/ipsec.d/ocspcerts \ |
332 |
- "${ROOT}"/etc/ipsec.d/private \ |
333 |
- "${ROOT}"/etc/ipsec.d/reqs |
334 |
- |
335 |
- ewarn |
336 |
- ewarn "The default permissions for /etc/ipsec.d/* have been tightened for" |
337 |
- ewarn "security reasons. Your system installed directories have been" |
338 |
- ewarn "updated accordingly. Please check if necessary." |
339 |
- ewarn |
340 |
- |
341 |
- if [[ $previous_4_3_6_with_caps == 1 ]]; then |
342 |
- if ! use non-root; then |
343 |
- ewarn |
344 |
- ewarn "IMPORTANT: You previously had ${PN} installed without root" |
345 |
- ewarn "privileges because it was implied by the 'caps' USE flag." |
346 |
- ewarn "This has been changed. If you want ${PN} with user privileges," |
347 |
- ewarn "you have to re-emerge it with the 'non-root' USE flag enabled." |
348 |
- ewarn |
349 |
- fi |
350 |
- fi |
351 |
- fi |
352 |
- if ! use caps && ! use non-root; then |
353 |
- ewarn |
354 |
- ewarn "You have decided to run ${PN} with root privileges and built it" |
355 |
- ewarn "without support for POSIX capability dropping. It is generally" |
356 |
- ewarn "strongly suggested that you reconsider- especially if you intend" |
357 |
- ewarn "to run ${PN} as server with a public ip address." |
358 |
- ewarn |
359 |
- ewarn "You should re-emerge ${PN} with at least the 'caps' USE flag enabled." |
360 |
- ewarn |
361 |
- fi |
362 |
- if use non-root; then |
363 |
- elog |
364 |
- elog "${PN} has been installed without superuser privileges (USE=non-root)." |
365 |
- elog "This imposes several limitations mainly to the IKEv1 daemon 'pluto'" |
366 |
- elog "but also a few to the IKEv2 daemon 'charon'." |
367 |
- elog |
368 |
- elog "Please carefully read: http://wiki.strongswan.org/wiki/nonRoot" |
369 |
- elog |
370 |
- elog "pluto uses a helper script by default to insert/remove routing and" |
371 |
- elog "policy rules upon connection start/stop which requires superuser" |
372 |
- elog "privileges. charon in contrast does this internally and can do so" |
373 |
- elog "even with reduced (user) privileges." |
374 |
- elog |
375 |
- elog "Thus if you require IKEv1 (pluto) or need to specify a custom updown" |
376 |
- elog "script to pluto or charon which requires superuser privileges, you" |
377 |
- elog "can work around this limitation by using sudo to grant the" |
378 |
- elog "user \"ipsec\" the appropriate rights." |
379 |
- elog "For example (the default case):" |
380 |
- elog "/etc/sudoers:" |
381 |
- elog " ipsec ALL=(ALL) NOPASSWD: SETENV: /usr/sbin/ipsec" |
382 |
- elog "Under the specific connection block in /etc/ipsec.conf:" |
383 |
- elog " leftupdown=\"sudo -E ipsec _updown iptables\"" |
384 |
- elog |
385 |
- fi |
386 |
- elog |
387 |
- elog "Make sure you have _all_ required kernel modules available including" |
388 |
- elog "the appropriate cryptographic algorithms. A list is available at:" |
389 |
- elog " http://wiki.strongswan.org/projects/strongswan/wiki/KernelModules" |
390 |
- elog |
391 |
- elog "The up-to-date manual is available online at:" |
392 |
- elog " http://wiki.strongswan.org/" |
393 |
- elog |
394 |
-} |
395 |
|
396 |
diff --git a/net-vpn/strongswan/strongswan-5.8.2.ebuild b/net-vpn/strongswan/strongswan-5.8.2.ebuild |
397 |
deleted file mode 100644 |
398 |
index bfcd20769ca..00000000000 |
399 |
--- a/net-vpn/strongswan/strongswan-5.8.2.ebuild |
400 |
+++ /dev/null |
401 |
@@ -1,310 +0,0 @@ |
402 |
-# Copyright 1999-2020 Gentoo Authors |
403 |
-# Distributed under the terms of the GNU General Public License v2 |
404 |
- |
405 |
-EAPI="7" |
406 |
-inherit linux-info systemd user |
407 |
- |
408 |
-DESCRIPTION="IPsec-based VPN solution, supporting IKEv1/IKEv2 and MOBIKE" |
409 |
-HOMEPAGE="https://www.strongswan.org/" |
410 |
-SRC_URI="https://download.strongswan.org/${P}.tar.bz2" |
411 |
- |
412 |
-LICENSE="GPL-2 RSA DES" |
413 |
-SLOT="0" |
414 |
-KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86" |
415 |
-IUSE="+caps curl +constraints debug dhcp eap farp gcrypt +gmp ldap mysql networkmanager +non-root +openssl selinux sqlite systemd pam pkcs11" |
416 |
- |
417 |
-STRONGSWAN_PLUGINS_STD="led lookip systime-fix unity vici" |
418 |
-STRONGSWAN_PLUGINS_OPT="aesni blowfish ccm chapoly ctr forecast gcm ha ipseckey newhope ntru padlock rdrand save-keys unbound whitelist" |
419 |
-for mod in $STRONGSWAN_PLUGINS_STD; do |
420 |
- IUSE="${IUSE} +strongswan_plugins_${mod}" |
421 |
-done |
422 |
- |
423 |
-for mod in $STRONGSWAN_PLUGINS_OPT; do |
424 |
- IUSE="${IUSE} strongswan_plugins_${mod}" |
425 |
-done |
426 |
- |
427 |
-COMMON_DEPEND="!net-misc/openswan |
428 |
- gmp? ( >=dev-libs/gmp-4.1.5:= ) |
429 |
- gcrypt? ( dev-libs/libgcrypt:0 ) |
430 |
- caps? ( sys-libs/libcap ) |
431 |
- curl? ( net-misc/curl ) |
432 |
- ldap? ( net-nds/openldap ) |
433 |
- openssl? ( >=dev-libs/openssl-0.9.8:=[-bindist] ) |
434 |
- mysql? ( dev-db/mysql-connector-c:= ) |
435 |
- sqlite? ( >=dev-db/sqlite-3.3.1 ) |
436 |
- systemd? ( sys-apps/systemd ) |
437 |
- networkmanager? ( net-misc/networkmanager ) |
438 |
- pam? ( sys-libs/pam ) |
439 |
- strongswan_plugins_unbound? ( net-dns/unbound:= net-libs/ldns )" |
440 |
-DEPEND="${COMMON_DEPEND} |
441 |
- virtual/linux-sources |
442 |
- sys-kernel/linux-headers" |
443 |
-RDEPEND="${COMMON_DEPEND} |
444 |
- virtual/logger |
445 |
- sys-apps/iproute2 |
446 |
- !net-vpn/libreswan |
447 |
- selinux? ( sec-policy/selinux-ipsec )" |
448 |
- |
449 |
-PATCHES=("${FILESDIR}"/${P}-gcc-10.patch) |
450 |
- |
451 |
-UGID="ipsec" |
452 |
- |
453 |
-pkg_setup() { |
454 |
- linux-info_pkg_setup |
455 |
- |
456 |
- elog "Linux kernel version: ${KV_FULL}" |
457 |
- |
458 |
- if ! kernel_is -ge 2 6 16; then |
459 |
- eerror |
460 |
- eerror "This ebuild currently only supports ${PN} with the" |
461 |
- eerror "native Linux 2.6 IPsec stack on kernels >= 2.6.16." |
462 |
- eerror |
463 |
- fi |
464 |
- |
465 |
- if kernel_is -lt 2 6 34; then |
466 |
- ewarn |
467 |
- ewarn "IMPORTANT KERNEL NOTES: Please read carefully..." |
468 |
- ewarn |
469 |
- |
470 |
- if kernel_is -lt 2 6 29; then |
471 |
- ewarn "[ < 2.6.29 ] Due to a missing kernel feature, you have to" |
472 |
- ewarn "include all required IPv6 modules even if you just intend" |
473 |
- ewarn "to run on IPv4 only." |
474 |
- ewarn |
475 |
- ewarn "This has been fixed with kernels >= 2.6.29." |
476 |
- ewarn |
477 |
- fi |
478 |
- |
479 |
- if kernel_is -lt 2 6 33; then |
480 |
- ewarn "[ < 2.6.33 ] Kernels prior to 2.6.33 include a non-standards" |
481 |
- ewarn "compliant implementation for SHA-2 HMAC support in ESP and" |
482 |
- ewarn "miss SHA384 and SHA512 HMAC support altogether." |
483 |
- ewarn |
484 |
- ewarn "If you need any of those features, please use kernel >= 2.6.33." |
485 |
- ewarn |
486 |
- fi |
487 |
- |
488 |
- if kernel_is -lt 2 6 34; then |
489 |
- ewarn "[ < 2.6.34 ] Support for the AES-GMAC authentification-only" |
490 |
- ewarn "ESP cipher is only included in kernels >= 2.6.34." |
491 |
- ewarn |
492 |
- ewarn "If you need it, please use kernel >= 2.6.34." |
493 |
- ewarn |
494 |
- fi |
495 |
- fi |
496 |
- |
497 |
- if use non-root; then |
498 |
- enewgroup ${UGID} |
499 |
- enewuser ${UGID} -1 -1 -1 ${UGID} |
500 |
- fi |
501 |
-} |
502 |
- |
503 |
-src_configure() { |
504 |
- local myconf="" |
505 |
- |
506 |
- if use non-root; then |
507 |
- myconf="${myconf} --with-user=${UGID} --with-group=${UGID}" |
508 |
- fi |
509 |
- |
510 |
- # If a user has already enabled db support, those plugins will |
511 |
- # most likely be desired as well. Besides they don't impose new |
512 |
- # dependencies and come at no cost (except for space). |
513 |
- if use mysql || use sqlite; then |
514 |
- myconf="${myconf} --enable-attr-sql --enable-sql" |
515 |
- fi |
516 |
- |
517 |
- # strongSwan builds and installs static libs by default which are |
518 |
- # useless to the user (and to strongSwan for that matter) because no |
519 |
- # header files or alike get installed... so disabling them is safe. |
520 |
- if use pam && use eap; then |
521 |
- myconf="${myconf} --enable-eap-gtc" |
522 |
- else |
523 |
- myconf="${myconf} --disable-eap-gtc" |
524 |
- fi |
525 |
- |
526 |
- for mod in $STRONGSWAN_PLUGINS_STD; do |
527 |
- if use strongswan_plugins_${mod}; then |
528 |
- myconf+=" --enable-${mod}" |
529 |
- fi |
530 |
- done |
531 |
- |
532 |
- for mod in $STRONGSWAN_PLUGINS_OPT; do |
533 |
- if use strongswan_plugins_${mod}; then |
534 |
- myconf+=" --enable-${mod}" |
535 |
- fi |
536 |
- done |
537 |
- |
538 |
- econf \ |
539 |
- --disable-static \ |
540 |
- --enable-ikev1 \ |
541 |
- --enable-ikev2 \ |
542 |
- --enable-swanctl \ |
543 |
- --enable-socket-dynamic \ |
544 |
- $(use_enable curl) \ |
545 |
- $(use_enable constraints) \ |
546 |
- $(use_enable ldap) \ |
547 |
- $(use_enable debug leak-detective) \ |
548 |
- $(use_enable dhcp) \ |
549 |
- $(use_enable eap eap-sim) \ |
550 |
- $(use_enable eap eap-sim-file) \ |
551 |
- $(use_enable eap eap-simaka-sql) \ |
552 |
- $(use_enable eap eap-simaka-pseudonym) \ |
553 |
- $(use_enable eap eap-simaka-reauth) \ |
554 |
- $(use_enable eap eap-identity) \ |
555 |
- $(use_enable eap eap-md5) \ |
556 |
- $(use_enable eap eap-aka) \ |
557 |
- $(use_enable eap eap-aka-3gpp2) \ |
558 |
- $(use_enable eap md4) \ |
559 |
- $(use_enable eap eap-mschapv2) \ |
560 |
- $(use_enable eap eap-radius) \ |
561 |
- $(use_enable eap eap-tls) \ |
562 |
- $(use_enable eap eap-ttls) \ |
563 |
- $(use_enable eap xauth-eap) \ |
564 |
- $(use_enable eap eap-dynamic) \ |
565 |
- $(use_enable farp) \ |
566 |
- $(use_enable gmp) \ |
567 |
- $(use_enable gcrypt) \ |
568 |
- $(use_enable mysql) \ |
569 |
- $(use_enable networkmanager nm) \ |
570 |
- $(use_enable openssl) \ |
571 |
- $(use_enable pam xauth-pam) \ |
572 |
- $(use_enable pkcs11) \ |
573 |
- $(use_enable sqlite) \ |
574 |
- $(use_enable systemd) \ |
575 |
- $(use_with caps capabilities libcap) \ |
576 |
- --with-piddir=/run \ |
577 |
- --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \ |
578 |
- ${myconf} |
579 |
-} |
580 |
- |
581 |
-src_install() { |
582 |
- emake DESTDIR="${D}" install |
583 |
- |
584 |
- if ! use systemd; then |
585 |
- rm -rf "${ED}"/lib/systemd || die |
586 |
- fi |
587 |
- |
588 |
- doinitd "${FILESDIR}"/ipsec |
589 |
- |
590 |
- local dir_ugid |
591 |
- if use non-root; then |
592 |
- fowners ${UGID}:${UGID} \ |
593 |
- /etc/ipsec.conf \ |
594 |
- /etc/strongswan.conf |
595 |
- |
596 |
- dir_ugid="${UGID}" |
597 |
- else |
598 |
- dir_ugid="root" |
599 |
- fi |
600 |
- |
601 |
- diropts -m 0750 -o ${dir_ugid} -g ${dir_ugid} |
602 |
- dodir /etc/ipsec.d \ |
603 |
- /etc/ipsec.d/aacerts \ |
604 |
- /etc/ipsec.d/acerts \ |
605 |
- /etc/ipsec.d/cacerts \ |
606 |
- /etc/ipsec.d/certs \ |
607 |
- /etc/ipsec.d/crls \ |
608 |
- /etc/ipsec.d/ocspcerts \ |
609 |
- /etc/ipsec.d/private \ |
610 |
- /etc/ipsec.d/reqs |
611 |
- |
612 |
- dodoc NEWS README TODO |
613 |
- |
614 |
- # shared libs are used only internally and there are no static libs, |
615 |
- # so it's safe to get rid of the .la files |
616 |
- find "${D}" -name '*.la' -delete || die "Failed to remove .la files." |
617 |
-} |
618 |
- |
619 |
-pkg_preinst() { |
620 |
- has_version "<net-vpn/strongswan-4.3.6-r1" |
621 |
- upgrade_from_leq_4_3_6=$(( !$? )) |
622 |
- |
623 |
- has_version "<net-vpn/strongswan-4.3.6-r1[-caps]" |
624 |
- previous_4_3_6_with_caps=$(( !$? )) |
625 |
-} |
626 |
- |
627 |
-pkg_postinst() { |
628 |
- if ! use openssl && ! use gcrypt; then |
629 |
- elog |
630 |
- elog "${PN} has been compiled without both OpenSSL and libgcrypt support." |
631 |
- elog "Please note that this might effect availability and speed of some" |
632 |
- elog "cryptographic features. You are advised to enable the OpenSSL plugin." |
633 |
- elif ! use openssl; then |
634 |
- elog |
635 |
- elog "${PN} has been compiled without the OpenSSL plugin. This might effect" |
636 |
- elog "availability and speed of some cryptographic features. There will be" |
637 |
- elog "no support for Elliptic Curve Cryptography (Diffie-Hellman groups 19-21," |
638 |
- elog "25, 26) and ECDSA." |
639 |
- fi |
640 |
- |
641 |
- if [[ $upgrade_from_leq_4_3_6 == 1 ]]; then |
642 |
- chmod 0750 "${ROOT}"/etc/ipsec.d \ |
643 |
- "${ROOT}"/etc/ipsec.d/aacerts \ |
644 |
- "${ROOT}"/etc/ipsec.d/acerts \ |
645 |
- "${ROOT}"/etc/ipsec.d/cacerts \ |
646 |
- "${ROOT}"/etc/ipsec.d/certs \ |
647 |
- "${ROOT}"/etc/ipsec.d/crls \ |
648 |
- "${ROOT}"/etc/ipsec.d/ocspcerts \ |
649 |
- "${ROOT}"/etc/ipsec.d/private \ |
650 |
- "${ROOT}"/etc/ipsec.d/reqs |
651 |
- |
652 |
- ewarn |
653 |
- ewarn "The default permissions for /etc/ipsec.d/* have been tightened for" |
654 |
- ewarn "security reasons. Your system installed directories have been" |
655 |
- ewarn "updated accordingly. Please check if necessary." |
656 |
- ewarn |
657 |
- |
658 |
- if [[ $previous_4_3_6_with_caps == 1 ]]; then |
659 |
- if ! use non-root; then |
660 |
- ewarn |
661 |
- ewarn "IMPORTANT: You previously had ${PN} installed without root" |
662 |
- ewarn "privileges because it was implied by the 'caps' USE flag." |
663 |
- ewarn "This has been changed. If you want ${PN} with user privileges," |
664 |
- ewarn "you have to re-emerge it with the 'non-root' USE flag enabled." |
665 |
- ewarn |
666 |
- fi |
667 |
- fi |
668 |
- fi |
669 |
- if ! use caps && ! use non-root; then |
670 |
- ewarn |
671 |
- ewarn "You have decided to run ${PN} with root privileges and built it" |
672 |
- ewarn "without support for POSIX capability dropping. It is generally" |
673 |
- ewarn "strongly suggested that you reconsider- especially if you intend" |
674 |
- ewarn "to run ${PN} as server with a public ip address." |
675 |
- ewarn |
676 |
- ewarn "You should re-emerge ${PN} with at least the 'caps' USE flag enabled." |
677 |
- ewarn |
678 |
- fi |
679 |
- if use non-root; then |
680 |
- elog |
681 |
- elog "${PN} has been installed without superuser privileges (USE=non-root)." |
682 |
- elog "This imposes several limitations mainly to the IKEv1 daemon 'pluto'" |
683 |
- elog "but also a few to the IKEv2 daemon 'charon'." |
684 |
- elog |
685 |
- elog "Please carefully read: http://wiki.strongswan.org/wiki/nonRoot" |
686 |
- elog |
687 |
- elog "pluto uses a helper script by default to insert/remove routing and" |
688 |
- elog "policy rules upon connection start/stop which requires superuser" |
689 |
- elog "privileges. charon in contrast does this internally and can do so" |
690 |
- elog "even with reduced (user) privileges." |
691 |
- elog |
692 |
- elog "Thus if you require IKEv1 (pluto) or need to specify a custom updown" |
693 |
- elog "script to pluto or charon which requires superuser privileges, you" |
694 |
- elog "can work around this limitation by using sudo to grant the" |
695 |
- elog "user \"ipsec\" the appropriate rights." |
696 |
- elog "For example (the default case):" |
697 |
- elog "/etc/sudoers:" |
698 |
- elog " ipsec ALL=(ALL) NOPASSWD: SETENV: /usr/sbin/ipsec" |
699 |
- elog "Under the specific connection block in /etc/ipsec.conf:" |
700 |
- elog " leftupdown=\"sudo -E ipsec _updown iptables\"" |
701 |
- elog |
702 |
- fi |
703 |
- elog |
704 |
- elog "Make sure you have _all_ required kernel modules available including" |
705 |
- elog "the appropriate cryptographic algorithms. A list is available at:" |
706 |
- elog " http://wiki.strongswan.org/projects/strongswan/wiki/KernelModules" |
707 |
- elog |
708 |
- elog "The up-to-date manual is available online at:" |
709 |
- elog " http://wiki.strongswan.org/" |
710 |
- elog |
711 |
-} |