Merge branch 'master' into staging
[jackhill/guix/guix.git] / gnu / packages / vpn.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013, 2016, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
5 ;;; Copyright © 2015 Jeff Mickey <j@codemac.net>
6 ;;; Copyright © 2016, 2017, 2019 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
9 ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
10 ;;; Copyright © 2018 Meiyo Peng <meiyo.peng@gmail.com>
11 ;;; Copyright © 2019, 2020 Leo Famulari <leo@famulari.name>
12 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
13 ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
14 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
15 ;;; Copyright © 2020 Ryan Prior <rprior@protonmail.com>
16 ;;;
17 ;;; This file is part of GNU Guix.
18 ;;;
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
23 ;;;
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
28 ;;;
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31
32 (define-module (gnu packages vpn)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix packages)
35 #:use-module (guix download)
36 #:use-module (guix git-download)
37 #:use-module (guix build-system cmake)
38 #:use-module (guix build-system gnu)
39 #:use-module (guix build-system linux-module)
40 #:use-module (guix build-system python)
41 #:use-module (gnu packages)
42 #:use-module (gnu packages admin)
43 #:use-module (gnu packages base)
44 #:use-module (gnu packages bash)
45 #:use-module (gnu packages check)
46 #:use-module (gnu packages dns)
47 #:use-module (gnu packages autotools)
48 #:use-module (gnu packages compression)
49 #:use-module (gnu packages gettext)
50 #:use-module (gnu packages gnupg)
51 #:use-module (gnu packages guile)
52 #:use-module (gnu packages libevent)
53 #:use-module (gnu packages linux)
54 #:use-module (gnu packages nss)
55 #:use-module (gnu packages perl)
56 #:use-module (gnu packages pkg-config)
57 #:use-module (gnu packages python)
58 #:use-module (gnu packages python-xyz)
59 #:use-module (gnu packages python-web)
60 #:use-module (gnu packages tls)
61 #:use-module (gnu packages xml))
62
63 (define-public gvpe
64 (package
65 (name "gvpe")
66 (version "3.1")
67 (source (origin
68 (method url-fetch)
69 (uri (string-append "mirror://gnu/gvpe/gvpe-"
70 version ".tar.gz"))
71 (sha256
72 (base32
73 "1cz8n75ksl0l908zc5l3rnfm1hv7130s2w8710799fr5sxrdbszi"))))
74 (build-system gnu-build-system)
75 (home-page "http://software.schmorp.de/pkg/gvpe.html")
76 (native-inputs `(("pkg-config" ,pkg-config)))
77 (inputs `(("openssl" ,openssl)
78 ("zlib" ,zlib)))
79 (synopsis "Secure VPN among multiple nodes over an untrusted network")
80 (description
81 "The GNU Virtual Private Ethernet creates a virtual network
82 with multiple nodes using a variety of transport protocols. It works
83 by creating encrypted host-to-host tunnels between multiple
84 endpoints.")
85 (license license:gpl3+)))
86
87 (define-public vpnc
88 (package
89 (name "vpnc")
90 (version "0.5.3")
91 (source (origin
92 (method url-fetch)
93 (uri (string-append "https://www.unix-ag.uni-kl.de/~massar/vpnc/vpnc-"
94 version ".tar.gz"))
95 (sha256 (base32
96 "1128860lis89g1s21hqxvap2nq426c9j4bvgghncc1zj0ays7kj6"))))
97 (build-system gnu-build-system)
98 (inputs `(("libgcrypt" ,libgcrypt)
99 ("perl" ,perl)
100 ("vpnc-scripts" ,vpnc-scripts)))
101 (arguments
102 `(#:tests? #f ; there is no check target
103 #:phases
104 (modify-phases %standard-phases
105 (add-after 'unpack 'use-store-paths
106 (lambda* (#:key inputs outputs #:allow-other-keys)
107 (let ((out (assoc-ref outputs "out"))
108 (vpnc-scripts (assoc-ref inputs "vpnc-scripts")))
109 (substitute* "config.c"
110 (("/etc/vpnc/vpnc-script")
111 (string-append vpnc-scripts "/etc/vpnc/vpnc-script")))
112 (substitute* "Makefile"
113 (("ETCDIR=.*")
114 (string-append "ETCDIR=" out "/etc/vpnc\n"))
115 (("PREFIX=.*")
116 (string-append "PREFIX=" out "\n")))
117 #t)))
118 (delete 'configure)))) ; no configure script
119 (synopsis "Client for Cisco VPN concentrators")
120 (description
121 "vpnc is a VPN client compatible with Cisco's EasyVPN equipment.
122 It supports IPSec (ESP) with Mode Configuration and Xauth. It supports only
123 shared-secret IPSec authentication with Xauth, AES (256, 192, 128), 3DES,
124 1DES, MD5, SHA1, DH1/2/5 and IP tunneling. It runs entirely in userspace.
125 Only \"Universal TUN/TAP device driver support\" is needed in the kernel.")
126 (license license:gpl2+) ; some file are bsd-2, see COPYING
127 (home-page "https://www.unix-ag.uni-kl.de/~massar/vpnc/")))
128
129 (define-public vpnc-scripts
130 (let ((commit "1000e0f6dd7d6bff163169a46359211c1fc3a6d2"))
131 (package
132 (name "vpnc-scripts")
133 (version (string-append "20190116." (string-take commit 7)))
134 (source (origin
135 (method git-fetch)
136 (uri
137 (git-reference
138 (url "git://git.infradead.org/users/dwmw2/vpnc-scripts.git")
139 (commit commit)))
140 (file-name (git-file-name name version))
141 (sha256
142 (base32
143 "1g41yarz2bl0f73kbjqnywr485ghanbp7nmspklfb0n07yp0z6ak"))))
144 (build-system gnu-build-system)
145 (inputs `(("guile" ,guile-3.0) ; for the wrapper scripts
146 ("coreutils" ,coreutils)
147 ("grep" ,grep)
148 ("iproute2" ,iproute) ; for ‘ip’
149 ("net-tools" ,net-tools) ; for ‘ifconfig’, ‘route’
150 ("sed" ,sed)
151 ("which" ,which)))
152 (arguments
153 `(#:phases
154 (modify-phases %standard-phases
155 (add-after 'unpack 'use-relative-paths
156 ;; Patch the scripts to work with and use relative paths.
157 (lambda* _
158 (for-each (lambda (script)
159 (substitute* script
160 (("^PATH=.*") "")
161 (("/usr/s?bin/") "")
162 (("\\[ +-x +([^]]+) +\\]" _ command)
163 (string-append "command -v >/dev/null 2>&1 "
164 command))))
165 (find-files "." "^vpnc-script"))
166 #t))
167 (delete 'configure) ; no configure script
168 (replace 'build
169 (lambda _
170 (invoke "gcc" "-o" "netunshare" "netunshare.c")))
171 (replace 'install
172 ;; There is no Makefile; manually install the relevant files.
173 (lambda* (#:key outputs #:allow-other-keys)
174 (let* ((out (assoc-ref outputs "out"))
175 (etc (string-append out "/etc/vpnc")))
176 (for-each (lambda (file)
177 (install-file file etc))
178 (append (find-files "." "^vpnc-script")
179 (list "netunshare"
180 "xinetd.netns.conf")))
181 #t)))
182 (add-after 'install 'wrap-scripts
183 ;; Wrap scripts with paths to their common hard dependencies.
184 ;; Optional dependencies will need to be installed by the user.
185 (lambda* (#:key inputs outputs #:allow-other-keys)
186 (let ((out (assoc-ref outputs "out")))
187 (for-each
188 (lambda (script)
189 (wrap-script (string-append out "/etc/vpnc/" script)
190 `("PATH" ":" prefix
191 ,(map (lambda (name)
192 (let ((input (assoc-ref inputs name)))
193 (string-append input "/bin:"
194 input "/sbin")))
195 (list "coreutils"
196 "grep"
197 "iproute2"
198 "net-tools"
199 "sed"
200 "which")))))
201 (list "vpnc-script-ptrtd"
202 "vpnc-script-sshd"
203 "vpnc-script"))
204 #t))))
205 #:tests? #f)) ; no tests
206 (home-page "http://git.infradead.org/users/dwmw2/vpnc-scripts.git")
207 (synopsis "Network configuration scripts for Cisco VPN clients")
208 (description
209 "This set of scripts configures routing and name services when invoked
210 by the VPNC or OpenConnect Cisco @dfn{Virtual Private Network} (VPN) clients.
211
212 The default @command{vpnc-script} automatically configures most common
213 connections, and provides hooks for performing custom actions at various stages
214 of the connection or disconnection process.
215
216 Alternative scripts are provided for more complicated set-ups, or to serve as an
217 example for writing your own. For example, @command{vpnc-script-sshd} contains
218 the entire VPN in a network namespace accessible only through SSH.")
219 (license license:gpl2+))))
220
221 (define-public ocproxy
222 (package
223 (name "ocproxy")
224 (version "1.60")
225 (source (origin
226 (method git-fetch)
227 (uri (git-reference
228 (url "https://github.com/cernekee/ocproxy.git")
229 (commit (string-append "v" version))))
230 (file-name (git-file-name name version))
231 (sha256
232 (base32
233 "03323nnhb4y9nzwva04mq7xg03dvdrgp689g89f69jqc261skcqx"))))
234 (build-system gnu-build-system)
235 (native-inputs
236 `(("autoconf" ,autoconf)
237 ("automake" ,automake)))
238 (inputs
239 `(("libevent" ,libevent)))
240 (home-page "https://github.com/cernekee/ocproxy")
241 (synopsis "OpenConnect proxy")
242 (description
243 "User-level @dfn{SOCKS} and port forwarding proxy for OpenConnect based
244 on LwIP. When using ocproxy, OpenConnect only handles network activity that
245 the user specifically asks to proxy, so the @dfn{VPN} interface no longer
246 \"hijacks\" all network traffic on the host.")
247 (license license:bsd-3)))
248
249 (define-public openconnect
250 (package
251 (name "openconnect")
252 (version "8.10")
253 (source (origin
254 (method url-fetch)
255 (uri (string-append "ftp://ftp.infradead.org/pub/openconnect/"
256 "openconnect-" version ".tar.gz"))
257 (sha256
258 (base32 "1cdsx4nsrwawbsisfkldfc9i4qn60g03vxb13nzppr2br9p4rrih"))))
259 (build-system gnu-build-system)
260 (propagated-inputs
261 `(("libxml2" ,libxml2)
262 ("gnutls" ,gnutls-3.6.13)
263 ("zlib" ,zlib)))
264 (inputs
265 `(("lz4" ,lz4)
266 ("vpnc-scripts" ,vpnc-scripts)))
267 (native-inputs
268 `(("gettext" ,gettext-minimal)
269 ("pkg-config" ,pkg-config)))
270 (arguments
271 `(#:configure-flags
272 `(,(string-append "--with-vpnc-script="
273 (assoc-ref %build-inputs "vpnc-scripts")
274 "/etc/vpnc/vpnc-script"))))
275 (synopsis "Client for Cisco VPN")
276 (description
277 "OpenConnect is a client for Cisco's AnyConnect SSL VPN, which is
278 supported by the ASA5500 Series, by IOS 12.4(9)T or later on Cisco SR500,
279 870, 880, 1800, 2800, 3800, 7200 Series and Cisco 7301 Routers,
280 and probably others.")
281 (license license:lgpl2.1)
282 (home-page "https://www.infradead.org/openconnect/")))
283
284 (define-public openvpn
285 (package
286 (name "openvpn")
287 (version "2.4.9")
288 (source (origin
289 (method url-fetch)
290 (uri (string-append
291 "https://swupdate.openvpn.org/community/releases/openvpn-"
292 version ".tar.xz"))
293 (sha256
294 (base32
295 "1qpbllwlha7cffsd5dlddb8rl22g9rar5zflkz1wrcllhvfkl7v4"))))
296 (build-system gnu-build-system)
297 (arguments
298 '(#:configure-flags '("--enable-iproute2=yes")))
299 (native-inputs
300 `(("iproute2" ,iproute)))
301 (inputs
302 `(("lz4" ,lz4)
303 ("lzo" ,lzo)
304 ("openssl" ,openssl)
305 ("linux-pam" ,linux-pam)))
306 (home-page "https://openvpn.net/")
307 (synopsis "Virtual private network daemon")
308 (description
309 "OpenVPN implements virtual private network (@dfn{VPN}) techniques
310 for creating secure point-to-point or site-to-site connections in routed or
311 bridged configurations and remote access facilities. It uses a custom
312 security protocol that utilizes SSL/TLS for key exchange. It is capable of
313 traversing network address translators (@dfn{NAT}s) and firewalls.")
314 (license license:gpl2)))
315
316 (define-public protonvpn-cli
317 (package
318 (name "protonvpn-cli")
319 (version "2.2.2")
320 (source
321 (origin
322 ;; PyPI has a ".whl" file but not a proper source release.
323 ;; Thus, fetch code from Git.
324 (method git-fetch)
325 (uri (git-reference
326 (url "https://github.com/ProtonVPN/linux-cli.git")
327 (commit (string-append "v" version))))
328 (file-name (git-file-name name version))
329 (sha256
330 (base32
331 "0ixjb02kj4z79whm1izd8mrn2h0rp9cmw4im1qvp93rahqxdd4n8"))))
332 (build-system python-build-system)
333 (arguments '(#:tests? #f)) ; no tests in repo
334 (native-inputs
335 `(("docopt" ,python-docopt)))
336 (inputs
337 `(("pythondialog" ,python-pythondialog)
338 ("requests" ,python-requests)))
339 (propagated-inputs
340 `(("openvpn" ,openvpn)))
341 (synopsis "Command-line client for ProtonVPN")
342 (description
343 "This is the official command-line interface for ProtonVPN, a secure
344 point-to-point virtual private networking (VPN) service with a gratis tier.
345 It can automatically find and connect to the fastest servers or use Tor over
346 VPN. The gratis tier offers unlimited bandwidth for up to 10 devices.")
347 (home-page "https://github.com/ProtonVPN/linux-cli")
348 (license license:gpl3+)))
349
350 (define-public tinc
351 (package
352 (name "tinc")
353 (version "1.0.36")
354 (source (origin
355 (method url-fetch)
356 (uri (string-append "https://tinc-vpn.org/packages/"
357 "tinc-" version ".tar.gz"))
358 (sha256
359 (base32
360 "021i2sl2mjscbm8g59d7vs74iw3gf0m48wg7w3zhwj6czarkpxs0"))))
361 (build-system gnu-build-system)
362 (arguments
363 '(#:configure-flags
364 '("--sysconfdir=/etc"
365 "--localstatedir=/var")))
366 (inputs `(("zlib" ,zlib)
367 ("lzo" ,lzo)
368 ("openssl" ,openssl)))
369 (home-page "https://tinc-vpn.org")
370 (synopsis "Virtual Private Network (VPN) daemon")
371 (description
372 "Tinc is a VPN that uses tunnelling and encryption to create a secure
373 private network between hosts on the internet.")
374 (license license:gpl2+)))
375
376 (define-public sshuttle
377 (package
378 (name "sshuttle")
379 (version "0.78.5")
380 (source
381 (origin
382 (method url-fetch)
383 (uri (pypi-uri name version))
384 (sha256
385 (base32
386 "0vp13xwrhx4m6zgsyzvai84lkq9mzkaw47j58dk0ll95kaymk2x8"))))
387 (build-system python-build-system)
388 (arguments
389 `(#:phases
390 (modify-phases %standard-phases
391 (add-after 'unpack 'patch-FHS-file-names
392 (lambda _
393 (substitute* "sshuttle/client.py"
394 (("/usr/bin/env") (which "env")))
395 (substitute* "sshuttle/ssh.py"
396 (("/bin/sh") "sh"))
397 #t)))))
398 (native-inputs
399 `(("python-setuptools-scm" ,python-setuptools-scm)
400 ;; For tests only.
401 ("python-flake8", python-flake8)
402 ("python-mock" ,python-mock)
403 ("python-pytest-cov" ,python-pytest-cov)
404 ("python-pytest-runner" ,python-pytest-runner)))
405 (home-page "https://github.com/sshuttle/sshuttle")
406 (synopsis "VPN that transparently forwards connections over SSH")
407 (description "sshuttle creates an encrypted virtual private network (VPN)
408 connection to any remote server to which you have secure shell (SSH) access.
409 The only requirement is a suitable version of Python on the server;
410 administrative privileges are required only on the client. Unlike most VPNs,
411 sshuttle forwards entire sessions, not packets, using kernel transparent
412 proxying. This makes it faster and more reliable than SSH's own tunneling and
413 port forwarding features. It can forward both TCP and UDP traffic, including
414 DNS domain name queries.")
415 (license license:lgpl2.0))) ; incorrectly identified as GPL in ‘setup.py’
416
417 (define-public sshoot
418 (package
419 (name "sshoot")
420 (version "1.2.6")
421 (source
422 (origin
423 (method url-fetch)
424 (uri (pypi-uri name version))
425 (sha256
426 (base32
427 "1ccgh0hjyxrwkgy3hnxz3hgbjbs0lmfs25d5l5jam0xbpcpj63h0"))))
428 (build-system python-build-system)
429 (arguments
430 '(#:phases
431 (modify-phases %standard-phases
432 (add-after 'unpack 'patch-paths
433 (lambda _
434 (substitute* "sshoot/tests/test_manager.py"
435 (("/bin/sh") (which "sh")))
436 #t)))))
437 (inputs
438 `(("python-argcomplete" ,python-argcomplete)
439 ("python-prettytable" ,python-prettytable)
440 ("python-pyyaml" ,python-pyyaml)))
441 ;; For tests only.
442 (native-inputs
443 `(("python-fixtures" ,python-fixtures)
444 ("python-pbr" ,python-pbr)
445 ("python-testtools" ,python-testtools)))
446 (home-page "https://github.com/albertodonato/sshoot")
447 (synopsis "sshuttle VPN session manager")
448 (description "sshoot provides a command-line interface to manage multiple
449 @command{sshuttle} virtual private networks. It supports flexible profiles
450 with configuration options for most of @command{sshuttle}’s features.")
451 (license license:gpl3+)))
452
453 (define-public badvpn
454 (package
455 (name "badvpn")
456 (version "1.999.130")
457 (source
458 (origin
459 (method git-fetch)
460 (uri (git-reference
461 (url "https://github.com/ambrop72/badvpn.git")
462 (commit version)))
463 (file-name (git-file-name name version))
464 (sha256
465 (base32 "0rm67xhi7bh3yph1vh07imv5y1pwyldvw3wa5bz471g8mnkc7d3c"))))
466 (build-system cmake-build-system)
467 (arguments
468 '(#:tests? #f)) ; no tests
469 (inputs
470 `(("nspr" ,nspr)
471 ("nss" ,nss)
472 ("openssl" ,openssl)))
473 (native-inputs
474 `(("pkg-config" ,pkg-config)))
475 (home-page "https://github.com/ambrop72/badvpn")
476 (synopsis "Peer-to-peer virtual private network (VPN)")
477 (description "@code{BadVPN} is a collection of virtual private
478 network (VPN) tools. It includes:
479
480 @enumerate
481 @item NCD programming language.\n
482 NCD (Network Configuration Daemon) is a daemon and programming/scripting
483 language for configuration of network interfaces and other aspects of the
484 operating system.
485 @item Tun2socks network-layer proxifier.\n
486 The tun2socks program socksifes TCP connections at the network layer. It
487 implements a TUN device which accepts all incoming TCP connections (regardless
488 of destination IP), and forwards the connections through a SOCKS server.
489 @item Peer-to-peer VPN.\n
490 The peer-to-peer VPN implements a Layer 2 (Ethernet) network between the peers
491 (VPN nodes).
492 @end enumerate")
493 ;; This project contains a bundled lwIP. lwIP is also released under the
494 ;; 3-clause BSD license.
495 (license license:bsd-3)))
496
497 (define-public wireguard-linux-compat
498 (package
499 (name "wireguard-linux-compat")
500 (version "1.0.20200401")
501 (source (origin
502 (method url-fetch)
503 (uri (string-append "https://git.zx2c4.com/wireguard-linux-compat/"
504 "snapshot/wireguard-linux-compat-" version
505 ".tar.xz"))
506 (sha256
507 (base32
508 "0ymprz3h4b92wlcqm5k5vmcgap8pjv202bgkdx0axmp12n1lmyvx"))))
509 (build-system linux-module-build-system)
510 (outputs '("out"
511 "kernel-patch"))
512 (arguments
513 `(#:tests? #f ; No test suite
514 #:modules ((guix build linux-module-build-system)
515 (guix build utils)
516 (ice-9 popen)
517 (ice-9 textual-ports))
518 #:phases
519 (modify-phases %standard-phases
520 (add-before 'build 'change-directory
521 (lambda _
522 (chdir "./src")
523 #t))
524 (add-after 'build 'build-patch
525 (lambda* (#:key outputs #:allow-other-keys)
526 (let* ((patch-builder "../kernel-tree-scripts/create-patch.sh")
527 (port (open-input-pipe patch-builder))
528 (str (get-string-all port)))
529 (close-pipe port)
530 (call-with-output-file "wireguard.patch"
531 (lambda (port)
532 (format port "~a" str))))
533 #t))
534 (add-after 'install 'install-patch
535 (lambda* (#:key outputs #:allow-other-keys)
536 (install-file "wireguard.patch"
537 (assoc-ref %outputs "kernel-patch"))
538 #t))
539 ;; So that 'install-license-files' works...
540 (add-before 'install-license-files 'reset-cwd
541 (lambda _
542 (chdir "..")
543 #t)))))
544 (home-page "https://git.zx2c4.com/wireguard-linux-compat/")
545 (synopsis "WireGuard kernel module for Linux 3.10 through 5.5")
546 (description "This package contains an out-of-tree kernel patch and
547 a loadable module adding WireGuard to Linux kernel versions 3.10 through 5.5.
548 WireGuard was added to Linux 5.6.")
549 (license license:gpl2)))
550
551 (define-public wireguard-tools
552 (package
553 (name "wireguard-tools")
554 (version "1.0.20200206")
555 (source
556 (origin
557 (method git-fetch)
558 (uri (git-reference
559 (url "https://git.zx2c4.com/wireguard-tools.git")
560 (commit (string-append "v" version))))
561 (file-name (git-file-name name version))
562 (sha256
563 (base32 "0ivc08lds5w39a6f2xdfih9wlk5g724hl3kpdvxvh5yff4l84qb7"))))
564 (build-system gnu-build-system)
565 (arguments
566 `(#:make-flags
567 (list "CC=gcc"
568 "--directory=src"
569 "WITH_BASHCOMPLETION=yes"
570 ;; Install the ‘simple and dirty’ helper script wg-quick(8).
571 "WITH_WGQUICK=yes"
572 (string-append "PREFIX=" (assoc-ref %outputs "out"))
573 ;; Currently used only to create an empty /etc/wireguard directory.
574 (string-append "SYSCONFDIR=no-thanks"))
575 ;; The test suite is meant to be run interactively. It runs Clang's
576 ;; scan-build static analyzer and then starts a web server to display the
577 ;; results.
578 #:tests? #f
579 #:phases
580 (modify-phases %standard-phases
581 ;; No configure script
582 (delete 'configure)
583 (add-after 'install 'install-contrib-docs
584 (lambda* (#:key outputs #:allow-other-keys)
585 (let ((out (assoc-ref outputs "out")))
586 (copy-recursively "contrib/"
587 (string-append out "/share/doc/wireguard-tools"))
588 #t)))
589 (add-after 'install 'wrap-wg-quick
590 (lambda* (#:key inputs outputs #:allow-other-keys)
591 (let* ((out (assoc-ref outputs "out"))
592 (inputs-sbin (map (lambda (input)
593 (string-append (assoc-ref inputs input) "/sbin"))
594 (list "resolvconf" "iproute" "procps"
595 "iptables")))
596 (coreutils (string-append (assoc-ref inputs "coreutils")
597 "/bin")))
598 (wrap-program (string-append out "/bin/wg-quick")
599 `("PATH" ":" prefix ,(append inputs-sbin
600 (list coreutils))))
601 #t))))))
602 (inputs
603 `(("resolvconf" ,openresolv)
604 ("coreutils" ,coreutils)
605 ("bash" ,bash) ; for scripts using /dev/tcp
606 ("procps" ,procps)
607 ("iproute" ,iproute)
608 ("iptables" ,iptables)))
609 (home-page "https://www.wireguard.com/")
610 (synopsis "Tools for configuring WireGuard tunnels")
611 (description
612 "This package provides the user-space command-line tools for using and
613 configuring WireGuard tunnels.
614
615 WireGuard is a simple and fast general-purpose @acronym{VPN, Virtual Private
616 Network} that securely encapsulates IP packets over UDP. It aims to be as easy
617 to configure and deploy as SSH. VPN connections are made simply by exchanging
618 public keys and can roam across IP addresses.")
619 (license
620 (list license:lgpl2.1+ ; src/netlink.h & contrib/embeddable-wg-library
621 license:gpl2)))) ; everything else
622
623 (define-public wireguard
624 (deprecated-package "wireguard" wireguard-tools))
625
626 (define-public xl2tpd
627 (package
628 (name "xl2tpd")
629 (version "1.3.15")
630 (source (origin
631 (method git-fetch)
632 (uri (git-reference
633 (url "https://github.com/xelerance/xl2tpd")
634 (commit (string-append "v" version))))
635 (file-name (git-file-name name version))
636 (sha256
637 (base32
638 "0ppwza8nwm1av1vldw40gin9wrjrs4l9si50jad414js3k8ycaag"))))
639 (build-system gnu-build-system)
640 (arguments
641 `(#:make-flags (list (string-append "PREFIX=" %output)
642 "CC=gcc")
643 #:phases (modify-phases %standard-phases
644 (delete 'configure)) ; no configure script
645 #:tests? #f)) ; no tests provided
646 (inputs `(("libpcap" ,libpcap)))
647 (home-page "https://www.xelerance.com/software/xl2tpd/")
648 (synopsis "Layer 2 Tunnelling Protocol Daemon (RFC 2661)")
649 (description
650 "xl2tpd is an implementation of the Layer 2 Tunnelling Protocol (RFC 2661).
651 L2TP allows you to tunnel PPP over UDP.")
652 (license license:gpl2)))