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