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>
6 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages ntp)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages base)
26 #:use-module (gnu packages linux)
27 #:use-module (gnu packages autotools)
28 #:use-module (gnu packages pkg-config)
29 #:use-module (gnu packages tls)
30 #:use-module (gnu packages libevent)
31 #:use-module ((guix licenses) #:prefix l:)
32 #:use-module (guix packages)
33 #:use-module (guix utils)
34 #:use-module (guix download)
35 #:use-module (guix git-download)
36 #:use-module (guix build-system gnu)
37 #:use-module (srfi srfi-1))
46 (uri (list (string-append
47 "http://archive.ntp.org/ntp4/ntp-"
48 (version-major+minor version)
49 "/ntp-" version ".tar.gz")
51 "https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-"
52 (version-major+minor version)
53 "/ntp-" version ".tar.gz")))
56 "0whbyf82lrczbri4adbsa4hg1ppfa6c7qcj7nhjwdfp1g1vjh95p"))
57 (modules '((guix build utils)))
60 ;; Remove the bundled copy of libevent, but we must keep
61 ;; sntp/libevent/build-aux since configure.ac contains
62 ;; AC_CONFIG_AUX_DIR([sntp/libevent/build-aux])
63 (rename-file "sntp/libevent/build-aux"
64 "sntp/libevent:build-aux")
65 (delete-file-recursively "sntp/libevent")
66 (mkdir "sntp/libevent")
67 (rename-file "sntp/libevent:build-aux"
68 "sntp/libevent/build-aux")
70 (native-inputs `(("which" ,which)
71 ("pkg-config" ,pkg-config)))
73 `(("openssl" ,openssl)
74 ("libevent" ,libevent)
75 ;; Build with POSIX capabilities support on GNU/Linux. This allows 'ntpd'
76 ;; to run as non-root (when invoked with '-u'.)
77 ,@(if (string-suffix? "-linux"
78 (or (%current-target-system) (%current-system)))
83 (modify-phases %standard-phases
84 (add-after 'unpack 'disable-network-test
86 (substitute* "tests/libntp/Makefile.in"
87 (("test-decodenetnum\\$\\(EXEEXT\\) ") ""))
89 (build-system gnu-build-system)
90 (synopsis "Real time clock synchronization system")
91 (description "NTP is a system designed to synchronize the clocks of
92 computers over a network.")
94 "http://www.eecis.udel.edu/~mills/ntp/html/copyright.html"
95 "A non-copyleft free licence from the University of Delaware"))
96 (home-page "http://www.ntp.org")))
98 (define-public openntpd
104 ;; XXX Use mirror://openbsd
106 "http://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/openntpd-"
110 "1s3plmxmybwpfrimq6sc54wxnn6ca7rb2g5k2bdjm4c88w4q1axi"))))
111 (build-system gnu-build-system)
112 (home-page "http://www.openntpd.org/")
113 (synopsis "NTP client and server by the OpenBSD Project")
114 (description "OpenNTPD is the OpenBSD Project's implementation of a client
115 and server for the Network Time Protocol. Its design goals include being
116 secure, easy to configure, and accurate enough for most purposes, so it's more
117 minimalist than ntpd.")
118 ;; A few of the source files are under bsd-3.
119 (license (list l:isc l:bsd-3))))
121 (define-public tlsdate
125 (home-page "https://github.com/ioerror/tlsdate")
129 (commit (string-append "tlsdate-" version))
133 "0w3v63qmbhpqlxjsvf4k3zp90k6mdzi8cdpgshan9iphy1f44xgl"))
134 (file-name (string-append name "-" version "-checkout"))))
135 (build-system gnu-build-system)
137 '(#:phases (modify-phases %standard-phases
138 (add-after 'unpack 'autogen
140 ;; The ancestor of 'SOURCE_DATE_EPOCH'; it contains the
141 ;; date that is recorded in binaries. It must be a
142 ;; "recent date" since it is used to detect bogus dates
143 ;; received from servers.
144 (setenv "COMPILE_DATE" (number->string 1450563040))
145 (zero? (system* "sh" "autogen.sh")))))))
146 (inputs `(("openssl" ,openssl)
147 ("libevent" ,libevent)))
148 (native-inputs `(("pkg-config" ,pkg-config)
149 ("autoconf" ,autoconf)
150 ("automake" ,automake)
151 ("libtool" ,libtool)))
152 (synopsis "Extract remote time from TLS handshakes")
154 "@command{tlsdate} sets the local clock by securely connecting with TLS
155 to remote servers and extracting the remote time out of the secure handshake.
156 Unlike ntpdate, @command{tlsdate} uses TCP, for instance connecting to a
157 remote HTTPS or TLS enabled service, and provides some protection against
158 adversaries that try to feed you malicious time information.")