1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
3 ;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
7 ;;; Copyright © 2016 ng0 <ng0@n0.is>
8 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2016, 2020 Marius Bakke <mbakke@fastmail.com>
10 ;;; Copyright © 2017 Vasile Dumitrascu <va511e@yahoo.com>
11 ;;; Copyright © 2017 Gregor Giesen <giesen@zaehlwerk.net>
12 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
13 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
14 ;;; Copyright © 2019 Chris Marusich <cmmarusich@gmail.com>
15 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
17 ;;; This file is part of GNU Guix.
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.
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.
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/>.
32 (define-module (gnu packages dns)
33 #:use-module (gnu packages admin)
34 #:use-module (gnu packages autotools)
35 #:use-module (gnu packages base)
36 #:use-module (gnu packages bash)
37 #:use-module (gnu packages check)
38 #:use-module (gnu packages databases)
39 #:use-module (gnu packages documentation)
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages crypto)
42 #:use-module (gnu packages datastructures)
43 #:use-module (gnu packages flex)
44 #:use-module (gnu packages glib)
45 #:use-module (gnu packages groff)
46 #:use-module (gnu packages groff)
47 #:use-module (gnu packages libedit)
48 #:use-module (gnu packages libevent)
49 #:use-module (gnu packages libidn)
50 #:use-module (gnu packages linux)
51 #:use-module (gnu packages lua)
52 #:use-module (gnu packages ncurses)
53 #:use-module (gnu packages nettle)
54 #:use-module (gnu packages networking)
55 #:use-module (gnu packages perl)
56 #:use-module (gnu packages pkg-config)
57 #:use-module (gnu packages protobuf)
58 #:use-module (gnu packages python)
59 #:use-module (gnu packages python-xyz)
60 #:use-module (gnu packages sphinx)
61 #:use-module (gnu packages swig)
62 #:use-module (gnu packages tls)
63 #:use-module (gnu packages web)
64 #:use-module (gnu packages xml)
65 #:use-module (gnu packages)
66 #:use-module ((guix licenses) #:prefix license:)
67 #:use-module (guix packages)
68 #:use-module (guix download)
69 #:use-module (guix git-download)
70 #:use-module (guix utils)
71 #:use-module (guix build-system gnu)
72 #:use-module (guix build-system meson)
73 #:use-module (guix build-system trivial))
75 (define-public dnsmasq
82 "http://www.thekelleys.org.uk/dnsmasq/dnsmasq-"
86 "1fv3g8vikj3sn37x1j6qsywn09w1jipvlv34j3q5qrljbrwa5ayd"))
87 (modules '((guix build utils)))
90 ;; The SIOCGSTAMP ioctl is defined in <linux/sockios.h> instead
91 ;; of <asm/sockios.h> starting with linux-libre-headers 5.2.
92 ;; Remove this for dnsmasq versions > 2.80.
93 (substitute* "src/dnsmasq.h"
94 (("#if defined\\(HAVE_LINUX_NETWORK\\)" all)
95 (string-append all "\n#include <linux/sockios.h>")))
97 (build-system gnu-build-system)
99 `(("pkg-config" ,pkg-config)))
104 (modify-phases %standard-phases (delete 'configure))
105 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
107 "COPTS=\"-DHAVE_DBUS\"")
108 #:tests? #f)) ; no ‘check’ target
109 (home-page "http://www.thekelleys.org.uk/dnsmasq/doc.html")
110 (synopsis "Small caching DNS proxy and DHCP/TFTP server")
112 "Dnsmasq is a light-weight DNS forwarder and DHCP server. It is designed
113 to provide DNS and, optionally, DHCP to a small network. It can serve the
114 names of local machines which are not in the global DNS. The DHCP server
115 integrates with the DNS server and allows machines with DHCP-allocated
116 addresses to appear in the DNS with names configured either on each host or in
117 a central configuration file. Dnsmasq supports static and dynamic DHCP leases
118 and BOOTP/TFTP for network booting of diskless machines.")
119 ;; Source files only say GPL2 and GPL3 are allowed.
120 (license (list license:gpl2 license:gpl3))))
122 ;; 'bind' is the name of a built-in Guile procedure, which is why we choose a
123 ;; different name here.
124 (define-public isc-bind
131 "https://ftp.isc.org/isc/bind9/" version
132 "/bind-" version ".tar.xz"))
135 "0a1f1wrlbnmq79q6s15fny36ip81malg6wlr8acp7amimsyxjjxg"))))
136 (build-system gnu-build-system)
137 (outputs `("out" "utils"))
139 ;; It would be nice to add GeoIP and gssapi once there are packages.
146 ("python-ply" ,python-ply)))
149 ("pkg-config" ,pkg-config)))
152 (list (string-append "--with-pkcs11="
153 (assoc-ref %build-inputs "p11-kit")))
155 (modify-phases %standard-phases
156 (add-after 'strip 'move-to-utils
160 (let ((target (string-append (assoc-ref %outputs "utils") file))
161 (src (string-append (assoc-ref %outputs "out") file)))
162 (mkdir-p (dirname target))
165 '("/bin/dig" "/bin/delv" "/bin/nslookup" "/bin/host" "/bin/nsupdate"
166 "/share/man/man1/dig.1"
167 "/share/man/man1/host.1"
168 "/share/man/man1/nslookup.1"
169 "/share/man/man1/nsupdate.1"))
171 ;; When and if guix provides user namespaces for the build process,
172 ;; then the following can be uncommented and the subsequent "force-test"
173 ;; will not be necessary.
175 ;; (add-before 'check 'set-up-loopback
177 ;; (system "bin/tests/system/ifconfig.sh up")))
180 ;; XXX Even ‘make force-test’ tries to create network interfaces
181 ;; and fails. The only working target is the (trivial) fuzz test.
182 (with-directory-excursion "fuzz"
183 (invoke "make" "check"))
185 (synopsis "An implementation of the Domain Name System")
186 (description "BIND is an implementation of the @dfn{Domain Name System}
187 (DNS) protocols for the Internet. It is a reference implementation of those
188 protocols, but it is also production-grade software, suitable for use in
189 high-volume and high-reliability applications. The name BIND stands for
190 \"Berkeley Internet Name Domain\", because the software originated in the early
191 1980s at the University of California at Berkeley.")
192 (home-page "https://www.isc.org/downloads/bind")
193 (license (list license:mpl2.0))))
195 (define-public dnscrypt-proxy
197 (name "dnscrypt-proxy")
202 "https://download.dnscrypt.org/dnscrypt-proxy/"
203 "dnscrypt-proxy-" version ".tar.bz2"))
206 "1dhvklr4dg2vlw108n11xbamacaryyg3dbrg629b76lp7685p7z8"))
207 (modules '((guix build utils)))
209 ;; Delete bundled libltdl. XXX: This package also bundles
210 ;; a modified libevent that cannot currently be removed.
212 (delete-file-recursively "libltdl")
214 (build-system gnu-build-system)
217 (modify-phases %standard-phases
218 (add-after 'unpack 'autoreconf
220 ;; Re-generate build files due to unbundling ltdl.
221 ;; TODO: Prevent generating new libltdl and building it.
222 ;; The system version is still favored and referenced.
223 (invoke "autoreconf" "-vif"))))))
225 `(("pkg-config" ,pkg-config)
226 ("automake" ,automake)
227 ("autoconf" ,autoconf)
228 ("libtool" ,libtool)))
230 `(("libltdl" ,libltdl)
231 ("libsodium" ,libsodium)))
232 (home-page "https://www.dnscrypt.org/")
233 (synopsis "Securely send DNS requests to a remote server")
235 "@command{dnscrypt-proxy} is a tool for securing communications
236 between a client and a DNS resolver. It verifies that responses you get
237 from a DNS provider was actually sent by that provider, and haven't been
238 tampered with. For optimal performance it is recommended to use this as
239 a forwarder for a caching DNS resolver such as @command{dnsmasq}, but it
240 can also be used as a normal DNS \"server\". A list of public dnscrypt
241 servers is included, and an up-to-date version is available at
242 @url{https://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-resolvers.csv}.")
243 (license (list license:isc
244 ;; Libevent and src/ext/queue.h is 3-clause BSD.
247 (define-public dnscrypt-wrapper
249 (name "dnscrypt-wrapper")
254 "https://github.com/cofyc/dnscrypt-wrapper/releases"
255 "/download/v" version "/" name "-v" version ".tar.bz2"))
258 "1vhg4g0r687f51wcdn7z9w1hxapazx6vyh5rsr8wa48sljzd583g"))))
259 (build-system gnu-build-system)
261 `(#:make-flags '("CC=gcc")
262 ;; TODO: Tests require ruby-cucumber and ruby-aruba.
265 (modify-phases %standard-phases
266 (add-after 'unpack 'create-configure
268 (invoke "make" "configure"))))))
270 `(("autoconf" ,autoconf)))
272 `(("libevent" ,libevent)
273 ("libsodium" ,libsodium)))
274 (home-page "https://github.com/Cofyc/dnscrypt-wrapper")
275 (synopsis "Server-side dnscrypt proxy")
277 "@command{dnscrypt-wrapper} is a tool to expose a name server over
278 the @code{dnscrypt} protocol. It can be used as an endpoint for the
279 @command{dnscrypt-proxy} client to securely tunnel DNS requests between
281 (license (list license:isc
282 ;; Bundled argparse is MIT. TODO: package and unbundle.
284 ;; dns-protocol.h and rfc1035.{c,h} is gpl2 or gpl3 (either).
288 (define-public libasr
295 (uri (string-append "https://www.opensmtpd.org/archives/"
296 "libasr-" version ".tar.gz"))
298 (base32 "1d6s8njqhvayx2gp47409sp1fn8m608ws26hr1srfp6i23nnpyqr"))))
299 (build-system gnu-build-system)
302 (modify-phases %standard-phases
303 (add-after 'install 'install-documentation
304 (lambda* (#:key outputs #:allow-other-keys)
305 (let ((out (assoc-ref outputs "out")))
306 (install-file "src/asr_run.3"
307 (string-append out "/share/man/man3"))
310 `(("autoconf" ,autoconf)
311 ("automake" ,automake)
313 ("pkg-config" ,pkg-config)))
314 (home-page "https://www.opensmtpd.org")
315 (synopsis "Asynchronous resolver library by the OpenBSD project")
317 "libasr is a free, simple and portable asynchronous resolver library.
318 It allows to run DNS queries and perform hostname resolutions in a fully
319 asynchronous fashion.")
320 (license (list license:isc
321 license:bsd-2 ; last part of getrrsetbyname_async.c
323 (license:non-copyleft "file://LICENSE") ; includes.h
333 (uri (string-append "https://www.nlnetlabs.nl/downloads/nsd/nsd-"
336 (base32 "0z7j3vwqqj0hh8n5irb2yqwzl45k4sn2wczbq1b1lqv5cxv6vgcy"))))
337 (build-system gnu-build-system)
340 (list "--enable-pie" ; fully benefit from ASLR
343 "--enable-relro-now" ; protect GOT and .dtor areas
344 "--disable-radix-tree"
345 (string-append "--with-libevent="
346 (assoc-ref %build-inputs "libevent"))
347 (string-append "--with-ssl="
348 (assoc-ref %build-inputs "openssl"))
349 "--with-configdir=/etc"
350 "--with-nsd_conf_file=/etc/nsd/nsd.conf"
351 "--with-logfile=/var/log/nsd.log"
352 "--with-pidfile=/var/db/nsd/nsd.pid"
353 "--with-dbfile=/var/db/nsd/nsd.db"
354 "--with-zonesdir=/etc/nsd"
355 "--with-xfrdfile=/var/db/nsd/xfrd.state"
356 "--with-zonelistfile=/var/db/nsd/zone.list")
358 (modify-phases %standard-phases
359 (add-before 'configure 'patch-installation-paths
360 (lambda* (#:key outputs #:allow-other-keys)
361 (let* ((out (assoc-ref outputs "out"))
362 (doc (string-append out "/share/doc/" ,name "-" ,version)))
363 ;; The ‘make install’ target tries to create the parent
364 ;; directories of run-time things like ‘pidfile’ above, and
365 ;; useless empty directories like 'configdir'. Remove such
366 ;; '$(INSTALL)' lines and install the example configuration file
367 ;; in an appropriate location.
368 (substitute* "Makefile.in"
369 ((".*INSTALL.*\\$\\((config|pid|xfr|db)dir" command)
370 (string-append "#" command))
371 (("\\$\\(nsdconfigfile\\)\\.sample" file-name)
372 (string-append doc "/examples/" file-name)))
374 #:tests? #f)) ; no tests
376 `(("libevent" ,libevent)
377 ("openssl" ,openssl)))
378 (home-page "https://www.nlnetlabs.nl/projects/nsd/about/")
379 (synopsis "Authoritative DNS name server")
380 (description "@dfn{NSD}, short for Name Server Daemon, is an authoritative
381 name server for the Domain Name System (@dfn{DNS}). It aims to be a fast and
382 RFC-compliant nameserver.
384 NSD uses zone information compiled via @command{zonec} into a binary database
385 file (@file{nsd.db}). This allows fast startup of the name service daemon and
386 allows syntax-structural errors in zone files to be flagged at compile time,
387 before being made available to NSD service itself. However, most traditional
388 BIND-style zone files can be directly imported into NSD without modification.
390 The collection of programs and processes that make up NSD are designed so that
391 the daemon itself runs as a non-privileged user and can be easily configured to
392 run in a @code{chroot} jail, thus making any security flaws in NSD less likely
393 to result in system-wide compromise.")
394 (license (list license:bsd-3))))
396 (define-public unbound
403 (uri (string-append "https://www.unbound.net/downloads/unbound-"
406 (base32 "0mg9divpysr42sp0m693a70693dp8025v6c9dv1yabr4g1jlhbqm"))))
407 (build-system gnu-build-system)
408 (outputs '("out" "python"))
414 ("libevent" ,libevent)
415 ("protobuf" ,protobuf)
416 ("python-wrapper" ,python-wrapper)
417 ("openssl" ,openssl)))
420 (list "--disable-static" ; save space and non-determinism in libunbound.a
422 "--with-ssl=" (assoc-ref %build-inputs "openssl"))
424 "--with-libevent=" (assoc-ref %build-inputs "libevent"))
426 "--with-libexpat=" (assoc-ref %build-inputs "expat"))
427 "--with-pythonmodule" "--with-pyunbound")
429 (modify-phases %standard-phases
430 (add-after 'configure 'fix-python-site-package-path
431 ;; Move python modules into their own output.
432 (lambda* (#:key outputs #:allow-other-keys)
433 (let ((pyout (assoc-ref outputs "python"))
434 (ver ,(version-major+minor (package-version python))))
435 (substitute* "Makefile"
436 (("^PYTHON_SITE_PKG=.*$")
439 pyout "/lib/python-" ver "/site-packages\n"))))
441 (add-before 'check 'fix-missing-nss-for-tests
442 ;; Unfortunately, the package's unittests involve some checks
443 ;; looking up protocols and services which are not provided
444 ;; by the minimalistic build environment, in particular,
445 ;; /etc/protocols and /etc/services are missing.
446 ;; Also, after plain substitution of protocol and service names
447 ;; in the test data, the tests still fail because the
448 ;; corresponding Resource Records have been signed by
450 ;; The following LD_PRELOAD library overwrites the glibc
451 ;; functions ‘get{proto,serv}byname’, ‘getprotobynumber’ and
452 ;; ‘getservbyport’ providing the few records required for the
453 ;; unit tests to pass.
454 (lambda* (#:key inputs outputs #:allow-other-keys)
455 (let* ((source (assoc-ref %build-inputs "source"))
456 (gcc (assoc-ref %build-inputs "gcc")))
457 (call-with-output-file "/tmp/nss_preload.c"
459 (display "#include <stdlib.h>
465 struct protoent *getprotobyname(const char *name) {
466 struct protoent *p = malloc(sizeof(struct protoent));
467 p->p_aliases = malloc(sizeof(char*));
468 if (strcasecmp(name, \"tcp\") == 0) {
471 p->p_aliases[0] = \"TCP\";
472 } else if (strcasecmp(name, \"udp\") == 0) {
475 p->p_aliases[0] = \"UDP\";
481 struct protoent *getprotobynumber(int proto) {
482 struct protoent *p = malloc(sizeof(struct protoent));
483 p->p_aliases = malloc(sizeof(char*));
488 p->p_aliases[0] = \"TCP\";
493 p->p_aliases[0] = \"UDP\";
502 struct servent *getservbyname(const char *name, const char *proto) {
503 struct servent *s = malloc(sizeof(struct servent));
504 char* buf = malloc((strlen(proto)+1)*sizeof(char));
506 s->s_aliases = malloc(sizeof(char*));
507 s->s_aliases[0] = NULL;
508 if (strcasecmp(name, \"domain\") == 0) {
509 s->s_name = \"domain\";
510 s->s_port = htons(53);
517 struct servent *getservbyport(int port, const char *proto) {
519 struct servent *s = malloc(sizeof(struct servent));
521 s->s_aliases = malloc(sizeof(char*));
522 s->s_aliases[0] = NULL;
525 s->s_name = \"domain\";
527 s->s_proto = \"udp\";
535 (invoke (string-append gcc "/bin/gcc")
536 "-shared" "-fPIC" "-o" "/tmp/nss_preload.so"
537 "/tmp/nss_preload.c")
538 ;; The preload library only affects the unittests.
539 (substitute* "Makefile"
541 "LD_PRELOAD=/tmp/nss_preload.so ./unittest")))
543 (home-page "https://www.unbound.net")
544 (synopsis "Validating, recursive, and caching DNS resolver")
546 "Unbound is a recursive-only caching DNS server which can perform DNSSEC
547 validation of results. It implements only a minimal amount of authoritative
548 service to prevent leakage to the root nameservers: forward lookups for
549 localhost, reverse for @code{127.0.0.1} and @code{::1}, and NXDOMAIN for zones
550 served by AS112. Stub and forward zones are supported.")
551 (license license:bsd-4)))
553 (define-public yadifa
558 (let ((build "8497"))
562 (string-append "http://cdn.yadifa.eu/sites/default/files/releases/"
563 "yadifa-" version "-" build ".tar.gz"))
565 (base32 "0xvyr91sfgzkpw6g3h893ldbwnki3w2472n56rr18w67qghs1sa5")))))
566 (build-system gnu-build-system)
570 `(("openssl" ,openssl)))
573 (modify-phases %standard-phases
574 (add-before 'configure 'omit-example-configurations
576 (substitute* "Makefile.in"
580 (list "--sysconfdir=/etc"
581 "--localstatedir=/var"
582 "--disable-build-timestamp" ; build reproducibly
587 "--enable-ctrl" ; enable remote control
591 (home-page "https://www.yadifa.eu/")
592 (synopsis "Authoritative DNS name server")
593 (description "YADIFA is an authoritative name server for the @dfn{Domain
594 Name System} (DNS). It aims for both higher performance and a smaller memory
595 footprint than other implementations, while remaining fully RFC-compliant.
596 YADIFA supports dynamic record updates and the @dfn{Domain Name System Security
597 Extensions} (DNSSEC).")
598 (license license:bsd-3)))
607 (uri (string-append "https://secure.nic.cz/files/knot-dns/"
608 "knot-" version ".tar.xz"))
610 (base32 "0zm0642hkb16sqkqpa84f89f3s0bw44m837r1nia8m89swvz3bgj"))
611 (modules '((guix build utils)))
614 ;; Delete bundled libraries.
615 (with-directory-excursion "src/contrib"
616 (delete-file-recursively "lmdb"))
618 (build-system gnu-build-system)
620 `(("pkg-config" ,pkg-config)))
625 ("libcap-ng" ,libcap-ng)
631 ("protobuf-c" ,protobuf-c)))
634 (modify-phases %standard-phases
635 (add-before 'configure 'disable-directory-pre-creation
637 ;; Don't install empty directories like ‘/etc’ outside the store.
638 ;; This is needed even when using ‘make config_dir=... install’.
639 (substitute* "src/Makefile.in" (("\\$\\(INSTALL\\) -d") "true"))
642 (lambda* (#:key outputs #:allow-other-keys)
643 (let* ((out (assoc-ref outputs "out"))
644 (doc (string-append out "/share/doc/" ,name "-" ,version))
645 (etc (string-append doc "/examples/etc")))
647 (string-append "config_dir=" etc)
650 (list "--sysconfdir=/etc"
651 "--localstatedir=/var"
652 "--enable-dnstap" ; let tools read/write capture files
653 "--with-module-dnstap=yes" ; detailed query capturing & logging
654 (string-append "--with-bash-completions="
655 (assoc-ref %outputs "out")
656 "/etc/bash_completion.d"))))
657 (home-page "https://www.knot-dns.cz/")
658 (synopsis "Authoritative DNS name server")
659 (description "Knot DNS is an authoritative name server for the @dfn{Domain
660 Name System} (DNS), designed to meet the needs of root and @dfn{top-level
661 domain} (TLD) name servers. It is implemented as a threaded daemon and uses a
662 number of programming techniques to improve speed. For example, the responder
663 is completely lock-free, resulting in a very high response rate. Other features
664 include automatic @dfn{DNS Security Extensions} (DNSSEC) signing, dynamic record
665 synthesis, and on-the-fly re-configuration.")
668 ;; src/contrib/{hat-trie,murmurhash3,openbsd},
669 ;; src/dnssec/contrib/vpool.[ch], and parts of libtap/ are ‘MIT’ (expat).
671 license:lgpl2.0+ ; parts of scr/contrib/ucw
672 license:public-domain ; src/contrib/fnv and possibly murmurhash3
673 license:gpl3+)))) ; everything else
675 (define-public knot-resolver
677 (name "knot-resolver")
681 (uri (string-append "https://secure.nic.cz/files/knot-resolver/"
682 "knot-resolver-" version ".tar.xz"))
685 "09ffmqx79lv5psr433x4n946njgsn071b9b7161pcb9bmrqz380c"))))
686 (build-system meson-build-system)
688 '(#:configure-flags '("-Ddoc=enabled")
690 (modify-phases %standard-phases
691 (add-before 'configure 'disable-default-ta
693 ;; Disable the default managed root TA, since we don't have
694 ;; write access to the keyfile and its directory in store.
695 (substitute* "daemon/lua/sandbox.lua.in"
696 (("^trust_anchors\\.add_file.*") ""))
698 (add-after 'build 'build-doc
700 (invoke "ninja" "doc")))
701 (add-after 'install 'wrap-binary
702 (lambda* (#:key inputs outputs #:allow-other-keys)
703 (let* ((out (assoc-ref outputs "out"))
704 (lua-* (map cdr (filter
706 (string-prefix? "lua-" (car input)))
708 (lua-path (lambda (p)
709 (string-append p "/share/lua/5.1/?.lua")))
710 (lua-cpath (lambda (p)
711 (string-append p "/lib/lua/5.1/?.so"))))
712 (wrap-program (string-append out "/sbin/kresd")
713 `("LUA_PATH" ";" prefix ,(map lua-path lua-*))
714 `("LUA_CPATH" ";" prefix ,(map lua-cpath lua-*)))
717 `(("cmocka" ,cmocka) ; for unit tests
719 ("protobuf-c" ,protobuf-c)
720 ("pkg-config" ,pkg-config)
721 ("python-breathe" ,python-breathe)
722 ("python-sphinx" ,python-sphinx)
723 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
731 ;; TODO: Add optional lua modules: basexx, cqueues and psl.
732 ("lua-bitop" ,lua5.1-bitop)
733 ("lua-filesystem" ,lua5.1-filesystem)
734 ("lua-sec" ,lua5.1-sec)
735 ("lua-socket" ,lua5.1-socket)))
736 (home-page "https://www.knot-resolver.cz/")
737 (synopsis "Caching validating DNS resolver")
739 "Knot Resolver is a caching full resolver implementation written in C and
740 LuaJIT, both a resolver library and a daemon.")
741 (license (list license:gpl3+
742 ;; Some 'contrib' files are under MIT, CC0 and LGPL2.
747 (define-public ddclient
755 (url "https://github.com/ddclient/ddclient.git")
756 (commit (string-append "v" version))))
757 (file-name (git-file-name name version))
759 (base32 "0hf377g4j9r9sac75xp17nk2h58mazswz4vkg4g2gl2yyhvzq91w"))))
760 (build-system trivial-build-system) ; no Makefile.PL
765 `(("inetutils" ,inetutils) ; logger
766 ("net-tools" ,net-tools)
767 ("perl-data-validate-ip" ,perl-data-validate-ip)
768 ("perl-digest-sha1" ,perl-digest-sha1)
769 ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
771 `(#:modules ((guix build utils)
776 (use-modules (guix build utils)
779 (setenv "PATH" (string-append
780 (assoc-ref %build-inputs "bash") "/bin" ":"
781 (assoc-ref %build-inputs "perl") "/bin"))
783 ;; Copy the (read-only) source into the (writable) build directory.
784 (copy-recursively (assoc-ref %build-inputs "source") ".")
787 (let* ((out (assoc-ref %outputs "out"))
788 (bin (string-append out "/bin")))
789 (let ((file "ddclient"))
791 (("/usr/bin/perl") (which "perl"))
792 ;; Strictly use ‘/etc/ddclient/ddclient.conf’.
793 (("\\$\\{program\\}\\.conf") "/etc/ddclient/ddclient.conf")
794 (("\\$etc\\$program.conf") "/etc/ddclient/ddclient.conf")
795 ;; Strictly use ‘/var/cache/ddclient/ddclient.cache’
796 (("\\$cachedir\\$program\\.cache")
797 "/var/cache/ddclient/ddclient.cache"))
798 (install-file file bin)
799 (wrap-program (string-append bin "/" file)
802 ,@(map (lambda (input)
805 (string-append store "/bin"))))
811 (((? (cut string-prefix? "perl-" <>) name) . dir)
812 (string-append dir "/lib/perl5/site_perl"))
815 (for-each (cut install-file <> (string-append out
817 (find-files "." "sample.*$"))))))
818 (home-page "https://ddclient.net/")
819 (synopsis "Address updating utility for dynamic DNS services")
820 (description "This package provides a client to update dynamic IP
821 addresses with several dynamic DNS service providers, such as
822 @uref{https://www.dyndns.com/account/login.html,DynDNS.com}.
824 This makes it possible to use a fixed hostname (such as myhost.dyndns.org) to
825 access a machine with a dynamic IP address.
827 The client supports both dynamic and (near) static services, as well as MX
828 record and alternative name management. It caches the address, and only
829 attempts the update when it has changed.")
830 (license license:gpl2+)))
833 ;; There have been no releases yet, hence this commit.
835 (commit "895d89c25d316d18df9d374fe78aae3902bc89fb"))
838 (version (git-version "0.0" revision commit))
842 (url "https://github.com/handshake-org/hnsd")
846 "0704y73sddn24jga9csw4gxyfb3pnrfnk0vdcph84n1h38490l16"))
847 (file-name (git-file-name name version))
848 (modules '((guix build utils)))
851 ;; Delete the bundled copy of libuv.
852 (delete-file-recursively "uv")
853 (substitute* "configure.ac"
854 (("AC_CONFIG_SUBDIRS\\(\\[uv\\]\\)") ""))
855 (substitute* "Makefile.am"
856 (("SUBDIRS = uv") "\n")
857 (("\\$\\(top_builddir\\)/uv/libuv.la") "-luv")
859 ;; Make sure the 'hnsd' binary is installed and
860 ;; dynamically-linked.
861 (("noinst_PROGRAMS") "bin_PROGRAMS")
862 (("hnsd_LDFLAGS = -static") ""))
864 ;; This script tries to chdir to "uv" and doesn't do more
865 ;; than "autoreconf" so remove it.
866 (delete-file "autogen.sh")
868 (build-system gnu-build-system)
870 '(#:configure-flags '("--disable-static"))) ;no need for libhsk.a
872 `(("autoconf" ,autoconf)
873 ("automake" ,automake)
874 ("libtool" ,libtool)))
876 `(("unbound" ,unbound)
878 (home-page "https://www.handshake.org/")
879 (synopsis "Resolver daemon for the Handshake naming protocol")
881 "@command{hnsd} is a @dfn{host name resolver} for the Handshake Naming
882 System (HNS) peer-to-peer network.")
883 (license license:expat))))
885 (define-public libmicrodns
892 (url "https://github.com/videolabs/libmicrodns")
894 (file-name (git-file-name name version))
897 "1xvl9k49ng35wbsqmnjnyqvkyjf8dcq2ywsq3jp3wh0rgmxhq2fh"))))
898 (build-system gnu-build-system)
900 `(("pkg-config" ,pkg-config)
901 ("autoconf" ,autoconf)
902 ("automake" ,automake)
903 ("libtool" ,libtool)))
904 (home-page "https://github.com/videolabs/libmicrodns")
905 (synopsis "Minimal mDNS resolver library")
906 (description "@code{libmicrodns} provides a minimal implementation of a
907 mDNS resolver as well as an announcer. mDNS (Multicast Domain Name System) is
908 a zero-config service that allows one to resolve host names to IP addresses in
910 (license license:lgpl2.1)))
912 (define-public public-suffix-list
913 ;; Mozilla releases the official list here:
915 ;; https://publicsuffix.org/list/public_suffix_list.dat
917 ;; However, Mozilla syncs that file from the GitHub repository periodically,
918 ;; so its contents will change over time. If you update this commit, please
919 ;; make sure that the new commit refers to a list which is identical to the
920 ;; officially published list available from the URL above.
921 (let ((commit "9375b697baddb0827a5995c81bd3c75877a0b35d"))
923 (name "public-suffix-list")
924 (version (git-version "0" "1" commit))
928 (url "https://github.com/publicsuffix/list.git")
930 (file-name (git-file-name name version))
933 "1sm7pni01rnl4ldzi8z8nc4cbgq8nxda9gwc68v0s3ij7jd1jmik"))))
934 (build-system trivial-build-system)
936 `(#:modules ((guix build utils))
939 (use-modules (guix build utils))
940 (let* ((out (assoc-ref %outputs "out"))
941 ;; Install to /share because that is where "read-only
942 ;; architecture-independent data files" should go (see:
943 ;; (standards) Directory Variables). Include the version in
944 ;; the directory name so that if multiple versions are ever
945 ;; installed in the same profile, they will not conflict.
946 (destination (string-append
947 out "/share/public-suffix-list-" ,version))
948 (source (assoc-ref %build-inputs "source")))
949 (with-directory-excursion source
950 (install-file "public_suffix_list.dat" destination)
951 (install-file "LICENSE" destination))
953 (home-page "https://publicsuffix.org/")
954 (synopsis "Database of current and historical DNS suffixes")
955 (description "This is the Public Suffix List maintained by Mozilla. A
956 \"public suffix\" is one under which Internet users can (or historically
957 could) directly register names in the Domain Name System (DNS). Some examples
958 of public suffixes are .com, .co.uk and pvt.k12.ma.us. This is a list of all
959 known public suffixes.")
960 (license license:mpl2.0))))