projects/guix·blob java-team · refs

1693 lines · 68.9 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013-2015, 2017, 2018 Ludovic Courtès <[email protected]>
3;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <[email protected]>
4;;; Copyright © 2014, 2016 Mark H Weaver <[email protected]>
5;;; Copyright © 2016, 2018 Ricardo Wurmus <[email protected]>
6;;; Copyright © 2015-2018, 2020 Efraim Flashner <[email protected]>
7;;; Copyright © 2016 John Darrington <[email protected]>
8;;; Copyright © 2016 Nikita <[email protected]>
9;;; Copyright © 2016–2022 Tobias Geerinckx-Rice <[email protected]>
10;;; Copyright © 2016, 2019-2021 Marius Bakke <[email protected]>
11;;; Copyright © 2017 Vasile Dumitrascu <[email protected]>
12;;; Copyright © 2017 Gregor Giesen <[email protected]>
13;;; Copyright © 2022 Oleg Pykhalov <[email protected]>
14;;; Copyright © 2019 Mathieu Othacehe <[email protected]>
15;;; Copyright © 2019 Chris Marusich <[email protected]>
16;;; Copyright © 2019 Rutger Helling <[email protected]>
17;;; Copyright © 2020, 2021 Pierre Langlois <[email protected]>
18;;; Copyright © 2020 Arun Isaac <[email protected]>
19;;; Copyright © 2020 Leo Famulari <[email protected]>
20;;; Copyright © 2020 Brice Waegeneire <[email protected]>
21;;; Copyright © 2020 Simon South <[email protected]>
22;;; Copyright © 2021 Maxime Devos <[email protected]>
23;;; Copyright © 2021, 2024 Zheng Junjie <[email protected]>
24;;; Copyright © 2023 Bruno Victal <[email protected]>
25;;; Copyright © 2023 Hilton Chain <[email protected]>
26;;; Copyright © 2023 Janneke Nieuwenhuizen <[email protected]>
27;;; Copyright © 2024 John Kehayias <[email protected]>
28;;; Copyright © 2024-2026 Ashish SHUKLA <[email protected]>
29;;; Copyright © 2025-2026 Artyom V. Poptsov <[email protected]>
30;;; Copyright © 2026 Anderson Torres <[email protected]>
31;;; Copyright © 2026 moksh <[email protected]>
32;;; Copyright © 2026 Sharlatan Hellseher <[email protected]>
33;;;
34;;; This file is part of GNU Guix.
35;;;
36;;; GNU Guix is free software; you can redistribute it and/or modify it
37;;; under the terms of the GNU General Public License as published by
38;;; the Free Software Foundation; either version 3 of the License, or (at
39;;; your option) any later version.
40;;;
41;;; GNU Guix is distributed in the hope that it will be useful, but
42;;; WITHOUT ANY WARRANTY; without even the implied warranty of
43;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44;;; GNU General Public License for more details.
45;;;
46;;; You should have received a copy of the GNU General Public License
47;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
48
49(define-module (gnu packages dns)
50 #:use-module (gnu packages admin)
51 #:use-module (gnu packages autotools)
52 #:use-module (gnu packages base)
53 #:use-module (gnu packages bash)
54 #:use-module (gnu packages check)
55 #:use-module (gnu packages compression)
56 #:use-module (gnu packages crypto)
57 #:use-module (gnu packages curl)
58 #:use-module (gnu packages databases)
59 #:use-module (gnu packages datastructures)
60 #:use-module (gnu packages dbm)
61 #:use-module (gnu packages documentation)
62 #:use-module (gnu packages elf)
63 #:use-module (gnu packages compiler-tools)
64 #:use-module (gnu packages freedesktop)
65 #:use-module (gnu packages gcc)
66 #:use-module (gnu packages gettext)
67 #:use-module (gnu packages glib)
68 #:use-module (gnu packages golang)
69 #:use-module (gnu packages golang-web)
70 #:use-module (gnu packages golang-crypto)
71 #:use-module (gnu packages golang-build)
72 #:use-module (gnu packages golang-check)
73 #:use-module (gnu packages golang-xyz)
74 #:use-module (gnu packages groff)
75 #:use-module (gnu packages gtk)
76 #:use-module (gnu packages libdaemon)
77 #:use-module (gnu packages libedit)
78 #:use-module (gnu packages libevent)
79 #:use-module (gnu packages libidn)
80 #:use-module (gnu packages linux)
81 #:use-module (gnu packages lua)
82 #:use-module (gnu packages m4)
83 #:use-module (gnu packages ncurses)
84 #:use-module (gnu packages nettle)
85 #:use-module (gnu packages networking)
86 #:use-module (gnu packages perl)
87 #:use-module (gnu packages perl-check)
88 #:use-module (gnu packages pkg-config)
89 #:use-module (gnu packages protobuf)
90 #:use-module (gnu packages python)
91 #:use-module (gnu packages python-build)
92 #:use-module (gnu packages python-web)
93 #:use-module (gnu packages python-xyz)
94 #:use-module (gnu packages ragel)
95 #:use-module (gnu packages serialization)
96 #:use-module (gnu packages shells)
97 #:use-module (gnu packages sphinx)
98 #:use-module (gnu packages swig)
99 #:use-module (gnu packages texinfo)
100 #:use-module (gnu packages tls)
101 #:use-module (gnu packages web)
102 #:use-module (gnu packages xml)
103 #:use-module (gnu packages)
104 #:use-module (guix build-system cmake)
105 #:use-module (guix build-system copy)
106 #:use-module (guix build-system glib-or-gtk)
107 #:use-module (guix build-system go)
108 #:use-module (guix build-system gnu)
109 #:use-module (guix build-system meson)
110 #:use-module (guix build-system pyproject)
111 #:use-module (guix download)
112 #:use-module (guix gexp)
113 #:use-module (guix git-download)
114 #:use-module ((guix licenses) #:prefix license:)
115 #:use-module (guix packages)
116 #:use-module ((guix search-paths) #:select ($SSL_CERT_DIR $SSL_CERT_FILE))
117 #:use-module (guix utils))
118
119(define-public adns
120 (package
121 (name "adns")
122 (version "1.6.2")
123 (source
124 (origin
125 (method git-fetch)
126 (uri (git-reference
127 (url "git://git.chiark.greenend.org.uk/~ianmdlvl/adns.git")
128 (commit (string-append "adns-" version))))
129 (file-name (git-file-name name version))
130 (sha256
131 (base32
132 "1vklz29q10w0cs3nc70d1f1rg62sr50h8v4i7kp53x0hjzzfzyq1"))))
133 (build-system gnu-build-system)
134 (arguments
135 (list
136 ;; INFO: Tests expect real name resolution to work.
137 #:tests? #f
138 #:configure-flags
139 #~(list
140 ;; Make sure the programs under bin/ find libadns.so.
141 (string-append "LDFLAGS=-Wl,-rpath -Wl,"
142 #$output:out
143 "/lib"))))
144 (native-inputs
145 (list m4))
146 (home-page "https://www.gnu.org/software/adns/")
147 (synopsis "Asynchronous DNS client library and utilities")
148 (description
149 "GNU adns is a C library that provides easy-to-use @acronym{DNS, Domain
150Name System} resolution functionality. The library is asynchronous, allowing
151several concurrent calls. The package also includes several command-line
152utilities for use in scripts.")
153 (license license:gpl3+)))
154
155(define-public avahi
156 (package
157 (name "avahi")
158 (version "0.8")
159 (home-page "https://avahi.org")
160 (source (origin
161 (method url-fetch)
162 (uri (string-append home-page "/download/avahi-"
163 version ".tar.gz"))
164 (sha256
165 (base32
166 "1npdixwxxn3s9q1f365x9n9rc5xgfz39hxf23faqvlrklgbhj0q6"))
167 (patches (search-patches "avahi-localstatedir.patch"))
168 (modules '((guix build utils)))
169 (snippet
170 '(begin
171 ;; Fix version constraint in the avahi-libevent pkg-config file.
172 ;; This can be removed for Avahi versions > 0.8.
173 (substitute* "avahi-libevent.pc.in"
174 (("libevent-2\\.1\\.5")
175 "libevent >= 2.1.5"))))))
176 (build-system gnu-build-system)
177 (arguments
178 `(#:configure-flags '("--with-distro=none"
179 "--disable-static"
180 "--localstatedir=/var" ; for the DBus socket
181 "--disable-python"
182 "--disable-mono"
183 "--disable-doxygen-doc"
184 "--disable-xmltoman"
185 "--enable-tests"
186 "--disable-qt4" "--disable-qt5"
187 "--disable-gtk" "--disable-gtk3"
188 "--enable-compat-libdns_sd"
189 ,@(if (%current-target-system)
190 '("ac_cv_prog_have_pkg_config=yes")
191 '())
192 ,@(if (or (%current-target-system)
193 (not (member (%current-system)
194 (package-supported-systems
195 libcap))))
196 '("--disable-autoipd")
197 '())
198 ,@(if (target-hurd?)
199 '("CFLAGS=-g -O2 -Wno-error=incompatible-pointer-types")
200 '()))
201 #:modules ((srfi srfi-26)
202 (guix build utils)
203 (guix build gnu-build-system))
204 #:phases
205 ,#~(modify-phases %standard-phases
206 (add-after 'patch-shebangs 'patch-more-shebangs
207 (lambda* (#:key inputs #:allow-other-keys)
208 (define path
209 `(,(dirname (search-input-file inputs "bin/sh"))))
210 (for-each
211 (cut patch-shebang <> path)
212 (find-files (string-append #$output "/etc/avahi"))))))))
213 (inputs
214 (cons* bash-minimal
215 dbus
216 expat
217 gdbm
218 glib
219 libdaemon
220 libevent
221 ;; Do not use libcap when cross-compiling since it's not quite
222 ;; cross-compilable; and use it only for supported systems.
223 (if (and (not (%current-target-system))
224 (member (%current-system)
225 (package-supported-systems libcap)))
226 (list libcap) ;to enable chroot support in avahi-daemon
227 (list))))
228 (native-inputs
229 (list gettext-minimal
230 (list glib "bin")
231 pkg-config))
232 (synopsis "Implementation of mDNS/DNS-SD protocols")
233 (description
234 "Avahi is a system which facilitates service discovery on a local
235network. It is an implementation of the mDNS (for \"Multicast DNS\") and
236DNS-SD (for \"DNS-Based Service Discovery\") protocols.")
237 (license license:lgpl2.1+)))
238
239(define-public c-ares
240 (package
241 (name "c-ares")
242 (version "1.34.4")
243 (source
244 (origin
245 (method url-fetch)
246 (uri (string-append
247 "https://github.com/c-ares/c-ares/releases/download/v"
248 version "/" name "-" version ".tar.gz"))
249 (sha256
250 (base32
251 "0br2msk3bpl5myhjp9vr5j2scpspvbg2fpnz69dcrr4ycpnxnf7s"))))
252 (build-system gnu-build-system)
253 (arguments
254 (list
255 #:phases
256 #~(modify-phases %standard-phases
257 (add-before 'check 'filter-live-tests
258 (lambda _
259 ;; Filter tests that require internet access.
260 (setenv "GTEST_FILTER" "-*.Live*:*.FamilyV4*")))
261 #$@(if (system-hurd?)
262 #~((add-after 'unpack 'skip-tests
263 (lambda _
264 (substitute* "test/ares-test-main.cc"
265 (("(^| )main *\\(.*" all)
266 (string-append all " exit (77);\n")))))
267 (add-after 'filter-live-tests 'filter-hurd-tests
268 (lambda _
269 (setenv "GTEST_FILTER"
270 (string-append
271 (getenv "GTEST_FILTER")
272 ":.*Basic/2"
273 ":.*CancelImmediate/2"
274 ":.*CancelImmediateGetHostByAddr/2"
275 ":.*CancelLater/1"
276 ":.*FamilyUnspecified/2"
277 ":.*FamilyV6/2"
278 ":.*GetAddrInfoParallelLookups/1"
279 ":.*GetHostByAddrDestroy/2"
280 ":.*GetHostByNameCNAMENoData/2"
281 ":.*GetHostByNameDestroyAbsolute/2"
282 ":.*GetHostByNameDestroyRelative/2"
283 ":.*GetHostByNameParallelLookups/1"
284 ":.*HostAlias/2"
285 ":.*HostAliasMissing/2"
286 ":.*HostAliasMissingFile/2"
287 ":.*NotImplResponse/2"
288 ":.*RefusedResponse/2"
289 ":.*Resend/1"
290 ":.*RetryWithoutEDNS/2"
291 ":.*SearchDomains/2"
292 ":.*SearchDomainsBare/2"
293 ":.*SearchDomainsServFailOnAAAA/2"
294 ":.*SearchDomainsWithResentReply/1"
295 ":.*SearchHighNdots/2"
296 ":.*SearchNoDataThenFail/2"
297 ":.*SearchNoDataThenNoDataBare/2"
298 ":.*SearchNoDataThenSuccess/2"
299 ":.*ServFailResponse/2"
300 ":.*SimpleQuery/2"
301 ":.*SockCallback/2"
302 ":.*SockConfigureCallback/2"
303 ":.*SortListV4/2"
304 ":.*SortListV6/2"
305 ":.*ThirdServer/2"
306 ":.*TruncationRetry/1"
307 ":.*UnspecifiedFamilyCname6A4/2"
308 ":.*UnspecifiedFamilyV4/2"
309 ":.*UnspecifiedFamilyV6/2")))))
310 #~()))))
311 (native-inputs
312 (list pkg-config))
313 (home-page "https://c-ares.haxx.se/")
314 (synopsis "C library for asynchronous DNS requests")
315 (description
316 "C-ares is a C library that performs DNS requests and name resolution
317asynchronously. It is intended for applications which need to perform DNS
318queries without blocking, or need to perform multiple DNS queries in parallel.
319The primary examples of such applications are servers which communicate with
320multiple clients and programs with graphical user interfaces.")
321 (license (license:x11-style "https://c-ares.haxx.se/license.html"))))
322
323(define-public c-ares-for-node-lts
324 (hidden-package c-ares))
325
326(define-public c-ares-for-node-bootstrap
327 (hidden-package
328 (package
329 (inherit c-ares)
330 (version "1.18.1")
331 (source
332 (origin
333 (method url-fetch)
334 (uri (string-append
335 "https://c-ares.haxx.se/download/c-ares-" version
336 ".tar.gz"))
337 (sha256
338 (base32
339 "1kxviskwsaa7dcgscvssxa8ps88pdq7kq4z93gxvz7sam2l54z8s")))))))
340
341;; INFO: gRPC requires a c-ares built with CMake in order to get the .cmake
342;; modules. We can not build c-ares itself with CMake because that would
343;; introduce a circular dependency through nghttp2.
344;;
345;; TODO: It would be nice if we could extract the modules somehow and make
346;; them work with the "normal" c-ares package instead of building a whole new
347;; library.
348(define-public c-ares/cmake
349 (hidden-package
350 (package
351 (inherit c-ares)
352 (build-system cmake-build-system)
353 (arguments
354 (list
355 ;; INFO: Tests require name resolution (the normal variant runs no
356 ;; tests).
357 #:tests? #f)))))
358
359(define-public cloudflare-cli
360 (let ((commit "2d986d3ec1b0e3158c4bd40e8918947cb74aa392")
361 (revision "1"))
362 (package
363 (name "cloudflare-cli")
364 (version (git-version "0.0.0" revision commit))
365 (source
366 (origin
367 (method git-fetch)
368 (uri (git-reference
369 (url "https://github.com/earlchew/cloudflare-cli")
370 (commit commit)))
371 (file-name (git-file-name name version))
372 (sha256
373 (base32
374 "0f86g6n86kwykl3jnhqjrdfy8ybkp03ghr3dlr70q2552qw4axw2"))))
375 (build-system copy-build-system)
376 (arguments
377 `(#:install-plan '(("cloudflare-cli" "bin/") ("cloudflare-cli.sh" "bin/"))
378 #:phases
379 (modify-phases %standard-phases
380 (add-after 'unpack 'find-jsonsh
381 (lambda* (#:key inputs #:allow-other-keys)
382 (substitute* "cloudflare-cli.sh"
383 (("\\$\\{0%/\\*\\}/jsonsh")
384 (string-append (assoc-ref inputs "json.sh") "/bin/JSON.sh")))
385 #t))
386 (add-after 'install 'wrap-program
387 (lambda* (#:key inputs outputs #:allow-other-keys)
388 (wrap-program (string-append (assoc-ref outputs "out") "/bin/cloudflare-cli")
389 `("PATH" ":" prefix
390 (,(string-join
391 (map (lambda (in) (string-append (assoc-ref inputs in) "/bin"))
392 '("grep" "curl"))
393 ":"))))
394 #t)))))
395 (inputs
396 (list bash-minimal curl grep json.sh))
397 (synopsis
398 "CLI to edit Cloudflare DNS records")
399 (description
400 "This command line tool to update Cloudfare DNS records is useful for tasks
401such as updating dynamic DNS records or updating DNS records for the ACME DNS-01
402protocol.")
403 (home-page "https://github.com/earlchew/cloudflare-cli")
404 (license license:expat))))
405
406(define-public ddclient
407 (package
408 (name "ddclient")
409 (version "4.0.0")
410 (source
411 (origin
412 (method git-fetch)
413 (uri (git-reference
414 (url "https://github.com/ddclient/ddclient")
415 (commit (string-append "v" version))))
416 (file-name (git-file-name name version))
417 (sha256
418 (base32 "0sz4f7qx4yjg6q6ybhzilb7f0kshz46c54y3i4hq2nww2bhkc8a4"))))
419 (build-system gnu-build-system)
420 (arguments
421 (list
422 #:phases
423 #~(modify-phases %standard-phases
424 (add-before 'bootstrap 'patch-ddclient.in-shebang
425 (lambda _
426 ;; This is run in the bootstrap phase, so patch before
427 (patch-shebang "ddclient.in")))
428 (add-after 'install 'wrap-program
429 (lambda* (#:key inputs #:allow-other-keys)
430 (wrap-program (string-append #$output "/bin/ddclient")
431 `("PERL5LIB" ":" prefix
432 ,(map (lambda (input-name)
433 (string-append (assoc-ref inputs input-name)
434 "/lib/perl5/site_perl"))
435 '("perl-json")))))))))
436 (native-inputs
437 (list autoconf
438 automake
439 perl-http-daemon
440 perl-plack
441 perl-test-mockmodule
442 perl-test-tcp
443 perl-test-warnings))
444 (inputs
445 (list curl
446 perl
447 perl-json
448 bash-minimal))
449 (home-page "https://github.com/ddclient/ddclient")
450 (synopsis "Dynamic DNS update client")
451 (description
452 "ddclient is used to update dynamic DNS entries for accounts on many
453dynamic DNS services. It supports a wide range of routers and protocols,
454including Cloudflare, Namecheap, DynDNS, FreeDNS, Google Domains, and many
455more.")
456 (license license:gpl2+)))
457
458(define-public ldns
459 (package
460 (name "ldns")
461 (version "1.9.2")
462 (source
463 (origin
464 (method url-fetch)
465 (uri
466 (string-append "https://www.nlnetlabs.nl/downloads/"
467 "ldns/ldns-" version ".tar.gz"))
468 (sha256
469 (base32 "0padp6fhfv0rb3q0cmz35ycabgc43dzw5f6f01186vjbk4hzl95m"))
470 (patches
471 ;; This patch adds the Guix-specific {drill,examples}{bin,man}dir make
472 ;; flags used below.
473 (search-patches "ldns-drill-examples.patch"))))
474 (build-system gnu-build-system)
475 (outputs '("out" "drill" "examples" "pyldns"))
476 (arguments
477 (list
478 #:tests? #f ; tests require <https://tpkg.github.io>
479 #:configure-flags
480 #~(list
481 "--disable-static"
482 "--enable-gost-anyway"
483 "--enable-rrtype-ninfo"
484 "--enable-rrtype-rkey"
485 "--enable-rrtype-ta"
486 "--enable-rrtype-avc"
487 "--enable-rrtype-doa"
488 "--enable-rrtype-amtrelay"
489 "--with-drill"
490 "--with-examples"
491 "--with-pyldns"
492 ;; Perl module DNS::LDNS not available.
493 ;; https://github.com/erikoest/DNS-LDNS.git
494 ;; "--with-p5-dns-ldns"
495 (string-append "--with-ssl=" #$(this-package-input "openssl"))
496 (string-append "--with-ca-path=/etc/ssl/certs"))
497 #:make-flags
498 #~(list
499 (string-append "drillbindir=" #$output:drill "/bin")
500 (string-append "drillmandir=" #$output:drill "/share/man")
501 (string-append "examplesbindir=" #$output:examples "/bin")
502 (string-append "examplesmandir=" #$output:examples "/share/man")
503 (string-append "python_site=" #$output:pyldns "/lib/python"
504 #$(version-major+minor (package-version
505 (this-package-input
506 "python-wrapper")))
507 "/site-packages"))))
508 (native-inputs
509 (list doxygen perl perl-devel-checklib pkg-config swig-4.0))
510 (inputs
511 (list libpcap openssl python-wrapper))
512 (synopsis "DNS library that facilitates DNS tool programming")
513 (description "LDNS aims to simplify DNS programming, it supports recent
514RFCs like the DNSSEC documents, and allows developers to easily create
515software conforming to current RFCs, and experimental software for current
516Internet Drafts. A secondary benefit of using ldns is speed; ldns is written in
517C it should be a lot faster than Perl.")
518 (home-page "https://nlnetlabs.nl/projects/ldns/about/")
519 (license license:bsd-3)))
520
521(define-public nss-mdns
522 (package
523 (name "nss-mdns")
524 (version "0.14.1")
525 (home-page "https://github.com/lathiat/nss-mdns")
526 (source (origin
527 (method url-fetch)
528 (uri (string-append home-page "/releases/download/v" version "/"
529 name "-" version ".tar.gz"))
530 (sha256
531 (base32
532 "134wdr0n9cm5ab4g6dwq76lvzqns9dcylr470i2xxjimnw0l22d2"))))
533 (build-system gnu-build-system)
534 (arguments
535 ;; The Avahi daemon socket is expected by 'configure.ac' to be at
536 ;; "$(localstatedir)/run/avahi-daemon/socket", but nowadays it lives in
537 ;; /run/avahi-daemon/socket. Remove the "$(localstatedir)" bit.
538 '(#:configure-flags '("AVAHI_SOCKET=/run/avahi-daemon/socket")))
539 (synopsis "Multicast DNS Name Service Switch (@dfn{NSS}) plug-in")
540 (description
541 "Nss-mdns is a plug-in for the GNU C Library's Name Service Switch
542(@dfn{NSS}) that resolves host names via multicast DNS (@dfn{mDNS}). It is
543most often used in home and other small networks without a local name server,
544to resolve host names in the @samp{.local} top-level domain.")
545 (license license:lgpl2.1+)))
546
547(define-public dnssec-trigger
548 (package
549 (name "dnssec-trigger")
550 (version "0.17")
551 (source
552 (origin
553 (method url-fetch)
554 (uri
555 (string-append "https://www.nlnetlabs.nl/downloads/"
556 name "/" name "-" version ".tar.gz"))
557 (sha256
558 (base32 "10928q406x9r66a090xl5kznzgyxpja88w4srwcv454hd351j9f0"))))
559 (build-system glib-or-gtk-build-system)
560 (outputs '("out" "gui" "nm"))
561 (arguments
562 (list #:test-target "test"
563 #:configure-flags
564 #~(list
565 (string-append "--with-ssl=" #$(this-package-input "openssl"))
566 "--with-hooks=networkmanager"
567 (string-append "--with-networkmanager-dispatch="
568 #$output:nm
569 "/etc/NetworkManager/dispatcher.d")
570 (string-append "--with-xdg-autostart="
571 #$output:gui
572 "/etc/xdg/autostart")
573 (string-append "--with-uidir="
574 #$output:gui
575 "/share/dnssec-trigger")
576 (string-append "--with-python="
577 #$(this-package-native-input "python-wrapper")
578 "/bin/python")
579 (string-append "--with-unbound-control="
580 #$(this-package-input "unbound")
581 "/sbin/unbound-control")
582 "--with-forward-zones-support")
583 #:phases
584 #~(modify-phases %standard-phases
585 (add-after 'unpack 'patch-configure
586 (lambda _
587 (substitute* "configure"
588 (("appindicator-0.1")
589 "appindicator3-0.1"))))
590 (add-before 'configure 'patch-makefile
591 (lambda _
592 (substitute* "Makefile.in"
593 (("/usr")
594 "$(prefix)")
595 (("/etc")
596 "$(prefix)/etc")
597 ((".*gtk-update-icon-cache.*")
598 ""))))
599 (add-after 'install 'remove-systemd
600 (lambda _
601 (delete-file-recursively
602 (string-append #$output "/lib/systemd"))))
603 (add-after 'remove-systemd 'move-gui
604 (lambda _
605 (mkdir-p (string-append #$output:gui "/bin"))
606 (mkdir-p (string-append #$output:gui "/share"))
607 (rename-file
608 (string-append #$output "/bin")
609 (string-append #$output:gui "/bin"))
610 (rename-file
611 (string-append #$output "/share/icons")
612 (string-append #$output:gui "/share/icons"))))
613 (add-after 'move-gui 'move-nm
614 (lambda _
615 (mkdir-p (string-append #$output:nm "/libexec"))
616 (rename-file
617 (string-append #$output "/libexec")
618 (string-append #$output:nm "/libexec")))))))
619 (native-inputs
620 (list cmocka pkg-config python-wrapper))
621 (inputs
622 (list gtk+-2 ldns libappindicator openssl unbound))
623 (synopsis "DNSSEC protection for the DNS traffic")
624 (description "DNSSEC-Trigger enables your computer to use DNSSEC protection
625for the DNS traffic. It relies on the Unbound DNS resolver running locally on
626your system, which performs DNSSEC validation. It reconfigures Unbound in such
627a way that it will signal it to to use the DHCP obtained forwarders if possible,
628fallback to doing its own AUTH queries if that fails, and if that fails it will
629prompt the user with the option to go with insecure DNS only.")
630 (home-page "https://www.nlnetlabs.nl/projects/dnssec-trigger/about/")
631 (license license:bsd-3)))
632
633(define-public dnsmasq
634 (package
635 (name "dnsmasq")
636 (version "2.92")
637 (source
638 (origin
639 (method git-fetch)
640 (uri (git-reference
641 (url "http://thekelleys.org.uk/git/dnsmasq.git")
642 (commit (string-append "v" version))))
643 (file-name (git-file-name name version))
644 (sha256
645 (base32 "055gn5kigz0m9y09vig97s1g257hnlkhw4wv9d9wdficnsxcbwwm"))))
646 (build-system gnu-build-system)
647 (arguments
648 (list
649 #:tests? #f ;no tests
650 #:make-flags
651 #~(list (string-append "PREFIX=" #$output)
652 (string-append "CC=" #$(cc-for-target))
653 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
654 "COPTS=\"-DHAVE_DBUS\"")
655 #:phases
656 #~(modify-phases %standard-phases
657 (delete 'configure) ;no configure
658 (add-after 'install 'install-dbus
659 (lambda _
660 (install-file "dbus/dnsmasq.conf"
661 (string-append #$output "/etc/dbus-1/system.d")))))))
662 (native-inputs
663 (list pkg-config))
664 (inputs
665 (list dbus))
666 (home-page "https://thekelleys.org.uk/dnsmasq/doc.html")
667 (synopsis "Small caching DNS proxy and DHCP/TFTP server")
668 (description
669 "Dnsmasq is a light-weight DNS forwarder and DHCP server. It is designed
670to provide DNS and, optionally, DHCP to a small network. It can serve the
671names of local machines which are not in the global DNS. The DHCP server
672integrates with the DNS server and allows machines with DHCP-allocated
673addresses to appear in the DNS with names configured either on each host or in
674a central configuration file. Dnsmasq supports static and dynamic DHCP leases
675and BOOTP/TFTP for network booting of diskless machines.")
676 ;; Source files only say GPL2 and GPL3 are allowed.
677 (license (list license:gpl2 license:gpl3))))
678
679(define-public dnsupdate
680 (package
681 (name "dnsupdate")
682 (version "0.4.1")
683 (source
684 (origin
685 (method git-fetch)
686 (uri (git-reference
687 (url "https://github.com/lopsided98/dnsupdate")
688 (commit version)))
689 (file-name (git-file-name name version))
690 (sha256
691 (base32 "0bp6mm0yhg4hs698xdmvcfad4jqf5rgb1cab88pfzyx9w52x0ag6"))))
692 (build-system pyproject-build-system)
693 (arguments
694 (list #:test-backend #~'unittest
695 #:test-flags #~'("discover" "-p" "*_test.py")))
696 (native-inputs
697 (list python-setuptools))
698 (propagated-inputs
699 (list python-beautifulsoup4
700 python-netifaces
701 python-pyyaml
702 python-requests))
703 (home-page "https://github.com/lopsided98/dnsupdate")
704 (synopsis "Modern and flexible dynamic DNS client")
705 (description
706 "Dnsupdate is a dynamic DNS client that provides support for multiple DNS
707services, including Afraid.org FreeDNS, Cloudflare, IETF standard DNS
708updates (nsupdate), and custom HTTP-based services. It uses YAML
709configuration files and supports multiple address detection methods.")
710 (license license:gpl3+)))
711
712;; 'bind' is the name of a built-in Guile procedure, which is why we choose a
713;; different name here.
714(define-public isc-bind
715 (package
716 (name "bind")
717 ;; When updating, check whether isc-dhcp's bundled copy should be as well.
718 ;; The BIND release notes are available here:
719 ;; https://www.isc.org/bind/
720 (version "9.19.24")
721 (source
722 (origin
723 (method url-fetch)
724 (uri (string-append "https://ftp.isc.org/isc/bind9/" version
725 "/bind-" version ".tar.xz"))
726 (sha256
727 (base32 "171668qgjvf257m3r04lxmbsiz9lnn57djnlmn8plh1lj77fw3nh"))))
728 (build-system gnu-build-system)
729 (outputs `("out" "utils"))
730 (inputs
731 ;; It would be nice to add GeoIP and gssapi once there are packages.
732 (list libcap
733 liburcu
734 libuv
735 libxml2
736 `(,nghttp2 "lib")
737 openssl
738 p11-kit
739 python
740 python-ply))
741 (native-inputs
742 (list perl pkg-config))
743 (arguments
744 `(#:configure-flags
745 (list (string-append "--with-pkcs11="
746 (assoc-ref %build-inputs "p11-kit")))
747 #:phases
748 (modify-phases %standard-phases
749 (add-after 'strip 'move-to-utils
750 (lambda _
751 (for-each
752 (lambda (file)
753 (let ((target (string-append (assoc-ref %outputs "utils") file))
754 (src (string-append (assoc-ref %outputs "out") file)))
755 (mkdir-p (dirname target))
756 (link src target)
757 (delete-file src)))
758 '("/bin/dig" "/bin/delv" "/bin/nslookup" "/bin/host" "/bin/nsupdate"
759 "/share/man/man1/dig.1"
760 "/share/man/man1/host.1"
761 "/share/man/man1/nslookup.1"
762 "/share/man/man1/nsupdate.1"))
763 #t))
764 ;; When and if guix provides user namespaces for the build process,
765 ;; then the following can be uncommented and the subsequent "force-test"
766 ;; will not be necessary.
767 ;;
768 ;; (add-before 'check 'set-up-loopback
769 ;; (lambda _
770 ;; (system "bin/tests/system/ifconfig.sh up")))
771 (replace 'check
772 (lambda _
773 ;; XXX Even ‘make force-test’ tries to create network interfaces
774 ;; and fails. The only working target is the (trivial) fuzz test.
775 (with-directory-excursion "fuzz"
776 (invoke "make" "check"))
777 #t)))))
778 (synopsis "@acronym{DNS, Domain Name System} implementation")
779 (description "BIND implements the @acronym{DNS, Domain Name System}
780protocols for the Internet. It is both a reference implementation of those
781protocols and production-grade software, suitable for use in high-volume and
782high-reliability applications.
783
784The name stands for \"Berkeley Internet Name Domain\" because the software
785originated in the early 1980s at the University of California at Berkeley.
786
787The @code{utils} output of this package contains the following command line
788utilities related to DNS name servers:
789
790@table @code
791@item delv
792DNS lookup and validation utility
793@item dig
794DNS lookup utility
795@item host
796DNS lookup utility
797@item nslookup
798Internet name servers interactive query utility
799@item nsupdate
800Dynamic DNS update utility
801@end table")
802 (home-page "https://www.isc.org/bind/")
803 (license (list license:mpl2.0))))
804
805(define-public dnscrypt-proxy
806 (package
807 (name "dnscrypt-proxy")
808 (version "2.1.18")
809 (source
810 (origin
811 (method git-fetch)
812 (uri (git-reference
813 (url "https://github.com/DNSCrypt/dnscrypt-proxy")
814 (commit version)))
815 (file-name (git-file-name name version))
816 (sha256
817 (base32 "1dh22j428a631nxg7wgf4szmnyscwpm7z1dj8pizabjmsgcm4p9s"))
818 (snippet
819 #~(begin
820 (use-modules (guix build utils))
821 (delete-file-recursively "vendor")
822 ;; Old version has been deprecated for a long time use v22 instead.
823 (substitute* (find-files "." "\\.go$")
824 (("github.com/coreos/go-systemd")
825 "github.com/coreos/go-systemd/v22"))))))
826 (build-system go-build-system)
827 (arguments
828 (list
829 #:install-source? #f
830 #:import-path "github.com/dnscrypt/dnscrypt-proxy/dnscrypt-proxy"
831 #:unpack-path "github.com/dnscrypt/dnscrypt-proxy"
832 #:test-subdirs #~(list "../...")
833 #:phases
834 #~(modify-phases %standard-phases
835 (add-after 'install 'install-config-file
836 (lambda* (#:key unpack-path #:allow-other-keys)
837 (with-directory-excursion (string-append "src/" unpack-path)
838 (let* ((etc (string-append #$output "/etc"))
839 (cfg-example
840 "dnscrypt-proxy/example-dnscrypt-proxy.toml")
841 (cfg-src
842 (string-append etc "/example-dnscrypt-proxy.toml"))
843 (cfg-dst (string-append etc "/dnscrypt-proxy.toml")))
844 (install-file cfg-example etc)
845 (rename-file cfg-src cfg-dst))))))))
846 (native-inputs
847 (list go-codeberg-org-miekg-dns
848 go-github-com-burntsushi-toml
849 go-github-com-vividcortex-ewma
850 go-github-com-cloudflare-circl
851 go-github-com-coreos-go-systemd-v22
852 go-github-com-dchest-safefile
853 go-github-com-fsnotify-fsnotify
854 go-github-com-gorilla-websocket
855 go-github-com-hashicorp-go-immutable-radix
856 go-github-com-hectane-go-acl
857 go-github-com-jedisct1-dlog
858 go-github-com-jedisct1-go-clocksmith
859 go-github-com-jedisct1-go-dnsstamps
860 go-github-com-jedisct1-go-hpke-compact
861 go-github-com-jedisct1-go-ipcrypt
862 go-github-com-jedisct1-go-minisign
863 go-github-com-jedisct1-go-sieve-cache
864 go-github-com-jedisct1-xsecretbox
865 go-github-com-k-sone-critbitgo
866 go-github-com-kardianos-service
867 go-github-com-lifenjoiner-dhcpdns
868 go-github-com-miekg-dns
869 go-github-com-powerman-check
870 go-github-com-quic-go-quic-go
871 go-golang-org-x-crypto
872 go-golang-org-x-net
873 go-golang-org-x-sys
874 go-gopkg-in-natefinch-lumberjack-v2))
875 (home-page "https://dnscrypt.info/")
876 (synopsis "Securely send DNS requests to a remote server")
877 (description
878 "@command{dnscrypt-proxy} is a tool for securing communications
879between a client and a DNS resolver. It verifies that responses you get
880from a DNS provider was actually sent by that provider, and haven't been
881tampered with. For optimal performance it is recommended to use this as
882a forwarder for a caching DNS resolver such as @command{dnsmasq}, but it
883can also be used as a normal DNS \"server\". A list of public dnscrypt
884servers is included, and an up-to-date version is available at
885@url{https://status.dnscrypt.info/}.")
886 (license license:isc)))
887
888(define-public dnscrypt-wrapper
889 (package
890 (name "dnscrypt-wrapper")
891 (version "0.2.2")
892 (source (origin
893 (method url-fetch)
894 (uri (string-append
895 "https://github.com/cofyc/dnscrypt-wrapper/releases"
896 "/download/v" version "/" name "-v" version ".tar.bz2"))
897 (sha256
898 (base32
899 "1vhg4g0r687f51wcdn7z9w1hxapazx6vyh5rsr8wa48sljzd583g"))))
900 (build-system gnu-build-system)
901 (arguments
902 `(#:make-flags '("CC=gcc")
903 ;; TODO: Tests require ruby-cucumber and ruby-aruba.
904 #:tests? #f
905 #:phases
906 (modify-phases %standard-phases
907 (add-after 'unpack 'create-configure
908 (lambda _
909 (invoke "make" "configure"))))))
910 (native-inputs
911 (list autoconf))
912 (inputs
913 (list libevent libsodium))
914 (home-page "https://github.com/Cofyc/dnscrypt-wrapper")
915 (synopsis "Server-side dnscrypt proxy")
916 (description
917 "@command{dnscrypt-wrapper} is a tool to expose a name server over
918the @code{dnscrypt} protocol. It can be used as an endpoint for the
919@command{dnscrypt-proxy} client to securely tunnel DNS requests between
920the two.")
921 (license (list license:isc
922 ;; Bundled argparse is MIT. TODO: package and unbundle.
923 license:expat
924 ;; dns-protocol.h and rfc1035.{c,h} is gpl2 or gpl3 (either).
925 license:gpl2
926 license:gpl3))))
927
928(define-public nsd
929 (package
930 (name "nsd")
931 (version "4.7.0")
932 (source
933 (origin
934 (method url-fetch)
935 (uri (string-append "https://www.nlnetlabs.nl/downloads/nsd/nsd-"
936 version ".tar.gz"))
937 (sha256
938 (base32 "057jxhhyggqhy4swwqlwf1lflc96cfqpm200l1gr3lls557a9b4g"))))
939 (build-system gnu-build-system)
940 (arguments
941 (list
942 #:configure-flags
943 #~(list "--enable-pie" ; fully benefit from tasty ASLR
944 "--enable-ratelimit"
945 "--enable-recvmmsg"
946 "--enable-relro-now" ; protect GOT and .dtor areas
947 "--disable-radix-tree"
948 (string-append "--with-libevent="
949 #$(this-package-input "libevent"))
950 (string-append "--with-ssl="
951 #$(this-package-input "openssl"))
952 "--with-configdir=/etc"
953 "--with-nsd_conf_file=/etc/nsd/nsd.conf"
954 "--with-logfile=/var/log/nsd.log"
955 "--with-pidfile=/var/db/nsd/nsd.pid"
956 "--with-dbfile=/var/db/nsd/nsd.db"
957 "--with-zonesdir=/etc/nsd"
958 "--with-xfrdfile=/var/db/nsd/xfrd.state"
959 "--with-zonelistfile=/var/db/nsd/zone.list")
960 #:phases
961 #~(modify-phases %standard-phases
962 (add-before 'configure 'patch-installation-paths
963 (lambda _
964 (let ((doc (string-append #$output "/share/doc/"
965 #$name "-" #$version)))
966 ;; The ‘make install’ target tries to create the parent
967 ;; directories of run-time things like ‘pidfile’ above, and
968 ;; useless empty directories like 'configdir'. Remove such
969 ;; '$(INSTALL)' lines and install the example configuration file
970 ;; in an appropriate location.
971 (substitute* "Makefile.in"
972 ((".*INSTALL.*\\$\\((config|pid|xfr|db)dir" command)
973 (string-append "#" command))
974 (("\\$\\(nsdconfigfile\\)\\.sample" file-name)
975 (string-append doc "/examples/" file-name)))))))
976 #:tests? #f)) ; no tests
977 (inputs
978 (list libevent openssl))
979 (home-page "https://www.nlnetlabs.nl/projects/nsd/about/")
980 (synopsis "Authoritative DNS name server")
981 (description "@dfn{NSD}, short for Name Server Daemon, is an authoritative
982name server for the Domain Name System (@dfn{DNS}). It aims to be a fast and
983RFC-compliant nameserver.
984
985NSD uses zone information compiled via @command{zonec} into a binary database
986file (@file{nsd.db}). This allows fast startup of the name service daemon and
987allows syntax-structural errors in zone files to be flagged at compile time,
988before being made available to NSD service itself. However, most traditional
989BIND-style zone files can be directly imported into NSD without modification.
990
991The collection of programs and processes that make up NSD are designed so that
992the daemon itself runs as a non-privileged user and can be easily configured to
993run in a @code{chroot} jail, thus making any security flaws in NSD less likely
994to result in system-wide compromise.")
995 (license (list license:bsd-3))))
996
997(define-public unbound
998 (package
999 (name "unbound")
1000 (version "1.26.1")
1001 (source
1002 (origin
1003 (method url-fetch)
1004 (uri (string-append "https://www.unbound.net/downloads/unbound-"
1005 version ".tar.gz"))
1006 (sha256
1007 (base32 "00qmmzhawlicnqxbgm5f6h2vy4a02i1k16kd8b1q54js887dr9im"))))
1008 (build-system gnu-build-system)
1009 (outputs '("out" "python"))
1010 (native-inputs
1011 (list flex pkg-config swig-4.0 python-wrapper))
1012 (inputs
1013 (list expat
1014 libevent
1015 `(,nghttp2 "lib")
1016 protobuf
1017 python-wrapper
1018 openssl))
1019 (arguments
1020 `(#:configure-flags
1021 (list "--disable-static" ; save space and non-determinism in libunbound.a
1022 (string-append
1023 "--with-libnghttp2=" (assoc-ref %build-inputs "nghttp2"))
1024 (string-append
1025 "--with-ssl=" (assoc-ref %build-inputs "openssl"))
1026 (string-append
1027 "--with-libevent=" (assoc-ref %build-inputs "libevent"))
1028 (string-append
1029 "--with-libexpat=" (assoc-ref %build-inputs "expat"))
1030 "--with-pythonmodule" "--with-pyunbound")
1031 #:phases
1032 (modify-phases %standard-phases
1033 (add-after 'configure 'fix-python-site-package-path
1034 ;; Move python modules into their own output.
1035 (lambda* (#:key outputs #:allow-other-keys)
1036 (let ((pyout (assoc-ref outputs "python"))
1037 (ver ,(version-major+minor (package-version python))))
1038 (substitute* "Makefile"
1039 (("^PYTHON_SITE_PKG=.*$")
1040 (string-append
1041 "PYTHON_SITE_PKG="
1042 pyout "/lib/python-" ver "/site-packages\n"))))))
1043 (add-before 'check 'fix-missing-nss-for-tests
1044 ;; Unfortunately, the package's unittests involve some checks
1045 ;; looking up protocols and services which are not provided
1046 ;; by the minimalistic build environment, in particular,
1047 ;; /etc/protocols and /etc/services are missing.
1048 ;; Also, after plain substitution of protocol and service names
1049 ;; in the test data, the tests still fail because the
1050 ;; corresponding Resource Records have been signed by
1051 ;; RRSIG records.
1052 ;; The following LD_PRELOAD library overwrites the glibc
1053 ;; functions ‘get{proto,serv}byname’, ‘getprotobynumber’ and
1054 ;; ‘getservbyport’ providing the few records required for the
1055 ;; unit tests to pass.
1056 (lambda* (#:key inputs outputs #:allow-other-keys)
1057 (let* ((source (assoc-ref %build-inputs "source"))
1058 (gcc (assoc-ref %build-inputs "gcc")))
1059 (call-with-output-file "/tmp/nss_preload.c"
1060 (lambda (port)
1061 (display "#include <stdlib.h>
1062#include <string.h>
1063#include <strings.h>
1064
1065#include <netdb.h>
1066
1067struct protoent *getprotobyname(const char *name) {
1068 struct protoent *p = malloc(sizeof(struct protoent));
1069 p->p_aliases = malloc(sizeof(char*));
1070 if (strcasecmp(name, \"tcp\") == 0) {
1071 p->p_name = \"tcp\";
1072 p->p_proto = 6;
1073 p->p_aliases[0] = \"TCP\";
1074 } else if (strcasecmp(name, \"udp\") == 0) {
1075 p->p_name = \"udp\";
1076 p->p_proto = 17;
1077 p->p_aliases[0] = \"UDP\";
1078 } else
1079 p = NULL;
1080 return p;
1081}
1082
1083struct protoent *getprotobynumber(int proto) {
1084 struct protoent *p = malloc(sizeof(struct protoent));
1085 p->p_aliases = malloc(sizeof(char*));
1086 switch(proto) {
1087 case 6:
1088 p->p_name = \"tcp\";
1089 p->p_proto = 6;
1090 p->p_aliases[0] = \"TCP\";
1091 break;
1092 case 17:
1093 p->p_name = \"udp\";
1094 p->p_proto = 17;
1095 p->p_aliases[0] = \"UDP\";
1096 break;
1097 default:
1098 p = NULL;
1099 break;
1100 }
1101 return p;
1102}
1103
1104struct servent *getservbyname(const char *name, const char *proto) {
1105 struct servent *s = malloc(sizeof(struct servent));
1106 char* buf = malloc((strlen(proto)+1)*sizeof(char));
1107 strcpy(buf, proto);
1108 s->s_aliases = malloc(sizeof(char*));
1109 s->s_aliases[0] = NULL;
1110 if (strcasecmp(name, \"domain\") == 0) {
1111 s->s_name = \"domain\";
1112 s->s_port = htons(53);
1113 s->s_proto = buf;
1114 } else
1115 s = NULL;
1116 return s;
1117}
1118
1119struct servent *getservbyport(int port, const char *proto) {
1120 char buf[32];
1121 struct servent *s = malloc(sizeof(struct servent));
1122 strcpy(buf, proto);
1123 s->s_aliases = malloc(sizeof(char*));
1124 s->s_aliases[0] = NULL;
1125 switch(port) {
1126 case 53:
1127 s->s_name = \"domain\";
1128 s->s_port = 53;
1129 s->s_proto = \"udp\";
1130 break;
1131 default:
1132 s = NULL;
1133 break;
1134 }
1135 return s;
1136}" port)))
1137 (invoke (string-append gcc "/bin/gcc")
1138 "-shared" "-fPIC" "-o" "/tmp/nss_preload.so"
1139 "/tmp/nss_preload.c")
1140 ;; The preload library only affects the unittests.
1141 (substitute* "Makefile"
1142 (("./unittest")
1143 "LD_PRELOAD=/tmp/nss_preload.so ./unittest"))))))))
1144 (home-page "https://www.unbound.net")
1145 (synopsis "Validating, recursive, and caching DNS resolver")
1146 (description
1147 "Unbound is a recursive-only caching DNS server which can perform DNSSEC
1148validation of results. It implements only a minimal amount of authoritative
1149service to prevent leakage to the root nameservers: forward lookups for
1150localhost, reverse for @code{127.0.0.1} and @code{::1}, and NXDOMAIN for zones
1151served by AS112. Stub and forward zones are supported.")
1152 (license license:bsd-4)))
1153
1154(define-public yadifa
1155 (package
1156 (name "yadifa")
1157 (version "2.6.4")
1158 (source
1159 (let ((build "10892"))
1160 (origin
1161 (method url-fetch)
1162 (uri
1163 (string-append "https://www.yadifa.eu/sites/default/files/releases/"
1164 "yadifa-" version "-" build ".tar.gz"))
1165 (sha256
1166 (base32 "0wdm0gc01bhd04p3jqxy3y8lgx5v8wlm8saiy35llna5ssi77fyq")))))
1167 (build-system gnu-build-system)
1168 (native-inputs
1169 (list which))
1170 (inputs
1171 (list openssl))
1172 (arguments
1173 `(#:phases
1174 (modify-phases %standard-phases
1175 (add-after 'unpack 'unhard-code
1176 (lambda _
1177 (substitute* (list "lib/dnslg/Makefile.in"
1178 "lib/dnsdb/Makefile.in"
1179 "lib/dnscore/Makefile.in")
1180 (("/usr/bin/(install)" _ command) command))))
1181 (add-before 'configure 'omit-example-configurations
1182 (lambda _
1183 (substitute* "Makefile.in"
1184 ((" (etc|var)") ""))))
1185 (add-after 'configure 'omit-spurious-references
1186 (lambda _
1187 ;; The many Makefile.in grep this(!) to #define BUILD_OPTIONS.
1188 (substitute* "config.log"
1189 (("(=/gnu/store/)[^-]*" _ match)
1190 (string-append match "..."))))))
1191 #:configure-flags
1192 (list "--sysconfdir=/etc"
1193 "--localstatedir=/var"
1194 "--enable-shared" "--disable-static"
1195 "--disable-build-timestamp" ; build reproducibly
1196 "--enable-tcp-manager")))
1197 (home-page "https://www.yadifa.eu/")
1198 (synopsis "Authoritative DNS name server")
1199 (description "YADIFA is an authoritative name server for the @dfn{Domain
1200Name System} (DNS). It aims for both higher performance and a smaller memory
1201footprint than other implementations, while remaining fully RFC-compliant.
1202YADIFA supports dynamic record updates and the @dfn{Domain Name System Security
1203Extensions} (DNSSEC).")
1204 (license license:bsd-3)))
1205
1206(define-public knot
1207 (package
1208 (name "knot")
1209 (version "3.5.7")
1210 (source
1211 (origin
1212 (method git-fetch)
1213 (uri (git-reference
1214 (url "https://gitlab.nic.cz/knot/knot-dns")
1215 (commit (string-append "v" version))))
1216 (file-name (git-file-name name version))
1217 (sha256
1218 (base32 "017iyklhjjrh4b9b9scb831v478iq7cs95xrkgvmya0xpvznsshy"))
1219 (patches
1220 (search-patches "knot-remove-runtime-deps.patch"))
1221 (modules '((guix build utils)))
1222 (snippet
1223 '(begin
1224 ;; Remove Ragel-generated C files. We'll recreate them below.
1225 (for-each delete-file (find-files "." "\\.c\\.[gt]."))
1226 (delete-file "src/libknot/yparser/ypbody.c")
1227 ;; Remove bundled libraries to ensure we always use the system's.
1228 (with-directory-excursion "src/contrib"
1229 (for-each delete-file-recursively
1230 ;; TODO: package libngtcp2 for DoQ (‘QUIC’) support.
1231 '("libngtcp2")))))))
1232 (build-system gnu-build-system)
1233 (outputs (list "out" "doc" "lib" "tools"))
1234 (arguments
1235 (list
1236 #:configure-flags
1237 #~(list (string-append "--docdir=" #$output:doc
1238 "/share/" #$name "-" #$version)
1239 (string-append "--infodir=" #$output:doc "/share/info")
1240 (string-append "--libdir=" #$output:lib "/lib")
1241 "--sysconfdir=/etc"
1242 "--localstatedir=/var"
1243 "--disable-static" ; static libraries are built by default
1244 "--enable-dnstap" ; let tools read/write capture files
1245 "--enable-fastparser" ; disabled by default when .git/ exists
1246 "--enable-xdp=yes"
1247 "--with-module-dnstap=yes") ; detailed query capturing & logging
1248 #:phases
1249 #~(modify-phases %standard-phases
1250 (add-after 'unpack 'link-missing-libbpf-dependency
1251 ;; Linking against -lbpf later would fail to find -lz: libbpf.pc has
1252 ;; zlib in its Requires.private (not Requires) field. Add it here.
1253 (lambda _
1254 (substitute* "configure.ac"
1255 (("enable_xdp=yes" match)
1256 (string-append match "\nlibbpf_LIBS=\"$libbpf_LIBS -lz\"")))))
1257 (add-before 'bootstrap 'update-parser
1258 (lambda _
1259 (with-directory-excursion "src"
1260 (invoke "sh" "../scripts/update_parser.sh"))))
1261 (add-before 'configure 'disable-directory-pre-creation
1262 (lambda _
1263 ;; Don't install empty directories like ‘/etc’ outside the store.
1264 ;; This is needed even when using ‘make config_dir=... install’.
1265 (substitute* "src/Makefile.in" (("\\$\\(INSTALL\\) -d") "true"))))
1266 (add-after 'build 'build-info
1267 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
1268 (apply invoke "make" "info"
1269 `(,@(if parallel-build?
1270 `("-j" ,(number->string (parallel-job-count)))
1271 '())
1272 ,@make-flags))))
1273 (replace 'install
1274 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
1275 (let* ((doc (string-append #$output "/share/doc/"
1276 #$name "-" #$version))
1277 (etc (string-append doc "/examples/etc")))
1278 (apply invoke "make" "install"
1279 (string-append "config_dir=" etc)
1280 `(,@(if parallel-build?
1281 `("-j" ,(number->string (parallel-job-count)))
1282 '())
1283 ,@make-flags)))))
1284 (add-after 'install 'install-info
1285 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
1286 (apply invoke "make" "install-info"
1287 `(,@(if parallel-build?
1288 `("-j" ,(number->string (parallel-job-count)))
1289 '())
1290 ,@make-flags))))
1291 (add-after 'install 'break-circular-:lib->:out-reference
1292 (lambda _
1293 (for-each (lambda (file)
1294 (substitute* file
1295 (("(prefix=).*" _ assign)
1296 (string-append assign #$output:lib "\n"))))
1297 (find-files #$output:lib "\\.pc$"))))
1298 (add-after 'install 'split:tools
1299 (lambda _
1300 (define (move source target file)
1301 (mkdir-p (dirname (string-append target "/" file)))
1302 (rename-file (string-append source "/" file)
1303 (string-append target "/" file)))
1304 (move #$output #$output:tools "bin")
1305 (move #$output #$output:tools "share/man/man1"))))))
1306 (native-inputs
1307 (list autoconf
1308 automake
1309 libtool
1310 pkg-config
1311 python-sphinx
1312 ragel
1313 texinfo))
1314 (inputs
1315 (list fstrm
1316 gnutls
1317 jansson
1318 libbpf-0.8
1319 libcap-ng
1320 libedit
1321 libelf
1322 libidn
1323 libmnl
1324 ngtcp2
1325 `(,nghttp2 "lib")
1326 liburcu
1327 lmdb
1328 ncurses
1329 protobuf-c))
1330 (home-page "https://www.knot-dns.cz/")
1331 (synopsis "Authoritative DNS name server")
1332 (description "Knot DNS is an authoritative name server for the @dfn{Domain
1333Name System} (DNS), designed to meet the needs of root and @dfn{top-level
1334domain} (TLD) name servers. It is implemented as a threaded daemon and uses a
1335number of programming techniques to improve speed. For example, the responder
1336is completely lock-free, resulting in a very high response rate. Other features
1337include automatic @dfn{DNS Security Extensions} (DNSSEC) signing, dynamic record
1338synthesis, and on-the-fly re-configuration.")
1339 (license
1340 (list
1341 ;; src/contrib/{hat-trie,murmurhash3,openbsd},
1342 ;; src/dnssec/contrib/vpool.[ch], and parts of libtap/ are ‘MIT’ (expat).
1343 license:expat
1344 license:lgpl2.0+ ; parts of scr/contrib/ucw
1345 license:public-domain ; src/contrib/fnv and possibly murmurhash3
1346 license:gpl3+)))) ; everything else
1347
1348(define-public knot-resolver
1349 (package
1350 (name "knot-resolver")
1351 (version "5.7.8")
1352 (source (origin
1353 (method url-fetch)
1354 (uri (string-append "https://secure.nic.cz/files/knot-resolver/"
1355 "knot-resolver-" version ".tar.xz"))
1356 (sha256
1357 (base32
1358 "0v7412x8n9krmwk1yarw8p891idmd3ws0fdk1hlyjchsnh276dp9"))))
1359 (build-system meson-build-system)
1360 (outputs '("out" "doc"))
1361 (arguments
1362 '(#:configure-flags '("-Ddoc=enabled")
1363 #:phases
1364 (modify-phases %standard-phases
1365 (add-before 'configure 'disable-default-ta
1366 (lambda _
1367 ;; Disable the default managed root TA, since we don't have
1368 ;; write access to the keyfile and its directory in store.
1369 (substitute* "daemon/lua/sandbox.lua.in"
1370 (("^trust_anchors\\.add_file.*") ""))))
1371 (add-after 'build 'build-doc
1372 (lambda _
1373 (invoke "ninja" "doc")))
1374 (add-after 'install 'move-doc
1375 (lambda* (#:key outputs #:allow-other-keys)
1376 ;; Move the manual and the example configuration files to the
1377 ;; "doc" output.
1378 (let ((out (assoc-ref outputs "out"))
1379 (doc (assoc-ref outputs "doc")))
1380 (mkdir-p (string-append doc "/share/doc/knot-resolver"))
1381 (for-each
1382 (lambda (dir)
1383 (rename-file (string-append out "/share/" dir)
1384 (string-append doc "/share/" dir)))
1385 '("doc/knot-resolver/examples"
1386 "doc/knot-resolver/html"
1387 "info")))))
1388 (add-after 'install 'wrap-binary
1389 (lambda* (#:key inputs outputs #:allow-other-keys)
1390 (let* ((out (assoc-ref outputs "out")))
1391 (wrap-program (string-append out "/sbin/kresd")
1392 `("GUIX_LUA_PATH" ";" prefix (,(getenv "GUIX_LUA_PATH")))
1393 `("GUIX_LUA_CPATH" ";" prefix (,(getenv "GUIX_LUA_CPATH"))))))))))
1394 (native-inputs
1395 (list cmocka ; for unit tests
1396 doxygen
1397 protobuf-c
1398 pkg-config
1399 python-breathe
1400 python-sphinx
1401 python-sphinx-rtd-theme
1402 texinfo))
1403 (inputs
1404 `(("bash" ,bash-minimal) ;for wrap-program
1405 ("fstrm" ,fstrm)
1406 ("gnutls" ,gnutls)
1407 ("knot:lib" ,knot "lib")
1408 ("libuv" ,libuv)
1409 ("lmdb" ,lmdb)
1410 ("luajit" ,luajit)
1411 ;; TODO: Add optional lua modules: basexx and psl.
1412 ("lua-bitop" ,lua5.1-bitop)
1413 ("nghttp2" ,nghttp2 "lib")
1414 ("python" ,python)))
1415 (home-page "https://www.knot-resolver.cz/")
1416 (synopsis "Caching validating DNS resolver")
1417 (description
1418 "Knot Resolver is a caching full resolver implementation written in C and
1419LuaJIT, both a resolver library and a daemon.")
1420 (license (list license:gpl3+
1421 ;; Some 'contrib' files are under MIT, CC0 and LGPL2.
1422 license:expat
1423 license:cc0
1424 license:lgpl2.0))))
1425
1426(define-public hnsd
1427 (package
1428 (name "hnsd")
1429 (version "2.0.0")
1430 (source (origin
1431 (method git-fetch)
1432 (uri (git-reference
1433 (url "https://github.com/handshake-org/hnsd")
1434 (commit (string-append "v" version))))
1435 (sha256
1436 (base32
1437 "1pqpf9vz1d01873wvkdnmsj9y2qrk8fka4c636qipsjv6ar2ply0"))
1438 (file-name (git-file-name name version))
1439 (modules '((guix build utils)))
1440 (snippet
1441 '(begin
1442 ;; Delete the bundled copy of libuv.
1443 (delete-file-recursively "uv")
1444 (substitute* "Makefile.am"
1445 (("SUBDIRS = uv") "\n")
1446 (("\\$\\(top_builddir\\)/uv/libuv.la") "-luv")
1447 ;; Make sure the 'hnsd' binary is dynamically-linked.
1448 (("^hnsd_LDFLAGS = -static") "\n"))
1449
1450 ;; This script tries to chdir to "uv" and doesn't do more
1451 ;; than "autoreconf" so remove it.
1452 (delete-file "autogen.sh")))))
1453 (build-system gnu-build-system)
1454 (arguments
1455 '(#:configure-flags '("--disable-static"))) ;no need for libhsk.a
1456 (native-inputs
1457 (list autoconf automake libtool))
1458 (inputs
1459 (list unbound libuv))
1460 (home-page "https://handshake.org/")
1461 (synopsis "Resolver daemon for the Handshake naming protocol")
1462 (description
1463 "@command{hnsd} is a @dfn{host name resolver} for the Handshake Naming
1464System (HNS) peer-to-peer network.")
1465 (license license:expat)))
1466
1467(define-public libmicrodns
1468 (package
1469 (name "libmicrodns")
1470 (version "0.1.2")
1471 (source (origin
1472 (method url-fetch)
1473 (uri (string-append "https://github.com/videolabs/libmicrodns/"
1474 "releases/download/" version "/microdns-"
1475 version ".tar.xz"))
1476 (sha256
1477 (base32
1478 "0p4va18zxgmzcdwhlbg2mmjwswlbgqy4ay5vaxrw7cxmhsflnv36"))))
1479 (build-system meson-build-system)
1480 (home-page "https://github.com/videolabs/libmicrodns")
1481 (synopsis "Minimal mDNS resolver library")
1482 (description "@code{libmicrodns} provides a minimal implementation of a
1483mDNS resolver as well as an announcer. mDNS (Multicast Domain Name System) is
1484a zero-config service that allows one to resolve host names to IP addresses in
1485local networks.")
1486 (license license:lgpl2.1)))
1487
1488(define-public public-suffix-list
1489 ;; Mozilla releases the official list here:
1490 ;;
1491 ;; https://publicsuffix.org/list/public_suffix_list.dat
1492 ;;
1493 ;; However, Mozilla syncs that file from the GitHub repository periodically,
1494 ;; so its contents will change over time. If you update this commit, please
1495 ;; make sure that the new commit refers to a list which is identical to the
1496 ;; officially published list available from the URL above.
1497 (let ((commit "e596036bde712ffb073b948eb8b884c72c94c6e1")
1498 (revision "3"))
1499 (package
1500 (name "public-suffix-list")
1501 (version (git-version "0.0.0" revision commit))
1502 (source (origin
1503 (method git-fetch)
1504 (uri (git-reference
1505 (url "https://github.com/publicsuffix/list")
1506 (commit commit)))
1507 (file-name (git-file-name name version))
1508 (sha256
1509 (base32
1510 "1865xbf78ry69wqrds2wxhii3409b5ky2jshkn9cymknfv0vplba"))))
1511 (build-system copy-build-system)
1512 (arguments
1513 (list #:install-plan
1514 ;; Install to /share because that is where "read-only
1515 ;; architecture-independent data files" should go (see: (standards)
1516 ;; Directory Variables). Include the version in the directory name
1517 ;; so that if multiple versions are ever installed in the same
1518 ;; profile, they will not conflict.
1519 #~'(("public_suffix_list.dat"
1520 #$(string-append "/share/public-suffix-list-" version "/")))))
1521 (home-page "https://publicsuffix.org/")
1522 (synopsis "Database of current and historical DNS suffixes")
1523 (description "This is the Public Suffix List maintained by Mozilla. A
1524\"public suffix\" is one under which Internet users can (or historically
1525could) directly register names in the Domain Name System (DNS). Some examples
1526of public suffixes are .com, .co.uk and pvt.k12.ma.us. This is a list of all
1527known public suffixes.")
1528 (license license:mpl2.0))))
1529
1530(define-public maradns
1531 (package
1532 (name "maradns")
1533 (version "3.5.0036")
1534 (source
1535 (origin
1536 (method url-fetch)
1537 (uri (string-append "https://maradns.samiam.org/download/"
1538 (version-major+minor version) "/"
1539 version "/maradns-" version ".tar.xz"))
1540 (sha256
1541 (base32 "185kl7zfvnwzfpyxbzpwck13m468av74kbqijp0s4v33iicfpnvc"))))
1542 (build-system gnu-build-system)
1543 (arguments
1544 (list
1545 #:tests? #f ; need to be root to run tests
1546 #:make-flags
1547 #~(list
1548 (string-append "CC=" #$(cc-for-target))
1549 (string-append "PREFIX=" #$output)
1550 (string-append "RPM_BUILD_ROOT=" #$output))
1551 #:phases
1552 #~(modify-phases %standard-phases
1553 (replace 'configure
1554 (lambda* (#:key native-inputs target #:allow-other-keys)
1555 ;; make_32bit_tables generates a header file that is used during
1556 ;; compilation. Hence, during cross compilation, it should be
1557 ;; built for the host system.
1558 (when target
1559 (substitute* "rng/Makefile"
1560 (("\\$\\(CC\\) -o make_32bit_tables")
1561 (string-append (search-input-file native-inputs "/bin/gcc")
1562 " -o make_32bit_tables"))))
1563 ;; ./configure doesn't support default flags
1564 (invoke "./configure")))
1565 (add-before 'install 'create-install-directories
1566 (lambda _
1567 (for-each (lambda (dir)
1568 (mkdir-p (string-append #$output dir)))
1569 (list "/bin" "/sbin" "/etc"
1570 "/share/man/man1"
1571 "/share/man/man5"
1572 "/share/man/man8")))))))
1573 (home-page "https://maradns.samiam.org")
1574 (synopsis "Small lightweight DNS server")
1575 (description "MaraDNS is a small and lightweight DNS server. MaraDNS
1576consists of a UDP-only authoritative DNS server for hosting domains, and a UDP
1577and TCP-capable recursive DNS server for finding domains on the internet.")
1578 (properties '((release-monitoring-url
1579 . "https://maradns.samiam.org/download.html")))
1580 (license license:bsd-2)))
1581
1582(define-public openresolv
1583 (package
1584 (name "openresolv")
1585 (version "3.17.4")
1586 (source
1587 (origin
1588 (method git-fetch)
1589 (uri (git-reference
1590 (url "https://github.com/NetworkConfiguration/openresolv")
1591 (commit (string-append "v" version))))
1592 (file-name (git-file-name name version))
1593 (sha256
1594 (base32
1595 "1lawj50qhr2yj7fy3p8x4m3kqz4lbvghnjc4jlqnxp484hg83ki3"))
1596 (patches
1597 (search-patches "openresolv-restartcmd-guix.patch"))))
1598 (build-system gnu-build-system)
1599 (arguments
1600 (list #:tests? #f ; No test suite
1601
1602 #:configure-flags
1603 #~(list (string-append "--prefix=" #$output:out)
1604 "--sysconfdir=/etc"
1605 "--rundir=/run")
1606
1607 #:phases
1608 #~(modify-phases %standard-phases
1609 (replace 'install
1610 (lambda* (#:key make-flags #:allow-other-keys)
1611 (apply invoke "make" "install"
1612 (string-append "SYSCONFDIR=" #$output "/etc")
1613 make-flags)))
1614 (add-after 'install 'wrap-program
1615 (lambda* (#:key inputs #:allow-other-keys)
1616 (substitute* (string-append #$output "/sbin/resolvconf")
1617 (("RESOLVCONF=\"\\$0\"")
1618 (format #f "RESOLVCONF=\"$0\"\nPATH=~a/bin:$PATH"
1619 (assoc-ref inputs "coreutils-minimal")))))))))
1620 (inputs
1621 (list coreutils-minimal))
1622 (home-page "https://roy.marples.name/projects/openresolv/")
1623 (synopsis "Resolvconf POSIX compliant implementation, a middleman for resolv.conf")
1624 (description "openresolv is an implementation of @command{resolvconf}, the
1625middleman between the network configuration services and
1626@file{/etc/resolv.conf}. @command{resolvconf} itself is just a script that
1627stores, removes and lists a full @file{resolv.conf} generated for the
1628interface. It then calls all the helper scripts it knows about so it can
1629configure the real @file{/etc/resolv.conf} and optionally any local
1630nameservers other than libc.")
1631 (license license:bsd-2)))
1632
1633(define-public smartdns
1634 (package
1635 (name "smartdns")
1636 (version "47")
1637 (source (origin
1638 (method git-fetch)
1639 (uri (git-reference
1640 (url "https://github.com/pymumu/smartdns")
1641 (commit (string-append "Release" version))))
1642 (file-name (git-file-name name version))
1643 (modules '((guix build utils)))
1644 (snippet '(substitute* "Makefile"
1645 ((".*SYSTEMDSYSTEMUNITDIR.*") "")))
1646 (sha256
1647 (base32
1648 "10a4nnrnf10n4rq166yixm0va1j0sdj9vca3kpwkzgn9blwvbqph"))))
1649 (build-system gnu-build-system)
1650 (arguments
1651 (list #:test-target "test"
1652 #:make-flags
1653 #~(list (string-append "CC=" #$(cc-for-target))
1654 (string-append "DESTDIR=" #$output)
1655 "PREFIX=''"
1656 (string-append "VER=" #$(package-version this-package)))
1657 #:phases
1658 #~(modify-phases %standard-phases
1659 (delete 'configure)
1660 (add-after 'unpack 'skip-unavailable-tests
1661 (lambda _
1662 (with-directory-excursion "test/cases"
1663 ;; Tests try to open /etc/resolv.conf
1664 (substitute* "test-bind.cc"
1665 ;; Bind.tls
1666 (("smartdns::Server server_wrap;" all)
1667 (string-append "GTEST_SKIP();" all)))
1668 ;; Tests use ICMP ping.
1669 (substitute* (find-files ".")
1670 ((".*PING_TYPE_ICMP.*" all)
1671 (string-append "GTEST_SKIP();" all)))
1672 (delete-file "test-speed-check.cc"))))
1673 ;; Compiled .o files in build phase can't be used for tests.
1674 (add-after 'skip-unavailable-tests 'prepare-test-dir
1675 (lambda _
1676 (copy-recursively "." "../test")))
1677 (add-before 'check 'enter-test-dir
1678 (lambda _
1679 (chdir "../test/test")))
1680 (add-after 'check 'leave-test-dir
1681 (lambda _
1682 (chdir "../../source"))))))
1683 ;; NOTE: DoQ and DoH3 support require OpenSSL 3.4+, which is currently not
1684 ;; available in Guix.
1685 (inputs (list openssl))
1686 (native-inputs (list googletest `(,isc-bind "utils") which))
1687 (home-page "https://github.com/pymumu/smartdns")
1688 (synopsis "Local DNS server")
1689 (description
1690 "SmartDNS is a DNS server that accepts DNS query requests from local
1691clients, obtains DNS query results from multiple upstream DNS servers, and
1692returns the fastest access results to clients.")
1693 (license license:gpl3+)))