Commit | Line | Data |
---|---|---|
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> |
d99e12d2 JD |
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) | |
ce0614dd | 24 | #:use-module (gnu packages base) |
52b321e9 | 25 | #:use-module (gnu packages linux) |
604d20a2 | 26 | #:use-module (gnu packages autotools) |
53a427cf | 27 | #:use-module (gnu packages pkg-config) |
cc2b77df | 28 | #:use-module (gnu packages tls) |
a60cd281 | 29 | #:use-module (gnu packages libevent) |
53a427cf | 30 | #:use-module ((guix licenses) #:prefix l:) |
d99e12d2 | 31 | #:use-module (guix packages) |
53a427cf | 32 | #:use-module (guix utils) |
d99e12d2 | 33 | #:use-module (guix download) |
604d20a2 | 34 | #:use-module (guix git-download) |
d99e12d2 JD |
35 | #:use-module (guix build-system gnu) |
36 | #:use-module (srfi srfi-1)) | |
37 | ||
38 | (define-public ntp | |
39 | (package | |
40 | (name "ntp") | |
0889321b | 41 | (version "4.2.8p6") |
d99e12d2 JD |
42 | (source (origin |
43 | (method url-fetch) | |
e881752c | 44 | (uri (string-append |
53a427cf MW |
45 | "http://archive.ntp.org/ntp4/ntp-" |
46 | (version-major+minor version) | |
d99e12d2 JD |
47 | "/ntp-" version ".tar.gz")) |
48 | (sha256 | |
49 | (base32 | |
0889321b | 50 | "0j509gd0snj8dq15rhfv2v4wisfaabya1gmgqslk1kisawf0wgaq")) |
a60cd281 MW |
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)))) | |
53a427cf MW |
64 | (native-inputs `(("which" ,which) |
65 | ("pkg-config" ,pkg-config))) | |
52b321e9 | 66 | (inputs |
53a427cf | 67 | `(("openssl" ,openssl) |
a60cd281 | 68 | ("libevent" ,libevent) |
53a427cf MW |
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 | '()))) | |
a60cd281 MW |
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))))) | |
d99e12d2 | 83 | (build-system gnu-build-system) |
e881752c | 84 | (synopsis "Real time clock synchronization system") |
d99e12d2 JD |
85 | (description "NTP is a system designed to synchronize the clocks of |
86 | computers over a network.") | |
53a427cf | 87 | (license (l:x11-style |
d99e12d2 JD |
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"))) | |
4ee69624 TUBK |
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)))) | |
604d20a2 LC |
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))) |