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