gnu: pocl: Update to 1.2.
[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, 2017 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
7 ;;; Copyright © 2016 Nils Gillmann <ng0@n0.is>
8 ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
10 ;;; Copyright © 2017 Vasile Dumitrascu <va511e@yahoo.com>
11 ;;; Copyright © 2017 Gregor Giesen <giesen@zaehlwerk.net>
12 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
13 ;;;
14 ;;; This file is part of GNU Guix.
15 ;;;
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
20 ;;;
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
25 ;;;
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29 (define-module (gnu packages dns)
30 #:use-module (gnu packages admin)
31 #:use-module (gnu packages autotools)
32 #:use-module (gnu packages base)
33 #:use-module (gnu packages bash)
34 #:use-module (gnu packages databases)
35 #:use-module (gnu packages compression)
36 #:use-module (gnu packages crypto)
37 #:use-module (gnu packages datastructures)
38 #:use-module (gnu packages flex)
39 #:use-module (gnu packages glib)
40 #:use-module (gnu packages groff)
41 #:use-module (gnu packages groff)
42 #:use-module (gnu packages libedit)
43 #:use-module (gnu packages libevent)
44 #:use-module (gnu packages libidn)
45 #:use-module (gnu packages linux)
46 #:use-module (gnu packages ncurses)
47 #:use-module (gnu packages nettle)
48 #:use-module (gnu packages networking)
49 #:use-module (gnu packages perl)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages protobuf)
52 #:use-module (gnu packages python)
53 #:use-module (gnu packages swig)
54 #:use-module (gnu packages tls)
55 #:use-module (gnu packages web)
56 #:use-module (gnu packages xml)
57 #:use-module (gnu packages)
58 #:use-module ((guix licenses) #:prefix license:)
59 #:use-module (guix packages)
60 #:use-module (guix download)
61 #:use-module (guix utils)
62 #:use-module (guix build-system gnu)
63 #:use-module (guix build-system trivial))
64
65 (define-public dnsmasq
66 (package
67 (name "dnsmasq")
68 (version "2.79")
69 (source (origin
70 (method url-fetch)
71 (uri (string-append
72 "http://www.thekelleys.org.uk/dnsmasq/dnsmasq-"
73 version ".tar.xz"))
74 (sha256
75 (base32
76 "07w6cw706yyahwvbvslhkrbjf2ynv567cgy9pal8bz8lrbsp9bbq"))))
77 (build-system gnu-build-system)
78 (native-inputs
79 `(("pkg-config" ,pkg-config)))
80 (inputs
81 `(("dbus" ,dbus)))
82 (arguments
83 `(#:phases
84 (modify-phases %standard-phases (delete 'configure))
85 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
86 "CC=gcc"
87 "COPTS=\"-DHAVE_DBUS\"")
88 #:tests? #f)) ; no ‘check’ target
89 (home-page "http://www.thekelleys.org.uk/dnsmasq/doc.html")
90 (synopsis "Small caching DNS proxy and DHCP/TFTP server")
91 (description
92 "Dnsmasq is a light-weight DNS forwarder and DHCP server. It is designed
93 to provide DNS and, optionally, DHCP to a small network. It can serve the
94 names of local machines which are not in the global DNS. The DHCP server
95 integrates with the DNS server and allows machines with DHCP-allocated
96 addresses to appear in the DNS with names configured either on each host or in
97 a central configuration file. Dnsmasq supports static and dynamic DHCP leases
98 and BOOTP/TFTP for network booting of diskless machines.")
99 ;; Source files only say GPL2 and GPL3 are allowed.
100 (license (list license:gpl2 license:gpl3))))
101
102 ;; 'bind' is the name of a built-in Guile procedure, which is why we choose a
103 ;; different name here.
104 (define-public isc-bind
105 (package
106 (name "bind")
107 (version "9.12.2-P1")
108 (source (origin
109 (method url-fetch)
110 (uri (string-append
111 "https://ftp.isc.org/isc/bind9/" version "/" name "-"
112 version ".tar.gz"))
113 (sha256
114 (base32
115 "192ld6w8f4n46hvdmmzzrfkd28apf4dwmbpbi3j2q1d2p315ajww"))))
116 (build-system gnu-build-system)
117 (outputs `("out" "utils"))
118 (inputs
119 ;; it would be nice to add GeoIP and gssapi once there is package
120 `(("libcap" ,libcap)
121 ("libxml2" ,libxml2)
122 ("openssl" ,openssl)
123 ("p11-kit" ,p11-kit)))
124 (native-inputs `(("perl" ,perl)
125 ("net-tools" ,net-tools)))
126 (arguments
127 `(#:configure-flags
128 (list (string-append "--with-openssl="
129 (assoc-ref %build-inputs "openssl"))
130 (string-append "--with-pkcs11="
131 (assoc-ref %build-inputs "p11-kit")))
132 #:phases
133 (modify-phases %standard-phases
134 (add-after 'strip 'move-to-utils
135 (lambda _
136 (for-each
137 (lambda (file)
138 (let ((target (string-append (assoc-ref %outputs "utils") file))
139 (src (string-append (assoc-ref %outputs "out") file)))
140 (mkdir-p (dirname target))
141 (link src target)
142 (delete-file src)))
143 '("/bin/dig" "/bin/delv" "/bin/nslookup" "/bin/host" "/bin/nsupdate"
144 "/share/man/man1/dig.1"
145 "/share/man/man1/host.1"
146 "/share/man/man1/nslookup.1"
147 "/share/man/man1/nsupdate.1"))))
148 ;; When and if guix provides user namespaces for the build process,
149 ;; then the following can be uncommented and the subsequent "force-test"
150 ;; will not be necessary.
151 ;;
152 ;; (add-before 'check 'set-up-loopback
153 ;; (lambda _
154 ;; (system "bin/tests/system/ifconfig.sh up")))
155 (replace 'check
156 (lambda _
157 (invoke "make" "force-test")
158 #t)))))
159 (synopsis "An implementation of the Domain Name System")
160 (description "BIND is an implementation of the @dfn{Domain Name System}
161 (DNS) protocols for the Internet. It is a reference implementation of those
162 protocols, but it is also production-grade software, suitable for use in
163 high-volume and high-reliability applications. The name BIND stands for
164 \"Berkeley Internet Name Domain\", because the software originated in the early
165 1980s at the University of California at Berkeley.")
166 (home-page "https://www.isc.org/downloads/bind")
167 (license (list license:mpl2.0))))
168
169 (define-public dnscrypt-proxy
170 (package
171 (name "dnscrypt-proxy")
172 (version "1.9.5")
173 (source (origin
174 (method url-fetch)
175 (uri (string-append
176 "https://download.dnscrypt.org/dnscrypt-proxy/"
177 "dnscrypt-proxy-" version ".tar.bz2"))
178 (sha256
179 (base32
180 "1dhvklr4dg2vlw108n11xbamacaryyg3dbrg629b76lp7685p7z8"))
181 (modules '((guix build utils)))
182 (snippet
183 ;; Delete bundled libltdl. XXX: This package also bundles
184 ;; a modified libevent that cannot currently be removed.
185 '(begin
186 (delete-file-recursively "libltdl")
187 #t))))
188 (build-system gnu-build-system)
189 (arguments
190 `(#:phases
191 (modify-phases %standard-phases
192 (add-after 'unpack 'autoreconf
193 (lambda _
194 ;; Re-generate build files due to unbundling ltdl.
195 ;; TODO: Prevent generating new libltdl and building it.
196 ;; The system version is still favored and referenced.
197 (invoke "autoreconf" "-vif"))))))
198 (native-inputs
199 `(("pkg-config" ,pkg-config)
200 ("automake" ,automake)
201 ("autoconf" ,autoconf)
202 ("libtool" ,libtool)))
203 (inputs
204 `(("libltdl" ,libltdl)
205 ("libsodium" ,libsodium)))
206 (home-page "https://www.dnscrypt.org/")
207 (synopsis "Securely send DNS requests to a remote server")
208 (description
209 "@command{dnscrypt-proxy} is a tool for securing communications
210 between a client and a DNS resolver. It verifies that responses you get
211 from a DNS provider was actually sent by that provider, and haven't been
212 tampered with. For optimal performance it is recommended to use this as
213 a forwarder for a caching DNS resolver such as @command{dnsmasq}, but it
214 can also be used as a normal DNS \"server\". A list of public dnscrypt
215 servers is included, and an up-to-date version is available at
216 @url{https://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-resolvers.csv}.")
217 (license (list license:isc
218 ;; Libevent and src/ext/queue.h is 3-clause BSD.
219 license:bsd-3))))
220
221 (define-public dnscrypt-wrapper
222 (package
223 (name "dnscrypt-wrapper")
224 (version "0.2.2")
225 (source (origin
226 (method url-fetch)
227 (uri (string-append
228 "https://github.com/cofyc/dnscrypt-wrapper/releases"
229 "/download/v" version "/" name "-v" version ".tar.bz2"))
230 (sha256
231 (base32
232 "1vhg4g0r687f51wcdn7z9w1hxapazx6vyh5rsr8wa48sljzd583g"))))
233 (build-system gnu-build-system)
234 (arguments
235 `(#:make-flags '("CC=gcc")
236 ;; TODO: Tests require ruby-cucumber and ruby-aruba.
237 #:tests? #f
238 #:phases
239 (modify-phases %standard-phases
240 (add-after 'unpack 'create-configure
241 (lambda _
242 (invoke "make" "configure"))))))
243 (native-inputs
244 `(("autoconf" ,autoconf)))
245 (inputs
246 `(("libevent" ,libevent)
247 ("libsodium" ,libsodium)))
248 (home-page "https://github.com/Cofyc/dnscrypt-wrapper")
249 (synopsis "Server-side dnscrypt proxy")
250 (description
251 "@command{dnscrypt-wrapper} is a tool to expose a name server over
252 the @code{dnscrypt} protocol. It can be used as an endpoint for the
253 @command{dnscrypt-proxy} client to securely tunnel DNS requests between
254 the two.")
255 (license (list license:isc
256 ;; Bundled argparse is MIT. TODO: package and unbundle.
257 license:expat
258 ;; dns-protocol.h and rfc1035.{c,h} is gpl2 or gpl3 (either).
259 license:gpl2
260 license:gpl3))))
261
262 (define-public libasr
263 (package
264 (name "libasr")
265 (version "201602131606")
266 (source
267 (origin
268 (method url-fetch)
269 (uri (string-append "https://www.opensmtpd.org/archives/"
270 name "-" version ".tar.gz"))
271 (sha256
272 (base32
273 "18kdmbjsxrfai16d66qslp48b1zf7gr8him2jj5dcqgbsl44ls75"))))
274 (build-system gnu-build-system)
275 (native-inputs
276 `(("autoconf" ,autoconf)
277 ("automake" ,automake)
278 ("pkg-config" ,pkg-config)
279 ("groff" ,groff)))
280 (home-page "https://www.opensmtpd.org")
281 (synopsis "Asynchronous resolver library by the OpenBSD project")
282 (description
283 "libasr is a free, simple and portable asynchronous resolver library.
284 It allows to run DNS queries and perform hostname resolutions in a fully
285 asynchronous fashion.")
286 (license (list license:isc
287 license:bsd-2 ; last part of getrrsetbyname_async.c
288 license:bsd-3
289 (license:non-copyleft "file://LICENSE") ; includes.h
290 license:openssl))))
291
292 (define-public unbound
293 (package
294 (name "unbound")
295 (version "1.8.0")
296 (source
297 (origin
298 (method url-fetch)
299 (uri (string-append "https://www.unbound.net/downloads/unbound-"
300 version ".tar.gz"))
301 (sha256
302 (base32
303 "0gxqc4ynd2g1a5dwaazqh9n8injh49a7dz0l9bbxqgv47dnrvxvq"))))
304 (build-system gnu-build-system)
305 (outputs '("out" "python"))
306 (native-inputs
307 `(("flex" ,flex)
308 ("swig" ,swig)))
309 (inputs
310 `(("expat" ,expat)
311 ("libevent" ,libevent)
312 ("protobuf" ,protobuf)
313 ("python" ,python-3)
314 ("python-wrapper" ,python-wrapper)
315 ("openssl" ,openssl)))
316 (arguments
317 `(#:configure-flags
318 (list "--disable-static" ;save space and non-determinism in libunbound.a
319 (string-append
320 "--with-ssl=" (assoc-ref %build-inputs "openssl"))
321 (string-append
322 "--with-libevent=" (assoc-ref %build-inputs "libevent"))
323 (string-append
324 "--with-libexpat=" (assoc-ref %build-inputs "expat"))
325 "--with-pythonmodule" "--with-pyunbound")
326 #:phases
327 (modify-phases %standard-phases
328 (add-after 'configure 'fix-python-site-package-path
329 ;; Move python modules into their own output.
330 (lambda* (#:key outputs #:allow-other-keys)
331 (let ((pyout (assoc-ref outputs "python"))
332 (ver ,(version-major+minor (package-version python))))
333 (substitute* "Makefile"
334 (("^PYTHON_SITE_PKG=.*$")
335 (string-append
336 "PYTHON_SITE_PKG="
337 pyout "/lib/python-" ver "/site-packages\n"))))
338 #t))
339 (add-before 'check 'fix-missing-nss-for-tests
340 ;; Unfortunately, the package's unittests involve some checks
341 ;; looking up protocols and services which are not provided
342 ;; by the minimalistic build environment, in particular,
343 ;; /etc/protocols and /etc/services are missing.
344 ;; Also, after plain substitution of protocol and service names
345 ;; in the test data, the tests still fail because the
346 ;; corresponding Resource Records have been signed by
347 ;; RRSIG records.
348 ;; The following LD_PRELOAD library overwrites the glibc
349 ;; functions ‘get{proto,serv}byname’, ‘getprotobynumber’ and
350 ;; ‘getservbyport’ providing the few records required for the
351 ;; unit tests to pass.
352 (lambda* (#:key inputs outputs #:allow-other-keys)
353 (let* ((source (assoc-ref %build-inputs "source"))
354 (gcc (assoc-ref %build-inputs "gcc")))
355 (call-with-output-file "/tmp/nss_preload.c"
356 (lambda (port)
357 (display "#include <stdlib.h>
358 #include <string.h>
359 #include <strings.h>
360
361 #include <netdb.h>
362
363 struct protoent *getprotobyname(const char *name) {
364 struct protoent *p = malloc(sizeof(struct protoent));
365 p->p_aliases = malloc(sizeof(char*));
366 if (strcasecmp(name, \"tcp\") == 0) {
367 p->p_name = \"tcp\";
368 p->p_proto = 6;
369 p->p_aliases[0] = \"TCP\";
370 } else if (strcasecmp(name, \"udp\") == 0) {
371 p->p_name = \"udp\";
372 p->p_proto = 17;
373 p->p_aliases[0] = \"UDP\";
374 } else
375 p = NULL;
376 return p;
377 }
378
379 struct protoent *getprotobynumber(int proto) {
380 struct protoent *p = malloc(sizeof(struct protoent));
381 p->p_aliases = malloc(sizeof(char*));
382 switch(proto) {
383 case 6:
384 p->p_name = \"tcp\";
385 p->p_proto = 6;
386 p->p_aliases[0] = \"TCP\";
387 break;
388 case 17:
389 p->p_name = \"udp\";
390 p->p_proto = 17;
391 p->p_aliases[0] = \"UDP\";
392 break;
393 default:
394 p = NULL;
395 break;
396 }
397 return p;
398 }
399
400 struct servent *getservbyname(const char *name, const char *proto) {
401 struct servent *s = malloc(sizeof(struct servent));
402 char* buf = malloc((strlen(proto)+1)*sizeof(char));
403 strcpy(buf, proto);
404 s->s_aliases = malloc(sizeof(char*));
405 s->s_aliases[0] = NULL;
406 if (strcasecmp(name, \"domain\") == 0) {
407 s->s_name = \"domain\";
408 s->s_port = htons(53);
409 s->s_proto = buf;
410 } else
411 s = NULL;
412 return s;
413 }
414
415 struct servent *getservbyport(int port, const char *proto) {
416 char buf[32];
417 struct servent *s = malloc(sizeof(struct servent));
418 strcpy(buf, proto);
419 s->s_aliases = malloc(sizeof(char*));
420 s->s_aliases[0] = NULL;
421 switch(port) {
422 case 53:
423 s->s_name = \"domain\";
424 s->s_port = 53;
425 s->s_proto = \"udp\";
426 break;
427 default:
428 s = NULL;
429 break;
430 }
431 return s;
432 }" port)))
433 (invoke (string-append gcc "/bin/gcc")
434 "-shared" "-fPIC" "-o" "/tmp/nss_preload.so"
435 "/tmp/nss_preload.c")
436 ;; The preload library only affects the unittests.
437 (substitute* "Makefile"
438 (("./unittest")
439 "LD_PRELOAD=/tmp/nss_preload.so ./unittest")))
440 #t)))))
441 (home-page "https://www.unbound.net")
442 (synopsis "Validating, recursive, and caching DNS resolver")
443 (description
444 "Unbound is a recursive-only caching DNS server which can perform DNSSEC
445 validation of results. It implements only a minimal amount of authoritative
446 service to prevent leakage to the root nameservers: forward lookups for
447 localhost, reverse for @code{127.0.0.1} and @code{::1}, and NXDOMAIN for zones
448 served by AS112. Stub and forward zones are supported.")
449 (license license:bsd-4)))
450
451 (define-public yadifa
452 (package
453 (name "yadifa")
454 (version "2.3.8")
455 (source
456 (let ((build "7713"))
457 (origin
458 (method url-fetch)
459 (uri
460 (string-append "http://cdn.yadifa.eu/sites/default/files/releases/"
461 name "-" version "-" build ".tar.gz"))
462 (sha256
463 (base32 "15xhzg4crjcxascwpz6y8qpqcgypzv2p9bspdskp4nx1x1y4316c")))))
464 (build-system gnu-build-system)
465 (native-inputs
466 `(("which" ,which)))
467 (inputs
468 `(("openssl" ,openssl)))
469 (arguments
470 `(#:phases
471 (modify-phases %standard-phases
472 (add-before 'configure 'omit-example-configurations
473 (lambda _
474 (substitute* "Makefile.in"
475 ((" (etc|var)") ""))
476 #t)))
477 #:configure-flags
478 (list "--sysconfdir=/etc"
479 "--localstatedir=/var"
480 "--disable-build-timestamp" ; build reproducibly
481 "--enable-shared"
482 "--disable-static"
483 "--enable-acl"
484 "--enable-caching"
485 "--enable-ctrl" ; enable remote control
486 "--enable-nsec"
487 "--enable-nsec3"
488 "--enable-tsig")))
489 (home-page "http://www.yadifa.eu/")
490 (synopsis "Authoritative DNS name server")
491 (description "YADIFA is an authoritative name server for the @dfn{Domain
492 Name System} (DNS). It aims for both higher performance and a smaller memory
493 footprint than other implementations, while remaining fully RFC-compliant.
494 YADIFA supports dynamic record updates and the @dfn{Domain Name System Security
495 Extensions} (DNSSEC).")
496 (license license:bsd-3)))
497
498 (define-public knot
499 (package
500 (name "knot")
501 (version "2.7.2")
502 (source (origin
503 (method url-fetch)
504 (uri (string-append "https://secure.nic.cz/files/knot-dns/"
505 name "-" version ".tar.xz"))
506 (sha256
507 (base32
508 "0cc4wgb02ch09x99a1fnr7vsdik8k920q7jafzcamjvy3kpb4w6b"))
509 (modules '((guix build utils)))
510 (snippet
511 '(begin
512 ;; Delete bundled libraries.
513 (with-directory-excursion "src/contrib"
514 (delete-file-recursively "lmdb"))
515 #t))))
516 (build-system gnu-build-system)
517 (native-inputs
518 `(("pkg-config" ,pkg-config)))
519 (inputs
520 `(("fstrm" ,fstrm)
521 ("gnutls" ,gnutls)
522 ("jansson" ,jansson)
523 ("libcap-ng" ,libcap-ng)
524 ("libedit" ,libedit)
525 ("libidn" ,libidn)
526 ("liburcu" ,liburcu)
527 ("lmdb" ,lmdb)
528 ("ncurses" ,ncurses)
529 ("protobuf-c" ,protobuf-c)))
530 (arguments
531 `(#:phases
532 (modify-phases %standard-phases
533 (add-before 'configure 'disable-directory-pre-creation
534 (lambda _
535 ;; Don't install empty directories like ‘/etc’ outside the store.
536 ;; This is needed even when using ‘make config_dir=... install’.
537 (substitute* "src/Makefile.in" (("\\$\\(INSTALL\\) -d") "true"))
538 #t))
539 (replace 'install
540 (lambda* (#:key outputs #:allow-other-keys)
541 (let* ((out (assoc-ref outputs "out"))
542 (doc (string-append out "/share/doc/" ,name "-" ,version))
543 (etc (string-append doc "/examples/etc")))
544 (invoke "make"
545 (string-append "config_dir=" etc)
546 "install")))))
547 #:configure-flags
548 (list "--sysconfdir=/etc"
549 "--localstatedir=/var"
550 "--enable-dnstap" ; let tools read/write capture files
551 "--with-module-dnstap=yes" ; detailed query capturing & logging
552 (string-append "--with-bash-completions="
553 (assoc-ref %outputs "out")
554 "/etc/bash_completion.d"))))
555 (home-page "https://www.knot-dns.cz/")
556 (synopsis "Authoritative DNS name server")
557 (description "Knot DNS is an authoritative name server for the @dfn{Domain
558 Name System} (DNS), designed to meet the needs of root and @dfn{top-level
559 domain} (TLD) name servers. It is implemented as a threaded daemon and uses a
560 number of programming techniques to improve speed. For example, the responder
561 is completely lock-free, resulting in a very high response rate. Other features
562 include automatic @dfn{DNS Security Extensions} (DNSSEC) signing, dynamic record
563 synthesis, and on-the-fly re-configuration.")
564 (license
565 (list
566 ;; src/contrib/{hat-trie,murmurhash3,openbsd},
567 ;; src/dnssec/contrib/vpool.[ch], and parts of libtap/ are ‘MIT’ (expat).
568 license:expat
569 license:lgpl2.0+ ; parts of scr/contrib/ucw
570 license:public-domain ; src/contrib/fnv and possibly murmurhash3
571 license:gpl3+)))) ; everything else
572
573 (define-public ddclient
574 (package
575 (name "ddclient")
576 (version "3.9.0")
577 (source (origin
578 (method url-fetch)
579 (uri (string-append "mirror://sourceforge/ddclient/ddclient/ddclient-"
580 version "/ddclient-" version ".tar.gz"))
581 (sha256
582 (base32
583 "0fwyhab8yga2yi1kdfkbqxa83wxhwpagmj1w1mwkg2iffh1fjjlw"))))
584 (build-system trivial-build-system) ; no Makefile.PL
585 (native-inputs
586 `(("bash" ,bash)
587 ("gzip" ,gzip)
588 ("perl" ,perl)
589 ("tar" ,tar)))
590 (inputs
591 `(("inetutils" ,inetutils) ; logger
592 ("net-tools" ,net-tools)
593 ("perl-data-validate-ip" ,perl-data-validate-ip)
594 ("perl-digest-sha1" ,perl-digest-sha1)
595 ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
596 (arguments
597 `(#:modules ((guix build utils)
598 (ice-9 match)
599 (srfi srfi-26))
600 #:builder
601 (begin
602 (use-modules (guix build utils)
603 (ice-9 match)
604 (srfi srfi-26))
605 ;; bootstrap
606 (setenv "PATH" (string-append
607 (assoc-ref %build-inputs "bash") "/bin" ":"
608 (assoc-ref %build-inputs "tar") "/bin" ":"
609 (assoc-ref %build-inputs "gzip") "/bin" ":"
610 (assoc-ref %build-inputs "perl") "/bin"))
611 ;; extract source
612 (invoke "tar" "xvf" (assoc-ref %build-inputs "source"))
613 ;; package
614 (with-directory-excursion (string-append ,name "-" ,version)
615 (let* ((out (assoc-ref %outputs "out"))
616 (bin (string-append out "/bin")))
617 (let ((file "ddclient"))
618 (substitute* file
619 (("/usr/bin/perl") (which "perl"))
620 ;; Strictly use ‘/etc/ddclient/ddclient.conf’.
621 (("\\$\\{program\\}\\.conf") "/etc/ddclient/ddclient.conf")
622 (("\\$etc\\$program.conf") "/etc/ddclient/ddclient.conf")
623 ;; Strictly use ‘/var/cache/ddclient/ddclient.cache’
624 (("\\$cachedir\\$program\\.cache")
625 "/var/cache/ddclient/ddclient.cache"))
626 (install-file file bin)
627 (wrap-program (string-append bin "/" file)
628 `("PATH" ":" =
629 ("$PATH"
630 ,@(map (lambda (input)
631 (match input
632 ((name . store)
633 (string-append store "/bin"))))
634 %build-inputs)))
635 `("PERL5LIB" ":" =
636 ,(delete
637 ""
638 (map (match-lambda
639 (((? (cut string-prefix? "perl-" <>) name) . dir)
640 (string-append dir "/lib/perl5/site_perl"))
641 (_ ""))
642 %build-inputs)))))
643 (for-each (cut install-file <> (string-append out
644 "/share/ddclient"))
645 (find-files "." "sample.*$")))))))
646 (home-page "https://sourceforge.net/projects/ddclient/")
647 (synopsis "Address updating utility for dynamic DNS services")
648 (description "This package provides a client to update dynamic IP
649 addresses with several dynamic DNS service providers, such as
650 @uref{https://www.dyndns.com/account/login.html,DynDNS.com}.
651
652 This makes it possible to use a fixed hostname (such as myhost.dyndns.org) to
653 access a machine with a dynamic IP address.
654
655 The client supports both dynamic and (near) static services, as well as MX
656 record and alternative name management. It caches the address, and only
657 attempts the update when it has changed.")
658 (license license:gpl2+)))