gnu: bind: Edit synopsis & description.
[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 "@acronym{DNS, Domain Name System} implementation")
379 (description "BIND implements the @acronym{DNS, Domain Name System}
380 protocols for the Internet. It is both a reference implementation of those
381 protocols and production-grade software, suitable for use in high-volume and
382 high-reliability applications.
383
384 The name stands for \"Berkeley Internet Name Domain\" because the software
385 originated in the early 1980s at the University of California at Berkeley.
386
387 The @code{utils} output of this package contains the following command line
388 utilities related to DNS name servers:
389
390 @table @code
391 @item delv
392 DNS lookup and validation utility
393 @item dig
394 DNS lookup utility
395 @item host
396 DNS lookup utility
397 @item nslookup
398 Internet name servers interactive query utility
399 @item nsupdate
400 Dynamic DNS update utility
401 @end table")
402 (home-page "https://www.isc.org/bind/")
403 (license (list license:mpl2.0))))
404
405 (define-public dnscrypt-proxy
406 (package
407 (name "dnscrypt-proxy")
408 (version "1.9.5")
409 (source (origin
410 (method url-fetch)
411 (uri (string-append
412 "https://download.dnscrypt.org/dnscrypt-proxy/"
413 "dnscrypt-proxy-" version ".tar.bz2"))
414 (sha256
415 (base32
416 "1dhvklr4dg2vlw108n11xbamacaryyg3dbrg629b76lp7685p7z8"))
417 (modules '((guix build utils)))
418 (snippet
419 ;; Delete bundled libltdl. XXX: This package also bundles
420 ;; a modified libevent that cannot currently be removed.
421 '(begin
422 (delete-file-recursively "libltdl")
423 #t))))
424 (build-system gnu-build-system)
425 (arguments
426 `(#:phases
427 (modify-phases %standard-phases
428 (add-after 'unpack 'autoreconf
429 (lambda _
430 ;; Re-generate build files due to unbundling ltdl.
431 ;; TODO: Prevent generating new libltdl and building it.
432 ;; The system version is still favored and referenced.
433 (invoke "autoreconf" "-vif"))))))
434 (native-inputs
435 `(("pkg-config" ,pkg-config)
436 ("automake" ,automake)
437 ("autoconf" ,autoconf)
438 ("libtool" ,libtool)))
439 (inputs
440 `(("libltdl" ,libltdl)
441 ("libsodium" ,libsodium)))
442 (home-page "https://www.dnscrypt.org/")
443 (synopsis "Securely send DNS requests to a remote server")
444 (description
445 "@command{dnscrypt-proxy} is a tool for securing communications
446 between a client and a DNS resolver. It verifies that responses you get
447 from a DNS provider was actually sent by that provider, and haven't been
448 tampered with. For optimal performance it is recommended to use this as
449 a forwarder for a caching DNS resolver such as @command{dnsmasq}, but it
450 can also be used as a normal DNS \"server\". A list of public dnscrypt
451 servers is included, and an up-to-date version is available at
452 @url{https://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-resolvers.csv}.")
453 (license (list license:isc
454 ;; Libevent and src/ext/queue.h is 3-clause BSD.
455 license:bsd-3))))
456
457 (define-public dnscrypt-wrapper
458 (package
459 (name "dnscrypt-wrapper")
460 (version "0.2.2")
461 (source (origin
462 (method url-fetch)
463 (uri (string-append
464 "https://github.com/cofyc/dnscrypt-wrapper/releases"
465 "/download/v" version "/" name "-v" version ".tar.bz2"))
466 (sha256
467 (base32
468 "1vhg4g0r687f51wcdn7z9w1hxapazx6vyh5rsr8wa48sljzd583g"))))
469 (build-system gnu-build-system)
470 (arguments
471 `(#:make-flags '("CC=gcc")
472 ;; TODO: Tests require ruby-cucumber and ruby-aruba.
473 #:tests? #f
474 #:phases
475 (modify-phases %standard-phases
476 (add-after 'unpack 'create-configure
477 (lambda _
478 (invoke "make" "configure"))))))
479 (native-inputs
480 `(("autoconf" ,autoconf)))
481 (inputs
482 `(("libevent" ,libevent)
483 ("libsodium" ,libsodium)))
484 (home-page "https://github.com/Cofyc/dnscrypt-wrapper")
485 (synopsis "Server-side dnscrypt proxy")
486 (description
487 "@command{dnscrypt-wrapper} is a tool to expose a name server over
488 the @code{dnscrypt} protocol. It can be used as an endpoint for the
489 @command{dnscrypt-proxy} client to securely tunnel DNS requests between
490 the two.")
491 (license (list license:isc
492 ;; Bundled argparse is MIT. TODO: package and unbundle.
493 license:expat
494 ;; dns-protocol.h and rfc1035.{c,h} is gpl2 or gpl3 (either).
495 license:gpl2
496 license:gpl3))))
497
498 (define-public libasr
499 (package
500 (name "libasr")
501 (version "1.0.4")
502 (source
503 (origin
504 (method url-fetch)
505 (uri (string-append "https://www.opensmtpd.org/archives/"
506 "libasr-" version ".tar.gz"))
507 (sha256
508 (base32 "1d6s8njqhvayx2gp47409sp1fn8m608ws26hr1srfp6i23nnpyqr"))))
509 (build-system gnu-build-system)
510 (arguments
511 `(#:phases
512 (modify-phases %standard-phases
513 (add-after 'install 'install-documentation
514 (lambda* (#:key outputs #:allow-other-keys)
515 (let ((out (assoc-ref outputs "out")))
516 (install-file "src/asr_run.3"
517 (string-append out "/share/man/man3"))
518 #t))))))
519 (native-inputs
520 `(("autoconf" ,autoconf)
521 ("automake" ,automake)
522 ("libtool" ,libtool)
523 ("pkg-config" ,pkg-config)))
524 (home-page "https://www.opensmtpd.org")
525 (synopsis "Asynchronous resolver library by the OpenBSD project")
526 (description
527 "libasr is a free, simple and portable asynchronous resolver library.
528 It runs DNS queries and performs hostname resolution in a fully
529 asynchronous fashion.")
530 (license (list license:isc
531 license:bsd-2 ; last part of getrrsetbyname_async.c
532 license:bsd-3
533 (license:non-copyleft "file://LICENSE") ; includes.h
534 license:openssl))))
535
536 (define-public nsd
537 (package
538 (name "nsd")
539 (version "4.3.4")
540 (source
541 (origin
542 (method url-fetch)
543 (uri (string-append "https://www.nlnetlabs.nl/downloads/nsd/nsd-"
544 version ".tar.gz"))
545 (sha256
546 (base32 "0l4ba80ihwg3s2ifhnkmk7rjabrcy5zw6sz4hn0vm9sif6lk9s1v"))))
547 (build-system gnu-build-system)
548 (arguments
549 `(#:configure-flags
550 (list "--enable-pie" ; fully benefit from ASLR
551 "--enable-ratelimit"
552 "--enable-recvmmsg"
553 "--enable-relro-now" ; protect GOT and .dtor areas
554 "--disable-radix-tree"
555 (string-append "--with-libevent="
556 (assoc-ref %build-inputs "libevent"))
557 (string-append "--with-ssl="
558 (assoc-ref %build-inputs "openssl"))
559 "--with-configdir=/etc"
560 "--with-nsd_conf_file=/etc/nsd/nsd.conf"
561 "--with-logfile=/var/log/nsd.log"
562 "--with-pidfile=/var/db/nsd/nsd.pid"
563 "--with-dbfile=/var/db/nsd/nsd.db"
564 "--with-zonesdir=/etc/nsd"
565 "--with-xfrdfile=/var/db/nsd/xfrd.state"
566 "--with-zonelistfile=/var/db/nsd/zone.list")
567 #:phases
568 (modify-phases %standard-phases
569 (add-before 'configure 'patch-installation-paths
570 (lambda* (#:key outputs #:allow-other-keys)
571 (let* ((out (assoc-ref outputs "out"))
572 (doc (string-append out "/share/doc/" ,name "-" ,version)))
573 ;; The ‘make install’ target tries to create the parent
574 ;; directories of run-time things like ‘pidfile’ above, and
575 ;; useless empty directories like 'configdir'. Remove such
576 ;; '$(INSTALL)' lines and install the example configuration file
577 ;; in an appropriate location.
578 (substitute* "Makefile.in"
579 ((".*INSTALL.*\\$\\((config|pid|xfr|db)dir" command)
580 (string-append "#" command))
581 (("\\$\\(nsdconfigfile\\)\\.sample" file-name)
582 (string-append doc "/examples/" file-name)))
583 #t))))
584 #:tests? #f)) ; no tests
585 (inputs
586 `(("libevent" ,libevent)
587 ("openssl" ,openssl)))
588 (home-page "https://www.nlnetlabs.nl/projects/nsd/about/")
589 (synopsis "Authoritative DNS name server")
590 (description "@dfn{NSD}, short for Name Server Daemon, is an authoritative
591 name server for the Domain Name System (@dfn{DNS}). It aims to be a fast and
592 RFC-compliant nameserver.
593
594 NSD uses zone information compiled via @command{zonec} into a binary database
595 file (@file{nsd.db}). This allows fast startup of the name service daemon and
596 allows syntax-structural errors in zone files to be flagged at compile time,
597 before being made available to NSD service itself. However, most traditional
598 BIND-style zone files can be directly imported into NSD without modification.
599
600 The collection of programs and processes that make up NSD are designed so that
601 the daemon itself runs as a non-privileged user and can be easily configured to
602 run in a @code{chroot} jail, thus making any security flaws in NSD less likely
603 to result in system-wide compromise.")
604 (license (list license:bsd-3))))
605
606 (define-public unbound
607 (package
608 (name "unbound")
609 (version "1.13.0")
610 (source
611 (origin
612 (method url-fetch)
613 (uri (string-append "https://www.unbound.net/downloads/unbound-"
614 version ".tar.gz"))
615 (sha256
616 (base32 "18dj7migq6379hps59793457l81s3z7dll3y0fj6qcmhjlx08m59"))))
617 (build-system gnu-build-system)
618 (outputs '("out" "python"))
619 (native-inputs
620 `(("flex" ,flex)
621 ("swig" ,swig)))
622 (inputs
623 `(("expat" ,expat)
624 ("libevent" ,libevent)
625 ("protobuf" ,protobuf)
626 ("python-wrapper" ,python-wrapper)
627 ("openssl" ,openssl)))
628 (arguments
629 `(#:configure-flags
630 (list "--disable-static" ; save space and non-determinism in libunbound.a
631 (string-append
632 "--with-ssl=" (assoc-ref %build-inputs "openssl"))
633 (string-append
634 "--with-libevent=" (assoc-ref %build-inputs "libevent"))
635 (string-append
636 "--with-libexpat=" (assoc-ref %build-inputs "expat"))
637 "--with-pythonmodule" "--with-pyunbound")
638 #:phases
639 (modify-phases %standard-phases
640 (add-after 'configure 'fix-python-site-package-path
641 ;; Move python modules into their own output.
642 (lambda* (#:key outputs #:allow-other-keys)
643 (let ((pyout (assoc-ref outputs "python"))
644 (ver ,(version-major+minor (package-version python))))
645 (substitute* "Makefile"
646 (("^PYTHON_SITE_PKG=.*$")
647 (string-append
648 "PYTHON_SITE_PKG="
649 pyout "/lib/python-" ver "/site-packages\n"))))
650 #t))
651 (add-before 'check 'fix-missing-nss-for-tests
652 ;; Unfortunately, the package's unittests involve some checks
653 ;; looking up protocols and services which are not provided
654 ;; by the minimalistic build environment, in particular,
655 ;; /etc/protocols and /etc/services are missing.
656 ;; Also, after plain substitution of protocol and service names
657 ;; in the test data, the tests still fail because the
658 ;; corresponding Resource Records have been signed by
659 ;; RRSIG records.
660 ;; The following LD_PRELOAD library overwrites the glibc
661 ;; functions ‘get{proto,serv}byname’, ‘getprotobynumber’ and
662 ;; ‘getservbyport’ providing the few records required for the
663 ;; unit tests to pass.
664 (lambda* (#:key inputs outputs #:allow-other-keys)
665 (let* ((source (assoc-ref %build-inputs "source"))
666 (gcc (assoc-ref %build-inputs "gcc")))
667 (call-with-output-file "/tmp/nss_preload.c"
668 (lambda (port)
669 (display "#include <stdlib.h>
670 #include <string.h>
671 #include <strings.h>
672
673 #include <netdb.h>
674
675 struct protoent *getprotobyname(const char *name) {
676 struct protoent *p = malloc(sizeof(struct protoent));
677 p->p_aliases = malloc(sizeof(char*));
678 if (strcasecmp(name, \"tcp\") == 0) {
679 p->p_name = \"tcp\";
680 p->p_proto = 6;
681 p->p_aliases[0] = \"TCP\";
682 } else if (strcasecmp(name, \"udp\") == 0) {
683 p->p_name = \"udp\";
684 p->p_proto = 17;
685 p->p_aliases[0] = \"UDP\";
686 } else
687 p = NULL;
688 return p;
689 }
690
691 struct protoent *getprotobynumber(int proto) {
692 struct protoent *p = malloc(sizeof(struct protoent));
693 p->p_aliases = malloc(sizeof(char*));
694 switch(proto) {
695 case 6:
696 p->p_name = \"tcp\";
697 p->p_proto = 6;
698 p->p_aliases[0] = \"TCP\";
699 break;
700 case 17:
701 p->p_name = \"udp\";
702 p->p_proto = 17;
703 p->p_aliases[0] = \"UDP\";
704 break;
705 default:
706 p = NULL;
707 break;
708 }
709 return p;
710 }
711
712 struct servent *getservbyname(const char *name, const char *proto) {
713 struct servent *s = malloc(sizeof(struct servent));
714 char* buf = malloc((strlen(proto)+1)*sizeof(char));
715 strcpy(buf, proto);
716 s->s_aliases = malloc(sizeof(char*));
717 s->s_aliases[0] = NULL;
718 if (strcasecmp(name, \"domain\") == 0) {
719 s->s_name = \"domain\";
720 s->s_port = htons(53);
721 s->s_proto = buf;
722 } else
723 s = NULL;
724 return s;
725 }
726
727 struct servent *getservbyport(int port, const char *proto) {
728 char buf[32];
729 struct servent *s = malloc(sizeof(struct servent));
730 strcpy(buf, proto);
731 s->s_aliases = malloc(sizeof(char*));
732 s->s_aliases[0] = NULL;
733 switch(port) {
734 case 53:
735 s->s_name = \"domain\";
736 s->s_port = 53;
737 s->s_proto = \"udp\";
738 break;
739 default:
740 s = NULL;
741 break;
742 }
743 return s;
744 }" port)))
745 (invoke (string-append gcc "/bin/gcc")
746 "-shared" "-fPIC" "-o" "/tmp/nss_preload.so"
747 "/tmp/nss_preload.c")
748 ;; The preload library only affects the unittests.
749 (substitute* "Makefile"
750 (("./unittest")
751 "LD_PRELOAD=/tmp/nss_preload.so ./unittest")))
752 #t)))))
753 (home-page "https://www.unbound.net")
754 (synopsis "Validating, recursive, and caching DNS resolver")
755 (description
756 "Unbound is a recursive-only caching DNS server which can perform DNSSEC
757 validation of results. It implements only a minimal amount of authoritative
758 service to prevent leakage to the root nameservers: forward lookups for
759 localhost, reverse for @code{127.0.0.1} and @code{::1}, and NXDOMAIN for zones
760 served by AS112. Stub and forward zones are supported.")
761 (license license:bsd-4)))
762
763 (define-public yadifa
764 (package
765 (name "yadifa")
766 (version "2.4.1")
767 (source
768 (let ((build "9916"))
769 (origin
770 (method url-fetch)
771 (uri
772 (string-append "https://www.yadifa.eu/sites/default/files/releases/"
773 "yadifa-" version "-" build ".tar.gz"))
774 (sha256
775 (base32 "1m1j7q1f0682xig8qign5ms52igix8pd45fds7p5j285dvrfa4xd")))))
776 (build-system gnu-build-system)
777 (native-inputs
778 `(("which" ,which)))
779 (inputs
780 `(("openssl" ,openssl)))
781 (arguments
782 `(#:phases
783 (modify-phases %standard-phases
784 (add-before 'configure 'omit-example-configurations
785 (lambda _
786 (substitute* "Makefile.in"
787 ((" (etc|var)") ""))
788 #t))
789 (add-after 'configure 'omit-spurious-references
790 (lambda _
791 ;; The many Makefile.in grep this(!) to #define BUILD_OPTIONS.
792 (substitute* "config.log"
793 (("(=/gnu/store/)[^-]*" _ match)
794 (string-append match "...")))
795 #t)))
796 #:configure-flags
797 (list "--sysconfdir=/etc"
798 "--localstatedir=/var"
799 "--enable-shared" "--disable-static"
800 "--disable-build-timestamp"))) ; build reproducibly
801 (home-page "https://www.yadifa.eu/")
802 (synopsis "Authoritative DNS name server")
803 (description "YADIFA is an authoritative name server for the @dfn{Domain
804 Name System} (DNS). It aims for both higher performance and a smaller memory
805 footprint than other implementations, while remaining fully RFC-compliant.
806 YADIFA supports dynamic record updates and the @dfn{Domain Name System Security
807 Extensions} (DNSSEC).")
808 (license license:bsd-3)))
809
810 (define-public knot
811 (package
812 (name "knot")
813 (version "3.0.3")
814 (source
815 (origin
816 (method git-fetch)
817 (uri (git-reference
818 (url "https://gitlab.nic.cz/knot/knot-dns")
819 (commit (string-append "v" version))))
820 (file-name (git-file-name name version))
821 (sha256
822 (base32 "0xzig9l91wj6x23mh75vw2r51ihrgx916c7wxvpcfnwrqsv4f3hy"))
823 (modules '((guix build utils)))
824 (snippet
825 '(begin
826 ;; Remove Ragel-generated C files. We'll recreate them below.
827 (for-each delete-file (find-files "." "\\.c\\.[gt]."))
828 (delete-file "src/libknot/yparser/ypbody.c")
829 ;; Remove bundled library to ensure we always use the system's.
830 (delete-file-recursively "src/contrib/libbpf")
831 #t))))
832 (build-system gnu-build-system)
833 (outputs (list "out" "doc" "lib" "tools"))
834 (arguments
835 `(#:configure-flags
836 (list (string-append "--docdir=" (assoc-ref %outputs "doc")
837 "/share/" ,name "-" ,version)
838 (string-append "--infodir=" (assoc-ref %outputs "doc")
839 "/share/info")
840 (string-append "--libdir=" (assoc-ref %outputs "lib") "/lib")
841 "--sysconfdir=/etc"
842 "--localstatedir=/var"
843 "--enable-dnstap" ; let tools read/write capture files
844 "--enable-fastparser" ; disabled by default when .git/ exists
845 "--enable-xdp=auto" ; XXX [=yes] currently means =embedded
846 "--with-module-dnstap=yes") ; detailed query capturing & logging
847 #:phases
848 (modify-phases %standard-phases
849 (add-after 'unpack 'link-missing-libbpf-dependency
850 ;; Linking against -lbpf later would fail to find -lz: libbpf.pc has
851 ;; zlib in its Requires.private (not Requires) field. Add it here.
852 (lambda _
853 (substitute* "configure.ac"
854 (("enable_xdp=yes" match)
855 (string-append match "\nlibbpf_LIBS=\"$libbpf_LIBS -lz\"")))
856 #true))
857 (add-before 'bootstrap 'update-parser
858 (lambda _
859 (with-directory-excursion "src"
860 (invoke "sh" "../scripts/update-parser.sh"))))
861 (add-before 'configure 'disable-directory-pre-creation
862 (lambda _
863 ;; Don't install empty directories like ‘/etc’ outside the store.
864 ;; This is needed even when using ‘make config_dir=... install’.
865 (substitute* "src/Makefile.in" (("\\$\\(INSTALL\\) -d") "true"))
866 #t))
867 (add-after 'build 'build-info
868 (lambda _
869 (invoke "make" "info")))
870 (replace 'install
871 (lambda* (#:key outputs #:allow-other-keys)
872 (let* ((out (assoc-ref outputs "out"))
873 (doc (string-append out "/share/doc/" ,name "-" ,version))
874 (etc (string-append doc "/examples/etc")))
875 (invoke "make"
876 (string-append "config_dir=" etc)
877 "install"))))
878 (add-after 'install 'install-info
879 (lambda _
880 (invoke "make" "install-info")))
881 (add-after 'install 'break-circular-:lib->:out-reference
882 (lambda* (#:key outputs #:allow-other-keys)
883 (let ((lib (assoc-ref outputs "lib")))
884 (for-each (lambda (file)
885 (substitute* file
886 (("(prefix=).*" _ assign)
887 (string-append assign lib "\n"))))
888 (find-files lib "\\.pc$"))
889 #true)))
890 (add-after 'install 'split-:tools
891 (lambda* (#:key outputs #:allow-other-keys)
892 (let* ((out (assoc-ref outputs "out"))
893 (tools (assoc-ref outputs "tools")))
894 (mkdir-p (string-append tools "/share/man"))
895 (rename-file (string-append out "/bin")
896 (string-append tools "/bin"))
897 (rename-file (string-append out "/share/man/man1")
898 (string-append tools "/share/man/man1"))
899 #true))))))
900 (native-inputs
901 `(("autoconf" ,autoconf)
902 ("automake" ,automake)
903 ("libtool" ,libtool)
904 ("pkg-config" ,pkg-config)
905 ("python-sphinx" ,python-sphinx)
906 ("ragel" ,ragel)
907 ("texinfo" ,texinfo)))
908 (inputs
909 `(("fstrm" ,fstrm)
910 ("gnutls" ,gnutls)
911 ("jansson" ,jansson)
912 ("libbpf" ,libbpf)
913 ("libcap-ng" ,libcap-ng)
914 ("libedit" ,libedit)
915 ("libelf" ,libelf)
916 ("libidn" ,libidn)
917 ("libnghttp2" ,nghttp2 "lib")
918 ("liburcu" ,liburcu)
919 ("lmdb" ,lmdb)
920 ("ncurses" ,ncurses)
921 ("protobuf-c" ,protobuf-c)))
922 (home-page "https://www.knot-dns.cz/")
923 (synopsis "Authoritative DNS name server")
924 (description "Knot DNS is an authoritative name server for the @dfn{Domain
925 Name System} (DNS), designed to meet the needs of root and @dfn{top-level
926 domain} (TLD) name servers. It is implemented as a threaded daemon and uses a
927 number of programming techniques to improve speed. For example, the responder
928 is completely lock-free, resulting in a very high response rate. Other features
929 include automatic @dfn{DNS Security Extensions} (DNSSEC) signing, dynamic record
930 synthesis, and on-the-fly re-configuration.")
931 (license
932 (list
933 ;; src/contrib/{hat-trie,murmurhash3,openbsd},
934 ;; src/dnssec/contrib/vpool.[ch], and parts of libtap/ are ‘MIT’ (expat).
935 license:expat
936 license:lgpl2.0+ ; parts of scr/contrib/ucw
937 license:public-domain ; src/contrib/fnv and possibly murmurhash3
938 license:gpl3+)))) ; everything else
939
940 (define-public knot-resolver
941 (package
942 (name "knot-resolver")
943 (version "5.2.1")
944 (source (origin
945 (method url-fetch)
946 (uri (string-append "https://secure.nic.cz/files/knot-resolver/"
947 "knot-resolver-" version ".tar.xz"))
948 (sha256
949 (base32
950 "09jqy23q1pgj76y2qd1xfk72wwmypnyawm3span3gx00qi2bfdxa"))))
951 (build-system meson-build-system)
952 (outputs '("out" "doc"))
953 (arguments
954 '(#:configure-flags '("-Ddoc=enabled")
955 #:phases
956 (modify-phases %standard-phases
957 (add-before 'configure 'disable-default-ta
958 (lambda _
959 ;; Disable the default managed root TA, since we don't have
960 ;; write access to the keyfile and its directory in store.
961 (substitute* "daemon/lua/sandbox.lua.in"
962 (("^trust_anchors\\.add_file.*") ""))
963 #t))
964 (add-after 'build 'build-doc
965 (lambda _
966 (invoke "ninja" "doc")))
967 (add-after 'install 'move-doc
968 (lambda* (#:key outputs #:allow-other-keys)
969 ;; Move the manual and the example configuration files to the
970 ;; "doc" output.
971 (let ((out (assoc-ref outputs "out"))
972 (doc (assoc-ref outputs "doc")))
973 (mkdir-p (string-append doc "/share/doc/knot-resolver"))
974 (for-each
975 (lambda (dir)
976 (rename-file (string-append out "/share/" dir)
977 (string-append doc "/share/" dir)))
978 '("doc/knot-resolver/examples"
979 "doc/knot-resolver/html"
980 "info")))))
981 (add-after 'install 'wrap-binary
982 (lambda* (#:key inputs outputs #:allow-other-keys)
983 (let* ((out (assoc-ref outputs "out"))
984 (lua-* (map cdr (filter
985 (lambda (input)
986 (string-prefix? "lua-" (car input)))
987 inputs)))
988 (lua-path (lambda (p)
989 (string-append p "/share/lua/5.1/?.lua")))
990 (lua-cpath (lambda (p)
991 (string-append p "/lib/lua/5.1/?.so"))))
992 (wrap-program (string-append out "/sbin/kresd")
993 `("LUA_PATH" ";" prefix ,(map lua-path lua-*))
994 `("LUA_CPATH" ";" prefix ,(map lua-cpath lua-*)))
995 #t))))))
996 (native-inputs
997 `(("cmocka" ,cmocka) ; for unit tests
998 ("doxygen" ,doxygen)
999 ("protobuf-c" ,protobuf-c)
1000 ("pkg-config" ,pkg-config)
1001 ("python-breathe" ,python-breathe)
1002 ("python-sphinx" ,python-sphinx)
1003 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
1004 ("texinfo" ,texinfo)))
1005 (inputs
1006 `(("fstrm" ,fstrm)
1007 ("gnutls" ,gnutls)
1008 ("knot:lib" ,knot "lib")
1009 ("libuv" ,libuv)
1010 ("lmdb" ,lmdb)
1011 ("luajit" ,luajit)
1012 ;; TODO: Add optional lua modules: basexx and psl.
1013 ("lua-bitop" ,lua5.1-bitop)
1014 ("nghttp2" ,nghttp2 "lib")))
1015 (home-page "https://www.knot-resolver.cz/")
1016 (synopsis "Caching validating DNS resolver")
1017 (description
1018 "Knot Resolver is a caching full resolver implementation written in C and
1019 LuaJIT, both a resolver library and a daemon.")
1020 (license (list license:gpl3+
1021 ;; Some 'contrib' files are under MIT, CC0 and LGPL2.
1022 license:expat
1023 license:cc0
1024 license:lgpl2.0))))
1025
1026 (define-public ddclient
1027 (package
1028 (name "ddclient")
1029 (version "3.9.1")
1030 (source
1031 (origin
1032 (method git-fetch)
1033 (uri (git-reference
1034 (url "https://github.com/ddclient/ddclient")
1035 (commit (string-append "v" version))))
1036 (file-name (git-file-name name version))
1037 (sha256
1038 (base32 "0hf377g4j9r9sac75xp17nk2h58mazswz4vkg4g2gl2yyhvzq91w"))))
1039 (build-system trivial-build-system) ; no Makefile.PL
1040 (native-inputs
1041 `(("bash" ,bash)
1042 ("perl" ,perl)))
1043 (inputs
1044 `(("inetutils" ,inetutils) ; logger
1045 ("net-tools" ,net-tools)
1046 ("perl-data-validate-ip" ,perl-data-validate-ip)
1047 ("perl-digest-sha1" ,perl-digest-sha1)
1048 ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
1049 (arguments
1050 `(#:modules ((guix build utils)
1051 (ice-9 match)
1052 (srfi srfi-26))
1053 #:builder
1054 (begin
1055 (use-modules (guix build utils)
1056 (ice-9 match)
1057 (srfi srfi-26))
1058 (setenv "PATH" (string-append
1059 (assoc-ref %build-inputs "bash") "/bin" ":"
1060 (assoc-ref %build-inputs "perl") "/bin"))
1061
1062 ;; Copy the (read-only) source into the (writable) build directory.
1063 (copy-recursively (assoc-ref %build-inputs "source") ".")
1064
1065 ;; Install.
1066 (let* ((out (assoc-ref %outputs "out"))
1067 (bin (string-append out "/bin")))
1068 (let ((file "ddclient"))
1069 (substitute* file
1070 (("/usr/bin/perl") (which "perl"))
1071 ;; Strictly use ‘/etc/ddclient/ddclient.conf’.
1072 (("\\$\\{program\\}\\.conf") "/etc/ddclient/ddclient.conf")
1073 (("\\$etc\\$program.conf") "/etc/ddclient/ddclient.conf")
1074 ;; Strictly use ‘/var/cache/ddclient/ddclient.cache’
1075 (("\\$cachedir\\$program\\.cache")
1076 "/var/cache/ddclient/ddclient.cache"))
1077 (install-file file bin)
1078 (wrap-program (string-append bin "/" file)
1079 `("PATH" ":" =
1080 ("$PATH"
1081 ,@(map (lambda (input)
1082 (match input
1083 ((name . store)
1084 (string-append store "/bin"))))
1085 %build-inputs)))
1086 `("PERL5LIB" ":" =
1087 ,(delete
1088 ""
1089 (map (match-lambda
1090 (((? (cut string-prefix? "perl-" <>) name) . dir)
1091 (string-append dir "/lib/perl5/site_perl"))
1092 (_ ""))
1093 %build-inputs)))))
1094 (for-each (cut install-file <> (string-append out
1095 "/share/ddclient"))
1096 (find-files "." "sample.*$"))))))
1097 (home-page "https://ddclient.net/")
1098 (synopsis "Address updating utility for dynamic DNS services")
1099 (description "This package provides a client to update dynamic IP
1100 addresses with several dynamic DNS service providers, such as
1101 @uref{https://www.dyndns.com/account/login.html,DynDNS.com}.
1102
1103 This makes it possible to use a fixed hostname (such as myhost.dyndns.org) to
1104 access a machine with a dynamic IP address.
1105
1106 The client supports both dynamic and (near) static services, as well as MX
1107 record and alternative name management. It caches the address, and only
1108 attempts the update when it has changed.")
1109 (license license:gpl2+)))
1110
1111 (define-public hnsd
1112 ;; There have been no releases yet, hence this commit.
1113 (let ((revision "0")
1114 (commit "895d89c25d316d18df9d374fe78aae3902bc89fb"))
1115 (package
1116 (name "hnsd")
1117 (version (git-version "0.0" revision commit))
1118 (source (origin
1119 (method git-fetch)
1120 (uri (git-reference
1121 (url "https://github.com/handshake-org/hnsd")
1122 (commit commit)))
1123 (sha256
1124 (base32
1125 "0704y73sddn24jga9csw4gxyfb3pnrfnk0vdcph84n1h38490l16"))
1126 (file-name (git-file-name name version))
1127 (modules '((guix build utils)))
1128 (snippet
1129 '(begin
1130 ;; Delete the bundled copy of libuv.
1131 (delete-file-recursively "uv")
1132 (substitute* "configure.ac"
1133 (("AC_CONFIG_SUBDIRS\\(\\[uv\\]\\)") ""))
1134 (substitute* "Makefile.am"
1135 (("SUBDIRS = uv") "\n")
1136 (("\\$\\(top_builddir\\)/uv/libuv.la") "-luv")
1137
1138 ;; Make sure the 'hnsd' binary is installed and
1139 ;; dynamically-linked.
1140 (("noinst_PROGRAMS") "bin_PROGRAMS")
1141 (("hnsd_LDFLAGS = -static") ""))
1142
1143 ;; This script tries to chdir to "uv" and doesn't do more
1144 ;; than "autoreconf" so remove it.
1145 (delete-file "autogen.sh")
1146 #t))))
1147 (build-system gnu-build-system)
1148 (arguments
1149 '(#:configure-flags '("--disable-static"))) ;no need for libhsk.a
1150 (native-inputs
1151 `(("autoconf" ,autoconf)
1152 ("automake" ,automake)
1153 ("libtool" ,libtool)))
1154 (inputs
1155 `(("unbound" ,unbound)
1156 ("libuv" ,libuv)))
1157 (home-page "https://www.handshake.org/")
1158 (synopsis "Resolver daemon for the Handshake naming protocol")
1159 (description
1160 "@command{hnsd} is a @dfn{host name resolver} for the Handshake Naming
1161 System (HNS) peer-to-peer network.")
1162 (license license:expat))))
1163
1164 (define-public libmicrodns
1165 (package
1166 (name "libmicrodns")
1167 (version "0.1.2")
1168 (source (origin
1169 (method url-fetch)
1170 (uri (string-append "https://github.com/videolabs/libmicrodns/"
1171 "releases/download/" version "/microdns-"
1172 version ".tar.xz"))
1173 (sha256
1174 (base32
1175 "0p4va18zxgmzcdwhlbg2mmjwswlbgqy4ay5vaxrw7cxmhsflnv36"))))
1176 (build-system meson-build-system)
1177 (home-page "https://github.com/videolabs/libmicrodns")
1178 (synopsis "Minimal mDNS resolver library")
1179 (description "@code{libmicrodns} provides a minimal implementation of a
1180 mDNS resolver as well as an announcer. mDNS (Multicast Domain Name System) is
1181 a zero-config service that allows one to resolve host names to IP addresses in
1182 local networks.")
1183 (license license:lgpl2.1)))
1184
1185 (define-public public-suffix-list
1186 ;; Mozilla releases the official list here:
1187 ;;
1188 ;; https://publicsuffix.org/list/public_suffix_list.dat
1189 ;;
1190 ;; However, Mozilla syncs that file from the GitHub repository periodically,
1191 ;; so its contents will change over time. If you update this commit, please
1192 ;; make sure that the new commit refers to a list which is identical to the
1193 ;; officially published list available from the URL above.
1194 (let ((commit "9375b697baddb0827a5995c81bd3c75877a0b35d"))
1195 (package
1196 (name "public-suffix-list")
1197 (version (git-version "0" "1" commit))
1198 (source (origin
1199 (method git-fetch)
1200 (uri (git-reference
1201 (url "https://github.com/publicsuffix/list")
1202 (commit commit)))
1203 (file-name (git-file-name name version))
1204 (sha256
1205 (base32
1206 "1sm7pni01rnl4ldzi8z8nc4cbgq8nxda9gwc68v0s3ij7jd1jmik"))))
1207 (build-system trivial-build-system)
1208 (arguments
1209 `(#:modules ((guix build utils))
1210 #:builder
1211 (begin
1212 (use-modules (guix build utils))
1213 (let* ((out (assoc-ref %outputs "out"))
1214 ;; Install to /share because that is where "read-only
1215 ;; architecture-independent data files" should go (see:
1216 ;; (standards) Directory Variables). Include the version in
1217 ;; the directory name so that if multiple versions are ever
1218 ;; installed in the same profile, they will not conflict.
1219 (destination (string-append
1220 out "/share/public-suffix-list-" ,version))
1221 (source (assoc-ref %build-inputs "source")))
1222 (with-directory-excursion source
1223 (install-file "public_suffix_list.dat" destination)
1224 (install-file "LICENSE" destination))
1225 #t))))
1226 (home-page "https://publicsuffix.org/")
1227 (synopsis "Database of current and historical DNS suffixes")
1228 (description "This is the Public Suffix List maintained by Mozilla. A
1229 \"public suffix\" is one under which Internet users can (or historically
1230 could) directly register names in the Domain Name System (DNS). Some examples
1231 of public suffixes are .com, .co.uk and pvt.k12.ma.us. This is a list of all
1232 known public suffixes.")
1233 (license license:mpl2.0))))
1234
1235 (define-public maradns
1236 (package
1237 (name "maradns")
1238 (version "3.5.0007")
1239 (source
1240 (origin
1241 (method url-fetch)
1242 (uri (string-append "https://maradns.samiam.org/download/"
1243 (version-major+minor version) "/"
1244 version "/maradns-" version ".tar.xz"))
1245 (sha256
1246 (base32 "0bc19xylg4whww9qaj5i4izwxcrh0c0ja7l1pfcn2la02hlvg1a6"))))
1247 (build-system gnu-build-system)
1248 (arguments
1249 `(#:tests? #f ; need to be root to run tests
1250 #:make-flags
1251 (list
1252 ,(string-append "CC=" (cc-for-target))
1253 (string-append "PREFIX=" %output)
1254 (string-append "RPM_BUILD_ROOT=" %output))
1255 #:phases
1256 (modify-phases %standard-phases
1257 (replace 'configure
1258 (lambda* (#:key native-inputs target #:allow-other-keys)
1259 ;; make_32bit_tables generates a header file that is used during
1260 ;; compilation. Hence, during cross compilation, it should be
1261 ;; built for the host system.
1262 (when target
1263 (substitute* "rng/Makefile"
1264 (("\\$\\(CC\\) -o make_32bit_tables")
1265 (string-append (assoc-ref native-inputs "gcc")
1266 "/bin/gcc -o make_32bit_tables"))))
1267 (invoke "./configure")))
1268 (add-before 'install 'create-install-directories
1269 (lambda* (#:key outputs #:allow-other-keys)
1270 (let ((out (assoc-ref outputs "out")))
1271 (for-each (lambda (dir)
1272 (mkdir-p (string-append out dir)))
1273 (list "/bin" "/sbin" "/etc"
1274 "/share/man/man1"
1275 "/share/man/man5"
1276 "/share/man/man8"))
1277 #t))))))
1278 (home-page "https://maradns.samiam.org")
1279 (synopsis "Small lightweight DNS server")
1280 (description "MaraDNS is a small and lightweight DNS server. MaraDNS
1281 consists of a UDP-only authoritative DNS server for hosting domains, and a UDP
1282 and TCP-capable recursive DNS server for finding domains on the internet.")
1283 (license license:bsd-2)))
1284
1285 (define-public openresolv
1286 (package
1287 (name "openresolv")
1288 (version "3.10.0")
1289 (source (origin
1290 (method url-fetch)
1291 (uri (string-append "https://roy.marples.name/downloads/openresolv/"
1292 "openresolv-" version ".tar.xz"))
1293 (sha256
1294 (base32
1295 "01ms6c087la4hk0f0w6n2vpsb7dg4kklah2rqyhz88p0vr9bqy20"))
1296 (patches
1297 (search-patches "openresolv-restartcmd-guix.patch"))))
1298 (build-system gnu-build-system)
1299 (arguments
1300 `(#:tests? #f ; No test suite
1301 #:configure-flags
1302 (list (string-append "--sysconfdir=/etc"))
1303 #:make-flags
1304 (list (string-append "SYSCONFDIR=/" (assoc-ref %outputs "out") "/etc"))))
1305 (home-page "https://roy.marples.name/projects/openresolv/")
1306 (synopsis "Resolvconf POSIX compliant implementation, a middleman for resolv.conf")
1307 (description "openresolv is an implementation of @command{resolvconf}, the
1308 middleman between the network configuration services and
1309 @file{/etc/resolv.conf}. @command{resolvconf} itself is just a script that
1310 stores, removes and lists a full @file{resolv.conf} generated for the
1311 interface. It then calls all the helper scripts it knows about so it can
1312 configure the real @file{/etc/resolv.conf} and optionally any local
1313 nameservers other than libc.")
1314 (license license:bsd-2)))