Permalink
Browse files

add ntp / ntpd

  • Loading branch information...
1 parent e67942f commit d92b6a542adc8d4d17b4ed047758289ba0978598 @JohnSonnenschein JohnSonnenschein committed Jan 11, 2011
View
@@ -26,7 +26,7 @@
PATH=/sbin:/usr/sbin:/usr/bin:/opt/SUNWspro/bin
BASE=$(PWD)
DESTDIR=$(BASE)/proto
-SUBDIRS= bash bzip2 curl gtar gzip libexpat libm libxml libz ncurses node.js nss-nspr openssl rsync vim wget
+SUBDIRS= bash bzip2 curl gtar gzip libexpat libm libxml libz ncurses node.js nss-nspr ntp openssl rsync vim wget
-include Makefile.inc
View
@@ -0,0 +1,75 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2011 Joyent Inc
+#
+
+
+VER = ntp-dev-4.2.5p200
+TARBALL = $(VER).tar.gz
+
+# configure(1) options to use
+# a default --prefix and --mandir are set in Makefile.master
+CONFIGURE_OPTIONS = --prefix=/usr
+CONFIGURE_OPTIONS += --mandir=/usr/man
+CONFIGURE_OPTIONS += --bindir=/usr/sbin
+CONFIGURE_OPTIONS += --with-binsubdir=sbin
+CONFIGURE_OPTIONS += --libexecdir=/usr/lib/inet
+CONFIGURE_OPTIONS += --sysconfdir=/etc/inet
+CONFIGURE_OPTIONS += --enable-all-clocks
+CONFIGURE_OPTIONS += --enable-debugging
+CONFIGURE_OPTIONS += --enable-debug-timing
+CONFIGURE_OPTIONS += --disable-optional-args
+CONFIGURE_OPTIONS += --enable-parse-clocks
+CONFIGURE_OPTIONS += --enable-ignore-dns-errors
+CONFIGURE_OPTIONS += --without-ntpsnmpd
+CONFIGURE_OPTIONS += --without-lineeditlibs
+CONFIGURE_OPTIONS += --with-openssl-libdir=/lib
+CONFIGURE_OPTIONS += --disable-getifaddrs
+
+TARGET_ENV = CC="gcc"
+TARGET_ENV += CFLAGS="-O2"
+TARGET_ENV += LD_OPTIONS="-L${DESTDIR}/usr/lib -L/usr/lib -R/usr/lib"
+
+install:= TARGET_ENV += DESTDIR=$(DESTDIR)
+
+all: $(VER)/config.status
+ (cd $(VER); env - make all $(TARGET_ENV))
+
+install:
+ (cd $(VER); env - make install $(TARGET_ENV))
+ (ksh93 install-ntp $(TARGET_ENV))
+
+$(VER)/config.status: $(VER)/.patched
+ (cd $(VER) ; env - bash ./configure $(CONFIGURE_OPTIONS) $(TARGET_ENV))
+
+$(VER)/.patched: $(VER)
+ (cd $(VER) ; env - ; for x in ../Patches/*; do gpatch -p0 < $$x; done ; touch .patched)
+
+$(VER): $(TARBALL) clean
+ gtar -zxf $(TARBALL)
+
+clean:
+ -rm -rf $(VER)
+
+FRC:
@@ -0,0 +1,81 @@
+--- sntp/header.h.orig Thu May 14 06:34:41 2009
++++ sntp/header.h Thu May 14 06:15:12 2009
+@@ -19,10 +19,10 @@
+ #define MAX_SOCKETS 10 /* Maximum number of addresses */
+
+ #ifndef LOCKNAME
+-# define LOCKNAME "/etc/sntp.pid" /* Stores the pid */
++# define LOCKNAME "/var/run/sntp.pid" /* Stores the pid */
+ #endif
+ #ifndef SAVENAME
+-# define SAVENAME "/etc/sntp.state" /* Stores the recovery state */
++# define SAVENAME "/var/ntp/sntp.state" /* Stores the recovery state */
+ #endif
+
+
+--- include/ntp_config.h.orig Thu May 14 06:34:41 2009
++++ include/ntp_config.h Thu May 14 06:15:12 2009
+@@ -10,7 +10,7 @@
+ */
+ #ifndef CONFIG_FILE
+ # ifndef SYS_WINNT
+-# define CONFIG_FILE "/etc/ntp.conf"
++# define CONFIG_FILE "/etc/inet/ntp.conf"
+ # else /* SYS_WINNT */
+ # define CONFIG_FILE "%windir%\\system32\\drivers\\etc\\ntp.conf"
+ # define ALT_CONFIG_FILE "%windir%\\ntp.conf"
+--- libntp/audio.c.orig Thu May 14 06:34:41 2009
++++ libntp/audio.c Thu May 14 06:15:12 2009
+@@ -53,7 +53,7 @@
+ static struct audio_device device; /* audio device ident */
+ #endif /* HAVE_SYS_AUDIOIO_H */
+ #ifdef PCM_STYLE_SOUND
+-# define INIT_FILE "/etc/ntp.audio"
++# define INIT_FILE "/etc/inet/ntp.audio"
+ int agc = SOUND_MIXER_WRITE_RECLEV; /* or IGAIN or LINE */
+ int monitor = SOUND_MIXER_WRITE_VOLUME; /* or OGAIN */
+ int devmask = 0;
+--- ntpdate/ntpdate.c.orig Thu May 14 06:34:41 2009
++++ ntpdate/ntpdate.c Thu May 14 06:15:12 2009
+@@ -192,7 +192,7 @@
+
+ #ifndef KEYFILE
+ # ifndef SYS_WINNT
+-#define KEYFILE "/etc/ntp.keys"
++#define KEYFILE "/etc/inet/ntp.keys"
+ # else
+ #define KEYFILE "%windir%\\ntp.keys"
+ # endif /* SYS_WINNT */
+--- ntpdate/ntptimeset.c.orig Thu May 14 06:34:41 2009
++++ ntpdate/ntptimeset.c Thu May 14 06:15:12 2009
+@@ -270,7 +270,7 @@
+
+ #ifndef KEYFILE
+ # ifndef SYS_WINNT
+-#define KEYFILE "/etc/ntp.keys"
++#define KEYFILE "/etc/inet/ntp.keys"
+ # else
+ #define KEYFILE "%windir%\\ntp.keys"
+ # endif /* SYS_WINNT */
+--- ntpdate/ntptime_config.c.orig Thu May 14 06:34:41 2009
++++ ntpdate/ntptime_config.c Thu May 14 06:15:12 2009
+@@ -37,7 +37,7 @@
+ */
+ #ifndef CONFIG_FILE
+ # ifndef SYS_WINNT
+-# define CONFIG_FILE "/etc/ntp.conf"
++# define CONFIG_FILE "/etc/inet/ntp.conf"
+ # else /* SYS_WINNT */
+ # define CONFIG_FILE "%windir%\\ntp.conf"
+ # define ALT_CONFIG_FILE "%windir%\\ntp.ini"
+--- ntpd/refclock_oncore.c.orig Thu May 14 06:34:41 2009
++++ ntpd/refclock_oncore.c Thu May 14 06:15:12 2009
+@@ -1188,7 +1188,7 @@
+
+ FILE *fd;
+ char *cp, *cc, *ca, line[100], units[2], device[20], Msg[160], **cpp;
+- char *dirs[] = { "/etc/ntp", "/etc", 0 };
++ char *dirs[] = { "/etc/inet", "/etc", 0 };
+ int i, sign, lat_flg, long_flg, ht_flg, mode, mask;
+ double f1, f2, f3;
+
View
@@ -0,0 +1,19 @@
+*** ntpd/ntp_io.c.orig Fri Jul 30 06:57:58 2010
+--- ntpd/ntp_io.c Fri Jul 30 06:58:46 2010
+***************
+*** 1869,1875 ****
+
+ case AF_INET:
+ if (setsockopt(iface->fd, IPPROTO_IP, IP_MULTICAST_IF,
+! (char *)NSRCADR(&iface->sin),
+ sizeof(NSRCADR(&iface->sin)))) {
+
+ msyslog(LOG_ERR,
+--- 1869,1875 ----
+
+ case AF_INET:
+ if (setsockopt(iface->fd, IPPROTO_IP, IP_MULTICAST_IF,
+! (void *)&NSRCADR(&iface->sin),
+ sizeof(NSRCADR(&iface->sin)))) {
+
+ msyslog(LOG_ERR,
Oops, something went wrong.

0 comments on commit d92b6a5

Please sign in to comment.