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 Nikita <nikita@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>
16 ;;; Copyright © 2020 Pierre Langlois <pierre.langlois@gmx.com>
17 ;;; Copyright © 2020 Arun Isaac <arunisaac@systemreboot.net>
18 ;;; Copyright © 2020 Leo Famulari <leo@famulari.name>
19 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
21 ;;; This file is part of GNU Guix.
23 ;;; GNU Guix is free software; you can redistribute it and/or modify it
24 ;;; under the terms of the GNU General Public License as published by
25 ;;; the Free Software Foundation; either version 3 of the License, or (at
26 ;;; your option) any later version.
28 ;;; GNU Guix is distributed in the hope that it will be useful, but
29 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 ;;; GNU General Public License for more details.
33 ;;; You should have received a copy of the GNU General Public License
34 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
36 (define-module (gnu packages dns)
37 #:use-module (gnu packages admin)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages bash)
41 #:use-module (gnu packages check)
42 #:use-module (gnu packages databases)
43 #:use-module (gnu packages documentation)
44 #:use-module (gnu packages compression)
45 #:use-module (gnu packages crypto)
46 #:use-module (gnu packages datastructures)
47 #:use-module (gnu packages flex)
48 #:use-module (gnu packages gcc)
49 #:use-module (gnu packages glib)
50 #:use-module (gnu packages groff)
51 #:use-module (gnu packages groff)
52 #:use-module (gnu packages libedit)
53 #:use-module (gnu packages libevent)
54 #:use-module (gnu packages libidn)
55 #:use-module (gnu packages linux)
56 #:use-module (gnu packages lua)
57 #:use-module (gnu packages ncurses)
58 #:use-module (gnu packages nettle)
59 #:use-module (gnu packages networking)
60 #:use-module (gnu packages perl)
61 #:use-module (gnu packages pkg-config)
62 #:use-module (gnu packages protobuf)
63 #:use-module (gnu packages python)
64 #:use-module (gnu packages python-xyz)
65 #:use-module (gnu packages sphinx)
66 #:use-module (gnu packages swig)
67 #:use-module (gnu packages tls)
68 #:use-module (gnu packages web)
69 #:use-module (gnu packages xml)
70 #:use-module (gnu packages)
71 #:use-module ((guix licenses) #:prefix license:)
72 #:use-module (guix packages)
73 #:use-module (guix download)
74 #:use-module (guix git-download)
75 #:use-module (guix utils)
76 #:use-module (guix build-system gnu)
77 #:use-module (guix build-system meson)
78 #:use-module (guix build-system trivial))
80 (define-public dnsmasq
87 "http://www.thekelleys.org.uk/dnsmasq/dnsmasq-"
91 "1yzq6anwgr5rlnwydpszb51cyhp2vjq29b24ck19flbwac1sk73l"))))
92 (build-system gnu-build-system)
94 `(("pkg-config" ,pkg-config)))
99 (modify-phases %standard-phases (delete 'configure))
100 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
102 "COPTS=\"-DHAVE_DBUS\"")
103 #:tests? #f)) ; no ‘check’ target
104 (home-page "http://www.thekelleys.org.uk/dnsmasq/doc.html")
105 (synopsis "Small caching DNS proxy and DHCP/TFTP server")
107 "Dnsmasq is a light-weight DNS forwarder and DHCP server. It is designed
108 to provide DNS and, optionally, DHCP to a small network. It can serve the
109 names of local machines which are not in the global DNS. The DHCP server
110 integrates with the DNS server and allows machines with DHCP-allocated
111 addresses to appear in the DNS with names configured either on each host or in
112 a central configuration file. Dnsmasq supports static and dynamic DHCP leases
113 and BOOTP/TFTP for network booting of diskless machines.")
114 ;; Source files only say GPL2 and GPL3 are allowed.
115 (license (list license:gpl2 license:gpl3))))
117 ;; 'bind' is the name of a built-in Guile procedure, which is why we choose a
118 ;; different name here.
119 (define-public isc-bind
126 "https://ftp.isc.org/isc/bind9/" version
127 "/bind-" version ".tar.xz"))
130 "0xf07mmd0vi91jd15z8d3hhjva8v27l4ip4l8yzah4gg3zjv6y33"))))
131 (build-system gnu-build-system)
132 (outputs `("out" "utils"))
134 ;; It would be nice to add GeoIP and gssapi once there are packages.
141 ("python-ply" ,python-ply)))
144 ("pkg-config" ,pkg-config)))
147 (list (string-append "--with-pkcs11="
148 (assoc-ref %build-inputs "p11-kit")))
150 (modify-phases %standard-phases
151 (add-after 'strip 'move-to-utils
155 (let ((target (string-append (assoc-ref %outputs "utils") file))
156 (src (string-append (assoc-ref %outputs "out") file)))
157 (mkdir-p (dirname target))
160 '("/bin/dig" "/bin/delv" "/bin/nslookup" "/bin/host" "/bin/nsupdate"
161 "/share/man/man1/dig.1"
162 "/share/man/man1/host.1"
163 "/share/man/man1/nslookup.1"
164 "/share/man/man1/nsupdate.1"))
166 ;; When and if guix provides user namespaces for the build process,
167 ;; then the following can be uncommented and the subsequent "force-test"
168 ;; will not be necessary.
170 ;; (add-before 'check 'set-up-loopback
172 ;; (system "bin/tests/system/ifconfig.sh up")))
175 ;; XXX Even ‘make force-test’ tries to create network interfaces
176 ;; and fails. The only working target is the (trivial) fuzz test.
177 (with-directory-excursion "fuzz"
178 (invoke "make" "check"))
180 (synopsis "Domain Name System (DNS) implementation")
181 (description "BIND is an implementation of the @dfn{Domain Name System}
182 (DNS) protocols for the Internet. It is a reference implementation of those
183 protocols, but it is also production-grade software, suitable for use in
184 high-volume and high-reliability applications. The name BIND stands for
185 \"Berkeley Internet Name Domain\", because the software originated in the
186 early 1980s at the University of California at Berkeley. The @code{utils}
187 output of this package contains the following DNS name servers related command
191 DNS lookup and validation utility
197 Internet name servers interactive query utility
199 Dynamic DNS update utility
201 (home-page "https://www.isc.org/bind/")
202 (license (list license:mpl2.0))))
204 (define-public dnscrypt-proxy
206 (name "dnscrypt-proxy")
211 "https://download.dnscrypt.org/dnscrypt-proxy/"
212 "dnscrypt-proxy-" version ".tar.bz2"))
215 "1dhvklr4dg2vlw108n11xbamacaryyg3dbrg629b76lp7685p7z8"))
216 (modules '((guix build utils)))
218 ;; Delete bundled libltdl. XXX: This package also bundles
219 ;; a modified libevent that cannot currently be removed.
221 (delete-file-recursively "libltdl")
223 (build-system gnu-build-system)
226 (modify-phases %standard-phases
227 (add-after 'unpack 'autoreconf
229 ;; Re-generate build files due to unbundling ltdl.
230 ;; TODO: Prevent generating new libltdl and building it.
231 ;; The system version is still favored and referenced.
232 (invoke "autoreconf" "-vif"))))))
234 `(("pkg-config" ,pkg-config)
235 ("automake" ,automake)
236 ("autoconf" ,autoconf)
237 ("libtool" ,libtool)))
239 `(("libltdl" ,libltdl)
240 ("libsodium" ,libsodium)))
241 (home-page "https://www.dnscrypt.org/")
242 (synopsis "Securely send DNS requests to a remote server")
244 "@command{dnscrypt-proxy} is a tool for securing communications
245 between a client and a DNS resolver. It verifies that responses you get
246 from a DNS provider was actually sent by that provider, and haven't been
247 tampered with. For optimal performance it is recommended to use this as
248 a forwarder for a caching DNS resolver such as @command{dnsmasq}, but it
249 can also be used as a normal DNS \"server\". A list of public dnscrypt
250 servers is included, and an up-to-date version is available at
251 @url{https://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-resolvers.csv}.")
252 (license (list license:isc
253 ;; Libevent and src/ext/queue.h is 3-clause BSD.
256 (define-public dnscrypt-wrapper
258 (name "dnscrypt-wrapper")
263 "https://github.com/cofyc/dnscrypt-wrapper/releases"
264 "/download/v" version "/" name "-v" version ".tar.bz2"))
267 "1vhg4g0r687f51wcdn7z9w1hxapazx6vyh5rsr8wa48sljzd583g"))))
268 (build-system gnu-build-system)
270 `(#:make-flags '("CC=gcc")
271 ;; TODO: Tests require ruby-cucumber and ruby-aruba.
274 (modify-phases %standard-phases
275 (add-after 'unpack 'create-configure
277 (invoke "make" "configure"))))))
279 `(("autoconf" ,autoconf)))
281 `(("libevent" ,libevent)
282 ("libsodium" ,libsodium)))
283 (home-page "https://github.com/Cofyc/dnscrypt-wrapper")
284 (synopsis "Server-side dnscrypt proxy")
286 "@command{dnscrypt-wrapper} is a tool to expose a name server over
287 the @code{dnscrypt} protocol. It can be used as an endpoint for the
288 @command{dnscrypt-proxy} client to securely tunnel DNS requests between
290 (license (list license:isc
291 ;; Bundled argparse is MIT. TODO: package and unbundle.
293 ;; dns-protocol.h and rfc1035.{c,h} is gpl2 or gpl3 (either).
297 (define-public libasr
304 (uri (string-append "https://www.opensmtpd.org/archives/"
305 "libasr-" version ".tar.gz"))
307 (base32 "1d6s8njqhvayx2gp47409sp1fn8m608ws26hr1srfp6i23nnpyqr"))))
308 (build-system gnu-build-system)
311 (modify-phases %standard-phases
312 (add-after 'install 'install-documentation
313 (lambda* (#:key outputs #:allow-other-keys)
314 (let ((out (assoc-ref outputs "out")))
315 (install-file "src/asr_run.3"
316 (string-append out "/share/man/man3"))
319 `(("autoconf" ,autoconf)
320 ("automake" ,automake)
322 ("pkg-config" ,pkg-config)))
323 (home-page "https://www.opensmtpd.org")
324 (synopsis "Asynchronous resolver library by the OpenBSD project")
326 "libasr is a free, simple and portable asynchronous resolver library.
327 It runs DNS queries and performs hostname resolution in a fully
328 asynchronous fashion.")
329 (license (list license:isc
330 license:bsd-2 ; last part of getrrsetbyname_async.c
332 (license:non-copyleft "file://LICENSE") ; includes.h
342 (uri (string-append "https://www.nlnetlabs.nl/downloads/nsd/nsd-"
345 (base32 "0ac3mbn5z4nc18782m9aswdpi2m9f4665vidw0ciyigdh0pywp2v"))))
346 (build-system gnu-build-system)
349 (list "--enable-pie" ; fully benefit from ASLR
352 "--enable-relro-now" ; protect GOT and .dtor areas
353 "--disable-radix-tree"
354 (string-append "--with-libevent="
355 (assoc-ref %build-inputs "libevent"))
356 (string-append "--with-ssl="
357 (assoc-ref %build-inputs "openssl"))
358 "--with-configdir=/etc"
359 "--with-nsd_conf_file=/etc/nsd/nsd.conf"
360 "--with-logfile=/var/log/nsd.log"
361 "--with-pidfile=/var/db/nsd/nsd.pid"
362 "--with-dbfile=/var/db/nsd/nsd.db"
363 "--with-zonesdir=/etc/nsd"
364 "--with-xfrdfile=/var/db/nsd/xfrd.state"
365 "--with-zonelistfile=/var/db/nsd/zone.list")
367 (modify-phases %standard-phases
368 (add-before 'configure 'patch-installation-paths
369 (lambda* (#:key outputs #:allow-other-keys)
370 (let* ((out (assoc-ref outputs "out"))
371 (doc (string-append out "/share/doc/" ,name "-" ,version)))
372 ;; The ‘make install’ target tries to create the parent
373 ;; directories of run-time things like ‘pidfile’ above, and
374 ;; useless empty directories like 'configdir'. Remove such
375 ;; '$(INSTALL)' lines and install the example configuration file
376 ;; in an appropriate location.
377 (substitute* "Makefile.in"
378 ((".*INSTALL.*\\$\\((config|pid|xfr|db)dir" command)
379 (string-append "#" command))
380 (("\\$\\(nsdconfigfile\\)\\.sample" file-name)
381 (string-append doc "/examples/" file-name)))
383 #:tests? #f)) ; no tests
385 `(("libevent" ,libevent)
386 ("openssl" ,openssl)))
387 (home-page "https://www.nlnetlabs.nl/projects/nsd/about/")
388 (synopsis "Authoritative DNS name server")
389 (description "@dfn{NSD}, short for Name Server Daemon, is an authoritative
390 name server for the Domain Name System (@dfn{DNS}). It aims to be a fast and
391 RFC-compliant nameserver.
393 NSD uses zone information compiled via @command{zonec} into a binary database
394 file (@file{nsd.db}). This allows fast startup of the name service daemon and
395 allows syntax-structural errors in zone files to be flagged at compile time,
396 before being made available to NSD service itself. However, most traditional
397 BIND-style zone files can be directly imported into NSD without modification.
399 The collection of programs and processes that make up NSD are designed so that
400 the daemon itself runs as a non-privileged user and can be easily configured to
401 run in a @code{chroot} jail, thus making any security flaws in NSD less likely
402 to result in system-wide compromise.")
403 (license (list license:bsd-3))))
405 (define-public unbound
412 (uri (string-append "https://www.unbound.net/downloads/unbound-"
415 (base32 "0dnmh9jjh2v274f0hl31bgv40pl77mmfgky8bkqr5kvi3b17fdmp"))))
416 (build-system gnu-build-system)
417 (outputs '("out" "python"))
423 ("libevent" ,libevent)
424 ("protobuf" ,protobuf)
425 ("python-wrapper" ,python-wrapper)
426 ("openssl" ,openssl)))
429 (list "--disable-static" ; save space and non-determinism in libunbound.a
431 "--with-ssl=" (assoc-ref %build-inputs "openssl"))
433 "--with-libevent=" (assoc-ref %build-inputs "libevent"))
435 "--with-libexpat=" (assoc-ref %build-inputs "expat"))
436 "--with-pythonmodule" "--with-pyunbound")
438 (modify-phases %standard-phases
439 (add-after 'configure 'fix-python-site-package-path
440 ;; Move python modules into their own output.
441 (lambda* (#:key outputs #:allow-other-keys)
442 (let ((pyout (assoc-ref outputs "python"))
443 (ver ,(version-major+minor (package-version python))))
444 (substitute* "Makefile"
445 (("^PYTHON_SITE_PKG=.*$")
448 pyout "/lib/python-" ver "/site-packages\n"))))
450 (add-before 'check 'fix-missing-nss-for-tests
451 ;; Unfortunately, the package's unittests involve some checks
452 ;; looking up protocols and services which are not provided
453 ;; by the minimalistic build environment, in particular,
454 ;; /etc/protocols and /etc/services are missing.
455 ;; Also, after plain substitution of protocol and service names
456 ;; in the test data, the tests still fail because the
457 ;; corresponding Resource Records have been signed by
459 ;; The following LD_PRELOAD library overwrites the glibc
460 ;; functions ‘get{proto,serv}byname’, ‘getprotobynumber’ and
461 ;; ‘getservbyport’ providing the few records required for the
462 ;; unit tests to pass.
463 (lambda* (#:key inputs outputs #:allow-other-keys)
464 (let* ((source (assoc-ref %build-inputs "source"))
465 (gcc (assoc-ref %build-inputs "gcc")))
466 (call-with-output-file "/tmp/nss_preload.c"
468 (display "#include <stdlib.h>
474 struct protoent *getprotobyname(const char *name) {
475 struct protoent *p = malloc(sizeof(struct protoent));
476 p->p_aliases = malloc(sizeof(char*));
477 if (strcasecmp(name, \"tcp\") == 0) {
480 p->p_aliases[0] = \"TCP\";
481 } else if (strcasecmp(name, \"udp\") == 0) {
484 p->p_aliases[0] = \"UDP\";
490 struct protoent *getprotobynumber(int proto) {
491 struct protoent *p = malloc(sizeof(struct protoent));
492 p->p_aliases = malloc(sizeof(char*));
497 p->p_aliases[0] = \"TCP\";
502 p->p_aliases[0] = \"UDP\";
511 struct servent *getservbyname(const char *name, const char *proto) {
512 struct servent *s = malloc(sizeof(struct servent));
513 char* buf = malloc((strlen(proto)+1)*sizeof(char));
515 s->s_aliases = malloc(sizeof(char*));
516 s->s_aliases[0] = NULL;
517 if (strcasecmp(name, \"domain\") == 0) {
518 s->s_name = \"domain\";
519 s->s_port = htons(53);
526 struct servent *getservbyport(int port, const char *proto) {
528 struct servent *s = malloc(sizeof(struct servent));
530 s->s_aliases = malloc(sizeof(char*));
531 s->s_aliases[0] = NULL;
534 s->s_name = \"domain\";
536 s->s_proto = \"udp\";
544 (invoke (string-append gcc "/bin/gcc")
545 "-shared" "-fPIC" "-o" "/tmp/nss_preload.so"
546 "/tmp/nss_preload.c")
547 ;; The preload library only affects the unittests.
548 (substitute* "Makefile"
550 "LD_PRELOAD=/tmp/nss_preload.so ./unittest")))
552 (home-page "https://www.unbound.net")
553 (synopsis "Validating, recursive, and caching DNS resolver")
555 "Unbound is a recursive-only caching DNS server which can perform DNSSEC
556 validation of results. It implements only a minimal amount of authoritative
557 service to prevent leakage to the root nameservers: forward lookups for
558 localhost, reverse for @code{127.0.0.1} and @code{::1}, and NXDOMAIN for zones
559 served by AS112. Stub and forward zones are supported.")
560 (license license:bsd-4)))
562 (define-public yadifa
567 (let ((build "8497"))
571 (string-append "http://cdn.yadifa.eu/sites/default/files/releases/"
572 "yadifa-" version "-" build ".tar.gz"))
574 (base32 "0xvyr91sfgzkpw6g3h893ldbwnki3w2472n56rr18w67qghs1sa5")))))
575 (build-system gnu-build-system)
579 `(("openssl" ,openssl)))
582 (modify-phases %standard-phases
583 (add-before 'configure 'omit-example-configurations
585 (substitute* "Makefile.in"
589 (list "--sysconfdir=/etc"
590 "--localstatedir=/var"
591 "--disable-build-timestamp" ; build reproducibly
596 "--enable-ctrl" ; enable remote control
600 (home-page "https://www.yadifa.eu/")
601 (synopsis "Authoritative DNS name server")
602 (description "YADIFA is an authoritative name server for the @dfn{Domain
603 Name System} (DNS). It aims for both higher performance and a smaller memory
604 footprint than other implementations, while remaining fully RFC-compliant.
605 YADIFA supports dynamic record updates and the @dfn{Domain Name System Security
606 Extensions} (DNSSEC).")
607 (license license:bsd-3)))
616 (uri (string-append "https://secure.nic.cz/files/knot-dns/"
617 "knot-" version ".tar.xz"))
619 (base32 "0xmzmhd2m9rb24clrrd9k058harsq67nyjplpbyxvy1g46xah28i"))
620 (modules '((guix build utils)))
623 ;; Delete bundled libraries.
624 (with-directory-excursion "src/contrib"
625 (delete-file-recursively "lmdb"))
627 (build-system gnu-build-system)
629 `(("pkg-config" ,pkg-config)))
634 ("libcap-ng" ,libcap-ng)
640 ("protobuf-c" ,protobuf-c)))
643 (modify-phases %standard-phases
644 (add-before 'configure 'disable-directory-pre-creation
646 ;; Don't install empty directories like ‘/etc’ outside the store.
647 ;; This is needed even when using ‘make config_dir=... install’.
648 (substitute* "src/Makefile.in" (("\\$\\(INSTALL\\) -d") "true"))
651 (lambda* (#:key outputs #:allow-other-keys)
652 (let* ((out (assoc-ref outputs "out"))
653 (doc (string-append out "/share/doc/" ,name "-" ,version))
654 (etc (string-append doc "/examples/etc")))
656 (string-append "config_dir=" etc)
659 (list "--sysconfdir=/etc"
660 "--localstatedir=/var"
661 "--enable-dnstap" ; let tools read/write capture files
662 "--with-module-dnstap=yes" ; detailed query capturing & logging
663 (string-append "--with-bash-completions="
664 (assoc-ref %outputs "out")
665 "/etc/bash_completion.d"))))
666 (home-page "https://www.knot-dns.cz/")
667 (synopsis "Authoritative DNS name server")
668 (description "Knot DNS is an authoritative name server for the @dfn{Domain
669 Name System} (DNS), designed to meet the needs of root and @dfn{top-level
670 domain} (TLD) name servers. It is implemented as a threaded daemon and uses a
671 number of programming techniques to improve speed. For example, the responder
672 is completely lock-free, resulting in a very high response rate. Other features
673 include automatic @dfn{DNS Security Extensions} (DNSSEC) signing, dynamic record
674 synthesis, and on-the-fly re-configuration.")
677 ;; src/contrib/{hat-trie,murmurhash3,openbsd},
678 ;; src/dnssec/contrib/vpool.[ch], and parts of libtap/ are ‘MIT’ (expat).
680 license:lgpl2.0+ ; parts of scr/contrib/ucw
681 license:public-domain ; src/contrib/fnv and possibly murmurhash3
682 license:gpl3+)))) ; everything else
684 (define-public knot-resolver
686 (name "knot-resolver")
690 (uri (string-append "https://secure.nic.cz/files/knot-resolver/"
691 "knot-resolver-" version ".tar.xz"))
694 "09ffmqx79lv5psr433x4n946njgsn071b9b7161pcb9bmrqz380c"))))
695 (build-system meson-build-system)
697 '(#:configure-flags '("-Ddoc=enabled")
699 (modify-phases %standard-phases
700 (add-before 'configure 'disable-default-ta
702 ;; Disable the default managed root TA, since we don't have
703 ;; write access to the keyfile and its directory in store.
704 (substitute* "daemon/lua/sandbox.lua.in"
705 (("^trust_anchors\\.add_file.*") ""))
707 (add-after 'build 'build-doc
709 (invoke "ninja" "doc")))
710 (add-after 'install 'wrap-binary
711 (lambda* (#:key inputs outputs #:allow-other-keys)
712 (let* ((out (assoc-ref outputs "out"))
713 (lua-* (map cdr (filter
715 (string-prefix? "lua-" (car input)))
717 (lua-path (lambda (p)
718 (string-append p "/share/lua/5.1/?.lua")))
719 (lua-cpath (lambda (p)
720 (string-append p "/lib/lua/5.1/?.so"))))
721 (wrap-program (string-append out "/sbin/kresd")
722 `("LUA_PATH" ";" prefix ,(map lua-path lua-*))
723 `("LUA_CPATH" ";" prefix ,(map lua-cpath lua-*)))
726 `(("cmocka" ,cmocka) ; for unit tests
728 ("protobuf-c" ,protobuf-c)
729 ("pkg-config" ,pkg-config)
730 ("python-breathe" ,python-breathe)
731 ("python-sphinx" ,python-sphinx)
732 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
740 ;; TODO: Add optional lua modules: basexx and psl.
741 ("lua-bitop" ,lua5.1-bitop)
742 ("lua-cqueues" ,lua5.1-cqueues)
743 ("lua-filesystem" ,lua5.1-filesystem)
744 ("lua-sec" ,lua5.1-sec)
745 ("lua-socket" ,lua5.1-socket)))
746 (home-page "https://www.knot-resolver.cz/")
747 (synopsis "Caching validating DNS resolver")
749 "Knot Resolver is a caching full resolver implementation written in C and
750 LuaJIT, both a resolver library and a daemon.")
751 (license (list license:gpl3+
752 ;; Some 'contrib' files are under MIT, CC0 and LGPL2.
757 (define-public ddclient
765 (url "https://github.com/ddclient/ddclient")
766 (commit (string-append "v" version))))
767 (file-name (git-file-name name version))
769 (base32 "0hf377g4j9r9sac75xp17nk2h58mazswz4vkg4g2gl2yyhvzq91w"))))
770 (build-system trivial-build-system) ; no Makefile.PL
775 `(("inetutils" ,inetutils) ; logger
776 ("net-tools" ,net-tools)
777 ("perl-data-validate-ip" ,perl-data-validate-ip)
778 ("perl-digest-sha1" ,perl-digest-sha1)
779 ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
781 `(#:modules ((guix build utils)
786 (use-modules (guix build utils)
789 (setenv "PATH" (string-append
790 (assoc-ref %build-inputs "bash") "/bin" ":"
791 (assoc-ref %build-inputs "perl") "/bin"))
793 ;; Copy the (read-only) source into the (writable) build directory.
794 (copy-recursively (assoc-ref %build-inputs "source") ".")
797 (let* ((out (assoc-ref %outputs "out"))
798 (bin (string-append out "/bin")))
799 (let ((file "ddclient"))
801 (("/usr/bin/perl") (which "perl"))
802 ;; Strictly use ‘/etc/ddclient/ddclient.conf’.
803 (("\\$\\{program\\}\\.conf") "/etc/ddclient/ddclient.conf")
804 (("\\$etc\\$program.conf") "/etc/ddclient/ddclient.conf")
805 ;; Strictly use ‘/var/cache/ddclient/ddclient.cache’
806 (("\\$cachedir\\$program\\.cache")
807 "/var/cache/ddclient/ddclient.cache"))
808 (install-file file bin)
809 (wrap-program (string-append bin "/" file)
812 ,@(map (lambda (input)
815 (string-append store "/bin"))))
821 (((? (cut string-prefix? "perl-" <>) name) . dir)
822 (string-append dir "/lib/perl5/site_perl"))
825 (for-each (cut install-file <> (string-append out
827 (find-files "." "sample.*$"))))))
828 (home-page "https://ddclient.net/")
829 (synopsis "Address updating utility for dynamic DNS services")
830 (description "This package provides a client to update dynamic IP
831 addresses with several dynamic DNS service providers, such as
832 @uref{https://www.dyndns.com/account/login.html,DynDNS.com}.
834 This makes it possible to use a fixed hostname (such as myhost.dyndns.org) to
835 access a machine with a dynamic IP address.
837 The client supports both dynamic and (near) static services, as well as MX
838 record and alternative name management. It caches the address, and only
839 attempts the update when it has changed.")
840 (license license:gpl2+)))
843 ;; There have been no releases yet, hence this commit.
845 (commit "895d89c25d316d18df9d374fe78aae3902bc89fb"))
848 (version (git-version "0.0" revision commit))
852 (url "https://github.com/handshake-org/hnsd")
856 "0704y73sddn24jga9csw4gxyfb3pnrfnk0vdcph84n1h38490l16"))
857 (file-name (git-file-name name version))
858 (modules '((guix build utils)))
861 ;; Delete the bundled copy of libuv.
862 (delete-file-recursively "uv")
863 (substitute* "configure.ac"
864 (("AC_CONFIG_SUBDIRS\\(\\[uv\\]\\)") ""))
865 (substitute* "Makefile.am"
866 (("SUBDIRS = uv") "\n")
867 (("\\$\\(top_builddir\\)/uv/libuv.la") "-luv")
869 ;; Make sure the 'hnsd' binary is installed and
870 ;; dynamically-linked.
871 (("noinst_PROGRAMS") "bin_PROGRAMS")
872 (("hnsd_LDFLAGS = -static") ""))
874 ;; This script tries to chdir to "uv" and doesn't do more
875 ;; than "autoreconf" so remove it.
876 (delete-file "autogen.sh")
878 (build-system gnu-build-system)
880 '(#:configure-flags '("--disable-static"))) ;no need for libhsk.a
882 `(("autoconf" ,autoconf)
883 ("automake" ,automake)
884 ("libtool" ,libtool)))
886 `(("unbound" ,unbound)
888 (home-page "https://www.handshake.org/")
889 (synopsis "Resolver daemon for the Handshake naming protocol")
891 "@command{hnsd} is a @dfn{host name resolver} for the Handshake Naming
892 System (HNS) peer-to-peer network.")
893 (license license:expat))))
895 (define-public libmicrodns
901 (uri (string-append "https://github.com/videolabs/libmicrodns/"
902 "releases/download/" version "/microdns-"
906 "0p4va18zxgmzcdwhlbg2mmjwswlbgqy4ay5vaxrw7cxmhsflnv36"))))
907 (build-system meson-build-system)
908 (home-page "https://github.com/videolabs/libmicrodns")
909 (synopsis "Minimal mDNS resolver library")
910 (description "@code{libmicrodns} provides a minimal implementation of a
911 mDNS resolver as well as an announcer. mDNS (Multicast Domain Name System) is
912 a zero-config service that allows one to resolve host names to IP addresses in
914 (license license:lgpl2.1)))
916 (define-public public-suffix-list
917 ;; Mozilla releases the official list here:
919 ;; https://publicsuffix.org/list/public_suffix_list.dat
921 ;; However, Mozilla syncs that file from the GitHub repository periodically,
922 ;; so its contents will change over time. If you update this commit, please
923 ;; make sure that the new commit refers to a list which is identical to the
924 ;; officially published list available from the URL above.
925 (let ((commit "9375b697baddb0827a5995c81bd3c75877a0b35d"))
927 (name "public-suffix-list")
928 (version (git-version "0" "1" commit))
932 (url "https://github.com/publicsuffix/list")
934 (file-name (git-file-name name version))
937 "1sm7pni01rnl4ldzi8z8nc4cbgq8nxda9gwc68v0s3ij7jd1jmik"))))
938 (build-system trivial-build-system)
940 `(#:modules ((guix build utils))
943 (use-modules (guix build utils))
944 (let* ((out (assoc-ref %outputs "out"))
945 ;; Install to /share because that is where "read-only
946 ;; architecture-independent data files" should go (see:
947 ;; (standards) Directory Variables). Include the version in
948 ;; the directory name so that if multiple versions are ever
949 ;; installed in the same profile, they will not conflict.
950 (destination (string-append
951 out "/share/public-suffix-list-" ,version))
952 (source (assoc-ref %build-inputs "source")))
953 (with-directory-excursion source
954 (install-file "public_suffix_list.dat" destination)
955 (install-file "LICENSE" destination))
957 (home-page "https://publicsuffix.org/")
958 (synopsis "Database of current and historical DNS suffixes")
959 (description "This is the Public Suffix List maintained by Mozilla. A
960 \"public suffix\" is one under which Internet users can (or historically
961 could) directly register names in the Domain Name System (DNS). Some examples
962 of public suffixes are .com, .co.uk and pvt.k12.ma.us. This is a list of all
963 known public suffixes.")
964 (license license:mpl2.0))))
966 (define-public maradns
973 (uri (string-append "https://maradns.samiam.org/download/"
974 (version-major+minor version) "/"
975 version "/maradns-" version ".tar.xz"))
977 (base32 "0bc19xylg4whww9qaj5i4izwxcrh0c0ja7l1pfcn2la02hlvg1a6"))))
978 (build-system gnu-build-system)
980 `(#:tests? #f ; need to be root to run tests
983 ,(string-append "CC=" (cc-for-target))
984 (string-append "PREFIX=" %output)
985 (string-append "RPM_BUILD_ROOT=" %output))
987 (modify-phases %standard-phases
989 (lambda* (#:key native-inputs target #:allow-other-keys)
990 ;; make_32bit_tables generates a header file that is used during
991 ;; compilation. Hence, during cross compilation, it should be
992 ;; built for the host system.
994 (substitute* "rng/Makefile"
995 (("\\$\\(CC\\) -o make_32bit_tables")
996 (string-append (assoc-ref native-inputs "gcc")
997 "/bin/gcc -o make_32bit_tables"))))
998 (invoke "./configure")))
999 (add-before 'install 'create-install-directories
1000 (lambda* (#:key outputs #:allow-other-keys)
1001 (let ((out (assoc-ref outputs "out")))
1002 (for-each (lambda (dir)
1003 (mkdir-p (string-append out dir)))
1004 (list "/bin" "/sbin" "/etc"
1009 (home-page "https://maradns.samiam.org")
1010 (synopsis "Small lightweight DNS server")
1011 (description "MaraDNS is a small and lightweight DNS server. MaraDNS
1012 consists of a UDP-only authoritative DNS server for hosting domains, and a UDP
1013 and TCP-capable recursive DNS server for finding domains on the internet.")
1014 (license license:bsd-2)))
1016 (define-public openresolv
1022 (uri (string-append "https://roy.marples.name/downloads/openresolv/"
1023 "openresolv-" version ".tar.xz"))
1026 "01ms6c087la4hk0f0w6n2vpsb7dg4kklah2rqyhz88p0vr9bqy20"))
1028 (search-patches "openresolv-restartcmd-guix.patch"))))
1029 (build-system gnu-build-system)
1031 `(#:tests? #f ; No test suite
1033 (list (string-append "--sysconfdir=/etc"))
1035 (list (string-append "SYSCONFDIR=/" (assoc-ref %outputs "out") "/etc"))))
1036 (home-page "https://roy.marples.name/projects/openresolv/")
1037 (synopsis "Resolvconf POSIX compliant implementation, a middleman for resolv.conf")
1038 (description "openresolv is an implementation of @command{resolvconf}, the
1039 middleman between the network configuration services and
1040 @file{/etc/resolv.conf}. @command{resolvconf} itself is just a script that
1041 stores, removes and lists a full @file{resolv.conf} generated for the
1042 interface. It then calls all the helper scripts it knows about so it can
1043 configure the real @file{/etc/resolv.conf} and optionally any local
1044 nameservers other than libc.")
1045 (license license:bsd-2)))