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