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