1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
3 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
5 ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages ntp)
23 #:use-module (gnu packages)
24 #:use-module (gnu packages base)
25 #:use-module (gnu packages linux)
26 #:use-module (gnu packages autotools)
27 #:use-module (gnu packages pkg-config)
28 #:use-module (gnu packages tls)
29 #:use-module (gnu packages libevent)
30 #:use-module ((guix licenses) #:prefix l:)
31 #:use-module (guix packages)
32 #:use-module (guix utils)
33 #:use-module (guix download)
34 #:use-module (guix git-download)
35 #:use-module (guix build-system gnu)
36 #:use-module (srfi srfi-1))
45 "http://archive.ntp.org/ntp4/ntp-"
46 (version-major+minor version)
47 "/ntp-" version ".tar.gz"))
50 "1p100856h17nb0kpnppy70nja57hbcc95h7shhxvw6mhl030rll1"))
51 (modules '((guix build utils)))
54 ;; Remove the bundled copy of libevent, but we must keep
55 ;; sntp/libevent/build-aux since configure.ac contains
56 ;; AC_CONFIG_AUX_DIR([sntp/libevent/build-aux])
57 (rename-file "sntp/libevent/build-aux"
58 "sntp/libevent:build-aux")
59 (delete-file-recursively "sntp/libevent")
60 (mkdir "sntp/libevent")
61 (rename-file "sntp/libevent:build-aux"
62 "sntp/libevent/build-aux")
64 (native-inputs `(("which" ,which)
65 ("pkg-config" ,pkg-config)))
67 `(("openssl" ,openssl)
68 ("libevent" ,libevent)
69 ;; Build with POSIX capabilities support on GNU/Linux. This allows 'ntpd'
70 ;; to run as non-root (when invoked with '-u'.)
71 ,@(if (string-suffix? "-linux"
72 (or (%current-target-system) (%current-system)))
77 (modify-phases %standard-phases
78 (add-after 'unpack 'disable-network-test
80 (substitute* "tests/libntp/Makefile.in"
81 (("test-decodenetnum\\$\\(EXEEXT\\) ") ""))
83 (build-system gnu-build-system)
84 (synopsis "Real time clock synchronization system")
85 (description "NTP is a system designed to synchronize the clocks of
86 computers over a network.")
88 "http://www.eecis.udel.edu/~mills/ntp/html/copyright.html"
89 "A non-copyleft free licence from the University of Delaware"))
90 (home-page "http://www.ntp.org")))
92 (define-public openntpd
98 ;; XXX Use mirror://openbsd
100 "http://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/openntpd-"
104 "0filjmb3b8rc39bvhm8q2azzj10ljfgq41qih71pxv919j57qhag"))))
105 (build-system gnu-build-system)
106 (home-page "http://www.openntpd.org/")
107 (synopsis "NTP client and server by the OpenBSD Project")
108 (description "OpenNTPD is the OpenBSD Project's implementation of a client
109 and server for the Network Time Protocol. Its design goals include being
110 secure, easy to configure, and accurate enough for most purposes, so it's more
111 minimalist than ntpd.")
112 ;; A few of the source files are under bsd-3.
113 (license (list l:isc l:bsd-3))))
115 (define-public tlsdate
119 (home-page "https://github.com/ioerror/tlsdate")
123 (commit (string-append "tlsdate-" version))
127 "0w3v63qmbhpqlxjsvf4k3zp90k6mdzi8cdpgshan9iphy1f44xgl"))
128 (file-name (string-append name "-" version "-checkout"))))
129 (build-system gnu-build-system)
131 '(#:phases (modify-phases %standard-phases
132 (add-after 'unpack 'autogen
134 ;; The ancestor of 'SOURCE_DATE_EPOCH'; it contains the
135 ;; date that is recorded in binaries. It must be a
136 ;; "recent date" since it is used to detect bogus dates
137 ;; received from servers.
138 (setenv "COMPILE_DATE" (number->string 1450563040))
139 (zero? (system* "sh" "autogen.sh")))))))
140 (inputs `(("openssl" ,openssl)
141 ("libevent" ,libevent)))
142 (native-inputs `(("pkg-config" ,pkg-config)
143 ("autoconf" ,autoconf)
144 ("automake" ,automake)
145 ("libtool" ,libtool)))
146 (synopsis "Extract remote time from TLS handshakes")
148 "@command{tlsdate} sets the local clock by securely connecting with TLS
149 to remote servers and extracting the remote time out of the secure handshake.
150 Unlike ntpdate, @command{tlsdate} uses TCP, for instance connecting to a
151 remote HTTPS or TLS enabled service, and provides some protection against
152 adversaries that try to feed you malicious time information.")