gnu: knot: Build separate outputs.
[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")
af9d3425 763 (version "2.3.10")
6cf626e8 764 (source
af9d3425 765 (let ((build "9729"))
8769d482
TGR
766 (origin
767 (method url-fetch)
768 (uri
769 (string-append "http://cdn.yadifa.eu/sites/default/files/releases/"
fe99b7f7 770 "yadifa-" version "-" build ".tar.gz"))
8769d482 771 (sha256
af9d3425 772 (base32 "0azaignqmylfdzr4x02s8y3pkn4f0xkpz3d1pkiiz8mwk92zgybn")))))
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"
789 "--disable-build-timestamp" ; build reproducibly
790 "--enable-shared"
791 "--disable-static"
792 "--enable-acl"
793 "--enable-caching"
794 "--enable-ctrl" ; enable remote control
795 "--enable-nsec"
796 "--enable-nsec3"
797 "--enable-tsig")))
9f733172 798 (home-page "https://www.yadifa.eu/")
6cf626e8 799 (synopsis "Authoritative DNS name server")
366efcb2
TGR
800 (description "YADIFA is an authoritative name server for the @dfn{Domain
801Name System} (DNS). It aims for both higher performance and a smaller memory
6cf626e8 802footprint than other implementations, while remaining fully RFC-compliant.
366efcb2
TGR
803YADIFA supports dynamic record updates and the @dfn{Domain Name System Security
804Extensions} (DNSSEC).")
6cf626e8 805 (license license:bsd-3)))
f9cdf1c1
TGR
806
807(define-public knot
808 (package
809 (name "knot")
0e5968e4 810 (version "3.0.1")
e41ddf76
TGR
811 (source
812 (origin
ca4143c7
TGR
813 (method git-fetch)
814 (uri (git-reference
815 (url "https://gitlab.nic.cz/knot/knot-dns")
816 (commit (string-append "v" version))))
817 (file-name (git-file-name name version))
e41ddf76 818 (sha256
0e5968e4 819 (base32 "10mlzldxqvbaw78nghkr0s73rlbpz9wg16z14321xw2l9xfibkad"))
2b73e50c
TGR
820 (modules '((guix build utils)))
821 (snippet
822 '(begin
823 ;; Remove Ragel-generated C files. We'll recreate them below.
824 (for-each delete-file (find-files "." "\\.c\\.[gt]."))
ca4143c7 825 (delete-file "src/libknot/yparser/ypbody.c")
387ad8fd
TGR
826 ;; Remove bundled library to ensure we always use the system's.
827 (delete-file-recursively "src/contrib/libbpf")
2b73e50c 828 #t))))
f9cdf1c1 829 (build-system gnu-build-system)
8154df53 830 (outputs (list "out" "doc" "lib" "tools"))
f9cdf1c1 831 (arguments
84da8f7f 832 `(#:configure-flags
8154df53
TGR
833 (list (string-append "--docdir=" (assoc-ref %outputs "doc")
834 "/share/" ,name "-" ,version)
835 (string-append "--infodir=" (assoc-ref %outputs "doc")
836 "/share/info")
837 (string-append "--libdir=" (assoc-ref %outputs "lib") "/lib")
838 "--sysconfdir=/etc"
84da8f7f
TGR
839 "--localstatedir=/var"
840 "--enable-dnstap" ; let tools read/write capture files
d3413b6f 841 "--enable-fastparser" ; disabled by default when .git/ exists
387ad8fd 842 "--enable-xdp=auto" ; XXX [=yes] currently means =embedded
2eb0585a 843 "--with-module-dnstap=yes") ; detailed query capturing & logging
84da8f7f 844 #:phases
f9cdf1c1 845 (modify-phases %standard-phases
387ad8fd
TGR
846 (add-after 'unpack 'link-missing-libbpf-dependency
847 ;; Linking against -lbpf later would fail to find -lz: libbpf.pc has
848 ;; zlib in its Requires.private (not Requires) field. Add it here.
849 (lambda _
850 (substitute* "configure.ac"
851 (("enable_xdp=yes" match)
852 (string-append match "\nlibbpf_LIBS=\"$libbpf_LIBS -lz\"")))
8154df53 853 #true))
ca4143c7
TGR
854 (add-before 'bootstrap 'update-parser
855 (lambda _
2b73e50c 856 (with-directory-excursion "src"
ca4143c7 857 (invoke "sh" "../scripts/update-parser.sh"))))
f9cdf1c1
TGR
858 (add-before 'configure 'disable-directory-pre-creation
859 (lambda _
860 ;; Don't install empty directories like ‘/etc’ outside the store.
1b00e3bd 861 ;; This is needed even when using ‘make config_dir=... install’.
2d431b01
TGR
862 (substitute* "src/Makefile.in" (("\\$\\(INSTALL\\) -d") "true"))
863 #t))
4756b9b1
SS
864 (add-after 'build 'build-info
865 (lambda _
866 (invoke "make" "info")))
f9cdf1c1
TGR
867 (replace 'install
868 (lambda* (#:key outputs #:allow-other-keys)
869 (let* ((out (assoc-ref outputs "out"))
ee1362fc 870 (doc (string-append out "/share/doc/" ,name "-" ,version))
f9cdf1c1 871 (etc (string-append doc "/examples/etc")))
6b042495
TGR
872 (invoke "make"
873 (string-append "config_dir=" etc)
4756b9b1
SS
874 "install"))))
875 (add-after 'install 'install-info
876 (lambda _
8154df53
TGR
877 (invoke "make" "install-info")))
878 (add-after 'install 'break-circular-:lib->:out-reference
879 (lambda* (#:key outputs #:allow-other-keys)
880 (let ((lib (assoc-ref outputs "lib")))
881 (for-each (lambda (file)
882 (substitute* file
883 (("(prefix=).*" _ assign)
884 (string-append assign lib "\n"))))
885 (find-files lib "\\.pc$"))
886 #true)))
887 (add-after 'install 'split-:tools
888 (lambda* (#:key outputs #:allow-other-keys)
889 (let* ((out (assoc-ref outputs "out"))
890 (tools (assoc-ref outputs "tools")))
891 (mkdir-p (string-append tools "/share/man"))
892 (rename-file (string-append out "/bin")
893 (string-append tools "/bin"))
894 (rename-file (string-append out "/share/man/man1")
895 (string-append tools "/share/man/man1"))
896 #true))))))
84da8f7f 897 (native-inputs
ca4143c7
TGR
898 `(("autoconf" ,autoconf)
899 ("automake" ,automake)
900 ("libtool" ,libtool)
901 ("pkg-config" ,pkg-config)
4756b9b1
SS
902 ("python-sphinx" ,python-sphinx)
903 ("ragel" ,ragel)
904 ("texinfo" ,texinfo)))
84da8f7f
TGR
905 (inputs
906 `(("fstrm" ,fstrm)
907 ("gnutls" ,gnutls)
908 ("jansson" ,jansson)
387ad8fd 909 ("libbpf" ,libbpf)
84da8f7f
TGR
910 ("libcap-ng" ,libcap-ng)
911 ("libedit" ,libedit)
387ad8fd 912 ("libelf" ,libelf)
84da8f7f 913 ("libidn" ,libidn)
dadfc9bc 914 ("libnghttp2" ,nghttp2 "lib")
84da8f7f
TGR
915 ("liburcu" ,liburcu)
916 ("lmdb" ,lmdb)
917 ("ncurses" ,ncurses)
918 ("protobuf-c" ,protobuf-c)))
f9cdf1c1
TGR
919 (home-page "https://www.knot-dns.cz/")
920 (synopsis "Authoritative DNS name server")
d1e4ad1b 921 (description "Knot DNS is an authoritative name server for the @dfn{Domain
f9cdf1c1
TGR
922Name System} (DNS), designed to meet the needs of root and @dfn{top-level
923domain} (TLD) name servers. It is implemented as a threaded daemon and uses a
924number of programming techniques to improve speed. For example, the responder
925is completely lock-free, resulting in a very high response rate. Other features
926include automatic @dfn{DNS Security Extensions} (DNSSEC) signing, dynamic record
927synthesis, and on-the-fly re-configuration.")
0056f4cc
TGR
928 (license
929 (list
930 ;; src/contrib/{hat-trie,murmurhash3,openbsd},
931 ;; src/dnssec/contrib/vpool.[ch], and parts of libtap/ are ‘MIT’ (expat).
932 license:expat
933 license:lgpl2.0+ ; parts of scr/contrib/ucw
934 license:public-domain ; src/contrib/fnv and possibly murmurhash3
935 license:gpl3+)))) ; everything else
0bc2d3e4 936
a35e16c0
SB
937(define-public knot-resolver
938 (package
939 (name "knot-resolver")
fb420edd 940 (version "5.1.3")
a35e16c0
SB
941 (source (origin
942 (method url-fetch)
943 (uri (string-append "https://secure.nic.cz/files/knot-resolver/"
944 "knot-resolver-" version ".tar.xz"))
945 (sha256
946 (base32
fb420edd 947 "12s5070nqqf599s1mb6rjas2as481rjf751qk5yrz6p34y885k90"))))
a35e16c0
SB
948 (build-system meson-build-system)
949 (arguments
8a5c4384 950 '(#:configure-flags '("-Ddoc=enabled")
a35e16c0
SB
951 #:phases
952 (modify-phases %standard-phases
8a5c4384
SB
953 (add-before 'configure 'disable-default-ta
954 (lambda _
955 ;; Disable the default managed root TA, since we don't have
956 ;; write access to the keyfile and its directory in store.
957 (substitute* "daemon/lua/sandbox.lua.in"
958 (("^trust_anchors\\.add_file.*") ""))
959 #t))
a35e16c0
SB
960 (add-after 'build 'build-doc
961 (lambda _
962 (invoke "ninja" "doc")))
963 (add-after 'install 'wrap-binary
964 (lambda* (#:key inputs outputs #:allow-other-keys)
965 (let* ((out (assoc-ref outputs "out"))
966 (lua-* (map cdr (filter
967 (lambda (input)
968 (string-prefix? "lua-" (car input)))
969 inputs)))
970 (lua-path (lambda (p)
971 (string-append p "/share/lua/5.1/?.lua")))
972 (lua-cpath (lambda (p)
973 (string-append p "/lib/lua/5.1/?.so"))))
974 (wrap-program (string-append out "/sbin/kresd")
975 `("LUA_PATH" ";" prefix ,(map lua-path lua-*))
976 `("LUA_CPATH" ";" prefix ,(map lua-cpath lua-*)))
977 #t))))))
978 (native-inputs
979 `(("cmocka" ,cmocka) ; for unit tests
980 ("doxygen" ,doxygen)
981 ("protobuf-c" ,protobuf-c)
982 ("pkg-config" ,pkg-config)
983 ("python-breathe" ,python-breathe)
984 ("python-sphinx" ,python-sphinx)
985 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
986 (inputs
987 `(("fstrm" ,fstrm)
988 ("gnutls" ,gnutls)
989 ("knot" ,knot)
990 ("libuv" ,libuv)
991 ("lmdb" ,lmdb)
992 ("luajit" ,luajit)
d1a26bed 993 ;; TODO: Add optional lua modules: basexx and psl.
fb420edd 994 ("lua-bitop" ,lua5.1-bitop)))
a35e16c0
SB
995 (home-page "https://www.knot-resolver.cz/")
996 (synopsis "Caching validating DNS resolver")
997 (description
998 "Knot Resolver is a caching full resolver implementation written in C and
999LuaJIT, both a resolver library and a daemon.")
1000 (license (list license:gpl3+
1001 ;; Some 'contrib' files are under MIT, CC0 and LGPL2.
1002 license:expat
1003 license:cc0
1004 license:lgpl2.0))))
1005
0bc2d3e4
OP
1006(define-public ddclient
1007 (package
1008 (name "ddclient")
8bb9f997
TGR
1009 (version "3.9.1")
1010 (source
1011 (origin
1012 (method git-fetch)
1013 (uri (git-reference
b0e7b699 1014 (url "https://github.com/ddclient/ddclient")
8bb9f997
TGR
1015 (commit (string-append "v" version))))
1016 (file-name (git-file-name name version))
1017 (sha256
1018 (base32 "0hf377g4j9r9sac75xp17nk2h58mazswz4vkg4g2gl2yyhvzq91w"))))
0bc2d3e4
OP
1019 (build-system trivial-build-system) ; no Makefile.PL
1020 (native-inputs
1021 `(("bash" ,bash)
8bb9f997 1022 ("perl" ,perl)))
0bc2d3e4 1023 (inputs
e12df2c6
TGR
1024 `(("inetutils" ,inetutils) ; logger
1025 ("net-tools" ,net-tools)
1026 ("perl-data-validate-ip" ,perl-data-validate-ip)
1027 ("perl-digest-sha1" ,perl-digest-sha1)
1028 ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
0bc2d3e4
OP
1029 (arguments
1030 `(#:modules ((guix build utils)
1031 (ice-9 match)
1032 (srfi srfi-26))
1033 #:builder
1034 (begin
1035 (use-modules (guix build utils)
1036 (ice-9 match)
1037 (srfi srfi-26))
0bc2d3e4
OP
1038 (setenv "PATH" (string-append
1039 (assoc-ref %build-inputs "bash") "/bin" ":"
0bc2d3e4 1040 (assoc-ref %build-inputs "perl") "/bin"))
8bb9f997
TGR
1041
1042 ;; Copy the (read-only) source into the (writable) build directory.
1043 (copy-recursively (assoc-ref %build-inputs "source") ".")
1044
1045 ;; Install.
1046 (let* ((out (assoc-ref %outputs "out"))
1047 (bin (string-append out "/bin")))
1048 (let ((file "ddclient"))
1049 (substitute* file
1050 (("/usr/bin/perl") (which "perl"))
1051 ;; Strictly use ‘/etc/ddclient/ddclient.conf’.
1052 (("\\$\\{program\\}\\.conf") "/etc/ddclient/ddclient.conf")
1053 (("\\$etc\\$program.conf") "/etc/ddclient/ddclient.conf")
1054 ;; Strictly use ‘/var/cache/ddclient/ddclient.cache’
1055 (("\\$cachedir\\$program\\.cache")
1056 "/var/cache/ddclient/ddclient.cache"))
1057 (install-file file bin)
1058 (wrap-program (string-append bin "/" file)
1059 `("PATH" ":" =
1060 ("$PATH"
1061 ,@(map (lambda (input)
1062 (match input
1063 ((name . store)
1064 (string-append store "/bin"))))
1065 %build-inputs)))
1066 `("PERL5LIB" ":" =
1067 ,(delete
1068 ""
1069 (map (match-lambda
1070 (((? (cut string-prefix? "perl-" <>) name) . dir)
1071 (string-append dir "/lib/perl5/site_perl"))
1072 (_ ""))
1073 %build-inputs)))))
1074 (for-each (cut install-file <> (string-append out
1075 "/share/ddclient"))
1076 (find-files "." "sample.*$"))))))
9469ab53 1077 (home-page "https://ddclient.net/")
0bc2d3e4
OP
1078 (synopsis "Address updating utility for dynamic DNS services")
1079 (description "This package provides a client to update dynamic IP
1080addresses with several dynamic DNS service providers, such as
1081@uref{https://www.dyndns.com/account/login.html,DynDNS.com}.
1082
1083This makes it possible to use a fixed hostname (such as myhost.dyndns.org) to
1084access a machine with a dynamic IP address.
1085
1086The client supports both dynamic and (near) static services, as well as MX
1087record and alternative name management. It caches the address, and only
1088attempts the update when it has changed.")
1089 (license license:gpl2+)))
91a4863d
LC
1090
1091(define-public hnsd
1092 ;; There have been no releases yet, hence this commit.
1093 (let ((revision "0")
1094 (commit "895d89c25d316d18df9d374fe78aae3902bc89fb"))
1095 (package
1096 (name "hnsd")
1097 (version (git-version "0.0" revision commit))
1098 (source (origin
1099 (method git-fetch)
1100 (uri (git-reference
1101 (url "https://github.com/handshake-org/hnsd")
1102 (commit commit)))
1103 (sha256
1104 (base32
1105 "0704y73sddn24jga9csw4gxyfb3pnrfnk0vdcph84n1h38490l16"))
1106 (file-name (git-file-name name version))
1107 (modules '((guix build utils)))
1108 (snippet
1109 '(begin
1110 ;; Delete the bundled copy of libuv.
1111 (delete-file-recursively "uv")
1112 (substitute* "configure.ac"
1113 (("AC_CONFIG_SUBDIRS\\(\\[uv\\]\\)") ""))
1114 (substitute* "Makefile.am"
1115 (("SUBDIRS = uv") "\n")
1116 (("\\$\\(top_builddir\\)/uv/libuv.la") "-luv")
1117
1118 ;; Make sure the 'hnsd' binary is installed and
1119 ;; dynamically-linked.
1120 (("noinst_PROGRAMS") "bin_PROGRAMS")
1121 (("hnsd_LDFLAGS = -static") ""))
1122
1123 ;; This script tries to chdir to "uv" and doesn't do more
1124 ;; than "autoreconf" so remove it.
1125 (delete-file "autogen.sh")
1126 #t))))
1127 (build-system gnu-build-system)
1128 (arguments
1129 '(#:configure-flags '("--disable-static"))) ;no need for libhsk.a
1130 (native-inputs
1131 `(("autoconf" ,autoconf)
1132 ("automake" ,automake)
1133 ("libtool" ,libtool)))
1134 (inputs
1135 `(("unbound" ,unbound)
1136 ("libuv" ,libuv)))
1137 (home-page "https://www.handshake.org/")
1138 (synopsis "Resolver daemon for the Handshake naming protocol")
1139 (description
1140 "@command{hnsd} is a @dfn{host name resolver} for the Handshake Naming
1141System (HNS) peer-to-peer network.")
1142 (license license:expat))))
498911d3
MO
1143
1144(define-public libmicrodns
1145 (package
1146 (name "libmicrodns")
65fd3f0a 1147 (version "0.1.2")
498911d3 1148 (source (origin
65fd3f0a
LF
1149 (method url-fetch)
1150 (uri (string-append "https://github.com/videolabs/libmicrodns/"
1151 "releases/download/" version "/microdns-"
1152 version ".tar.xz"))
498911d3
MO
1153 (sha256
1154 (base32
65fd3f0a
LF
1155 "0p4va18zxgmzcdwhlbg2mmjwswlbgqy4ay5vaxrw7cxmhsflnv36"))))
1156 (build-system meson-build-system)
498911d3
MO
1157 (home-page "https://github.com/videolabs/libmicrodns")
1158 (synopsis "Minimal mDNS resolver library")
1159 (description "@code{libmicrodns} provides a minimal implementation of a
1160mDNS resolver as well as an announcer. mDNS (Multicast Domain Name System) is
1161a zero-config service that allows one to resolve host names to IP addresses in
1162local networks.")
1163 (license license:lgpl2.1)))
41553c90
CM
1164
1165(define-public public-suffix-list
1166 ;; Mozilla releases the official list here:
1167 ;;
1168 ;; https://publicsuffix.org/list/public_suffix_list.dat
1169 ;;
1170 ;; However, Mozilla syncs that file from the GitHub repository periodically,
1171 ;; so its contents will change over time. If you update this commit, please
1172 ;; make sure that the new commit refers to a list which is identical to the
1173 ;; officially published list available from the URL above.
1174 (let ((commit "9375b697baddb0827a5995c81bd3c75877a0b35d"))
1175 (package
1176 (name "public-suffix-list")
1177 (version (git-version "0" "1" commit))
1178 (source (origin
1179 (method git-fetch)
1180 (uri (git-reference
b0e7b699 1181 (url "https://github.com/publicsuffix/list")
41553c90
CM
1182 (commit commit)))
1183 (file-name (git-file-name name version))
1184 (sha256
1185 (base32
1186 "1sm7pni01rnl4ldzi8z8nc4cbgq8nxda9gwc68v0s3ij7jd1jmik"))))
1187 (build-system trivial-build-system)
1188 (arguments
1189 `(#:modules ((guix build utils))
1190 #:builder
1191 (begin
1192 (use-modules (guix build utils))
1193 (let* ((out (assoc-ref %outputs "out"))
1194 ;; Install to /share because that is where "read-only
1195 ;; architecture-independent data files" should go (see:
1196 ;; (standards) Directory Variables). Include the version in
1197 ;; the directory name so that if multiple versions are ever
1198 ;; installed in the same profile, they will not conflict.
1199 (destination (string-append
1200 out "/share/public-suffix-list-" ,version))
1201 (source (assoc-ref %build-inputs "source")))
1202 (with-directory-excursion source
1203 (install-file "public_suffix_list.dat" destination)
1204 (install-file "LICENSE" destination))
1205 #t))))
1206 (home-page "https://publicsuffix.org/")
1207 (synopsis "Database of current and historical DNS suffixes")
1208 (description "This is the Public Suffix List maintained by Mozilla. A
1209\"public suffix\" is one under which Internet users can (or historically
1210could) directly register names in the Domain Name System (DNS). Some examples
1211of public suffixes are .com, .co.uk and pvt.k12.ma.us. This is a list of all
1212known public suffixes.")
1213 (license license:mpl2.0))))
0d36d0ba
AI
1214
1215(define-public maradns
1216 (package
1217 (name "maradns")
0ac91500 1218 (version "3.5.0007")
0d36d0ba
AI
1219 (source
1220 (origin
1221 (method url-fetch)
1222 (uri (string-append "https://maradns.samiam.org/download/"
1223 (version-major+minor version) "/"
1224 version "/maradns-" version ".tar.xz"))
1225 (sha256
0ac91500 1226 (base32 "0bc19xylg4whww9qaj5i4izwxcrh0c0ja7l1pfcn2la02hlvg1a6"))))
0d36d0ba
AI
1227 (build-system gnu-build-system)
1228 (arguments
0ac91500 1229 `(#:tests? #f ; need to be root to run tests
0d36d0ba
AI
1230 #:make-flags
1231 (list
de53ddb5 1232 ,(string-append "CC=" (cc-for-target))
0d36d0ba
AI
1233 (string-append "PREFIX=" %output)
1234 (string-append "RPM_BUILD_ROOT=" %output))
1235 #:phases
1236 (modify-phases %standard-phases
1237 (replace 'configure
018114ba
AI
1238 (lambda* (#:key native-inputs target #:allow-other-keys)
1239 ;; make_32bit_tables generates a header file that is used during
1240 ;; compilation. Hence, during cross compilation, it should be
1241 ;; built for the host system.
1242 (when target
1243 (substitute* "rng/Makefile"
1244 (("\\$\\(CC\\) -o make_32bit_tables")
1245 (string-append (assoc-ref native-inputs "gcc")
1246 "/bin/gcc -o make_32bit_tables"))))
0d36d0ba
AI
1247 (invoke "./configure")))
1248 (add-before 'install 'create-install-directories
1249 (lambda* (#:key outputs #:allow-other-keys)
1250 (let ((out (assoc-ref outputs "out")))
1251 (for-each (lambda (dir)
1252 (mkdir-p (string-append out dir)))
1253 (list "/bin" "/sbin" "/etc"
1254 "/share/man/man1"
1255 "/share/man/man5"
1256 "/share/man/man8"))
1257 #t))))))
1258 (home-page "https://maradns.samiam.org")
1259 (synopsis "Small lightweight DNS server")
1260 (description "MaraDNS is a small and lightweight DNS server. MaraDNS
1261consists of a UDP-only authoritative DNS server for hosting domains, and a UDP
1262and TCP-capable recursive DNS server for finding domains on the internet.")
1263 (license license:bsd-2)))
6b6647f8
BW
1264
1265(define-public openresolv
1266 (package
1267 (name "openresolv")
1268 (version "3.10.0")
1269 (source (origin
1270 (method url-fetch)
1271 (uri (string-append "https://roy.marples.name/downloads/openresolv/"
1272 "openresolv-" version ".tar.xz"))
1273 (sha256
1274 (base32
1275 "01ms6c087la4hk0f0w6n2vpsb7dg4kklah2rqyhz88p0vr9bqy20"))
1276 (patches
1277 (search-patches "openresolv-restartcmd-guix.patch"))))
1278 (build-system gnu-build-system)
1279 (arguments
1280 `(#:tests? #f ; No test suite
1281 #:configure-flags
1282 (list (string-append "--sysconfdir=/etc"))
1283 #:make-flags
1284 (list (string-append "SYSCONFDIR=/" (assoc-ref %outputs "out") "/etc"))))
1285 (home-page "https://roy.marples.name/projects/openresolv/")
1286 (synopsis "Resolvconf POSIX compliant implementation, a middleman for resolv.conf")
1287 (description "openresolv is an implementation of @command{resolvconf}, the
1288middleman between the network configuration services and
1289@file{/etc/resolv.conf}. @command{resolvconf} itself is just a script that
1290stores, removes and lists a full @file{resolv.conf} generated for the
1291interface. It then calls all the helper scripts it knows about so it can
1292configure the real @file{/etc/resolv.conf} and optionally any local
1293nameservers other than libc.")
1294 (license license:bsd-2)))