gnu: python-pathpy: Build documentation.
[jackhill/guix/guix.git] / gnu / packages / ntp.scm
CommitLineData
d99e12d2 1;;; GNU Guix --- Functional package management for GNU
53a427cf 2;;; Copyright © 2014 John Darrington <jmd@gnu.org>
b7921ba5 3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4ee69624 4;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
604d20a2 5;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
ac10a81a 6;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
d99e12d2
JD
7;;;
8;;; This file is part of GNU Guix.
9;;;
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.
14;;;
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.
19;;;
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/>.
22
23(define-module (gnu packages ntp)
24 #:use-module (gnu packages)
ce0614dd 25 #:use-module (gnu packages base)
52b321e9 26 #:use-module (gnu packages linux)
604d20a2 27 #:use-module (gnu packages autotools)
53a427cf 28 #:use-module (gnu packages pkg-config)
cc2b77df 29 #:use-module (gnu packages tls)
a60cd281 30 #:use-module (gnu packages libevent)
53a427cf 31 #:use-module ((guix licenses) #:prefix l:)
d99e12d2 32 #:use-module (guix packages)
53a427cf 33 #:use-module (guix utils)
d99e12d2 34 #:use-module (guix download)
604d20a2 35 #:use-module (guix git-download)
d99e12d2
JD
36 #:use-module (guix build-system gnu)
37 #:use-module (srfi srfi-1))
38
39(define-public ntp
40 (package
41 (name "ntp")
64a42a08 42 (version "4.2.8p8")
d99e12d2
JD
43 (source (origin
44 (method url-fetch)
620ce2ef
LF
45 (uri (list (string-append
46 "http://archive.ntp.org/ntp4/ntp-"
47 (version-major+minor version)
48 "/ntp-" version ".tar.gz")
49 (string-append
50 "https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-"
51 (version-major+minor version)
52 "/ntp-" version ".tar.gz")))
d99e12d2
JD
53 (sha256
54 (base32
64a42a08 55 "1vlpgd0dk2wkpmmf869sfxi8f46sfnmjgk51vl8n6vj5y2sx1cra"))
a60cd281
MW
56 (modules '((guix build utils)))
57 (snippet
58 '(begin
59 ;; Remove the bundled copy of libevent, but we must keep
60 ;; sntp/libevent/build-aux since configure.ac contains
61 ;; AC_CONFIG_AUX_DIR([sntp/libevent/build-aux])
62 (rename-file "sntp/libevent/build-aux"
63 "sntp/libevent:build-aux")
64 (delete-file-recursively "sntp/libevent")
65 (mkdir "sntp/libevent")
66 (rename-file "sntp/libevent:build-aux"
67 "sntp/libevent/build-aux")
68 #t))))
53a427cf
MW
69 (native-inputs `(("which" ,which)
70 ("pkg-config" ,pkg-config)))
52b321e9 71 (inputs
53a427cf 72 `(("openssl" ,openssl)
a60cd281 73 ("libevent" ,libevent)
53a427cf
MW
74 ;; Build with POSIX capabilities support on GNU/Linux. This allows 'ntpd'
75 ;; to run as non-root (when invoked with '-u'.)
76 ,@(if (string-suffix? "-linux"
77 (or (%current-target-system) (%current-system)))
78 `(("libcap" ,libcap))
79 '())))
a60cd281
MW
80 (arguments
81 `(#:phases
82 (modify-phases %standard-phases
83 (add-after 'unpack 'disable-network-test
84 (lambda _
85 (substitute* "tests/libntp/Makefile.in"
86 (("test-decodenetnum\\$\\(EXEEXT\\) ") ""))
87 #t)))))
d99e12d2 88 (build-system gnu-build-system)
e881752c 89 (synopsis "Real time clock synchronization system")
d99e12d2
JD
90 (description "NTP is a system designed to synchronize the clocks of
91computers over a network.")
53a427cf 92 (license (l:x11-style
d99e12d2
JD
93 "http://www.eecis.udel.edu/~mills/ntp/html/copyright.html"
94 "A non-copyleft free licence from the University of Delaware"))
95 (home-page "http://www.ntp.org")))
4ee69624
TUBK
96
97(define-public openntpd
98 (package
99 (name "openntpd")
77952b4c 100 (version "6.0p1")
4ee69624
TUBK
101 (source (origin
102 (method url-fetch)
103 ;; XXX Use mirror://openbsd
104 (uri (string-append
105 "http://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/openntpd-"
106 version ".tar.gz"))
107 (sha256
108 (base32
77952b4c 109 "1s3plmxmybwpfrimq6sc54wxnn6ca7rb2g5k2bdjm4c88w4q1axi"))))
4ee69624
TUBK
110 (build-system gnu-build-system)
111 (home-page "http://www.openntpd.org/")
112 (synopsis "NTP client and server by the OpenBSD Project")
113 (description "OpenNTPD is the OpenBSD Project's implementation of a client
114and server for the Network Time Protocol. Its design goals include being
115secure, easy to configure, and accurate enough for most purposes, so it's more
116minimalist than ntpd.")
117 ;; A few of the source files are under bsd-3.
118 (license (list l:isc l:bsd-3))))
604d20a2
LC
119
120(define-public tlsdate
121 (package
122 (name "tlsdate")
123 (version "0.0.13")
124 (home-page "https://github.com/ioerror/tlsdate")
125 (source (origin
126 (method git-fetch)
127 (uri (git-reference
128 (commit (string-append "tlsdate-" version))
129 (url home-page)))
130 (sha256
131 (base32
132 "0w3v63qmbhpqlxjsvf4k3zp90k6mdzi8cdpgshan9iphy1f44xgl"))
133 (file-name (string-append name "-" version "-checkout"))))
134 (build-system gnu-build-system)
135 (arguments
136 '(#:phases (modify-phases %standard-phases
137 (add-after 'unpack 'autogen
138 (lambda _
139 ;; The ancestor of 'SOURCE_DATE_EPOCH'; it contains the
140 ;; date that is recorded in binaries. It must be a
141 ;; "recent date" since it is used to detect bogus dates
142 ;; received from servers.
143 (setenv "COMPILE_DATE" (number->string 1450563040))
144 (zero? (system* "sh" "autogen.sh")))))))
145 (inputs `(("openssl" ,openssl)
146 ("libevent" ,libevent)))
147 (native-inputs `(("pkg-config" ,pkg-config)
148 ("autoconf" ,autoconf)
149 ("automake" ,automake)
150 ("libtool" ,libtool)))
151 (synopsis "Extract remote time from TLS handshakes")
152 (description
153 "@command{tlsdate} sets the local clock by securely connecting with TLS
154to remote servers and extracting the remote time out of the secure handshake.
155Unlike ntpdate, @command{tlsdate} uses TCP, for instance connecting to a
156remote HTTPS or TLS enabled service, and provides some protection against
157adversaries that try to feed you malicious time information.")
158 (license l:bsd-3)))