Gentoo Archives: gentoo-commits

From: Patrick Lauer <patrick@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-vpn/strongswan/
Date: Sun, 24 Sep 2017 17:31:25
Message-Id: 1506274278.4a46b9ce178543306ede835036cf6116e4b70fc5.patrick@gentoo
1 commit: 4a46b9ce178543306ede835036cf6116e4b70fc5
2 Author: Patrick Lauer <patrick <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 24 17:30:10 2017 +0000
4 Commit: Patrick Lauer <patrick <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 24 17:31:18 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4a46b9ce
7
8 net-vpn/strongswan: Bump
9
10 Package-Manager: Portage-2.3.10, Repoman-2.3.3
11
12 net-vpn/strongswan/Manifest | 1 +
13 net-vpn/strongswan/strongswan-5.6.0.ebuild | 302 +++++++++++++++++++++++++++++
14 2 files changed, 303 insertions(+)
15
16 diff --git a/net-vpn/strongswan/Manifest b/net-vpn/strongswan/Manifest
17 index b3e0c053c88..a413933a7cd 100644
18 --- a/net-vpn/strongswan/Manifest
19 +++ b/net-vpn/strongswan/Manifest
20 @@ -1 +1,2 @@
21 DIST strongswan-5.5.3.tar.bz2 4768820 SHA256 c5ea54b199174708de11af9b8f4ecf28b5b0743d4bc0e380e741f25b28c0f8d4 SHA512 0b0b25d2102c98cda54300dc8c3c3a49a55e64f7c695dda65a24f2194f19bce0b7aab9e4f7486c243b552f9d1a94867d6a8782ee504aad1c9973809706d599ac WHIRLPOOL 80bc68ed5afc46fa7585c806cc52713d47495664ea0c37746198918bad9814d14d261be921158b6c7a9cd5e8c84733b0b23b80b7c6338005adca38974241d7f1
22 +DIST strongswan-5.6.0.tar.bz2 4850722 SHA256 a14dc0d92634ed52730bfc76a76db30943a28ed3c65a560066e1e9f785827b13 SHA512 9362069a01c3642e62864d88fdb409a3c7514bf7c92cbe36e552c6a80915119cf5bb91c39592aab2d15b562684a0628a764e4fa7636d3b5fd2ebaf165c0ce649 WHIRLPOOL 5aeb256c254aae7d5923984355bcdb106d8cae6e7780df2c7849aa1fd8d5a27d6ad9a47c6d926c7dee2dff605f56bd2697034d4055dacdde1aea57168d8672af
23
24 diff --git a/net-vpn/strongswan/strongswan-5.6.0.ebuild b/net-vpn/strongswan/strongswan-5.6.0.ebuild
25 new file mode 100644
26 index 00000000000..d7477edc168
27 --- /dev/null
28 +++ b/net-vpn/strongswan/strongswan-5.6.0.ebuild
29 @@ -0,0 +1,302 @@
30 +# Copyright 1999-2017 Gentoo Foundation
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=5
34 +inherit eutils linux-info systemd user
35 +
36 +DESCRIPTION="IPsec-based VPN solution focused on security and ease of use, supporting IKEv1/IKEv2 and MOBIKE"
37 +HOMEPAGE="http://www.strongswan.org/"
38 +SRC_URI="http://download.strongswan.org/${P}.tar.bz2"
39 +
40 +LICENSE="GPL-2 RSA DES"
41 +SLOT="0"
42 +KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
43 +IUSE="+caps curl +constraints debug dhcp eap farp gcrypt +gmp ldap mysql networkmanager +non-root +openssl selinux sqlite pam pkcs11"
44 +
45 +STRONGSWAN_PLUGINS_STD="led lookip systime-fix unity vici"
46 +STRONGSWAN_PLUGINS_OPT="blowfish ccm ctr gcm ha ipseckey ntru padlock rdrand unbound whitelist"
47 +for mod in $STRONGSWAN_PLUGINS_STD; do
48 + IUSE="${IUSE} +strongswan_plugins_${mod}"
49 +done
50 +
51 +for mod in $STRONGSWAN_PLUGINS_OPT; do
52 + IUSE="${IUSE} strongswan_plugins_${mod}"
53 +done
54 +
55 +COMMON_DEPEND="!net-misc/openswan
56 + gmp? ( >=dev-libs/gmp-4.1.5:= )
57 + gcrypt? ( dev-libs/libgcrypt:0 )
58 + caps? ( sys-libs/libcap )
59 + curl? ( net-misc/curl )
60 + ldap? ( net-nds/openldap )
61 + openssl? ( >=dev-libs/openssl-0.9.8:=[-bindist] )
62 + mysql? ( virtual/mysql )
63 + sqlite? ( >=dev-db/sqlite-3.3.1 )
64 + networkmanager? ( net-misc/networkmanager )
65 + pam? ( sys-libs/pam )
66 + strongswan_plugins_unbound? ( net-dns/unbound net-libs/ldns )"
67 +DEPEND="${COMMON_DEPEND}
68 + virtual/linux-sources
69 + sys-kernel/linux-headers"
70 +RDEPEND="${COMMON_DEPEND}
71 + virtual/logger
72 + sys-apps/iproute2
73 + !net-vpn/libreswan
74 + selinux? ( sec-policy/selinux-ipsec )"
75 +
76 +UGID="ipsec"
77 +
78 +pkg_setup() {
79 + linux-info_pkg_setup
80 + elog "Linux kernel version: ${KV_FULL}"
81 +
82 + if ! kernel_is -ge 2 6 16; then
83 + eerror
84 + eerror "This ebuild currently only supports ${PN} with the"
85 + eerror "native Linux 2.6 IPsec stack on kernels >= 2.6.16."
86 + eerror
87 + fi
88 +
89 + if kernel_is -lt 2 6 34; then
90 + ewarn
91 + ewarn "IMPORTANT KERNEL NOTES: Please read carefully..."
92 + ewarn
93 +
94 + if kernel_is -lt 2 6 29; then
95 + ewarn "[ < 2.6.29 ] Due to a missing kernel feature, you have to"
96 + ewarn "include all required IPv6 modules even if you just intend"
97 + ewarn "to run on IPv4 only."
98 + ewarn
99 + ewarn "This has been fixed with kernels >= 2.6.29."
100 + ewarn
101 + fi
102 +
103 + if kernel_is -lt 2 6 33; then
104 + ewarn "[ < 2.6.33 ] Kernels prior to 2.6.33 include a non-standards"
105 + ewarn "compliant implementation for SHA-2 HMAC support in ESP and"
106 + ewarn "miss SHA384 and SHA512 HMAC support altogether."
107 + ewarn
108 + ewarn "If you need any of those features, please use kernel >= 2.6.33."
109 + ewarn
110 + fi
111 +
112 + if kernel_is -lt 2 6 34; then
113 + ewarn "[ < 2.6.34 ] Support for the AES-GMAC authentification-only"
114 + ewarn "ESP cipher is only included in kernels >= 2.6.34."
115 + ewarn
116 + ewarn "If you need it, please use kernel >= 2.6.34."
117 + ewarn
118 + fi
119 + fi
120 +
121 + if use non-root; then
122 + enewgroup ${UGID}
123 + enewuser ${UGID} -1 -1 -1 ${UGID}
124 + fi
125 +}
126 +
127 +src_prepare() {
128 + epatch_user
129 +}
130 +
131 +src_configure() {
132 + local myconf=""
133 +
134 + if use non-root; then
135 + myconf="${myconf} --with-user=${UGID} --with-group=${UGID}"
136 + fi
137 +
138 + # If a user has already enabled db support, those plugins will
139 + # most likely be desired as well. Besides they don't impose new
140 + # dependencies and come at no cost (except for space).
141 + if use mysql || use sqlite; then
142 + myconf="${myconf} --enable-attr-sql --enable-sql"
143 + fi
144 +
145 + # strongSwan builds and installs static libs by default which are
146 + # useless to the user (and to strongSwan for that matter) because no
147 + # header files or alike get installed... so disabling them is safe.
148 + if use pam && use eap; then
149 + myconf="${myconf} --enable-eap-gtc"
150 + else
151 + myconf="${myconf} --disable-eap-gtc"
152 + fi
153 +
154 + for mod in $STRONGSWAN_PLUGINS_STD; do
155 + if use strongswan_plugins_${mod}; then
156 + myconf+=" --enable-${mod}"
157 + fi
158 + done
159 +
160 + for mod in $STRONGSWAN_PLUGINS_OPT; do
161 + if use strongswan_plugins_${mod}; then
162 + myconf+=" --enable-${mod}"
163 + fi
164 + done
165 +
166 + econf \
167 + --disable-static \
168 + --enable-ikev1 \
169 + --enable-ikev2 \
170 + --enable-swanctl \
171 + --enable-socket-dynamic \
172 + $(use_with caps capabilities libcap) \
173 + $(use_enable curl) \
174 + $(use_enable constraints) \
175 + $(use_enable ldap) \
176 + $(use_enable debug leak-detective) \
177 + $(use_enable dhcp) \
178 + $(use_enable eap eap-sim) \
179 + $(use_enable eap eap-sim-file) \
180 + $(use_enable eap eap-simaka-sql) \
181 + $(use_enable eap eap-simaka-pseudonym) \
182 + $(use_enable eap eap-simaka-reauth) \
183 + $(use_enable eap eap-identity) \
184 + $(use_enable eap eap-md5) \
185 + $(use_enable eap eap-aka) \
186 + $(use_enable eap eap-aka-3gpp2) \
187 + $(use_enable eap md4) \
188 + $(use_enable eap eap-mschapv2) \
189 + $(use_enable eap eap-radius) \
190 + $(use_enable eap eap-tls) \
191 + $(use_enable eap xauth-eap) \
192 + $(use_enable farp) \
193 + $(use_enable gmp) \
194 + $(use_enable gcrypt) \
195 + $(use_enable mysql) \
196 + $(use_enable networkmanager nm) \
197 + $(use_enable openssl) \
198 + $(use_enable pam xauth-pam) \
199 + $(use_enable pkcs11) \
200 + $(use_enable sqlite) \
201 + "$(systemd_with_unitdir)" \
202 + ${myconf}
203 +}
204 +
205 +src_install() {
206 + emake DESTDIR="${D}" install
207 +
208 + doinitd "${FILESDIR}"/ipsec
209 +
210 + local dir_ugid
211 + if use non-root; then
212 + fowners ${UGID}:${UGID} \
213 + /etc/ipsec.conf \
214 + /etc/strongswan.conf
215 +
216 + dir_ugid="${UGID}"
217 + else
218 + dir_ugid="root"
219 + fi
220 +
221 + diropts -m 0750 -o ${dir_ugid} -g ${dir_ugid}
222 + dodir /etc/ipsec.d \
223 + /etc/ipsec.d/aacerts \
224 + /etc/ipsec.d/acerts \
225 + /etc/ipsec.d/cacerts \
226 + /etc/ipsec.d/certs \
227 + /etc/ipsec.d/crls \
228 + /etc/ipsec.d/ocspcerts \
229 + /etc/ipsec.d/private \
230 + /etc/ipsec.d/reqs
231 +
232 + dodoc NEWS README TODO || die
233 +
234 + # shared libs are used only internally and there are no static libs,
235 + # so it's safe to get rid of the .la files
236 + find "${D}" -name '*.la' -delete || die "Failed to remove .la files."
237 +}
238 +
239 +pkg_preinst() {
240 + has_version "<net-vpn/strongswan-4.3.6-r1"
241 + upgrade_from_leq_4_3_6=$(( !$? ))
242 +
243 + has_version "<net-vpn/strongswan-4.3.6-r1[-caps]"
244 + previous_4_3_6_with_caps=$(( !$? ))
245 +}
246 +
247 +pkg_postinst() {
248 + if ! use openssl && ! use gcrypt; then
249 + elog
250 + elog "${PN} has been compiled without both OpenSSL and libgcrypt support."
251 + elog "Please note that this might effect availability and speed of some"
252 + elog "cryptographic features. You are advised to enable the OpenSSL plugin."
253 + elif ! use openssl; then
254 + elog
255 + elog "${PN} has been compiled without the OpenSSL plugin. This might effect"
256 + elog "availability and speed of some cryptographic features. There will be"
257 + elog "no support for Elliptic Curve Cryptography (Diffie-Hellman groups 19-21,"
258 + elog "25, 26) and ECDSA."
259 + fi
260 +
261 + if [[ $upgrade_from_leq_4_3_6 == 1 ]]; then
262 + chmod 0750 "${ROOT}"/etc/ipsec.d \
263 + "${ROOT}"/etc/ipsec.d/aacerts \
264 + "${ROOT}"/etc/ipsec.d/acerts \
265 + "${ROOT}"/etc/ipsec.d/cacerts \
266 + "${ROOT}"/etc/ipsec.d/certs \
267 + "${ROOT}"/etc/ipsec.d/crls \
268 + "${ROOT}"/etc/ipsec.d/ocspcerts \
269 + "${ROOT}"/etc/ipsec.d/private \
270 + "${ROOT}"/etc/ipsec.d/reqs
271 +
272 + ewarn
273 + ewarn "The default permissions for /etc/ipsec.d/* have been tightened for"
274 + ewarn "security reasons. Your system installed directories have been"
275 + ewarn "updated accordingly. Please check if necessary."
276 + ewarn
277 +
278 + if [[ $previous_4_3_6_with_caps == 1 ]]; then
279 + if ! use non-root; then
280 + ewarn
281 + ewarn "IMPORTANT: You previously had ${PN} installed without root"
282 + ewarn "privileges because it was implied by the 'caps' USE flag."
283 + ewarn "This has been changed. If you want ${PN} with user privileges,"
284 + ewarn "you have to re-emerge it with the 'non-root' USE flag enabled."
285 + ewarn
286 + fi
287 + fi
288 + fi
289 + if ! use caps && ! use non-root; then
290 + ewarn
291 + ewarn "You have decided to run ${PN} with root privileges and built it"
292 + ewarn "without support for POSIX capability dropping. It is generally"
293 + ewarn "strongly suggested that you reconsider- especially if you intend"
294 + ewarn "to run ${PN} as server with a public ip address."
295 + ewarn
296 + ewarn "You should re-emerge ${PN} with at least the 'caps' USE flag enabled."
297 + ewarn
298 + fi
299 + if use non-root; then
300 + elog
301 + elog "${PN} has been installed without superuser privileges (USE=non-root)."
302 + elog "This imposes several limitations mainly to the IKEv1 daemon 'pluto'"
303 + elog "but also a few to the IKEv2 daemon 'charon'."
304 + elog
305 + elog "Please carefully read: http://wiki.strongswan.org/wiki/nonRoot"
306 + elog
307 + elog "pluto uses a helper script by default to insert/remove routing and"
308 + elog "policy rules upon connection start/stop which requires superuser"
309 + elog "privileges. charon in contrast does this internally and can do so"
310 + elog "even with reduced (user) privileges."
311 + elog
312 + elog "Thus if you require IKEv1 (pluto) or need to specify a custom updown"
313 + elog "script to pluto or charon which requires superuser privileges, you"
314 + elog "can work around this limitation by using sudo to grant the"
315 + elog "user \"ipsec\" the appropriate rights."
316 + elog "For example (the default case):"
317 + elog "/etc/sudoers:"
318 + elog " ipsec ALL=(ALL) NOPASSWD: SETENV: /usr/sbin/ipsec"
319 + elog "Under the specific connection block in /etc/ipsec.conf:"
320 + elog " leftupdown=\"sudo -E ipsec _updown iptables\""
321 + elog
322 + fi
323 + elog
324 + elog "Make sure you have _all_ required kernel modules available including"
325 + elog "the appropriate cryptographic algorithms. A list is available at:"
326 + elog " http://wiki.strongswan.org/projects/strongswan/wiki/KernelModules"
327 + elog
328 + elog "The up-to-date manual is available online at:"
329 + elog " http://wiki.strongswan.org/"
330 + elog
331 +}