gnu: youtube-dl: Update to 2016.05.01.
[jackhill/guix/guix.git] / gnu / packages / ntp.scm
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 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
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.
13 ;;;
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.
18 ;;;
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/>.
21
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))
37
38 (define-public ntp
39 (package
40 (name "ntp")
41 (version "4.2.8p7")
42 (source (origin
43 (method url-fetch)
44 (uri (string-append
45 "http://archive.ntp.org/ntp4/ntp-"
46 (version-major+minor version)
47 "/ntp-" version ".tar.gz"))
48 (sha256
49 (base32
50 "1p100856h17nb0kpnppy70nja57hbcc95h7shhxvw6mhl030rll1"))
51 (modules '((guix build utils)))
52 (snippet
53 '(begin
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")
63 #t))))
64 (native-inputs `(("which" ,which)
65 ("pkg-config" ,pkg-config)))
66 (inputs
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)))
73 `(("libcap" ,libcap))
74 '())))
75 (arguments
76 `(#:phases
77 (modify-phases %standard-phases
78 (add-after 'unpack 'disable-network-test
79 (lambda _
80 (substitute* "tests/libntp/Makefile.in"
81 (("test-decodenetnum\\$\\(EXEEXT\\) ") ""))
82 #t)))))
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.")
87 (license (l:x11-style
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")))
91
92 (define-public openntpd
93 (package
94 (name "openntpd")
95 (version "5.7p3")
96 (source (origin
97 (method url-fetch)
98 ;; XXX Use mirror://openbsd
99 (uri (string-append
100 "http://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/openntpd-"
101 version ".tar.gz"))
102 (sha256
103 (base32
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))))
114
115 (define-public tlsdate
116 (package
117 (name "tlsdate")
118 (version "0.0.13")
119 (home-page "https://github.com/ioerror/tlsdate")
120 (source (origin
121 (method git-fetch)
122 (uri (git-reference
123 (commit (string-append "tlsdate-" version))
124 (url home-page)))
125 (sha256
126 (base32
127 "0w3v63qmbhpqlxjsvf4k3zp90k6mdzi8cdpgshan9iphy1f44xgl"))
128 (file-name (string-append name "-" version "-checkout"))))
129 (build-system gnu-build-system)
130 (arguments
131 '(#:phases (modify-phases %standard-phases
132 (add-after 'unpack 'autogen
133 (lambda _
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")
147 (description
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.")
153 (license l:bsd-3)))