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