gnu: bind: Update to 9.16.6 [multiple CVE fixes].
[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 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>
20 ;;;
21 ;;; This file is part of GNU Guix.
22 ;;;
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.
27 ;;;
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.
32 ;;;
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/>.
35
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 certs)
42 #:use-module (gnu packages check)
43 #:use-module (gnu packages databases)
44 #:use-module (gnu packages documentation)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages crypto)
47 #:use-module (gnu packages datastructures)
48 #:use-module (gnu packages flex)
49 #:use-module (gnu packages freedesktop)
50 #:use-module (gnu packages gcc)
51 #:use-module (gnu packages glib)
52 #:use-module (gnu packages groff)
53 #:use-module (gnu packages groff)
54 #:use-module (gnu packages gtk)
55 #:use-module (gnu packages libedit)
56 #:use-module (gnu packages libevent)
57 #:use-module (gnu packages libidn)
58 #:use-module (gnu packages linux)
59 #:use-module (gnu packages lua)
60 #:use-module (gnu packages ncurses)
61 #:use-module (gnu packages nettle)
62 #:use-module (gnu packages networking)
63 #:use-module (gnu packages perl)
64 #:use-module (gnu packages pkg-config)
65 #:use-module (gnu packages protobuf)
66 #:use-module (gnu packages python)
67 #:use-module (gnu packages python-xyz)
68 #:use-module (gnu packages shells)
69 #:use-module (gnu packages sphinx)
70 #:use-module (gnu packages swig)
71 #:use-module (gnu packages tls)
72 #:use-module (gnu packages web)
73 #:use-module (gnu packages xml)
74 #:use-module (gnu packages)
75 #:use-module ((guix licenses) #:prefix license:)
76 #:use-module (guix packages)
77 #:use-module (guix download)
78 #:use-module (guix git-download)
79 #:use-module (guix utils)
80 #:use-module (guix build-system glib-or-gtk)
81 #:use-module (guix build-system gnu)
82 #:use-module (guix build-system meson)
83 #:use-module (guix build-system trivial))
84
85 (define-public ldns
86 (package
87 (name "ldns")
88 (version "1.7.1")
89 (source
90 (origin
91 (method url-fetch)
92 (uri
93 (string-append "https://www.nlnetlabs.nl/downloads/"
94 name "/" name "-" version ".tar.gz"))
95 (sha256
96 (base32 "0ac242n7996fswq1a3nlh1bbbhrsdwsq4mx7xq8ffq6aplb4rj4a"))
97 (patches
98 (search-patches
99 ;; To create make-flag vairables,
100 ;; for splitting installation of drill and examples.
101 "ldns-drill-examples.patch"))))
102 (build-system gnu-build-system)
103 (outputs '("out" "drill" "examples" "pyldns"))
104 (arguments
105 `( ;; Tests require Tpkg.
106 ;; https://tpkg.github.io/
107 #:tests? #f
108 #:configure-flags
109 (list
110 "--disable-static"
111 "--enable-gost-anyway"
112 "--enable-rrtype-ninfo"
113 "--enable-rrtype-rkey"
114 "--enable-rrtype-ta"
115 "--enable-rrtype-avc"
116 "--enable-rrtype-doa"
117 "--enable-rrtype-amtrelay"
118 "--with-drill"
119 "--with-examples"
120 "--with-pyldns"
121 ;; Perl module DNS::LDNS not available.
122 ;; https://github.com/erikoest/DNS-LDNS.git
123 ;; "--with-p5-dns-ldns"
124 (string-append "--with-ssl="
125 (assoc-ref %build-inputs "openssl"))
126 (string-append "--with-ca-path="
127 (assoc-ref %build-inputs "nss-certs")
128 "/etc/ssl/certs"))
129 #:make-flags
130 (list
131 (string-append "drillbindir="
132 (assoc-ref %outputs "drill")
133 "/bin")
134 (string-append "drillmandir="
135 (assoc-ref %outputs "drill")
136 "/share/man")
137 (string-append "examplesbindir="
138 (assoc-ref %outputs "examples")
139 "/bin")
140 (string-append "examplesmandir="
141 (assoc-ref %outputs "examples")
142 "/share/man")
143 (string-append "python_site="
144 (assoc-ref %outputs "pyldns")
145 "/lib/python"
146 ,(version-major+minor
147 (package-version python))
148 "/site-packages"))))
149 (native-inputs
150 `(("doxygen" ,doxygen)
151 ("ksh" ,oksh)
152 ("perl" ,perl)
153 ("perl-devel-checklib" ,perl-devel-checklib)
154 ("pkg-config" ,pkg-config)
155 ("python" ,python-wrapper)
156 ("swig" ,swig)))
157 (inputs
158 `(("libpcap" ,libpcap)
159 ("nss-certs" ,nss-certs)
160 ("openssl" ,openssl)))
161 (synopsis "DNS library that facilitates DNS tool programming")
162 (description "LDNS aims to simplify DNS programming, it supports recent
163 RFCs like the DNSSEC documents, and allows developers to easily create
164 software conforming to current RFCs, and experimental software for current
165 Internet Drafts. A secondary benefit of using ldns is speed; ldns is written in
166 C it should be a lot faster than Perl.")
167 (home-page "https://nlnetlabs.nl/projects/ldns/about/")
168 (license license:bsd-3)))
169
170 (define-public dnssec-trigger
171 (package
172 (name "dnssec-trigger")
173 (version "0.17")
174 (source
175 (origin
176 (method url-fetch)
177 (uri
178 (string-append "https://www.nlnetlabs.nl/downloads/"
179 name "/" name "-" version ".tar.gz"))
180 (sha256
181 (base32 "10928q406x9r66a090xl5kznzgyxpja88w4srwcv454hd351j9f0"))))
182 (build-system glib-or-gtk-build-system)
183 (outputs '("out" "gui" "nm"))
184 (arguments
185 `(#:test-target "test"
186 #:configure-flags
187 (list
188 (string-append "--with-ssl="
189 (assoc-ref %build-inputs "openssl"))
190 "--with-hooks=networkmanager"
191 (string-append "--with-networkmanager-dispatch="
192 (assoc-ref %outputs "nm")
193 "/etc/NetworkManager/dispatcher.d")
194 (string-append "--with-xdg-autostart="
195 (assoc-ref %outputs "gui")
196 "/etc/xdg/autostart")
197 (string-append "--with-uidir="
198 (assoc-ref %outputs "gui")
199 "/share/dnssec-trigger")
200 (string-append "--with-python="
201 (assoc-ref %build-inputs "python")
202 "/bin/python")
203 (string-append "--with-unbound-control="
204 (assoc-ref %build-inputs "unbound")
205 "/sbin/unbound-control")
206 "--with-forward-zones-support")
207 #:phases
208 (modify-phases %standard-phases
209 (add-after 'unpack 'patch-configure
210 (lambda _
211 (substitute* "configure"
212 (("appindicator-0.1")
213 "appindicator3-0.1"))
214 #t))
215 (add-before 'configure 'patch-makefile
216 (lambda _
217 (substitute* "Makefile.in"
218 (("/usr")
219 "$(prefix)")
220 (("/etc")
221 "$(prefix)/etc")
222 ((".*gtk-update-icon-cache.*")
223 ""))
224 #t))
225 (add-after 'install 'remove-systemd
226 (lambda* (#:key outputs #:allow-other-keys)
227 (let* ((out (assoc-ref outputs "out")))
228 (delete-file-recursively
229 (string-append out "/lib/systemd"))
230 #t)))
231 (add-after 'remove-systemd 'move-gui
232 (lambda* (#:key outputs #:allow-other-keys)
233 (let* ((out (assoc-ref outputs "out"))
234 (gui (assoc-ref outputs "gui")))
235 (mkdir-p (string-append gui "/bin"))
236 (mkdir-p (string-append gui "/share"))
237 (rename-file
238 (string-append out "/bin")
239 (string-append gui "/bin"))
240 (rename-file
241 (string-append out "/share/icons")
242 (string-append gui "/share/icons"))
243 #t)))
244 (add-after 'move-gui 'move-nm
245 (lambda* (#:key outputs #:allow-other-keys)
246 (let* ((out (assoc-ref outputs "out"))
247 (nm (assoc-ref outputs "nm")))
248 (mkdir-p (string-append nm "/libexec"))
249 (rename-file
250 (string-append out "/libexec")
251 (string-append nm "/libexec"))
252 #t))))))
253 (native-inputs
254 `(("cmocka" ,cmocka)
255 ("pkg-config" ,pkg-config)
256 ("python" ,python-wrapper)))
257 (inputs
258 `(("gtk+-2" ,gtk+-2)
259 ("ldns" ,ldns)
260 ("libappindicator" ,libappindicator)
261 ("openssl" ,openssl)
262 ("unbound" ,unbound)))
263 (synopsis "DNSSEC protection for the DNS traffic")
264 (description "DNSSEC-Trigger enables your computer to use DNSSEC protection
265 for the DNS traffic. It relies on the Unbound DNS resolver running locally on
266 your system, which performs DNSSEC validation. It reconfigures Unbound in such
267 a way that it will signal it to to use the DHCP obtained forwarders if possible,
268 fallback to doing its own AUTH queries if that fails, and if that fails it will
269 prompt the user with the option to go with insecure DNS only.")
270 (home-page "https://www.nlnetlabs.nl/projects/dnssec-trigger/about/")
271 (license license:bsd-3)))
272
273 (define-public dnsmasq
274 (package
275 (name "dnsmasq")
276 (version "2.82")
277 (source (origin
278 (method url-fetch)
279 (uri (string-append
280 "http://www.thekelleys.org.uk/dnsmasq/dnsmasq-"
281 version ".tar.xz"))
282 (sha256
283 (base32
284 "0cn1xd1s6xs78jmrmwjnh9m6w3q38pk6dyqy2phvasqiyd33cll4"))))
285 (build-system gnu-build-system)
286 (native-inputs
287 `(("pkg-config" ,pkg-config)))
288 (inputs
289 `(("dbus" ,dbus)))
290 (arguments
291 `(#:phases
292 (modify-phases %standard-phases (delete 'configure))
293 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
294 "CC=gcc"
295 "COPTS=\"-DHAVE_DBUS\"")
296 #:tests? #f)) ; no ‘check’ target
297 (home-page "http://www.thekelleys.org.uk/dnsmasq/doc.html")
298 (synopsis "Small caching DNS proxy and DHCP/TFTP server")
299 (description
300 "Dnsmasq is a light-weight DNS forwarder and DHCP server. It is designed
301 to provide DNS and, optionally, DHCP to a small network. It can serve the
302 names of local machines which are not in the global DNS. The DHCP server
303 integrates with the DNS server and allows machines with DHCP-allocated
304 addresses to appear in the DNS with names configured either on each host or in
305 a central configuration file. Dnsmasq supports static and dynamic DHCP leases
306 and BOOTP/TFTP for network booting of diskless machines.")
307 ;; Source files only say GPL2 and GPL3 are allowed.
308 (license (list license:gpl2 license:gpl3))))
309
310 ;; 'bind' is the name of a built-in Guile procedure, which is why we choose a
311 ;; different name here.
312 (define-public isc-bind
313 (package
314 (name "bind")
315 (version "9.16.6")
316 (source (origin
317 (method url-fetch)
318 (uri (string-append
319 "https://ftp.isc.org/isc/bind9/" version
320 "/bind-" version ".tar.xz"))
321 (sha256
322 (base32
323 "1jvi6ms51vyrhpflx05xlb7gblyd59zsyj28b8s3pl3xnkrv0rxm"))))
324 (build-system gnu-build-system)
325 (outputs `("out" "utils"))
326 (inputs
327 ;; It would be nice to add GeoIP and gssapi once there are packages.
328 `(("libcap" ,libcap)
329 ("libuv" ,libuv)
330 ("libxml2" ,libxml2)
331 ("openssl" ,openssl)
332 ("p11-kit" ,p11-kit)
333 ("python" ,python)
334 ("python-ply" ,python-ply)))
335 (native-inputs
336 `(("perl" ,perl)
337 ("pkg-config" ,pkg-config)))
338 (arguments
339 `(#:configure-flags
340 (list (string-append "--with-pkcs11="
341 (assoc-ref %build-inputs "p11-kit")))
342 #:phases
343 (modify-phases %standard-phases
344 (add-after 'strip 'move-to-utils
345 (lambda _
346 (for-each
347 (lambda (file)
348 (let ((target (string-append (assoc-ref %outputs "utils") file))
349 (src (string-append (assoc-ref %outputs "out") file)))
350 (mkdir-p (dirname target))
351 (link src target)
352 (delete-file src)))
353 '("/bin/dig" "/bin/delv" "/bin/nslookup" "/bin/host" "/bin/nsupdate"
354 "/share/man/man1/dig.1"
355 "/share/man/man1/host.1"
356 "/share/man/man1/nslookup.1"
357 "/share/man/man1/nsupdate.1"))
358 #t))
359 ;; When and if guix provides user namespaces for the build process,
360 ;; then the following can be uncommented and the subsequent "force-test"
361 ;; will not be necessary.
362 ;;
363 ;; (add-before 'check 'set-up-loopback
364 ;; (lambda _
365 ;; (system "bin/tests/system/ifconfig.sh up")))
366 (replace 'check
367 (lambda _
368 ;; XXX Even ‘make force-test’ tries to create network interfaces
369 ;; and fails. The only working target is the (trivial) fuzz test.
370 (with-directory-excursion "fuzz"
371 (invoke "make" "check"))
372 #t)))))
373 (synopsis "Domain Name System (DNS) implementation")
374 (description "BIND is an implementation of the @dfn{Domain Name System}
375 (DNS) protocols for the Internet. It is a reference implementation of those
376 protocols, but it is also production-grade software, suitable for use in
377 high-volume and high-reliability applications. The name BIND stands for
378 \"Berkeley Internet Name Domain\", because the software originated in the
379 early 1980s at the University of California at Berkeley. The @code{utils}
380 output of this package contains the following DNS name servers related command
381 line utilities:
382 @table @code
383 @item delv
384 DNS lookup and validation utility
385 @item dig
386 DNS lookup utility
387 @item host
388 DNS lookup utility
389 @item nslookup
390 Internet name servers interactive query utility
391 @item nsupdate
392 Dynamic DNS update utility
393 @end table")
394 (home-page "https://www.isc.org/bind/")
395 (license (list license:mpl2.0))))
396
397 (define-public dnscrypt-proxy
398 (package
399 (name "dnscrypt-proxy")
400 (version "1.9.5")
401 (source (origin
402 (method url-fetch)
403 (uri (string-append
404 "https://download.dnscrypt.org/dnscrypt-proxy/"
405 "dnscrypt-proxy-" version ".tar.bz2"))
406 (sha256
407 (base32
408 "1dhvklr4dg2vlw108n11xbamacaryyg3dbrg629b76lp7685p7z8"))
409 (modules '((guix build utils)))
410 (snippet
411 ;; Delete bundled libltdl. XXX: This package also bundles
412 ;; a modified libevent that cannot currently be removed.
413 '(begin
414 (delete-file-recursively "libltdl")
415 #t))))
416 (build-system gnu-build-system)
417 (arguments
418 `(#:phases
419 (modify-phases %standard-phases
420 (add-after 'unpack 'autoreconf
421 (lambda _
422 ;; Re-generate build files due to unbundling ltdl.
423 ;; TODO: Prevent generating new libltdl and building it.
424 ;; The system version is still favored and referenced.
425 (invoke "autoreconf" "-vif"))))))
426 (native-inputs
427 `(("pkg-config" ,pkg-config)
428 ("automake" ,automake)
429 ("autoconf" ,autoconf)
430 ("libtool" ,libtool)))
431 (inputs
432 `(("libltdl" ,libltdl)
433 ("libsodium" ,libsodium)))
434 (home-page "https://www.dnscrypt.org/")
435 (synopsis "Securely send DNS requests to a remote server")
436 (description
437 "@command{dnscrypt-proxy} is a tool for securing communications
438 between a client and a DNS resolver. It verifies that responses you get
439 from a DNS provider was actually sent by that provider, and haven't been
440 tampered with. For optimal performance it is recommended to use this as
441 a forwarder for a caching DNS resolver such as @command{dnsmasq}, but it
442 can also be used as a normal DNS \"server\". A list of public dnscrypt
443 servers is included, and an up-to-date version is available at
444 @url{https://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-resolvers.csv}.")
445 (license (list license:isc
446 ;; Libevent and src/ext/queue.h is 3-clause BSD.
447 license:bsd-3))))
448
449 (define-public dnscrypt-wrapper
450 (package
451 (name "dnscrypt-wrapper")
452 (version "0.2.2")
453 (source (origin
454 (method url-fetch)
455 (uri (string-append
456 "https://github.com/cofyc/dnscrypt-wrapper/releases"
457 "/download/v" version "/" name "-v" version ".tar.bz2"))
458 (sha256
459 (base32
460 "1vhg4g0r687f51wcdn7z9w1hxapazx6vyh5rsr8wa48sljzd583g"))))
461 (build-system gnu-build-system)
462 (arguments
463 `(#:make-flags '("CC=gcc")
464 ;; TODO: Tests require ruby-cucumber and ruby-aruba.
465 #:tests? #f
466 #:phases
467 (modify-phases %standard-phases
468 (add-after 'unpack 'create-configure
469 (lambda _
470 (invoke "make" "configure"))))))
471 (native-inputs
472 `(("autoconf" ,autoconf)))
473 (inputs
474 `(("libevent" ,libevent)
475 ("libsodium" ,libsodium)))
476 (home-page "https://github.com/Cofyc/dnscrypt-wrapper")
477 (synopsis "Server-side dnscrypt proxy")
478 (description
479 "@command{dnscrypt-wrapper} is a tool to expose a name server over
480 the @code{dnscrypt} protocol. It can be used as an endpoint for the
481 @command{dnscrypt-proxy} client to securely tunnel DNS requests between
482 the two.")
483 (license (list license:isc
484 ;; Bundled argparse is MIT. TODO: package and unbundle.
485 license:expat
486 ;; dns-protocol.h and rfc1035.{c,h} is gpl2 or gpl3 (either).
487 license:gpl2
488 license:gpl3))))
489
490 (define-public libasr
491 (package
492 (name "libasr")
493 (version "1.0.4")
494 (source
495 (origin
496 (method url-fetch)
497 (uri (string-append "https://www.opensmtpd.org/archives/"
498 "libasr-" version ".tar.gz"))
499 (sha256
500 (base32 "1d6s8njqhvayx2gp47409sp1fn8m608ws26hr1srfp6i23nnpyqr"))))
501 (build-system gnu-build-system)
502 (arguments
503 `(#:phases
504 (modify-phases %standard-phases
505 (add-after 'install 'install-documentation
506 (lambda* (#:key outputs #:allow-other-keys)
507 (let ((out (assoc-ref outputs "out")))
508 (install-file "src/asr_run.3"
509 (string-append out "/share/man/man3"))
510 #t))))))
511 (native-inputs
512 `(("autoconf" ,autoconf)
513 ("automake" ,automake)
514 ("libtool" ,libtool)
515 ("pkg-config" ,pkg-config)))
516 (home-page "https://www.opensmtpd.org")
517 (synopsis "Asynchronous resolver library by the OpenBSD project")
518 (description
519 "libasr is a free, simple and portable asynchronous resolver library.
520 It runs DNS queries and performs hostname resolution in a fully
521 asynchronous fashion.")
522 (license (list license:isc
523 license:bsd-2 ; last part of getrrsetbyname_async.c
524 license:bsd-3
525 (license:non-copyleft "file://LICENSE") ; includes.h
526 license:openssl))))
527
528 (define-public nsd
529 (package
530 (name "nsd")
531 (version "4.3.2")
532 (source
533 (origin
534 (method url-fetch)
535 (uri (string-append "https://www.nlnetlabs.nl/downloads/nsd/nsd-"
536 version ".tar.gz"))
537 (sha256
538 (base32 "0ac3mbn5z4nc18782m9aswdpi2m9f4665vidw0ciyigdh0pywp2v"))))
539 (build-system gnu-build-system)
540 (arguments
541 `(#:configure-flags
542 (list "--enable-pie" ; fully benefit from ASLR
543 "--enable-ratelimit"
544 "--enable-recvmmsg"
545 "--enable-relro-now" ; protect GOT and .dtor areas
546 "--disable-radix-tree"
547 (string-append "--with-libevent="
548 (assoc-ref %build-inputs "libevent"))
549 (string-append "--with-ssl="
550 (assoc-ref %build-inputs "openssl"))
551 "--with-configdir=/etc"
552 "--with-nsd_conf_file=/etc/nsd/nsd.conf"
553 "--with-logfile=/var/log/nsd.log"
554 "--with-pidfile=/var/db/nsd/nsd.pid"
555 "--with-dbfile=/var/db/nsd/nsd.db"
556 "--with-zonesdir=/etc/nsd"
557 "--with-xfrdfile=/var/db/nsd/xfrd.state"
558 "--with-zonelistfile=/var/db/nsd/zone.list")
559 #:phases
560 (modify-phases %standard-phases
561 (add-before 'configure 'patch-installation-paths
562 (lambda* (#:key outputs #:allow-other-keys)
563 (let* ((out (assoc-ref outputs "out"))
564 (doc (string-append out "/share/doc/" ,name "-" ,version)))
565 ;; The ‘make install’ target tries to create the parent
566 ;; directories of run-time things like ‘pidfile’ above, and
567 ;; useless empty directories like 'configdir'. Remove such
568 ;; '$(INSTALL)' lines and install the example configuration file
569 ;; in an appropriate location.
570 (substitute* "Makefile.in"
571 ((".*INSTALL.*\\$\\((config|pid|xfr|db)dir" command)
572 (string-append "#" command))
573 (("\\$\\(nsdconfigfile\\)\\.sample" file-name)
574 (string-append doc "/examples/" file-name)))
575 #t))))
576 #:tests? #f)) ; no tests
577 (inputs
578 `(("libevent" ,libevent)
579 ("openssl" ,openssl)))
580 (home-page "https://www.nlnetlabs.nl/projects/nsd/about/")
581 (synopsis "Authoritative DNS name server")
582 (description "@dfn{NSD}, short for Name Server Daemon, is an authoritative
583 name server for the Domain Name System (@dfn{DNS}). It aims to be a fast and
584 RFC-compliant nameserver.
585
586 NSD uses zone information compiled via @command{zonec} into a binary database
587 file (@file{nsd.db}). This allows fast startup of the name service daemon and
588 allows syntax-structural errors in zone files to be flagged at compile time,
589 before being made available to NSD service itself. However, most traditional
590 BIND-style zone files can be directly imported into NSD without modification.
591
592 The collection of programs and processes that make up NSD are designed so that
593 the daemon itself runs as a non-privileged user and can be easily configured to
594 run in a @code{chroot} jail, thus making any security flaws in NSD less likely
595 to result in system-wide compromise.")
596 (license (list license:bsd-3))))
597
598 (define-public unbound
599 (package
600 (name "unbound")
601 (version "1.10.1")
602 (source
603 (origin
604 (method url-fetch)
605 (uri (string-append "https://www.unbound.net/downloads/unbound-"
606 version ".tar.gz"))
607 (sha256
608 (base32 "0dnmh9jjh2v274f0hl31bgv40pl77mmfgky8bkqr5kvi3b17fdmp"))))
609 (build-system gnu-build-system)
610 (outputs '("out" "python"))
611 (native-inputs
612 `(("flex" ,flex)
613 ("swig" ,swig)))
614 (inputs
615 `(("expat" ,expat)
616 ("libevent" ,libevent)
617 ("protobuf" ,protobuf)
618 ("python-wrapper" ,python-wrapper)
619 ("openssl" ,openssl)))
620 (arguments
621 `(#:configure-flags
622 (list "--disable-static" ; save space and non-determinism in libunbound.a
623 (string-append
624 "--with-ssl=" (assoc-ref %build-inputs "openssl"))
625 (string-append
626 "--with-libevent=" (assoc-ref %build-inputs "libevent"))
627 (string-append
628 "--with-libexpat=" (assoc-ref %build-inputs "expat"))
629 "--with-pythonmodule" "--with-pyunbound")
630 #:phases
631 (modify-phases %standard-phases
632 (add-after 'configure 'fix-python-site-package-path
633 ;; Move python modules into their own output.
634 (lambda* (#:key outputs #:allow-other-keys)
635 (let ((pyout (assoc-ref outputs "python"))
636 (ver ,(version-major+minor (package-version python))))
637 (substitute* "Makefile"
638 (("^PYTHON_SITE_PKG=.*$")
639 (string-append
640 "PYTHON_SITE_PKG="
641 pyout "/lib/python-" ver "/site-packages\n"))))
642 #t))
643 (add-before 'check 'fix-missing-nss-for-tests
644 ;; Unfortunately, the package's unittests involve some checks
645 ;; looking up protocols and services which are not provided
646 ;; by the minimalistic build environment, in particular,
647 ;; /etc/protocols and /etc/services are missing.
648 ;; Also, after plain substitution of protocol and service names
649 ;; in the test data, the tests still fail because the
650 ;; corresponding Resource Records have been signed by
651 ;; RRSIG records.
652 ;; The following LD_PRELOAD library overwrites the glibc
653 ;; functions ‘get{proto,serv}byname’, ‘getprotobynumber’ and
654 ;; ‘getservbyport’ providing the few records required for the
655 ;; unit tests to pass.
656 (lambda* (#:key inputs outputs #:allow-other-keys)
657 (let* ((source (assoc-ref %build-inputs "source"))
658 (gcc (assoc-ref %build-inputs "gcc")))
659 (call-with-output-file "/tmp/nss_preload.c"
660 (lambda (port)
661 (display "#include <stdlib.h>
662 #include <string.h>
663 #include <strings.h>
664
665 #include <netdb.h>
666
667 struct protoent *getprotobyname(const char *name) {
668 struct protoent *p = malloc(sizeof(struct protoent));
669 p->p_aliases = malloc(sizeof(char*));
670 if (strcasecmp(name, \"tcp\") == 0) {
671 p->p_name = \"tcp\";
672 p->p_proto = 6;
673 p->p_aliases[0] = \"TCP\";
674 } else if (strcasecmp(name, \"udp\") == 0) {
675 p->p_name = \"udp\";
676 p->p_proto = 17;
677 p->p_aliases[0] = \"UDP\";
678 } else
679 p = NULL;
680 return p;
681 }
682
683 struct protoent *getprotobynumber(int proto) {
684 struct protoent *p = malloc(sizeof(struct protoent));
685 p->p_aliases = malloc(sizeof(char*));
686 switch(proto) {
687 case 6:
688 p->p_name = \"tcp\";
689 p->p_proto = 6;
690 p->p_aliases[0] = \"TCP\";
691 break;
692 case 17:
693 p->p_name = \"udp\";
694 p->p_proto = 17;
695 p->p_aliases[0] = \"UDP\";
696 break;
697 default:
698 p = NULL;
699 break;
700 }
701 return p;
702 }
703
704 struct servent *getservbyname(const char *name, const char *proto) {
705 struct servent *s = malloc(sizeof(struct servent));
706 char* buf = malloc((strlen(proto)+1)*sizeof(char));
707 strcpy(buf, proto);
708 s->s_aliases = malloc(sizeof(char*));
709 s->s_aliases[0] = NULL;
710 if (strcasecmp(name, \"domain\") == 0) {
711 s->s_name = \"domain\";
712 s->s_port = htons(53);
713 s->s_proto = buf;
714 } else
715 s = NULL;
716 return s;
717 }
718
719 struct servent *getservbyport(int port, const char *proto) {
720 char buf[32];
721 struct servent *s = malloc(sizeof(struct servent));
722 strcpy(buf, proto);
723 s->s_aliases = malloc(sizeof(char*));
724 s->s_aliases[0] = NULL;
725 switch(port) {
726 case 53:
727 s->s_name = \"domain\";
728 s->s_port = 53;
729 s->s_proto = \"udp\";
730 break;
731 default:
732 s = NULL;
733 break;
734 }
735 return s;
736 }" port)))
737 (invoke (string-append gcc "/bin/gcc")
738 "-shared" "-fPIC" "-o" "/tmp/nss_preload.so"
739 "/tmp/nss_preload.c")
740 ;; The preload library only affects the unittests.
741 (substitute* "Makefile"
742 (("./unittest")
743 "LD_PRELOAD=/tmp/nss_preload.so ./unittest")))
744 #t)))))
745 (home-page "https://www.unbound.net")
746 (synopsis "Validating, recursive, and caching DNS resolver")
747 (description
748 "Unbound is a recursive-only caching DNS server which can perform DNSSEC
749 validation of results. It implements only a minimal amount of authoritative
750 service to prevent leakage to the root nameservers: forward lookups for
751 localhost, reverse for @code{127.0.0.1} and @code{::1}, and NXDOMAIN for zones
752 served by AS112. Stub and forward zones are supported.")
753 (license license:bsd-4)))
754
755 (define-public yadifa
756 (package
757 (name "yadifa")
758 (version "2.3.9")
759 (source
760 (let ((build "8497"))
761 (origin
762 (method url-fetch)
763 (uri
764 (string-append "http://cdn.yadifa.eu/sites/default/files/releases/"
765 "yadifa-" version "-" build ".tar.gz"))
766 (sha256
767 (base32 "0xvyr91sfgzkpw6g3h893ldbwnki3w2472n56rr18w67qghs1sa5")))))
768 (build-system gnu-build-system)
769 (native-inputs
770 `(("which" ,which)))
771 (inputs
772 `(("openssl" ,openssl)))
773 (arguments
774 `(#:phases
775 (modify-phases %standard-phases
776 (add-before 'configure 'omit-example-configurations
777 (lambda _
778 (substitute* "Makefile.in"
779 ((" (etc|var)") ""))
780 #t)))
781 #:configure-flags
782 (list "--sysconfdir=/etc"
783 "--localstatedir=/var"
784 "--disable-build-timestamp" ; build reproducibly
785 "--enable-shared"
786 "--disable-static"
787 "--enable-acl"
788 "--enable-caching"
789 "--enable-ctrl" ; enable remote control
790 "--enable-nsec"
791 "--enable-nsec3"
792 "--enable-tsig")))
793 (home-page "https://www.yadifa.eu/")
794 (synopsis "Authoritative DNS name server")
795 (description "YADIFA is an authoritative name server for the @dfn{Domain
796 Name System} (DNS). It aims for both higher performance and a smaller memory
797 footprint than other implementations, while remaining fully RFC-compliant.
798 YADIFA supports dynamic record updates and the @dfn{Domain Name System Security
799 Extensions} (DNSSEC).")
800 (license license:bsd-3)))
801
802 (define-public knot
803 (package
804 (name "knot")
805 (version "2.9.5")
806 (source
807 (origin
808 (method url-fetch)
809 (uri (string-append "https://secure.nic.cz/files/knot-dns/"
810 "knot-" version ".tar.xz"))
811 (sha256
812 (base32 "0xmzmhd2m9rb24clrrd9k058harsq67nyjplpbyxvy1g46xah28i"))
813 (modules '((guix build utils)))
814 (snippet
815 '(begin
816 ;; Delete bundled libraries.
817 (with-directory-excursion "src/contrib"
818 (delete-file-recursively "lmdb"))
819 #t))))
820 (build-system gnu-build-system)
821 (native-inputs
822 `(("pkg-config" ,pkg-config)))
823 (inputs
824 `(("fstrm" ,fstrm)
825 ("gnutls" ,gnutls)
826 ("jansson" ,jansson)
827 ("libcap-ng" ,libcap-ng)
828 ("libedit" ,libedit)
829 ("libidn" ,libidn)
830 ("liburcu" ,liburcu)
831 ("lmdb" ,lmdb)
832 ("ncurses" ,ncurses)
833 ("protobuf-c" ,protobuf-c)))
834 (arguments
835 `(#:phases
836 (modify-phases %standard-phases
837 (add-before 'configure 'disable-directory-pre-creation
838 (lambda _
839 ;; Don't install empty directories like ‘/etc’ outside the store.
840 ;; This is needed even when using ‘make config_dir=... install’.
841 (substitute* "src/Makefile.in" (("\\$\\(INSTALL\\) -d") "true"))
842 #t))
843 (replace 'install
844 (lambda* (#:key outputs #:allow-other-keys)
845 (let* ((out (assoc-ref outputs "out"))
846 (doc (string-append out "/share/doc/" ,name "-" ,version))
847 (etc (string-append doc "/examples/etc")))
848 (invoke "make"
849 (string-append "config_dir=" etc)
850 "install")))))
851 #:configure-flags
852 (list "--sysconfdir=/etc"
853 "--localstatedir=/var"
854 "--enable-dnstap" ; let tools read/write capture files
855 "--with-module-dnstap=yes" ; detailed query capturing & logging
856 (string-append "--with-bash-completions="
857 (assoc-ref %outputs "out")
858 "/etc/bash_completion.d"))))
859 (home-page "https://www.knot-dns.cz/")
860 (synopsis "Authoritative DNS name server")
861 (description "Knot DNS is an authoritative name server for the @dfn{Domain
862 Name System} (DNS), designed to meet the needs of root and @dfn{top-level
863 domain} (TLD) name servers. It is implemented as a threaded daemon and uses a
864 number of programming techniques to improve speed. For example, the responder
865 is completely lock-free, resulting in a very high response rate. Other features
866 include automatic @dfn{DNS Security Extensions} (DNSSEC) signing, dynamic record
867 synthesis, and on-the-fly re-configuration.")
868 (license
869 (list
870 ;; src/contrib/{hat-trie,murmurhash3,openbsd},
871 ;; src/dnssec/contrib/vpool.[ch], and parts of libtap/ are ‘MIT’ (expat).
872 license:expat
873 license:lgpl2.0+ ; parts of scr/contrib/ucw
874 license:public-domain ; src/contrib/fnv and possibly murmurhash3
875 license:gpl3+)))) ; everything else
876
877 (define-public knot-resolver
878 (package
879 (name "knot-resolver")
880 (version "4.3.0")
881 (source (origin
882 (method url-fetch)
883 (uri (string-append "https://secure.nic.cz/files/knot-resolver/"
884 "knot-resolver-" version ".tar.xz"))
885 (sha256
886 (base32
887 "09ffmqx79lv5psr433x4n946njgsn071b9b7161pcb9bmrqz380c"))))
888 (build-system meson-build-system)
889 (arguments
890 '(#:configure-flags '("-Ddoc=enabled")
891 #:phases
892 (modify-phases %standard-phases
893 (add-before 'configure 'disable-default-ta
894 (lambda _
895 ;; Disable the default managed root TA, since we don't have
896 ;; write access to the keyfile and its directory in store.
897 (substitute* "daemon/lua/sandbox.lua.in"
898 (("^trust_anchors\\.add_file.*") ""))
899 #t))
900 (add-after 'build 'build-doc
901 (lambda _
902 (invoke "ninja" "doc")))
903 (add-after 'install 'wrap-binary
904 (lambda* (#:key inputs outputs #:allow-other-keys)
905 (let* ((out (assoc-ref outputs "out"))
906 (lua-* (map cdr (filter
907 (lambda (input)
908 (string-prefix? "lua-" (car input)))
909 inputs)))
910 (lua-path (lambda (p)
911 (string-append p "/share/lua/5.1/?.lua")))
912 (lua-cpath (lambda (p)
913 (string-append p "/lib/lua/5.1/?.so"))))
914 (wrap-program (string-append out "/sbin/kresd")
915 `("LUA_PATH" ";" prefix ,(map lua-path lua-*))
916 `("LUA_CPATH" ";" prefix ,(map lua-cpath lua-*)))
917 #t))))))
918 (native-inputs
919 `(("cmocka" ,cmocka) ; for unit tests
920 ("doxygen" ,doxygen)
921 ("protobuf-c" ,protobuf-c)
922 ("pkg-config" ,pkg-config)
923 ("python-breathe" ,python-breathe)
924 ("python-sphinx" ,python-sphinx)
925 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
926 (inputs
927 `(("fstrm" ,fstrm)
928 ("gnutls" ,gnutls)
929 ("knot" ,knot)
930 ("libuv" ,libuv)
931 ("lmdb" ,lmdb)
932 ("luajit" ,luajit)
933 ;; TODO: Add optional lua modules: basexx and psl.
934 ("lua-bitop" ,lua5.1-bitop)
935 ("lua-cqueues" ,lua5.1-cqueues)
936 ("lua-filesystem" ,lua5.1-filesystem)
937 ("lua-sec" ,lua5.1-sec)
938 ("lua-socket" ,lua5.1-socket)))
939 (home-page "https://www.knot-resolver.cz/")
940 (synopsis "Caching validating DNS resolver")
941 (description
942 "Knot Resolver is a caching full resolver implementation written in C and
943 LuaJIT, both a resolver library and a daemon.")
944 (license (list license:gpl3+
945 ;; Some 'contrib' files are under MIT, CC0 and LGPL2.
946 license:expat
947 license:cc0
948 license:lgpl2.0))))
949
950 (define-public ddclient
951 (package
952 (name "ddclient")
953 (version "3.9.1")
954 (source
955 (origin
956 (method git-fetch)
957 (uri (git-reference
958 (url "https://github.com/ddclient/ddclient")
959 (commit (string-append "v" version))))
960 (file-name (git-file-name name version))
961 (sha256
962 (base32 "0hf377g4j9r9sac75xp17nk2h58mazswz4vkg4g2gl2yyhvzq91w"))))
963 (build-system trivial-build-system) ; no Makefile.PL
964 (native-inputs
965 `(("bash" ,bash)
966 ("perl" ,perl)))
967 (inputs
968 `(("inetutils" ,inetutils) ; logger
969 ("net-tools" ,net-tools)
970 ("perl-data-validate-ip" ,perl-data-validate-ip)
971 ("perl-digest-sha1" ,perl-digest-sha1)
972 ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
973 (arguments
974 `(#:modules ((guix build utils)
975 (ice-9 match)
976 (srfi srfi-26))
977 #:builder
978 (begin
979 (use-modules (guix build utils)
980 (ice-9 match)
981 (srfi srfi-26))
982 (setenv "PATH" (string-append
983 (assoc-ref %build-inputs "bash") "/bin" ":"
984 (assoc-ref %build-inputs "perl") "/bin"))
985
986 ;; Copy the (read-only) source into the (writable) build directory.
987 (copy-recursively (assoc-ref %build-inputs "source") ".")
988
989 ;; Install.
990 (let* ((out (assoc-ref %outputs "out"))
991 (bin (string-append out "/bin")))
992 (let ((file "ddclient"))
993 (substitute* file
994 (("/usr/bin/perl") (which "perl"))
995 ;; Strictly use ‘/etc/ddclient/ddclient.conf’.
996 (("\\$\\{program\\}\\.conf") "/etc/ddclient/ddclient.conf")
997 (("\\$etc\\$program.conf") "/etc/ddclient/ddclient.conf")
998 ;; Strictly use ‘/var/cache/ddclient/ddclient.cache’
999 (("\\$cachedir\\$program\\.cache")
1000 "/var/cache/ddclient/ddclient.cache"))
1001 (install-file file bin)
1002 (wrap-program (string-append bin "/" file)
1003 `("PATH" ":" =
1004 ("$PATH"
1005 ,@(map (lambda (input)
1006 (match input
1007 ((name . store)
1008 (string-append store "/bin"))))
1009 %build-inputs)))
1010 `("PERL5LIB" ":" =
1011 ,(delete
1012 ""
1013 (map (match-lambda
1014 (((? (cut string-prefix? "perl-" <>) name) . dir)
1015 (string-append dir "/lib/perl5/site_perl"))
1016 (_ ""))
1017 %build-inputs)))))
1018 (for-each (cut install-file <> (string-append out
1019 "/share/ddclient"))
1020 (find-files "." "sample.*$"))))))
1021 (home-page "https://ddclient.net/")
1022 (synopsis "Address updating utility for dynamic DNS services")
1023 (description "This package provides a client to update dynamic IP
1024 addresses with several dynamic DNS service providers, such as
1025 @uref{https://www.dyndns.com/account/login.html,DynDNS.com}.
1026
1027 This makes it possible to use a fixed hostname (such as myhost.dyndns.org) to
1028 access a machine with a dynamic IP address.
1029
1030 The client supports both dynamic and (near) static services, as well as MX
1031 record and alternative name management. It caches the address, and only
1032 attempts the update when it has changed.")
1033 (license license:gpl2+)))
1034
1035 (define-public hnsd
1036 ;; There have been no releases yet, hence this commit.
1037 (let ((revision "0")
1038 (commit "895d89c25d316d18df9d374fe78aae3902bc89fb"))
1039 (package
1040 (name "hnsd")
1041 (version (git-version "0.0" revision commit))
1042 (source (origin
1043 (method git-fetch)
1044 (uri (git-reference
1045 (url "https://github.com/handshake-org/hnsd")
1046 (commit commit)))
1047 (sha256
1048 (base32
1049 "0704y73sddn24jga9csw4gxyfb3pnrfnk0vdcph84n1h38490l16"))
1050 (file-name (git-file-name name version))
1051 (modules '((guix build utils)))
1052 (snippet
1053 '(begin
1054 ;; Delete the bundled copy of libuv.
1055 (delete-file-recursively "uv")
1056 (substitute* "configure.ac"
1057 (("AC_CONFIG_SUBDIRS\\(\\[uv\\]\\)") ""))
1058 (substitute* "Makefile.am"
1059 (("SUBDIRS = uv") "\n")
1060 (("\\$\\(top_builddir\\)/uv/libuv.la") "-luv")
1061
1062 ;; Make sure the 'hnsd' binary is installed and
1063 ;; dynamically-linked.
1064 (("noinst_PROGRAMS") "bin_PROGRAMS")
1065 (("hnsd_LDFLAGS = -static") ""))
1066
1067 ;; This script tries to chdir to "uv" and doesn't do more
1068 ;; than "autoreconf" so remove it.
1069 (delete-file "autogen.sh")
1070 #t))))
1071 (build-system gnu-build-system)
1072 (arguments
1073 '(#:configure-flags '("--disable-static"))) ;no need for libhsk.a
1074 (native-inputs
1075 `(("autoconf" ,autoconf)
1076 ("automake" ,automake)
1077 ("libtool" ,libtool)))
1078 (inputs
1079 `(("unbound" ,unbound)
1080 ("libuv" ,libuv)))
1081 (home-page "https://www.handshake.org/")
1082 (synopsis "Resolver daemon for the Handshake naming protocol")
1083 (description
1084 "@command{hnsd} is a @dfn{host name resolver} for the Handshake Naming
1085 System (HNS) peer-to-peer network.")
1086 (license license:expat))))
1087
1088 (define-public libmicrodns
1089 (package
1090 (name "libmicrodns")
1091 (version "0.1.2")
1092 (source (origin
1093 (method url-fetch)
1094 (uri (string-append "https://github.com/videolabs/libmicrodns/"
1095 "releases/download/" version "/microdns-"
1096 version ".tar.xz"))
1097 (sha256
1098 (base32
1099 "0p4va18zxgmzcdwhlbg2mmjwswlbgqy4ay5vaxrw7cxmhsflnv36"))))
1100 (build-system meson-build-system)
1101 (home-page "https://github.com/videolabs/libmicrodns")
1102 (synopsis "Minimal mDNS resolver library")
1103 (description "@code{libmicrodns} provides a minimal implementation of a
1104 mDNS resolver as well as an announcer. mDNS (Multicast Domain Name System) is
1105 a zero-config service that allows one to resolve host names to IP addresses in
1106 local networks.")
1107 (license license:lgpl2.1)))
1108
1109 (define-public public-suffix-list
1110 ;; Mozilla releases the official list here:
1111 ;;
1112 ;; https://publicsuffix.org/list/public_suffix_list.dat
1113 ;;
1114 ;; However, Mozilla syncs that file from the GitHub repository periodically,
1115 ;; so its contents will change over time. If you update this commit, please
1116 ;; make sure that the new commit refers to a list which is identical to the
1117 ;; officially published list available from the URL above.
1118 (let ((commit "9375b697baddb0827a5995c81bd3c75877a0b35d"))
1119 (package
1120 (name "public-suffix-list")
1121 (version (git-version "0" "1" commit))
1122 (source (origin
1123 (method git-fetch)
1124 (uri (git-reference
1125 (url "https://github.com/publicsuffix/list")
1126 (commit commit)))
1127 (file-name (git-file-name name version))
1128 (sha256
1129 (base32
1130 "1sm7pni01rnl4ldzi8z8nc4cbgq8nxda9gwc68v0s3ij7jd1jmik"))))
1131 (build-system trivial-build-system)
1132 (arguments
1133 `(#:modules ((guix build utils))
1134 #:builder
1135 (begin
1136 (use-modules (guix build utils))
1137 (let* ((out (assoc-ref %outputs "out"))
1138 ;; Install to /share because that is where "read-only
1139 ;; architecture-independent data files" should go (see:
1140 ;; (standards) Directory Variables). Include the version in
1141 ;; the directory name so that if multiple versions are ever
1142 ;; installed in the same profile, they will not conflict.
1143 (destination (string-append
1144 out "/share/public-suffix-list-" ,version))
1145 (source (assoc-ref %build-inputs "source")))
1146 (with-directory-excursion source
1147 (install-file "public_suffix_list.dat" destination)
1148 (install-file "LICENSE" destination))
1149 #t))))
1150 (home-page "https://publicsuffix.org/")
1151 (synopsis "Database of current and historical DNS suffixes")
1152 (description "This is the Public Suffix List maintained by Mozilla. A
1153 \"public suffix\" is one under which Internet users can (or historically
1154 could) directly register names in the Domain Name System (DNS). Some examples
1155 of public suffixes are .com, .co.uk and pvt.k12.ma.us. This is a list of all
1156 known public suffixes.")
1157 (license license:mpl2.0))))
1158
1159 (define-public maradns
1160 (package
1161 (name "maradns")
1162 (version "3.5.0007")
1163 (source
1164 (origin
1165 (method url-fetch)
1166 (uri (string-append "https://maradns.samiam.org/download/"
1167 (version-major+minor version) "/"
1168 version "/maradns-" version ".tar.xz"))
1169 (sha256
1170 (base32 "0bc19xylg4whww9qaj5i4izwxcrh0c0ja7l1pfcn2la02hlvg1a6"))))
1171 (build-system gnu-build-system)
1172 (arguments
1173 `(#:tests? #f ; need to be root to run tests
1174 #:make-flags
1175 (list
1176 ,(string-append "CC=" (cc-for-target))
1177 (string-append "PREFIX=" %output)
1178 (string-append "RPM_BUILD_ROOT=" %output))
1179 #:phases
1180 (modify-phases %standard-phases
1181 (replace 'configure
1182 (lambda* (#:key native-inputs target #:allow-other-keys)
1183 ;; make_32bit_tables generates a header file that is used during
1184 ;; compilation. Hence, during cross compilation, it should be
1185 ;; built for the host system.
1186 (when target
1187 (substitute* "rng/Makefile"
1188 (("\\$\\(CC\\) -o make_32bit_tables")
1189 (string-append (assoc-ref native-inputs "gcc")
1190 "/bin/gcc -o make_32bit_tables"))))
1191 (invoke "./configure")))
1192 (add-before 'install 'create-install-directories
1193 (lambda* (#:key outputs #:allow-other-keys)
1194 (let ((out (assoc-ref outputs "out")))
1195 (for-each (lambda (dir)
1196 (mkdir-p (string-append out dir)))
1197 (list "/bin" "/sbin" "/etc"
1198 "/share/man/man1"
1199 "/share/man/man5"
1200 "/share/man/man8"))
1201 #t))))))
1202 (home-page "https://maradns.samiam.org")
1203 (synopsis "Small lightweight DNS server")
1204 (description "MaraDNS is a small and lightweight DNS server. MaraDNS
1205 consists of a UDP-only authoritative DNS server for hosting domains, and a UDP
1206 and TCP-capable recursive DNS server for finding domains on the internet.")
1207 (license license:bsd-2)))
1208
1209 (define-public openresolv
1210 (package
1211 (name "openresolv")
1212 (version "3.10.0")
1213 (source (origin
1214 (method url-fetch)
1215 (uri (string-append "https://roy.marples.name/downloads/openresolv/"
1216 "openresolv-" version ".tar.xz"))
1217 (sha256
1218 (base32
1219 "01ms6c087la4hk0f0w6n2vpsb7dg4kklah2rqyhz88p0vr9bqy20"))
1220 (patches
1221 (search-patches "openresolv-restartcmd-guix.patch"))))
1222 (build-system gnu-build-system)
1223 (arguments
1224 `(#:tests? #f ; No test suite
1225 #:configure-flags
1226 (list (string-append "--sysconfdir=/etc"))
1227 #:make-flags
1228 (list (string-append "SYSCONFDIR=/" (assoc-ref %outputs "out") "/etc"))))
1229 (home-page "https://roy.marples.name/projects/openresolv/")
1230 (synopsis "Resolvconf POSIX compliant implementation, a middleman for resolv.conf")
1231 (description "openresolv is an implementation of @command{resolvconf}, the
1232 middleman between the network configuration services and
1233 @file{/etc/resolv.conf}. @command{resolvconf} itself is just a script that
1234 stores, removes and lists a full @file{resolv.conf} generated for the
1235 interface. It then calls all the helper scripts it knows about so it can
1236 configure the real @file{/etc/resolv.conf} and optionally any local
1237 nameservers other than libc.")
1238 (license license:bsd-2)))