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