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