gnu: unbound: Update to 1.9.3.
[jackhill/guix/guix.git] / gnu / packages / dns.scm
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 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2016 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 ;;;
17 ;;; This file is part of GNU Guix.
18 ;;;
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
23 ;;;
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
28 ;;;
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31
32 (define-module (gnu packages 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 databases)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages crypto)
40 #:use-module (gnu packages datastructures)
41 #:use-module (gnu packages flex)
42 #:use-module (gnu packages glib)
43 #:use-module (gnu packages groff)
44 #:use-module (gnu packages groff)
45 #:use-module (gnu packages libedit)
46 #:use-module (gnu packages libevent)
47 #:use-module (gnu packages libidn)
48 #:use-module (gnu packages linux)
49 #:use-module (gnu packages ncurses)
50 #:use-module (gnu packages nettle)
51 #:use-module (gnu packages networking)
52 #:use-module (gnu packages perl)
53 #:use-module (gnu packages pkg-config)
54 #:use-module (gnu packages protobuf)
55 #:use-module (gnu packages python)
56 #:use-module (gnu packages python-xyz)
57 #:use-module (gnu packages swig)
58 #:use-module (gnu packages tls)
59 #:use-module (gnu packages web)
60 #:use-module (gnu packages xml)
61 #:use-module (gnu packages)
62 #:use-module ((guix licenses) #:prefix license:)
63 #:use-module (guix packages)
64 #:use-module (guix download)
65 #:use-module (guix git-download)
66 #:use-module (guix utils)
67 #:use-module (guix build-system gnu)
68 #:use-module (guix build-system trivial))
69
70 (define-public dnsmasq
71 (package
72 (name "dnsmasq")
73 (version "2.80")
74 (source (origin
75 (method url-fetch)
76 (uri (string-append
77 "http://www.thekelleys.org.uk/dnsmasq/dnsmasq-"
78 version ".tar.xz"))
79 (sha256
80 (base32
81 "1fv3g8vikj3sn37x1j6qsywn09w1jipvlv34j3q5qrljbrwa5ayd"))))
82 (build-system gnu-build-system)
83 (native-inputs
84 `(("pkg-config" ,pkg-config)))
85 (inputs
86 `(("dbus" ,dbus)))
87 (arguments
88 `(#:phases
89 (modify-phases %standard-phases (delete 'configure))
90 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
91 "CC=gcc"
92 "COPTS=\"-DHAVE_DBUS\"")
93 #:tests? #f)) ; no ‘check’ target
94 (home-page "http://www.thekelleys.org.uk/dnsmasq/doc.html")
95 (synopsis "Small caching DNS proxy and DHCP/TFTP server")
96 (description
97 "Dnsmasq is a light-weight DNS forwarder and DHCP server. It is designed
98 to provide DNS and, optionally, DHCP to a small network. It can serve the
99 names of local machines which are not in the global DNS. The DHCP server
100 integrates with the DNS server and allows machines with DHCP-allocated
101 addresses to appear in the DNS with names configured either on each host or in
102 a central configuration file. Dnsmasq supports static and dynamic DHCP leases
103 and BOOTP/TFTP for network booting of diskless machines.")
104 ;; Source files only say GPL2 and GPL3 are allowed.
105 (license (list license:gpl2 license:gpl3))))
106
107 ;; 'bind' is the name of a built-in Guile procedure, which is why we choose a
108 ;; different name here.
109 (define-public isc-bind
110 (package
111 (name "bind")
112 (version "9.14.5")
113 (source (origin
114 (method url-fetch)
115 (uri (string-append
116 "https://ftp.isc.org/isc/bind9/" version
117 "/bind-" version ".tar.gz"))
118 (sha256
119 (base32
120 "0ic0k0kpavwnbyf10rwx6yypxg66f65fprwc0dbmp61xp0n6gl0j"))))
121 (build-system gnu-build-system)
122 (outputs `("out" "utils"))
123 (inputs
124 ;; It would be nice to add GeoIP and gssapi once there are packages.
125 `(("libcap" ,libcap)
126 ("libxml2" ,libxml2)
127 ("openssl" ,openssl)
128 ("p11-kit" ,p11-kit)
129 ("python" ,python)
130 ("python-ply" ,python-ply)))
131 (native-inputs `(("perl" ,perl)
132 ("net-tools" ,net-tools)))
133 (arguments
134 `(#:configure-flags
135 (list (string-append "--with-openssl="
136 (assoc-ref %build-inputs "openssl"))
137 (string-append "--with-pkcs11="
138 (assoc-ref %build-inputs "p11-kit")))
139 #:phases
140 (modify-phases %standard-phases
141 (add-after 'strip 'move-to-utils
142 (lambda _
143 (for-each
144 (lambda (file)
145 (let ((target (string-append (assoc-ref %outputs "utils") file))
146 (src (string-append (assoc-ref %outputs "out") file)))
147 (mkdir-p (dirname target))
148 (link src target)
149 (delete-file src)))
150 '("/bin/dig" "/bin/delv" "/bin/nslookup" "/bin/host" "/bin/nsupdate"
151 "/share/man/man1/dig.1"
152 "/share/man/man1/host.1"
153 "/share/man/man1/nslookup.1"
154 "/share/man/man1/nsupdate.1"))
155 #t))
156 ;; When and if guix provides user namespaces for the build process,
157 ;; then the following can be uncommented and the subsequent "force-test"
158 ;; will not be necessary.
159 ;;
160 ;; (add-before 'check 'set-up-loopback
161 ;; (lambda _
162 ;; (system "bin/tests/system/ifconfig.sh up")))
163 (replace 'check
164 (lambda _
165 ;; XXX Even ‘make force-test’ tries to create network interfaces
166 ;; and fails. The only working target is the (trivial) fuzz test.
167 (with-directory-excursion "fuzz"
168 (invoke "make" "check"))
169 #t)))))
170 (synopsis "An implementation of the Domain Name System")
171 (description "BIND is an implementation of the @dfn{Domain Name System}
172 (DNS) protocols for the Internet. It is a reference implementation of those
173 protocols, but it is also production-grade software, suitable for use in
174 high-volume and high-reliability applications. The name BIND stands for
175 \"Berkeley Internet Name Domain\", because the software originated in the early
176 1980s at the University of California at Berkeley.")
177 (home-page "https://www.isc.org/downloads/bind")
178 (license (list license:mpl2.0))))
179
180 (define-public dnscrypt-proxy
181 (package
182 (name "dnscrypt-proxy")
183 (version "1.9.5")
184 (source (origin
185 (method url-fetch)
186 (uri (string-append
187 "https://download.dnscrypt.org/dnscrypt-proxy/"
188 "dnscrypt-proxy-" version ".tar.bz2"))
189 (sha256
190 (base32
191 "1dhvklr4dg2vlw108n11xbamacaryyg3dbrg629b76lp7685p7z8"))
192 (modules '((guix build utils)))
193 (snippet
194 ;; Delete bundled libltdl. XXX: This package also bundles
195 ;; a modified libevent that cannot currently be removed.
196 '(begin
197 (delete-file-recursively "libltdl")
198 #t))))
199 (build-system gnu-build-system)
200 (arguments
201 `(#:phases
202 (modify-phases %standard-phases
203 (add-after 'unpack 'autoreconf
204 (lambda _
205 ;; Re-generate build files due to unbundling ltdl.
206 ;; TODO: Prevent generating new libltdl and building it.
207 ;; The system version is still favored and referenced.
208 (invoke "autoreconf" "-vif"))))))
209 (native-inputs
210 `(("pkg-config" ,pkg-config)
211 ("automake" ,automake)
212 ("autoconf" ,autoconf)
213 ("libtool" ,libtool)))
214 (inputs
215 `(("libltdl" ,libltdl)
216 ("libsodium" ,libsodium)))
217 (home-page "https://www.dnscrypt.org/")
218 (synopsis "Securely send DNS requests to a remote server")
219 (description
220 "@command{dnscrypt-proxy} is a tool for securing communications
221 between a client and a DNS resolver. It verifies that responses you get
222 from a DNS provider was actually sent by that provider, and haven't been
223 tampered with. For optimal performance it is recommended to use this as
224 a forwarder for a caching DNS resolver such as @command{dnsmasq}, but it
225 can also be used as a normal DNS \"server\". A list of public dnscrypt
226 servers is included, and an up-to-date version is available at
227 @url{https://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-resolvers.csv}.")
228 (license (list license:isc
229 ;; Libevent and src/ext/queue.h is 3-clause BSD.
230 license:bsd-3))))
231
232 (define-public dnscrypt-wrapper
233 (package
234 (name "dnscrypt-wrapper")
235 (version "0.2.2")
236 (source (origin
237 (method url-fetch)
238 (uri (string-append
239 "https://github.com/cofyc/dnscrypt-wrapper/releases"
240 "/download/v" version "/" name "-v" version ".tar.bz2"))
241 (sha256
242 (base32
243 "1vhg4g0r687f51wcdn7z9w1hxapazx6vyh5rsr8wa48sljzd583g"))))
244 (build-system gnu-build-system)
245 (arguments
246 `(#:make-flags '("CC=gcc")
247 ;; TODO: Tests require ruby-cucumber and ruby-aruba.
248 #:tests? #f
249 #:phases
250 (modify-phases %standard-phases
251 (add-after 'unpack 'create-configure
252 (lambda _
253 (invoke "make" "configure"))))))
254 (native-inputs
255 `(("autoconf" ,autoconf)))
256 (inputs
257 `(("libevent" ,libevent)
258 ("libsodium" ,libsodium)))
259 (home-page "https://github.com/Cofyc/dnscrypt-wrapper")
260 (synopsis "Server-side dnscrypt proxy")
261 (description
262 "@command{dnscrypt-wrapper} is a tool to expose a name server over
263 the @code{dnscrypt} protocol. It can be used as an endpoint for the
264 @command{dnscrypt-proxy} client to securely tunnel DNS requests between
265 the two.")
266 (license (list license:isc
267 ;; Bundled argparse is MIT. TODO: package and unbundle.
268 license:expat
269 ;; dns-protocol.h and rfc1035.{c,h} is gpl2 or gpl3 (either).
270 license:gpl2
271 license:gpl3))))
272
273 (define-public libasr
274 (package
275 (name "libasr")
276 (version "201602131606")
277 (source
278 (origin
279 (method url-fetch)
280 (uri (string-append "https://www.opensmtpd.org/archives/"
281 name "-" version ".tar.gz"))
282 (sha256
283 (base32
284 "18kdmbjsxrfai16d66qslp48b1zf7gr8him2jj5dcqgbsl44ls75"))))
285 (build-system gnu-build-system)
286 (native-inputs
287 `(("autoconf" ,autoconf)
288 ("automake" ,automake)
289 ("pkg-config" ,pkg-config)
290 ("groff" ,groff)))
291 (home-page "https://www.opensmtpd.org")
292 (synopsis "Asynchronous resolver library by the OpenBSD project")
293 (description
294 "libasr is a free, simple and portable asynchronous resolver library.
295 It allows to run DNS queries and perform hostname resolutions in a fully
296 asynchronous fashion.")
297 (license (list license:isc
298 license:bsd-2 ; last part of getrrsetbyname_async.c
299 license:bsd-3
300 (license:non-copyleft "file://LICENSE") ; includes.h
301 license:openssl))))
302
303 (define-public nsd
304 (package
305 (name "nsd")
306 (version "4.2.2")
307 (source
308 (origin
309 (method url-fetch)
310 (uri (string-append "https://www.nlnetlabs.nl/downloads/nsd/nsd-"
311 version ".tar.gz"))
312 (sha256
313 (base32 "1ys608jyp5scc957q4brm094c97sxlwymina7d2nvzi51aa37cw3"))))
314 (build-system gnu-build-system)
315 (arguments
316 `(#:configure-flags
317 (list "--enable-pie" ; fully benefit from ASLR
318 "--enable-ratelimit"
319 "--enable-recvmmsg"
320 "--enable-relro-now" ; protect GOT and .dtor areas
321 "--disable-radix-tree"
322 (string-append "--with-libevent="
323 (assoc-ref %build-inputs "libevent"))
324 (string-append "--with-ssl="
325 (assoc-ref %build-inputs "openssl"))
326 "--with-configdir=/etc"
327 "--with-nsd_conf_file=/etc/nsd/nsd.conf"
328 "--with-logfile=/var/log/nsd.log"
329 "--with-pidfile=/var/db/nsd/nsd.pid"
330 "--with-dbfile=/var/db/nsd/nsd.db"
331 "--with-zonesdir=/etc/nsd"
332 "--with-xfrdfile=/var/db/nsd/xfrd.state"
333 "--with-zonelistfile=/var/db/nsd/zone.list")
334 #:phases
335 (modify-phases %standard-phases
336 (add-before 'configure 'patch-installation-paths
337 (lambda* (#:key outputs #:allow-other-keys)
338 (let* ((out (assoc-ref outputs "out"))
339 (doc (string-append out "/share/doc/" ,name "-" ,version)))
340 ;; The ‘make install’ target tries to create the parent
341 ;; directories of run-time things like ‘pidfile’ above, and
342 ;; useless empty directories like 'configdir'. Remove such
343 ;; '$(INSTALL)' lines and install the example configuration file
344 ;; in an appropriate location.
345 (substitute* "Makefile.in"
346 ((".*INSTALL.*\\$\\((config|pid|xfr|db)dir" command)
347 (string-append "#" command))
348 (("\\$\\(nsdconfigfile\\)\\.sample" file-name)
349 (string-append doc "/examples/" file-name)))
350 #t))))
351 #:tests? #f)) ; no tests
352 (inputs
353 `(("libevent" ,libevent)
354 ("openssl" ,openssl)))
355 (home-page "https://www.nlnetlabs.nl/projects/nsd/about/")
356 (synopsis "Authoritative DNS name server")
357 (description "@dfn{NSD}, short for Name Server Daemon, is an authoritative
358 name server for the Domain Name System (@dfn{DNS}). It aims to be a fast and
359 RFC-compliant nameserver.
360
361 NSD uses zone information compiled via @command{zonec} into a binary database
362 file (@file{nsd.db}). This allows fast startup of the name service daemon and
363 allows syntax-structural errors in zone files to be flagged at compile time,
364 before being made available to NSD service itself. However, most traditional
365 BIND-style zone files can be directly imported into NSD without modification.
366
367 The collection of programs and processes that make up NSD are designed so that
368 the daemon itself runs as a non-privileged user and can be easily configured to
369 run in a @code{chroot} jail, thus making any security flaws in NSD less likely
370 to result in system-wide compromise.")
371 (license (list license:bsd-3))))
372
373 (define-public unbound
374 (package
375 (name "unbound")
376 (version "1.9.3")
377 (source
378 (origin
379 (method url-fetch)
380 (uri (string-append "https://www.unbound.net/downloads/unbound-"
381 version ".tar.gz"))
382 (sha256
383 (base32 "1ykdy62sgzv33ggkmzwx2h0ifm7hyyxyfkb4zckv7gz4f28xsm8v"))))
384 (build-system gnu-build-system)
385 (outputs '("out" "python"))
386 (native-inputs
387 `(("flex" ,flex)
388 ("swig" ,swig)))
389 (inputs
390 `(("expat" ,expat)
391 ("libevent" ,libevent)
392 ("protobuf" ,protobuf)
393 ("python" ,python-3)
394 ("python-wrapper" ,python-wrapper)
395 ("openssl" ,openssl)))
396 (arguments
397 `(#:configure-flags
398 (list "--disable-static" ; save space and non-determinism in libunbound.a
399 (string-append
400 "--with-ssl=" (assoc-ref %build-inputs "openssl"))
401 (string-append
402 "--with-libevent=" (assoc-ref %build-inputs "libevent"))
403 (string-append
404 "--with-libexpat=" (assoc-ref %build-inputs "expat"))
405 "--with-pythonmodule" "--with-pyunbound")
406 #:phases
407 (modify-phases %standard-phases
408 (add-after 'configure 'fix-python-site-package-path
409 ;; Move python modules into their own output.
410 (lambda* (#:key outputs #:allow-other-keys)
411 (let ((pyout (assoc-ref outputs "python"))
412 (ver ,(version-major+minor (package-version python))))
413 (substitute* "Makefile"
414 (("^PYTHON_SITE_PKG=.*$")
415 (string-append
416 "PYTHON_SITE_PKG="
417 pyout "/lib/python-" ver "/site-packages\n"))))
418 #t))
419 (add-before 'check 'fix-missing-nss-for-tests
420 ;; Unfortunately, the package's unittests involve some checks
421 ;; looking up protocols and services which are not provided
422 ;; by the minimalistic build environment, in particular,
423 ;; /etc/protocols and /etc/services are missing.
424 ;; Also, after plain substitution of protocol and service names
425 ;; in the test data, the tests still fail because the
426 ;; corresponding Resource Records have been signed by
427 ;; RRSIG records.
428 ;; The following LD_PRELOAD library overwrites the glibc
429 ;; functions ‘get{proto,serv}byname’, ‘getprotobynumber’ and
430 ;; ‘getservbyport’ providing the few records required for the
431 ;; unit tests to pass.
432 (lambda* (#:key inputs outputs #:allow-other-keys)
433 (let* ((source (assoc-ref %build-inputs "source"))
434 (gcc (assoc-ref %build-inputs "gcc")))
435 (call-with-output-file "/tmp/nss_preload.c"
436 (lambda (port)
437 (display "#include <stdlib.h>
438 #include <string.h>
439 #include <strings.h>
440
441 #include <netdb.h>
442
443 struct protoent *getprotobyname(const char *name) {
444 struct protoent *p = malloc(sizeof(struct protoent));
445 p->p_aliases = malloc(sizeof(char*));
446 if (strcasecmp(name, \"tcp\") == 0) {
447 p->p_name = \"tcp\";
448 p->p_proto = 6;
449 p->p_aliases[0] = \"TCP\";
450 } else if (strcasecmp(name, \"udp\") == 0) {
451 p->p_name = \"udp\";
452 p->p_proto = 17;
453 p->p_aliases[0] = \"UDP\";
454 } else
455 p = NULL;
456 return p;
457 }
458
459 struct protoent *getprotobynumber(int proto) {
460 struct protoent *p = malloc(sizeof(struct protoent));
461 p->p_aliases = malloc(sizeof(char*));
462 switch(proto) {
463 case 6:
464 p->p_name = \"tcp\";
465 p->p_proto = 6;
466 p->p_aliases[0] = \"TCP\";
467 break;
468 case 17:
469 p->p_name = \"udp\";
470 p->p_proto = 17;
471 p->p_aliases[0] = \"UDP\";
472 break;
473 default:
474 p = NULL;
475 break;
476 }
477 return p;
478 }
479
480 struct servent *getservbyname(const char *name, const char *proto) {
481 struct servent *s = malloc(sizeof(struct servent));
482 char* buf = malloc((strlen(proto)+1)*sizeof(char));
483 strcpy(buf, proto);
484 s->s_aliases = malloc(sizeof(char*));
485 s->s_aliases[0] = NULL;
486 if (strcasecmp(name, \"domain\") == 0) {
487 s->s_name = \"domain\";
488 s->s_port = htons(53);
489 s->s_proto = buf;
490 } else
491 s = NULL;
492 return s;
493 }
494
495 struct servent *getservbyport(int port, const char *proto) {
496 char buf[32];
497 struct servent *s = malloc(sizeof(struct servent));
498 strcpy(buf, proto);
499 s->s_aliases = malloc(sizeof(char*));
500 s->s_aliases[0] = NULL;
501 switch(port) {
502 case 53:
503 s->s_name = \"domain\";
504 s->s_port = 53;
505 s->s_proto = \"udp\";
506 break;
507 default:
508 s = NULL;
509 break;
510 }
511 return s;
512 }" port)))
513 (invoke (string-append gcc "/bin/gcc")
514 "-shared" "-fPIC" "-o" "/tmp/nss_preload.so"
515 "/tmp/nss_preload.c")
516 ;; The preload library only affects the unittests.
517 (substitute* "Makefile"
518 (("./unittest")
519 "LD_PRELOAD=/tmp/nss_preload.so ./unittest")))
520 #t)))))
521 (home-page "https://www.unbound.net")
522 (synopsis "Validating, recursive, and caching DNS resolver")
523 (description
524 "Unbound is a recursive-only caching DNS server which can perform DNSSEC
525 validation of results. It implements only a minimal amount of authoritative
526 service to prevent leakage to the root nameservers: forward lookups for
527 localhost, reverse for @code{127.0.0.1} and @code{::1}, and NXDOMAIN for zones
528 served by AS112. Stub and forward zones are supported.")
529 (license license:bsd-4)))
530
531 (define-public yadifa
532 (package
533 (name "yadifa")
534 (version "2.3.9")
535 (source
536 (let ((build "8497"))
537 (origin
538 (method url-fetch)
539 (uri
540 (string-append "http://cdn.yadifa.eu/sites/default/files/releases/"
541 "yadifa-" version "-" build ".tar.gz"))
542 (sha256
543 (base32 "0xvyr91sfgzkpw6g3h893ldbwnki3w2472n56rr18w67qghs1sa5")))))
544 (build-system gnu-build-system)
545 (native-inputs
546 `(("which" ,which)))
547 (inputs
548 `(("openssl" ,openssl)))
549 (arguments
550 `(#:phases
551 (modify-phases %standard-phases
552 (add-before 'configure 'omit-example-configurations
553 (lambda _
554 (substitute* "Makefile.in"
555 ((" (etc|var)") ""))
556 #t)))
557 #:configure-flags
558 (list "--sysconfdir=/etc"
559 "--localstatedir=/var"
560 "--disable-build-timestamp" ; build reproducibly
561 "--enable-shared"
562 "--disable-static"
563 "--enable-acl"
564 "--enable-caching"
565 "--enable-ctrl" ; enable remote control
566 "--enable-nsec"
567 "--enable-nsec3"
568 "--enable-tsig")))
569 (home-page "http://www.yadifa.eu/")
570 (synopsis "Authoritative DNS name server")
571 (description "YADIFA is an authoritative name server for the @dfn{Domain
572 Name System} (DNS). It aims for both higher performance and a smaller memory
573 footprint than other implementations, while remaining fully RFC-compliant.
574 YADIFA supports dynamic record updates and the @dfn{Domain Name System Security
575 Extensions} (DNSSEC).")
576 (license license:bsd-3)))
577
578 (define-public knot
579 (package
580 (name "knot")
581 (version "2.8.2")
582 (source
583 (origin
584 (method url-fetch)
585 (uri (string-append "https://secure.nic.cz/files/knot-dns/"
586 "knot-" version ".tar.xz"))
587 (sha256
588 (base32 "0dx1lp4w33rpa54nns41k4vfdfin6naaskwh132r4qs0l9hl7lh0"))
589 (modules '((guix build utils)))
590 (snippet
591 '(begin
592 ;; Delete bundled libraries.
593 (with-directory-excursion "src/contrib"
594 (delete-file-recursively "lmdb"))
595 #t))))
596 (build-system gnu-build-system)
597 (native-inputs
598 `(("pkg-config" ,pkg-config)))
599 (inputs
600 `(("fstrm" ,fstrm)
601 ("gnutls" ,gnutls)
602 ("jansson" ,jansson)
603 ("libcap-ng" ,libcap-ng)
604 ("libedit" ,libedit)
605 ("libidn" ,libidn)
606 ("liburcu" ,liburcu)
607 ("lmdb" ,lmdb)
608 ("ncurses" ,ncurses)
609 ("protobuf-c" ,protobuf-c)))
610 (arguments
611 `(#:phases
612 (modify-phases %standard-phases
613 (add-before 'configure 'disable-directory-pre-creation
614 (lambda _
615 ;; Don't install empty directories like ‘/etc’ outside the store.
616 ;; This is needed even when using ‘make config_dir=... install’.
617 (substitute* "src/Makefile.in" (("\\$\\(INSTALL\\) -d") "true"))
618 #t))
619 (replace 'install
620 (lambda* (#:key outputs #:allow-other-keys)
621 (let* ((out (assoc-ref outputs "out"))
622 (doc (string-append out "/share/doc/" ,name "-" ,version))
623 (etc (string-append doc "/examples/etc")))
624 (invoke "make"
625 (string-append "config_dir=" etc)
626 "install")))))
627 #:configure-flags
628 (list "--sysconfdir=/etc"
629 "--localstatedir=/var"
630 "--enable-dnstap" ; let tools read/write capture files
631 "--with-module-dnstap=yes" ; detailed query capturing & logging
632 (string-append "--with-bash-completions="
633 (assoc-ref %outputs "out")
634 "/etc/bash_completion.d"))))
635 (home-page "https://www.knot-dns.cz/")
636 (synopsis "Authoritative DNS name server")
637 (description "Knot DNS is an authoritative name server for the @dfn{Domain
638 Name System} (DNS), designed to meet the needs of root and @dfn{top-level
639 domain} (TLD) name servers. It is implemented as a threaded daemon and uses a
640 number of programming techniques to improve speed. For example, the responder
641 is completely lock-free, resulting in a very high response rate. Other features
642 include automatic @dfn{DNS Security Extensions} (DNSSEC) signing, dynamic record
643 synthesis, and on-the-fly re-configuration.")
644 (license
645 (list
646 ;; src/contrib/{hat-trie,murmurhash3,openbsd},
647 ;; src/dnssec/contrib/vpool.[ch], and parts of libtap/ are ‘MIT’ (expat).
648 license:expat
649 license:lgpl2.0+ ; parts of scr/contrib/ucw
650 license:public-domain ; src/contrib/fnv and possibly murmurhash3
651 license:gpl3+)))) ; everything else
652
653 (define-public ddclient
654 (package
655 (name "ddclient")
656 (version "3.9.0")
657 (source (origin
658 (method url-fetch)
659 (uri (string-append "mirror://sourceforge/ddclient/ddclient/ddclient-"
660 version "/ddclient-" version ".tar.gz"))
661 (sha256
662 (base32
663 "0fwyhab8yga2yi1kdfkbqxa83wxhwpagmj1w1mwkg2iffh1fjjlw"))))
664 (build-system trivial-build-system) ; no Makefile.PL
665 (native-inputs
666 `(("bash" ,bash)
667 ("gzip" ,gzip)
668 ("perl" ,perl)
669 ("tar" ,tar)))
670 (inputs
671 `(("inetutils" ,inetutils) ; logger
672 ("net-tools" ,net-tools)
673 ("perl-data-validate-ip" ,perl-data-validate-ip)
674 ("perl-digest-sha1" ,perl-digest-sha1)
675 ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
676 (arguments
677 `(#:modules ((guix build utils)
678 (ice-9 match)
679 (srfi srfi-26))
680 #:builder
681 (begin
682 (use-modules (guix build utils)
683 (ice-9 match)
684 (srfi srfi-26))
685 ;; bootstrap
686 (setenv "PATH" (string-append
687 (assoc-ref %build-inputs "bash") "/bin" ":"
688 (assoc-ref %build-inputs "tar") "/bin" ":"
689 (assoc-ref %build-inputs "gzip") "/bin" ":"
690 (assoc-ref %build-inputs "perl") "/bin"))
691 ;; extract source
692 (invoke "tar" "xvf" (assoc-ref %build-inputs "source"))
693 ;; package
694 (with-directory-excursion (string-append ,name "-" ,version)
695 (let* ((out (assoc-ref %outputs "out"))
696 (bin (string-append out "/bin")))
697 (let ((file "ddclient"))
698 (substitute* file
699 (("/usr/bin/perl") (which "perl"))
700 ;; Strictly use ‘/etc/ddclient/ddclient.conf’.
701 (("\\$\\{program\\}\\.conf") "/etc/ddclient/ddclient.conf")
702 (("\\$etc\\$program.conf") "/etc/ddclient/ddclient.conf")
703 ;; Strictly use ‘/var/cache/ddclient/ddclient.cache’
704 (("\\$cachedir\\$program\\.cache")
705 "/var/cache/ddclient/ddclient.cache"))
706 (install-file file bin)
707 (wrap-program (string-append bin "/" file)
708 `("PATH" ":" =
709 ("$PATH"
710 ,@(map (lambda (input)
711 (match input
712 ((name . store)
713 (string-append store "/bin"))))
714 %build-inputs)))
715 `("PERL5LIB" ":" =
716 ,(delete
717 ""
718 (map (match-lambda
719 (((? (cut string-prefix? "perl-" <>) name) . dir)
720 (string-append dir "/lib/perl5/site_perl"))
721 (_ ""))
722 %build-inputs)))))
723 (for-each (cut install-file <> (string-append out
724 "/share/ddclient"))
725 (find-files "." "sample.*$")))))))
726 (home-page "https://sourceforge.net/projects/ddclient/")
727 (synopsis "Address updating utility for dynamic DNS services")
728 (description "This package provides a client to update dynamic IP
729 addresses with several dynamic DNS service providers, such as
730 @uref{https://www.dyndns.com/account/login.html,DynDNS.com}.
731
732 This makes it possible to use a fixed hostname (such as myhost.dyndns.org) to
733 access a machine with a dynamic IP address.
734
735 The client supports both dynamic and (near) static services, as well as MX
736 record and alternative name management. It caches the address, and only
737 attempts the update when it has changed.")
738 (license license:gpl2+)))
739
740 (define-public hnsd
741 ;; There have been no releases yet, hence this commit.
742 (let ((revision "0")
743 (commit "895d89c25d316d18df9d374fe78aae3902bc89fb"))
744 (package
745 (name "hnsd")
746 (version (git-version "0.0" revision commit))
747 (source (origin
748 (method git-fetch)
749 (uri (git-reference
750 (url "https://github.com/handshake-org/hnsd")
751 (commit commit)))
752 (sha256
753 (base32
754 "0704y73sddn24jga9csw4gxyfb3pnrfnk0vdcph84n1h38490l16"))
755 (file-name (git-file-name name version))
756 (modules '((guix build utils)))
757 (snippet
758 '(begin
759 ;; Delete the bundled copy of libuv.
760 (delete-file-recursively "uv")
761 (substitute* "configure.ac"
762 (("AC_CONFIG_SUBDIRS\\(\\[uv\\]\\)") ""))
763 (substitute* "Makefile.am"
764 (("SUBDIRS = uv") "\n")
765 (("\\$\\(top_builddir\\)/uv/libuv.la") "-luv")
766
767 ;; Make sure the 'hnsd' binary is installed and
768 ;; dynamically-linked.
769 (("noinst_PROGRAMS") "bin_PROGRAMS")
770 (("hnsd_LDFLAGS = -static") ""))
771
772 ;; This script tries to chdir to "uv" and doesn't do more
773 ;; than "autoreconf" so remove it.
774 (delete-file "autogen.sh")
775 #t))))
776 (build-system gnu-build-system)
777 (arguments
778 '(#:configure-flags '("--disable-static"))) ;no need for libhsk.a
779 (native-inputs
780 `(("autoconf" ,autoconf)
781 ("automake" ,automake)
782 ("libtool" ,libtool)))
783 (inputs
784 `(("unbound" ,unbound)
785 ("libuv" ,libuv)))
786 (home-page "https://www.handshake.org/")
787 (synopsis "Resolver daemon for the Handshake naming protocol")
788 (description
789 "@command{hnsd} is a @dfn{host name resolver} for the Handshake Naming
790 System (HNS) peer-to-peer network.")
791 (license license:expat))))
792
793 (define-public libmicrodns
794 (package
795 (name "libmicrodns")
796 (version "0.0.10")
797 (source (origin
798 (method git-fetch)
799 (uri (git-reference
800 (url "https://github.com/videolabs/libmicrodns")
801 (commit version)))
802 (file-name (git-file-name name version))
803 (sha256
804 (base32
805 "1xvl9k49ng35wbsqmnjnyqvkyjf8dcq2ywsq3jp3wh0rgmxhq2fh"))))
806 (build-system gnu-build-system)
807 (native-inputs
808 `(("pkg-config" ,pkg-config)
809 ("autoconf" ,autoconf)
810 ("automake" ,automake)
811 ("libtool" ,libtool)))
812 (home-page "https://github.com/videolabs/libmicrodns")
813 (synopsis "Minimal mDNS resolver library")
814 (description "@code{libmicrodns} provides a minimal implementation of a
815 mDNS resolver as well as an announcer. mDNS (Multicast Domain Name System) is
816 a zero-config service that allows one to resolve host names to IP addresses in
817 local networks.")
818 (license license:lgpl2.1)))
819
820 (define-public public-suffix-list
821 ;; Mozilla releases the official list here:
822 ;;
823 ;; https://publicsuffix.org/list/public_suffix_list.dat
824 ;;
825 ;; However, Mozilla syncs that file from the GitHub repository periodically,
826 ;; so its contents will change over time. If you update this commit, please
827 ;; make sure that the new commit refers to a list which is identical to the
828 ;; officially published list available from the URL above.
829 (let ((commit "9375b697baddb0827a5995c81bd3c75877a0b35d"))
830 (package
831 (name "public-suffix-list")
832 (version (git-version "0" "1" commit))
833 (source (origin
834 (method git-fetch)
835 (uri (git-reference
836 (url "https://github.com/publicsuffix/list.git")
837 (commit commit)))
838 (file-name (git-file-name name version))
839 (sha256
840 (base32
841 "1sm7pni01rnl4ldzi8z8nc4cbgq8nxda9gwc68v0s3ij7jd1jmik"))))
842 (build-system trivial-build-system)
843 (arguments
844 `(#:modules ((guix build utils))
845 #:builder
846 (begin
847 (use-modules (guix build utils))
848 (let* ((out (assoc-ref %outputs "out"))
849 ;; Install to /share because that is where "read-only
850 ;; architecture-independent data files" should go (see:
851 ;; (standards) Directory Variables). Include the version in
852 ;; the directory name so that if multiple versions are ever
853 ;; installed in the same profile, they will not conflict.
854 (destination (string-append
855 out "/share/public-suffix-list-" ,version))
856 (source (assoc-ref %build-inputs "source")))
857 (with-directory-excursion source
858 (install-file "public_suffix_list.dat" destination)
859 (install-file "LICENSE" destination))
860 #t))))
861 (home-page "https://publicsuffix.org/")
862 (synopsis "Database of current and historical DNS suffixes")
863 (description "This is the Public Suffix List maintained by Mozilla. A
864 \"public suffix\" is one under which Internet users can (or historically
865 could) directly register names in the Domain Name System (DNS). Some examples
866 of public suffixes are .com, .co.uk and pvt.k12.ma.us. This is a list of all
867 known public suffixes.")
868 (license license:mpl2.0))))