+
+(define-public ddclient
+ (package
+ (name "ddclient")
+ (version "3.9.0")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "mirror://sourceforge/ddclient/ddclient/ddclient-"
+ version "/ddclient-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0fwyhab8yga2yi1kdfkbqxa83wxhwpagmj1w1mwkg2iffh1fjjlw"))))
+ (build-system trivial-build-system) ; no Makefile.PL
+ (native-inputs
+ `(("bash" ,bash)
+ ("gzip" ,gzip)
+ ("perl" ,perl)
+ ("tar" ,tar)))
+ (inputs
+ `(("inetutils" ,inetutils) ; logger
+ ("net-tools" ,net-tools)
+ ("perl-data-validate-ip" ,perl-data-validate-ip)
+ ("perl-digest-sha1" ,perl-digest-sha1)
+ ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
+ (arguments
+ `(#:modules ((guix build utils)
+ (ice-9 match)
+ (srfi srfi-26))
+ #:builder
+ (begin
+ (use-modules (guix build utils)
+ (ice-9 match)
+ (srfi srfi-26))
+ ;; bootstrap
+ (setenv "PATH" (string-append
+ (assoc-ref %build-inputs "bash") "/bin" ":"
+ (assoc-ref %build-inputs "tar") "/bin" ":"
+ (assoc-ref %build-inputs "gzip") "/bin" ":"
+ (assoc-ref %build-inputs "perl") "/bin"))
+ ;; extract source
+ (invoke "tar" "xvf" (assoc-ref %build-inputs "source"))
+ ;; package
+ (with-directory-excursion (string-append ,name "-" ,version)
+ (let* ((out (assoc-ref %outputs "out"))
+ (bin (string-append out "/bin")))
+ (let ((file "ddclient"))
+ (substitute* file
+ (("/usr/bin/perl") (which "perl"))
+ ;; Strictly use ‘/etc/ddclient/ddclient.conf’.
+ (("\\$\\{program\\}\\.conf") "/etc/ddclient/ddclient.conf")
+ (("\\$etc\\$program.conf") "/etc/ddclient/ddclient.conf")
+ ;; Strictly use ‘/var/cache/ddclient/ddclient.cache’
+ (("\\$cachedir\\$program\\.cache")
+ "/var/cache/ddclient/ddclient.cache"))
+ (install-file file bin)
+ (wrap-program (string-append bin "/" file)
+ `("PATH" ":" =
+ ("$PATH"
+ ,@(map (lambda (input)
+ (match input
+ ((name . store)
+ (string-append store "/bin"))))
+ %build-inputs)))
+ `("PERL5LIB" ":" =
+ ,(delete
+ ""
+ (map (match-lambda
+ (((? (cut string-prefix? "perl-" <>) name) . dir)
+ (string-append dir "/lib/perl5/site_perl"))
+ (_ ""))
+ %build-inputs)))))
+ (for-each (cut install-file <> (string-append out
+ "/share/ddclient"))
+ (find-files "." "sample.*$")))))))
+ (home-page "https://sourceforge.net/projects/ddclient/")
+ (synopsis "Address updating utility for dynamic DNS services")
+ (description "This package provides a client to update dynamic IP
+addresses with several dynamic DNS service providers, such as
+@uref{https://www.dyndns.com/account/login.html,DynDNS.com}.
+
+This makes it possible to use a fixed hostname (such as myhost.dyndns.org) to
+access a machine with a dynamic IP address.
+
+The client supports both dynamic and (near) static services, as well as MX
+record and alternative name management. It caches the address, and only
+attempts the update when it has changed.")
+ (license license:gpl2+)))
+
+(define-public hnsd
+ ;; There have been no releases yet, hence this commit.
+ (let ((revision "0")
+ (commit "895d89c25d316d18df9d374fe78aae3902bc89fb"))
+ (package
+ (name "hnsd")
+ (version (git-version "0.0" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/handshake-org/hnsd")
+ (commit commit)))
+ (sha256
+ (base32
+ "0704y73sddn24jga9csw4gxyfb3pnrfnk0vdcph84n1h38490l16"))
+ (file-name (git-file-name name version))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ ;; Delete the bundled copy of libuv.
+ (delete-file-recursively "uv")
+ (substitute* "configure.ac"
+ (("AC_CONFIG_SUBDIRS\\(\\[uv\\]\\)") ""))
+ (substitute* "Makefile.am"
+ (("SUBDIRS = uv") "\n")
+ (("\\$\\(top_builddir\\)/uv/libuv.la") "-luv")
+
+ ;; Make sure the 'hnsd' binary is installed and
+ ;; dynamically-linked.
+ (("noinst_PROGRAMS") "bin_PROGRAMS")
+ (("hnsd_LDFLAGS = -static") ""))
+
+ ;; This script tries to chdir to "uv" and doesn't do more
+ ;; than "autoreconf" so remove it.
+ (delete-file "autogen.sh")
+ #t))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:configure-flags '("--disable-static"))) ;no need for libhsk.a
+ (native-inputs
+ `(("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("libtool" ,libtool)))
+ (inputs
+ `(("unbound" ,unbound)
+ ("libuv" ,libuv)))
+ (home-page "https://www.handshake.org/")
+ (synopsis "Resolver daemon for the Handshake naming protocol")
+ (description
+ "@command{hnsd} is a @dfn{host name resolver} for the Handshake Naming
+System (HNS) peer-to-peer network.")
+ (license license:expat))))
+
+(define-public libmicrodns
+ (package
+ (name "libmicrodns")
+ (version "0.0.10")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/videolabs/libmicrodns")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1xvl9k49ng35wbsqmnjnyqvkyjf8dcq2ywsq3jp3wh0rgmxhq2fh"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("libtool" ,libtool)))
+ (home-page "https://github.com/videolabs/libmicrodns")
+ (synopsis "Minimal mDNS resolver library")
+ (description "@code{libmicrodns} provides a minimal implementation of a
+mDNS resolver as well as an announcer. mDNS (Multicast Domain Name System) is
+a zero-config service that allows one to resolve host names to IP addresses in
+local networks.")
+ (license license:lgpl2.1)))