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