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