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