gnu: inetutils: Set the $localstatedir.
[jackhill/guix/guix.git] / gnu / packages / dns.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
3 ;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
7 ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
8 ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
10 ;;;
11 ;;; This file is part of GNU Guix.
12 ;;;
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
17 ;;;
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
22 ;;;
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26 (define-module (gnu packages dns)
27 #:use-module (gnu packages autotools)
28 #:use-module (gnu packages base)
29 #:use-module (gnu packages databases)
30 #:use-module (gnu packages crypto)
31 #:use-module (gnu packages glib)
32 #:use-module (gnu packages groff)
33 #:use-module (gnu packages libevent)
34 #:use-module (gnu packages linux)
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages tls)
38 #:use-module (gnu packages xml)
39 #:use-module ((guix licenses) #:prefix license:)
40 #:use-module (guix packages)
41 #:use-module (guix download)
42 #:use-module (guix build-system gnu))
43
44 (define-public dnsmasq
45 (package
46 (name "dnsmasq")
47 (version "2.76")
48 (source (origin
49 (method url-fetch)
50 (uri (string-append
51 "http://www.thekelleys.org.uk/dnsmasq/dnsmasq-"
52 version ".tar.xz"))
53 (sha256
54 (base32
55 "15lzih6671gh9knzpl8mxchiml7z5lfqzr7jm2r0rjhrxs6nk4jb"))))
56 (build-system gnu-build-system)
57 (native-inputs
58 `(("pkg-config" ,pkg-config)))
59 (inputs
60 `(("dbus" ,dbus)))
61 (arguments
62 `(#:phases
63 (alist-delete 'configure %standard-phases)
64 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
65 "CC=gcc"
66 "COPTS=\"-DHAVE_DBUS\"")
67 ;; No 'check' target.
68 #:tests? #f))
69 (home-page "http://www.thekelleys.org.uk/dnsmasq/doc.html")
70 (synopsis "Small caching DNS proxy and DHCP/TFTP server")
71 (description
72 "Dnsmasq is a lightweight DNS forwarder and DHCP server. It is designed
73 to provide DNS and optionally, DHCP, to a small network. It can serve the
74 names of local machines which are not in the global DNS. The DHCP server
75 integrates with the DNS server and allows machines with DHCP-allocated
76 addresses to appear in the DNS with names configured either in each host or in
77 a central configuration file. Dnsmasq supports static and dynamic DHCP leases
78 and BOOTP/TFTP for network booting of diskless machines.")
79 ;; Source files only say GPL2 and GPL3 are allowed.
80 (license (list license:gpl2 license:gpl3))))
81
82 (define-public bind
83 (package
84 (name "bind")
85 (version "9.10.4-P6")
86 (source (origin
87 (method url-fetch)
88 (uri (string-append
89 "ftp://ftp.isc.org/isc/bind9/" version "/" name "-"
90 version ".tar.gz"))
91 (sha256
92 (base32
93 "0rgffdm0h6dks0np4h9q4kd8nyb3azrdxw2skqnjzd8ws78vzpx1"))))
94 (build-system gnu-build-system)
95 (outputs `("out" "utils"))
96 (inputs
97 ;; it would be nice to add GeoIP and gssapi once there is package
98 `(("libcap" ,libcap)
99 ("libxml2" ,libxml2)
100 ("openssl" ,openssl)
101 ("p11-kit" ,p11-kit)))
102 (native-inputs `(("perl" ,perl)
103 ("net-tools" ,net-tools)))
104 (arguments
105 `(#:configure-flags
106 (list (string-append "--with-openssl="
107 (assoc-ref %build-inputs "openssl"))
108 (string-append "--with-pkcs11="
109 (assoc-ref %build-inputs "p11-kit")))
110 #:phases
111 (modify-phases %standard-phases
112 (add-after 'strip 'move-to-utils
113 (lambda _
114 (for-each
115 (lambda (file)
116 (let ((target (string-append (assoc-ref %outputs "utils") file))
117 (src (string-append (assoc-ref %outputs "out") file)))
118 (mkdir-p (dirname target))
119 (link src target)
120 (delete-file src)))
121 '("/bin/dig" "/bin/delv" "/bin/nslookup" "/bin/host" "/bin/nsupdate"
122 "/share/man/man1/dig.1"
123 "/share/man/man1/host.1"
124 "/share/man/man1/nslookup.1"
125 "/share/man/man1/nsupdate.1"))))
126 ;; When and if guix provides user namespaces for the build process,
127 ;; then the following can be uncommented and the subsequent "force-test"
128 ;; will not be necessary.
129 ;;
130 ;; (add-before 'check 'set-up-loopback
131 ;; (lambda _
132 ;; (system "bin/tests/system/ifconfig.sh up")))
133 (replace 'check
134 (lambda _
135 (zero? (system* "make" "force-test")))))))
136 (synopsis "An implementation of the Domain Name System")
137 (description "BIND is an implementation of the Domain Name System (DNS)
138 protocols for the Internet. It is a reference implementation of those
139 protocols, but it is also production-grade software, suitable for use in
140 high-volume and high-reliability applications. The name BIND stands for
141 \"Berkeley Internet Name Domain\", because the software originated in the early
142 1980s at the University of California at Berkeley.")
143 (home-page "https://www.isc.org/downloads/bind")
144 (license (list license:isc))))
145
146 (define-public dnscrypt-proxy
147 (package
148 (name "dnscrypt-proxy")
149 (version "1.9.4")
150 (source (origin
151 (method url-fetch)
152 (uri (string-append
153 "https://download.dnscrypt.org/dnscrypt-proxy/"
154 "dnscrypt-proxy-" version ".tar.bz2"))
155 (sha256
156 (base32
157 "07piwsjczamwvdpv1585kg4awqakip51bwsm8nqi6bljww4agx7x"))
158 (modules '((guix build utils)))
159 (snippet
160 ;; Delete bundled libltdl. XXX: This package also bundles
161 ;; a modified libevent that cannot currently be removed.
162 '(delete-file-recursively "libltdl"))))
163 (build-system gnu-build-system)
164 (arguments
165 `(#:phases
166 (modify-phases %standard-phases
167 (add-before 'configure 'autoreconf
168 (lambda _
169 ;; Re-generate build files due to unbundling ltdl.
170 ;; TODO: Prevent generating new libltdl and building it.
171 ;; The system version is still favored and referenced.
172 (zero? (system* "autoreconf" "-vif")))))))
173 (native-inputs
174 `(("pkg-config" ,pkg-config)
175 ("automake" ,automake)
176 ("autoconf" ,autoconf)
177 ("libtool" ,libtool)))
178 (inputs
179 `(("libltdl" ,libltdl)
180 ("libsodium" ,libsodium)))
181 (home-page "https://www.dnscrypt.org/")
182 (synopsis "Securely send DNS requests to a remote server")
183 (description
184 "@command{dnscrypt-proxy} is a tool for securing communications
185 between a client and a DNS resolver. It verifies that responses you get
186 from a DNS provider was actually sent by that provider, and haven't been
187 tampered with. For optimal performance it is recommended to use this as
188 a forwarder for a caching DNS resolver such as @command{dnsmasq}, but it
189 can also be used as a normal DNS \"server\". A list of public dnscrypt
190 servers is included, and an up-to-date version is available at
191 @url{https://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-resolvers.csv}.")
192 (license (list license:isc
193 ;; Libevent and src/ext/queue.h is 3-clause BSD.
194 license:bsd-3))))
195
196 (define-public dnscrypt-wrapper
197 (package
198 (name "dnscrypt-wrapper")
199 (version "0.2.2")
200 (source (origin
201 (method url-fetch)
202 (uri (string-append
203 "https://github.com/cofyc/dnscrypt-wrapper/releases"
204 "/download/v" version "/" name "-v" version ".tar.bz2"))
205 (sha256
206 (base32
207 "1vhg4g0r687f51wcdn7z9w1hxapazx6vyh5rsr8wa48sljzd583g"))))
208 (build-system gnu-build-system)
209 (arguments
210 `(#:make-flags '("CC=gcc")
211 ;; TODO: Tests require ruby-cucumber and ruby-aruba.
212 #:tests? #f
213 #:phases
214 (modify-phases %standard-phases
215 (add-before 'configure 'create-configure
216 (lambda _
217 (zero? (system* "make" "configure")))))))
218 (native-inputs
219 `(("autoconf" ,autoconf)))
220 (inputs
221 `(("libevent" ,libevent)
222 ("libsodium" ,libsodium)))
223 (home-page "https://github.com/Cofyc/dnscrypt-wrapper")
224 (synopsis "Server-side dnscrypt proxy")
225 (description
226 "@command{dnscrypt-wrapper} is a tool to expose a name server over
227 the @code{dnscrypt} protocol. It can be used as an endpoint for the
228 @command{dnscrypt-proxy} client to securely tunnel DNS requests between
229 the two.")
230 (license (list license:isc
231 ;; Bundled argparse is MIT. TODO: package and unbundle.
232 license:expat
233 ;; dns-protocol.h and rfc1035.{c,h} is gpl2 or gpl3 (either).
234 license:gpl2
235 license:gpl3))))
236
237 (define-public libasr
238 (package
239 (name "libasr")
240 (version "201602131606")
241 (source
242 (origin
243 (method url-fetch)
244 (uri (string-append "https://www.opensmtpd.org/archives/"
245 name "-" version ".tar.gz"))
246 (sha256
247 (base32
248 "18kdmbjsxrfai16d66qslp48b1zf7gr8him2jj5dcqgbsl44ls75"))))
249 (build-system gnu-build-system)
250 (native-inputs
251 `(("autoconf" ,autoconf)
252 ("automake" ,automake)
253 ("pkg-config" ,pkg-config)
254 ("groff" ,groff)))
255 (home-page "https://www.opensmtpd.org")
256 (synopsis "Asynchronous resolver library by the OpenBSD project")
257 (description
258 "libasr is a free, simple and portable asynchronous resolver library.
259 It allows to run DNS queries and perform hostname resolutions in a fully
260 asynchronous fashion.")
261 (license (list license:isc
262 license:bsd-2 ; last part of getrrsetbyname_async.c
263 license:bsd-3
264 (license:non-copyleft "file://LICENSE") ; includes.h
265 license:openssl))))
266
267 (define-public yadifa
268 (package
269 (name "yadifa")
270 (version "2.2.3")
271 (source
272 (let ((revision "6711"))
273 (origin
274 (method url-fetch)
275 (uri
276 (string-append "http://cdn.yadifa.eu/sites/default/files/releases/"
277 name "-" version "-" revision ".tar.gz"))
278 (sha256
279 (base32
280 "0ikfm40gx0zjw3gnxsw3rn1k4wb8jacgklja3ygcj1knq6hy2zaa")))))
281 (build-system gnu-build-system)
282 (native-inputs
283 `(("which" ,which)))
284 (inputs
285 `(("openssl" ,openssl)))
286 (arguments
287 `(#:phases (modify-phases %standard-phases
288 (add-before 'configure 'omit-example-configurations
289 (lambda _ (substitute* "Makefile.in"
290 ((" (etc|var)") "")))))
291 #:configure-flags (list "--sysconfdir=/etc" "--localstatedir=/var"
292 "--enable-shared" "--disable-static"
293 "--enable-messages" "--enable-ctrl"
294 "--enable-nsec" "--enable-nsec3"
295 "--enable-tsig" "--enable-caching"
296 ;; NSID is a rarely-used debugging aid, that also
297 ;; causes the build to fail. Just disable it.
298 "--disable-nsid")))
299 (home-page "http://www.yadifa.eu/")
300 (synopsis "Authoritative DNS name server")
301 (description "YADIFA is an authorative name server for the Domain Name
302 System (DNS). It aims for both higher performance and a smaller memory
303 footprint than other implementations, while remaining fully RFC-compliant.
304 YADIFA supports dynamic record updates and the Domain Name System Security
305 Extensions (DNSSEC).")
306 (license license:bsd-3)))