ports/opt (3.2): openntpd: 3.9p1 -> 5.7p4
commit 6baf78cab5873c381ded4dc1bf7ccb4070eebe05 Author: Alan Mizrahi <alan+crux@mizrahi.com.ve> Date: Sat Jan 2 19:40:44 2016 +0900 openntpd: 3.9p1 -> 5.7p4 diff --git a/openntpd/.footprint b/openntpd/.footprint index 4b46660..cc001eb 100644 --- a/openntpd/.footprint +++ b/openntpd/.footprint @@ -3,12 +3,16 @@ drwxr-xr-x root/root etc/ drwxr-xr-x root/root etc/rc.d/ -rwxr-xr-x root/root etc/rc.d/ntpd drwxr-xr-x root/root usr/ -drwxr-xr-x root/root usr/man/ -drwxr-xr-x root/root usr/man/man5/ --rw-r--r-- root/root usr/man/man5/ntpd.conf.5.gz -drwxr-xr-x root/root usr/man/man8/ --rw-r--r-- root/root usr/man/man8/ntpd.8.gz drwxr-xr-x root/root usr/sbin/ +-rwxr-xr-x root/root usr/sbin/ntpctl -rwxr-xr-x root/root usr/sbin/ntpd +drwxr-xr-x root/root usr/share/ +drwxr-xr-x root/root usr/share/man/ +drwxr-xr-x root/root usr/share/man/man5/ +-rw-r--r-- root/root usr/share/man/man5/ntpd.conf.5.gz +drwxr-xr-x root/root usr/share/man/man8/ +-rw-r--r-- root/root usr/share/man/man8/ntpctl.8.gz +-rw-r--r-- root/root usr/share/man/man8/ntpd.8.gz drwxr-xr-x root/root var/ -drwxr-xr-x root/root var/empty/ +drwxr-xr-x root/root var/lib/ +drwxr-xr-x root/root var/lib/ntp/ diff --git a/openntpd/.md5sum b/openntpd/.md5sum index 1225415..865d2be 100644 --- a/openntpd/.md5sum +++ b/openntpd/.md5sum @@ -1,3 +1,3 @@ -1edcbbfaed3be43cea078c9b863865e6 linux-adjtimex.patch -8e42b6b3709b17ba8b56cb6b1be01543 ntpd -afc34175f38d08867c1403d9008600b3 openntpd-3.9p1.tar.gz +a153057cd7706ecedc4276628dfaca40 ntpd +b4514b06835b472754573e4a549a4644 openntpd-paths.patch +9d818a143fbc5d830203fa2f4b4c6a2a openntpd-5.7p4.tar.gz diff --git a/openntpd/Pkgfile b/openntpd/Pkgfile index 63666c8..ace9901 100644 --- a/openntpd/Pkgfile +++ b/openntpd/Pkgfile @@ -4,23 +4,32 @@ # Packager: Matt Housh, jaeger at morpheus dot net name=openntpd -version=3.9p1 +version=5.7p4 release=4 -source=(ftp://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/$name-$version.tar.gz \ - ntpd \ - linux-adjtimex.patch ) +source=( +ftp://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/$name-$version.tar.gz +ntpd +openntpd-paths.patch +) build() { cd $name-$version - patch -p1 -i $SRC/linux-adjtimex.patch + + # change drift file and control socket locations + patch -p1 -i $SRC/openntpd-paths.patch ./configure \ --prefix=/usr \ --sysconfdir=/etc \ + --localstatedir=/var \ --with-privsep-user=ntp \ - --with-adjtimex + --with-cacert=/etc/ssl/cert.pem make make DESTDIR=$PKG install + rmdir $PKG/var/db $PKG/var/run install -D -m 0755 $SRC/ntpd $PKG/etc/rc.d/ntpd + + # drift file will be created here + mkdir -p $PKG/var/lib/ntp } diff --git a/openntpd/linux-adjtimex.patch b/openntpd/linux-adjtimex.patch deleted file mode 100644 index 9faa5d9..0000000 --- a/openntpd/linux-adjtimex.patch +++ /dev/null @@ -1,165 +0,0 @@ -diff -urN openntpd-3.9p1.orig/configure.ac openntpd-3.9p1/configure.ac ---- openntpd-3.9p1.orig/configure.ac 2006-05-14 14:29:23.000000000 +0900 -+++ openntpd-3.9p1/configure.ac 2011-11-22 09:34:20.036828225 +0900 -@@ -583,6 +583,11 @@ - [ builtin_arc4random=$withval ] - ) - -+AC_ARG_WITH(adjtimex, -+ [ --with-adjtimex Use adjtimex to adjust kernel skew], -+ [ AC_DEFINE(USE_ADJTIMEX, [], [Use adjust skew with adjtimex (experimental)]) ] -+ ) -+ - AC_ARG_WITH(mantype, - [ --with-mantype=man|cat|doc Set man page type], - [ -diff -urN openntpd-3.9p1.orig/defines.h openntpd-3.9p1/defines.h ---- openntpd-3.9p1.orig/defines.h 2006-05-14 14:29:21.000000000 +0900 -+++ openntpd-3.9p1/defines.h 2011-11-22 09:34:20.036828225 +0900 -@@ -20,6 +20,10 @@ - # define setproctitle(x) - #endif - -+#ifdef USE_ADJTIMEX -+# define adjtime(a,b) (_compat_adjtime((a),(b))) -+#endif -+ - #if !defined(SA_LEN) - # if defined(HAVE_STRUCT_SOCKADDR_SA_LEN) - # define SA_LEN(x) ((x)->sa_len) -diff -urN openntpd-3.9p1.orig/openbsd-compat/Makefile.in openntpd-3.9p1/openbsd-compat/Makefile.in ---- openntpd-3.9p1.orig/openbsd-compat/Makefile.in 2006-05-14 14:29:19.000000000 +0900 -+++ openntpd-3.9p1/openbsd-compat/Makefile.in 2011-11-22 09:34:20.036828225 +0900 -@@ -9,7 +9,7 @@ - COMPAT= atomicio.o bsd-arc4random.o bsd-misc.o bsd-poll.o \ - bsd-snprintf.o bsd-getifaddrs.o bsd-setresuid.o \ - bsd-setresgid.o fake-rfc2553.o --PORT= port-qnx.o -+PORT= port-linux.o port-qnx.o - - VPATH=@srcdir@ - CC=@CC@ -diff -urN openntpd-3.9p1.orig/openbsd-compat/openbsd-compat.h openntpd-3.9p1/openbsd-compat/openbsd-compat.h ---- openntpd-3.9p1.orig/openbsd-compat/openbsd-compat.h 2006-05-14 14:29:19.000000000 +0900 -+++ openntpd-3.9p1/openbsd-compat/openbsd-compat.h 2011-11-22 09:34:20.036828225 +0900 -@@ -46,6 +46,11 @@ - __attribute__((__format__ (printf, 2, 3))); - #endif - -+#ifdef USE_ADJTIMEX -+# include <sys/time.h> -+int _compat_adjtime(const struct timeval *, struct timeval *); -+#endif -+ - #ifndef HAVE_INET_PTON - int inet_pton(int, const char *, void *); - #endif -diff -urN openntpd-3.9p1.orig/openbsd-compat/port-linux.c openntpd-3.9p1/openbsd-compat/port-linux.c ---- openntpd-3.9p1.orig/openbsd-compat/port-linux.c 1970-01-01 09:00:00.000000000 +0900 -+++ openntpd-3.9p1/openbsd-compat/port-linux.c 2011-11-22 09:34:20.036828225 +0900 -@@ -0,0 +1,105 @@ -+ -+ -+/* -+ * Copyright (c) 2004 Darren Tucker <dtucker at zip com au> -+ * -+ * Permission to use, copy, modify, and distribute this software for any -+ * purpose with or without fee is hereby granted, provided that the above -+ * copyright notice and this permission notice appear in all copies. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+#include "includes.h" -+ -+#ifdef USE_ADJTIMEX -+#include <sys/timex.h> -+#include <errno.h> -+#ifdef adjtime -+# undef adjtime -+#endif -+ -+#include "ntpd.h" -+ -+/* scale factor used by adjtimex freq param. 1 ppm = 65536 */ -+#define ADJTIMEX_FREQ_SCALE 65536 -+ -+/* maximum change to skew per adjustment, in PPM */ -+#define MAX_SKEW_DELTA 5.0 -+ -+int -+_compat_adjtime(const struct timeval *delta, struct timeval *olddelta) -+{ -+ static struct timeval tlast = {0,0}; -+ static double tskew = 0; -+ static int synced = -1; -+ struct timeval tnow, tdelta; -+ double skew = 0, newskew, deltaskew, adjust, interval = 0; -+ struct timex tmx; -+ int result, saved_errno; -+ -+ gettimeofday(&tnow, NULL); -+ adjust = (double)delta->tv_sec; -+ adjust += (double)delta->tv_usec / 1000000; -+ -+ /* Even if the caller doesn't care about the olddelta, we do */ -+ if (olddelta == NULL) -+ olddelta = &tdelta; -+ -+ result = adjtime(delta, olddelta); -+ saved_errno = errno; -+ -+ if (olddelta->tv_sec == 0 && olddelta->tv_usec == 0 && -+ synced != INT_MAX) -+ synced++; -+ else -+ synced = 0; -+ -+ /* -+ * do skew calculations if we have synced -+ */ -+ if (synced == 0 ) { -+ tmx.modes = 0; -+ if (adjtimex(&tmx) == -1) -+ log_warn("adjtimex get failed"); -+ else -+ tskew = (double)tmx.freq / ADJTIMEX_FREQ_SCALE; -+ } else if (synced >= 1) { -+ interval = (double)(tnow.tv_sec - tlast.tv_sec); -+ interval += (double)(tnow.tv_usec - tlast.tv_usec) / 1000000; -+ -+ skew = (adjust * 1000000) / interval; -+ newskew = ((tskew * synced) + skew) / synced; -+ deltaskew = newskew - tskew; -+ -+ if (deltaskew > MAX_SKEW_DELTA) { -+ log_info("skew change %0.3lf exceeds limit", deltaskew); -+ tskew += MAX_SKEW_DELTA; -+ } else if (deltaskew < -MAX_SKEW_DELTA) { -+ log_info("skew change %0.3lf exceeds limit", deltaskew); -+ tskew -= MAX_SKEW_DELTA; -+ } else { -+ tskew = newskew; -+ } -+ -+ /* Adjust the kernel skew. */ -+ tmx.freq = (long)(tskew * ADJTIMEX_FREQ_SCALE); -+ tmx.modes = ADJ_FREQUENCY; -+ if (adjtimex(&tmx) == -1) -+ log_warn("adjtimex set freq failed"); -+ } -+ -+ log_debug("interval %0.3lf skew %0.3lf total skew %0.3lf", interval, -+ skew, tskew); -+ -+ tlast = tnow; -+ errno = saved_errno; -+ return result; -+} -+#endif diff --git a/openntpd/ntpd b/openntpd/ntpd index 26e6850..91d9372 100644 --- a/openntpd/ntpd +++ b/openntpd/ntpd @@ -3,9 +3,9 @@ NAME=ntpd USER=root CONFIG= -RUNDIR=/var/run -PIDFILE= -STARTCMD="/usr/sbin/ntpd -s" +RUNDIR="/var/run/openntpd" +PIDFILE="$RUNDIR/openntpd.pid" +STARTCMD="/usr/sbin/ntpd -s -p $PIDFILE" STOPCMD= STOPTIMEOUT=120 diff --git a/openntpd/openntpd-paths.patch b/openntpd/openntpd-paths.patch new file mode 100644 index 0000000..a7dfc96 --- /dev/null +++ b/openntpd/openntpd-paths.patch @@ -0,0 +1,56 @@ +diff -ru openntpd-5.7p4.orig/src/ntpctl.8 openntpd-5.7p4/src/ntpctl.8 +--- openntpd-5.7p4.orig/src/ntpctl.8 2016-01-01 21:37:56.105451771 +0900 ++++ openntpd-5.7p4/src/ntpctl.8 2016-01-01 22:07:10.772159485 +0900 +@@ -63,8 +63,8 @@ + When the median constraint is set, the offset to the local time is displayed. + .El + .Sh FILES +-.Bl -tag -width "/var/run/ntpd.sockXXX" -compact +-.It Pa /var/run/ntpd.sock ++.Bl -tag -width "/var/run/openntpd/ntpd.sockXXX" -compact ++.It Pa /var/run/openntpd/ntpd.sock + Socket file for communication with + .Xr ntpd 8 . + .El +diff -ru openntpd-5.7p4.orig/src/ntpd.8 openntpd-5.7p4/src/ntpd.8 +--- openntpd-5.7p4.orig/src/ntpd.8 2016-01-01 21:37:56.105451771 +0900 ++++ openntpd-5.7p4/src/ntpd.8 2016-01-01 22:06:42.479471373 +0900 +@@ -122,7 +122,7 @@ + typically + .Xr ntpd.conf 5 , + and its initial clock drift from +-.Pa /var/db/ntpd.drift . ++.Pa /var/lib/ntp/ntp.drift . + Clock drift is periodically written to the drift file thereafter. + .Pp + When +@@ -137,12 +137,12 @@ + it writes its peer and sensor status to + .Xr syslog 3 . + .Sh FILES +-.Bl -tag -width "/var/db/ntpd.driftXXX" -compact ++.Bl -tag -width "/var/run/openntpd/ntpd.sockXXX" -compact + .It Pa /etc/ntpd.conf + Default configuration file. +-.It Pa /var/db/ntpd.drift ++.It Pa /var/lib/ntp/ntp.drift + Drift file. +-.It Pa /var/run/ntpd.sock ++.It Pa /var/run/openntpd/ntpd.sock + Socket file for communication with + .Xr ntpctl 8 . + .El +diff -ru openntpd-5.7p4.orig/src/ntpd.h openntpd-5.7p4/src/ntpd.h +--- openntpd-5.7p4.orig/src/ntpd.h 2016-01-01 21:37:56.106451771 +0900 ++++ openntpd-5.7p4/src/ntpd.h 2016-01-01 22:06:42.479471373 +0900 +@@ -48,8 +48,8 @@ + #ifndef LOCALSTATEDIR + #define LOCALSTATEDIR "/var" + #endif +-#define DRIFTFILE LOCALSTATEDIR "/db/ntpd.drift" +-#define CTLSOCKET LOCALSTATEDIR "/run/ntpd.sock" ++#define DRIFTFILE LOCALSTATEDIR "/lib/ntp/ntp.drift" ++#define CTLSOCKET LOCALSTATEDIR "/run/openntpd/ntpd.sock" + + #if defined(SO_SETFIB) + #define SO_RTABLE SO_SETFIB
participants (1)
-
crux@crux.nu