rpms/ntp/devel ntp-4.2.4p7-editline.patch, NONE, 1.1 ntp-4.2.4p7-sleep.patch, NONE, 1.1 ntpstat-0.2-clksrc.patch, NONE, 1.1 ntpstat-0.2-multipacket.patch, NONE, 1.1 ntp.conf, 1.15, 1.16 ntp.spec, 1.91, 1.92 ntp-4.2.4p4-bsdadv.patch, 1.1, NONE ntp-4.2.4p5-sleep.patch, 1.2, NONE
Miroslav Lichvar
mlichvar at fedoraproject.org
Tue Jul 21 15:55:15 UTC 2009
- Previous message (by thread): rpms/DeviceKit-power/F-11 .cvsignore, 1.11, 1.12 DeviceKit-power.spec, 1.14, 1.15 sources, 1.11, 1.12
- Next message (by thread): rpms/tabled/devel import.log, NONE, 1.1 tabled.init, NONE, 1.1 tabled.spec, NONE, 1.1 tabled.sysconf, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: mlichvar
Update of /cvs/pkgs/rpms/ntp/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv16925
Modified Files:
ntp.conf ntp.spec
Added Files:
ntp-4.2.4p7-editline.patch ntp-4.2.4p7-sleep.patch
ntpstat-0.2-clksrc.patch ntpstat-0.2-multipacket.patch
Removed Files:
ntp-4.2.4p4-bsdadv.patch ntp-4.2.4p5-sleep.patch
Log Message:
- handle system time jumps better
- don't wake up every second for refclocks without timer
- don't crash in ntpstat when unknown clock type is received (#505564)
- make ntpstat process first packet in multipacket response
- switch to editline
- set pool.ntp.org vendor zone in spec (#512711)
- compile with -fno-strict-aliasing
ntp-4.2.4p7-editline.patch:
configure | 8 +++++++-
ntpdc/ntpdc.c | 5 ++---
ntpq/ntpq.c | 5 ++---
3 files changed, 11 insertions(+), 7 deletions(-)
--- NEW FILE ntp-4.2.4p7-editline.patch ---
diff -up ntp-4.2.4p7/configure.editline ntp-4.2.4p7/configure
--- ntp-4.2.4p7/configure.editline 2009-05-18 10:44:23.000000000 +0200
+++ ntp-4.2.4p7/configure 2009-07-20 15:18:48.000000000 +0200
@@ -24614,8 +24614,14 @@ done
# following block becomes on 4.2.5: NTP_LINEEDITLIBS
+READLINE_LIBS="-ledit"
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBEDIT
+_ACEOF
+
for ac_header in readline/history.h readline/readline.h
do
+break
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo "$as_me:$LINENO: checking for $ac_header" >&5
@@ -24764,7 +24770,7 @@ fi
done
case "$ac_cv_header_readline_history_h$ac_cv_header_readline_readline_h" in
- *no*) ;;
+ *) ;;
*) save_LIBS=$LIBS
LIBS=
# Ralf Wildenhues: either unset ... or cache READLINE_LIBS
diff -up ntp-4.2.4p7/ntpdc/ntpdc.c.editline ntp-4.2.4p7/ntpdc/ntpdc.c
--- ntp-4.2.4p7/ntpdc/ntpdc.c.editline 2009-05-18 10:22:36.000000000 +0200
+++ ntp-4.2.4p7/ntpdc/ntpdc.c 2009-07-20 15:17:25.000000000 +0200
@@ -26,9 +26,8 @@
# define closesocket close
#endif /* SYS_WINNT */
-#if defined(HAVE_LIBREADLINE) || defined (HAVE_LIBEDIT)
-# include <readline/readline.h>
-# include <readline/history.h>
+#if defined (HAVE_LIBEDIT)
+# include <editline/readline.h>
#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */
#ifdef SYS_VXWORKS
diff -up ntp-4.2.4p7/ntpq/ntpq.c.editline ntp-4.2.4p7/ntpq/ntpq.c
--- ntp-4.2.4p7/ntpq/ntpq.c.editline 2009-05-18 10:22:36.000000000 +0200
+++ ntp-4.2.4p7/ntpq/ntpq.c 2009-07-20 15:17:25.000000000 +0200
@@ -30,9 +30,8 @@
# define closesocket close
#endif /* SYS_WINNT */
-#if defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT)
-# include <readline/readline.h>
-# include <readline/history.h>
+#if defined(HAVE_LIBEDIT)
+# include <editline/readline.h>
#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */
#ifdef SYS_VXWORKS
ntp-4.2.4p7-sleep.patch:
include/ntp_refclock.h | 1
include/ntp_stdlib.h | 1
include/ntpd.h | 5 +-
libntp/authkeys.c | 18 ++++++++
ntpd/ntp_loopfilter.c | 14 +++++-
ntpd/ntp_refclock.c | 15 +++++++
ntpd/ntp_timer.c | 53 ++++++++++++++++++++++++--
ntpd/ntpd.c | 99 ++++++++++++++++++++++++++++---------------------
8 files changed, 158 insertions(+), 48 deletions(-)
--- NEW FILE ntp-4.2.4p7-sleep.patch ---
diff -up ntp-4.2.4p7/include/ntp_refclock.h.sleep ntp-4.2.4p7/include/ntp_refclock.h
--- ntp-4.2.4p7/include/ntp_refclock.h.sleep 2006-06-06 22:16:19.000000000 +0200
+++ ntp-4.2.4p7/include/ntp_refclock.h 2009-07-21 16:38:47.000000000 +0200
@@ -260,6 +260,7 @@ extern void refclock_control P((struct s
struct refclockstat *));
extern int refclock_open P((char *, u_int, u_int));
extern int refclock_setup P((int, u_int, u_int));
+extern int refclock_timer_needed P((struct peer *));
extern void refclock_timer P((struct peer *));
extern void refclock_transmit P((struct peer *));
extern int refclock_ioctl P((int, u_int));
diff -up ntp-4.2.4p7/include/ntp_stdlib.h.sleep ntp-4.2.4p7/include/ntp_stdlib.h
--- ntp-4.2.4p7/include/ntp_stdlib.h.sleep 2006-12-28 13:03:05.000000000 +0100
+++ ntp-4.2.4p7/include/ntp_stdlib.h 2009-07-21 16:38:47.000000000 +0200
@@ -101,6 +101,7 @@ extern const char * FindConfig P((const
extern void signal_no_reset P((int, RETSIGTYPE (*func)(int)));
extern void getauthkeys P((const char *));
+extern int auth_agekeys_is_needed P((void));
extern void auth_agekeys P((void));
extern void rereadkeys P((void));
diff -up ntp-4.2.4p7/include/ntpd.h.sleep ntp-4.2.4p7/include/ntpd.h
--- ntp-4.2.4p7/include/ntpd.h.sleep 2009-07-21 16:38:47.000000000 +0200
+++ ntp-4.2.4p7/include/ntpd.h 2009-07-21 16:38:47.000000000 +0200
@@ -120,8 +120,10 @@ extern int leap_actual P((int));
/* ntp_loopfilter.c */
extern void init_loopfilter P((void));
extern int local_clock P((struct peer *, double));
-extern void adj_host_clock P((void));
+extern int adj_host_clock_is_needed P((void));
+extern void adj_host_clock P((int));
extern void loop_config P((int, double));
+extern int huffpuff_enabled P((void));
extern void huffpuff P((void));
extern u_long sys_clocktime;
extern u_long sys_tai;
@@ -221,6 +223,7 @@ extern void hack_restrict P((int, struct
/* ntp_timer.c */
extern void init_timer P((void));
extern void reinit_timer P((void));
+extern int when_next_event P((void));
extern void timer P((void));
extern void timer_clr_stats P((void));
extern void timer_interfacetimeout P((u_long));
diff -up ntp-4.2.4p7/libntp/authkeys.c.sleep ntp-4.2.4p7/libntp/authkeys.c
--- ntp-4.2.4p7/libntp/authkeys.c.sleep 2004-02-25 06:58:03.000000000 +0100
+++ ntp-4.2.4p7/libntp/authkeys.c 2009-07-21 16:38:47.000000000 +0200
@@ -394,6 +394,24 @@ auth_delkeys(void)
}
}
+int auth_agekeys_is_needed() {
+ struct savekey *sk;
+ int i;
+
+ if (authnumkeys > 20)
+ return 1;
+
+ for (i = 0; i < HASHSIZE; i++) {
+ sk = key_hash[i];
+ while (sk != 0) {
+ if (sk->lifetime > 0)
+ return 1;
+ sk = sk->next;
+ }
+ }
+ return 0;
+}
+
/*
* auth_agekeys - delete keys whose lifetimes have expired
*/
diff -up ntp-4.2.4p7/ntpd/ntp_loopfilter.c.sleep ntp-4.2.4p7/ntpd/ntp_loopfilter.c
--- ntp-4.2.4p7/ntpd/ntp_loopfilter.c.sleep 2009-07-21 16:38:47.000000000 +0200
+++ ntp-4.2.4p7/ntpd/ntp_loopfilter.c 2009-07-21 16:38:47.000000000 +0200
@@ -752,6 +752,10 @@ local_clock(
#endif /* LOCKCLOCK */
}
+int adj_host_clock_is_needed() {
+ return !(!ntp_enable || mode_ntpdate || (pll_control &&
+ kern_enable));
+}
/*
* adj_host_clock - Called once every second to update the local clock.
@@ -761,7 +765,7 @@ local_clock(
*/
void
adj_host_clock(
- void
+ int time_elapsed
)
{
double adjustment;
@@ -776,7 +780,8 @@ adj_host_clock(
* maximum error and the local clock driver will pick it up and
* pass to the common refclock routines. Very elegant.
*/
- sys_rootdispersion += clock_phi;
+ sys_rootdispersion += clock_phi * time_elapsed;
+ DPRINTF(2, ("loopfilter: %d\n", time_elapsed));
#ifndef LOCKCLOCK
/*
@@ -833,6 +838,11 @@ rstclock(
}
+int huffpuff_enabled()
+{
+ return sys_huffpuff != NULL;
+}
+
/*
* huff-n'-puff filter
*/
diff -up ntp-4.2.4p7/ntpd/ntp_refclock.c.sleep ntp-4.2.4p7/ntpd/ntp_refclock.c
--- ntp-4.2.4p7/ntpd/ntp_refclock.c.sleep 2006-06-06 22:16:43.000000000 +0200
+++ ntp-4.2.4p7/ntpd/ntp_refclock.c 2009-07-21 16:38:47.000000000 +0200
@@ -309,6 +309,21 @@ refclock_unpeer(
}
+int
+refclock_timer_needed(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ u_char clktype;
+ int unit;
+
+ clktype = peer->refclktype;
+ unit = peer->refclkunit;
+ if (refclock_conf[clktype]->clock_timer != noentry)
+ return 1;
+ return 0;
+}
+
/*
* refclock_timer - called once per second for housekeeping.
*/
diff -up ntp-4.2.4p7/ntpd/ntp_timer.c.sleep ntp-4.2.4p7/ntpd/ntp_timer.c
--- ntp-4.2.4p7/ntpd/ntp_timer.c.sleep 2009-05-12 07:58:55.000000000 +0200
+++ ntp-4.2.4p7/ntpd/ntp_timer.c 2009-07-21 16:38:47.000000000 +0200
@@ -63,6 +63,7 @@ volatile u_long alarm_overflow;
#define HOUR (60*60)
u_long current_time;
+l_fp timer_base;
/*
* Stats. Number of overflows and number of calls to transmit().
@@ -99,6 +100,8 @@ static RETSIGTYPE alarming P((int));
void
reinit_timer(void)
{
+ get_systime(&timer_base);
+#if 0
#if !defined(SYS_WINNT) && !defined(VMS)
# if defined(HAVE_TIMER_CREATE) && defined(HAVE_TIMER_SETTIME)
timer_gettime(ntpd_timerid, &itimer);
@@ -132,6 +135,7 @@ reinit_timer(void)
setitimer(ITIMER_REAL, &itimer, (struct itimerval *)0);
# endif
# endif /* VMS */
+#endif
}
/*
@@ -159,6 +163,8 @@ init_timer(void)
timer_xmtcalls = 0;
timer_timereset = 0;
+ get_systime(&timer_base);
+#if 0
#if !defined(SYS_WINNT)
/*
* Set up the alarm interrupt. The first comes 2**EVENT_TIMEOUT
@@ -242,6 +248,7 @@ init_timer(void)
}
#endif /* SYS_WINNT */
+#endif
}
#if defined(SYS_WINNT)
@@ -252,6 +259,46 @@ get_timer_handle(void)
}
#endif
+int when_next_event() {
+ register struct peer *peer, *next_peer;
+ u_int n;
+ int next = current_time + HOUR;
+
+ if (adj_host_clock_is_needed())
+ return 1;
+ for (n = 0; n < NTP_HASH_SIZE; n++) {
+ for (peer = peer_hash[n]; peer != 0; peer = next_peer) {
+ next_peer = peer->next;
+#ifdef REFCLOCK
+ if (peer->flags & FLAG_REFCLOCK && refclock_timer_needed(peer))
+ return 1;
+#endif /* REFCLOCK */
+ if (peer->action && peer->nextaction < next)
+ next = peer->nextaction;
+ if (peer->nextdate < next)
+ next = peer->nextdate;
+ }
+ }
+
+ if (auth_agekeys_is_needed() && keys_timer < next)
+ next = keys_timer;
+ if (huffpuff_enabled() && huffpuff_timer < next)
+ next = huffpuff_timer;
+#ifdef OPENSSL
+ if (revoke_timer < next)
+ next = revoke_timer;
+#endif /* OPENSSL */
+ if (interface_interval && interface_timer < next)
+ next = interface_timer;
+ if (stats_timer < next)
+ next = stats_timer;
+
+ next -= current_time;
+ if (next <= 0)
+ next = 1;
+ return next;
+}
+
/*
* timer - dispatch anyone who needs to be
*/
@@ -264,14 +311,12 @@ timer(void)
#endif /* OPENSSL */
u_int n;
- current_time += (1<<EVENT_TIMEOUT);
-
/*
* Adjustment timeout first.
*/
if (adjust_timer <= current_time) {
- adjust_timer += 1;
- adj_host_clock();
+ adj_host_clock(current_time - adjust_timer + 1);
+ adjust_timer = current_time + 1;
kod_proto();
#ifdef REFCLOCK
for (n = 0; n < NTP_HASH_SIZE; n++) {
diff -up ntp-4.2.4p7/ntpd/ntpd.c.sleep ntp-4.2.4p7/ntpd/ntpd.c
--- ntp-4.2.4p7/ntpd/ntpd.c.sleep 2009-07-21 16:38:47.000000000 +0200
+++ ntp-4.2.4p7/ntpd/ntpd.c 2009-07-21 16:39:29.000000000 +0200
@@ -179,8 +179,6 @@ extern const char *Version;
char const *progname;
-int was_alarmed;
-
#ifdef DECL_SYSCALL
/*
* We put this here, since the argument profile is syscall-specific
@@ -434,6 +432,7 @@ set_process_priority(void)
msyslog(LOG_ERR, "set_process_priority: No way found to improve our priority");
}
+#define TS_LAST_SIZE 2
/*
* Main program. Initialize us, disconnect us from the tty if necessary,
@@ -446,6 +445,9 @@ ntpdmain(
)
{
l_fp now;
+ l_fp ts_last[TS_LAST_SIZE];
+ unsigned int ts_last_index;
+ int time_elapsed;
struct recvbuf *rbuf;
#ifdef _AIX /* HMS: ifdef SIGDANGER? */
struct sigaction sa;
@@ -998,7 +1000,11 @@ getgroup:
#else /* normal I/O */
BLOCK_IO_AND_ALARM();
- was_alarmed = 0;
+
+ for (ts_last_index = 0; ts_last_index < TS_LAST_SIZE; ts_last_index++)
+ L_CLR(&ts_last[ts_last_index]);
+ time_elapsed = ts_last_index = 0;
+
for (;;)
{
# if !defined(HAVE_SIGNALED_IO)
@@ -1009,39 +1015,66 @@ getgroup:
int nfound;
# endif
- if (alarm_flag) /* alarmed? */
- {
- was_alarmed = 1;
- alarm_flag = 0;
- }
-
- if (!was_alarmed && has_full_recv_buffer() == ISC_FALSE)
+ if (has_full_recv_buffer() == ISC_FALSE)
{
/*
* Nothing to do. Wait for something.
*/
# ifndef HAVE_SIGNALED_IO
+ extern l_fp timer_base;
+ l_fp ts, ts2, ts3;
+ double d;
+
rdfdes = activefds;
-# if defined(VMS) || defined(SYS_VXWORKS)
- /* make select() wake up after one second */
- {
+ ts2 = timer_base;
+ get_systime(&ts);
+ ts3 = ts;
+ L_SUB(&ts3, &ts_last[ts_last_index]);
+
+ /* don't call when_next_event() too often */
+ if (ts3.l_ui)
+ ts2.l_ui += when_next_event();
+ else
+ ts2.l_ui += 1;
+
+ L_SUB(&ts2, &ts);
+ LFPTOD(&ts2, d);
+ DPRINTF(2, ("main: scheduled event in %f\n", d));
+ if (d > 0.0) {
struct timeval t1;
- t1.tv_sec = 1; t1.tv_usec = 0;
+ t1.tv_sec = d;
+ t1.tv_usec = (d - t1.tv_sec) * 1000000;
nfound = select(maxactivefd+1, &rdfdes, (fd_set *)0,
(fd_set *)0, &t1);
+ get_systime(&ts);
+ } else
+ nfound = 0;
+
+ ts3 = ts;
+ L_SUB(&ts3, &timer_base);
+#ifdef DEBUG
+ LFPTOD(&ts3, d);
+ DPRINTF(2, ("main: elapsed %f\n", d));
+#endif
+
+ if (ts3.l_i < 0 || ts3.l_ui > ts2.l_ui + 10) {
+#ifdef DEBUG
+ DPRINTF(2, ("main: unexpected time jump\n"));
+#endif
+ ts3.l_ui = 0;
+ reinit_timer();
}
-# else
- nfound = select(maxactivefd+1, &rdfdes, (fd_set *)0,
- (fd_set *)0, (struct timeval *)0);
-# endif /* VMS */
- if (nfound > 0)
- {
- l_fp ts;
- get_systime(&ts);
+ time_elapsed += ts3.l_ui;
+ current_time += ts3.l_ui;
+ timer_base.l_ui += ts3.l_ui;
+ if (nfound > 0)
+ {
(void)input_handler(&ts);
+ ts_last[ts_last_index] = ts;
+ ts_last_index = (ts_last_index + 1) % TS_LAST_SIZE;
}
else if (nfound == -1 && errno != EINTR)
netsyslog(LOG_ERR, "select() error: %m");
@@ -1050,17 +1083,12 @@ getgroup:
netsyslog(LOG_DEBUG, "select(): nfound=%d, error: %m", nfound);
# endif /* DEBUG */
# else /* HAVE_SIGNALED_IO */
-
+# error not supported
wait_for_signal();
# endif /* HAVE_SIGNALED_IO */
- if (alarm_flag) /* alarmed? */
- {
- was_alarmed = 1;
- alarm_flag = 0;
- }
}
- if (was_alarmed)
+ if (time_elapsed)
{
UNBLOCK_IO_AND_ALARM();
/*
@@ -1068,7 +1096,7 @@ getgroup:
* to process expiry.
*/
timer();
- was_alarmed = 0;
+ time_elapsed = 0;
BLOCK_IO_AND_ALARM();
}
@@ -1086,19 +1114,8 @@ getgroup:
rbuf = get_full_recv_buffer();
while (rbuf != NULL)
{
- if (alarm_flag)
- {
- was_alarmed = 1;
- alarm_flag = 0;
- }
UNBLOCK_IO_AND_ALARM();
- if (was_alarmed)
- { /* avoid timer starvation during lengthy I/O handling */
- timer();
- was_alarmed = 0;
- }
-
/*
* Call the data procedure to handle each received
* packet.
ntpstat-0.2-clksrc.patch:
ntpstat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- NEW FILE ntpstat-0.2-clksrc.patch ---
diff -up ntp-4.2.4p7/ntpstat-0.2/ntpstat.c.ntpstat ntp-4.2.4p7/ntpstat-0.2/ntpstat.c
--- ntp-4.2.4p7/ntpstat-0.2/ntpstat.c.ntpstat 2002-06-10 08:02:12.000000000 +0200
+++ ntp-4.2.4p7/ntpstat-0.2/ntpstat.c 2009-07-20 12:22:35.000000000 +0200
@@ -187,7 +187,7 @@ int main (void) {
else
printf("unknown source");
- if (!strncmp(clksrcname[clksrc],clksrcname[6],sizeof(clksrcname[6]))) {
+ if (clksrc == 6) {
// source of sync is another NTP server so check the IP address
strncpy(buff, ntpmsg.payload, sizeof(buff));
if ((newstr = strstr (buff, REFID))) {
ntpstat-0.2-multipacket.patch:
ntpstat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- NEW FILE ntpstat-0.2-multipacket.patch ---
diff -up ntp-4.2.4p7/ntpstat-0.2/ntpstat.c.ntpstat ntp-4.2.4p7/ntpstat-0.2/ntpstat.c
--- ntp-4.2.4p7/ntpstat-0.2/ntpstat.c.ntpstat 2002-06-10 08:02:12.000000000 +0200
+++ ntp-4.2.4p7/ntpstat-0.2/ntpstat.c 2009-07-20 12:22:35.000000000 +0200
@@ -151,7 +151,7 @@ int main (void) {
/* For the reply message to be valid, the first byte should be as sent,
and the second byte should be the same, with the response bit set */
byte1ok = ((ntpmsg.byte1&0x3F) == B1VAL);
- byte2ok = (ntpmsg.byte2 == (B2VAL|RMASK));
+ byte2ok = ((ntpmsg.byte2 & ~MMASK) == (B2VAL|RMASK));
if (!(byte1ok && byte2ok)) {
fprintf (stderr,"status word is 0x%02x%02x\n", ntpmsg.byte1,ntpmsg.byte2 );
die ("return data appears to be invalid based on status word");
Index: ntp.conf
===================================================================
RCS file: /cvs/pkgs/rpms/ntp/devel/ntp.conf,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -p -r1.15 -r1.16
--- ntp.conf 29 Aug 2008 08:26:04 -0000 1.15
+++ ntp.conf 21 Jul 2009 15:55:14 -0000 1.16
@@ -19,9 +19,9 @@ restrict -6 ::1
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
-server 0.fedora.pool.ntp.org
-server 1.fedora.pool.ntp.org
-server 2.fedora.pool.ntp.org
+server 0.VENDORZONE.pool.ntp.org
+server 1.VENDORZONE.pool.ntp.org
+server 2.VENDORZONE.pool.ntp.org
#broadcast 192.168.1.255 autokey # broadcast server
#broadcastclient # broadcast client
Index: ntp.spec
===================================================================
RCS file: /cvs/pkgs/rpms/ntp/devel/ntp.spec,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -p -r1.91 -r1.92
--- ntp.spec 28 May 2009 18:49:30 -0000 1.91
+++ ntp.spec 21 Jul 2009 15:55:14 -0000 1.92
@@ -1,19 +1,19 @@
Summary: The NTP daemon and utilities
Name: ntp
Version: 4.2.4p7
-Release: 2%{?dist}
+Release: 3%{?dist}
# primary license (COPYRIGHT) : MIT
# ElectricFence/ (not used) : GPLv2
# kernel/sys/ppsclock.h (not used) : BSD with advertising
# include/ntif.h (not used) : BSD
-# include/rsa_md5.h (replaced) : BSD with advertising
-# include/ntp_rfc2553.h (replaced) : BSD with advertising
+# include/rsa_md5.h : BSD with advertising
+# include/ntp_rfc2553.h : BSD with advertising
# libisc/inet_aton.c (not used) : BSD with advertising
-# libntp/md5c.c (replaced) : BSD with advertising
-# libntp/mktime.c (replaced) : BSD with advertising
-# libntp/ntp_random.c (replaced) : BSD with advertising
-# libntp/memmove.c (replaced) : BSD with advertising
-# libntp/ntp_rfc2553.c (replaced) : BSD with advertising
+# libntp/md5c.c : BSD with advertising
+# libntp/mktime.c : BSD with advertising
+# libntp/ntp_random.c : BSD with advertising
+# libntp/memmove.c : BSD with advertising
+# libntp/ntp_rfc2553.c : BSD with advertising
# libntp/adjtimex.c (not used) : BSD
# libopts/ : BSD or GPLv2+
# libparse/ : BSD
@@ -26,7 +26,7 @@ Release: 2%{?dist}
# ntpstat-0.2/ : GPLv2
# util/ansi2knr.c (not used) : GPL+
# sntp/ (not packaged) : MSNTP
-License: (MIT and BSD and BSD with advertising) and (MIT and BSD) and GPLv2
+License: (MIT and BSD and BSD with advertising) and GPLv2
Group: System Environment/Daemons
Source0: http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-%{version}.tar.gz
Source1: ntp.conf
@@ -64,8 +64,8 @@ Patch10: ntp-4.2.4p5-htmldoc.patch
Patch11: ntp-4.2.4p2-filegen.patch
# ntpbz #738
Patch12: ntp-4.2.4-sprintf.patch
-# drop this and switch to libedit in 4.2.6
-Patch13: ntp-4.2.4p4-bsdadv.patch
+# use editline instead of readline
+Patch13: ntp-4.2.4p7-editline.patch
# add option -m to lock memory
Patch14: ntp-4.2.4p7-mlock.patch
# fixed in 4.2.5
@@ -73,7 +73,7 @@ Patch15: ntp-4.2.4p2-clockselect.patch
# don't build sntp
Patch16: ntp-4.2.4p7-nosntp.patch
# ntpbz #802
-Patch17: ntp-4.2.4p5-sleep.patch
+Patch17: ntp-4.2.4p7-sleep.patch
# ntpbz #779, #823
Patch18: ntp-4.2.4p7-bcast.patch
# ntpbz #759
@@ -100,15 +100,17 @@ Patch28: ntp-4.2.4p7-nano.patch
Patch29: ntp-4.2.4p7-minpoll.patch
# fix frequency mode, backported from 4.2.5
Patch30: ntp-4.2.4p7-freqmode.patch
+# handle unknown clock types
+Patch31: ntpstat-0.2-clksrc.patch
+# process first packet in multipacket response
+Patch32: ntpstat-0.2-multipacket.patch
URL: http://www.ntp.org
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig /sbin/service
Requires(postun): /sbin/service
Requires: ntpdate = %{version}-%{release}
-# Require libreadline linked with libtinfo
-Requires: readline >= 5.2-3
-BuildRequires: libcap-devel openssl-devel readline-devel perl-HTML-Parser
+BuildRequires: libcap-devel openssl-devel libedit-devel perl-HTML-Parser
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
@@ -151,6 +153,12 @@ This package contains NTP documentation
%define ntpdocdir %{_datadir}/doc/%{name}-%{version}
+# pool.ntp.org vendor zone which will be used in ntp.conf
+%if 0%{!?vendorzone:1}
+%{?fedora: %define vendorzone fedora.}
+%{?rhel: %define vendorzone rhel.}
+%endif
+
%prep
%setup -q -a 5
@@ -165,6 +173,7 @@ This package contains NTP documentation
%patch10 -p1 -b .htmldoc
%patch11 -p1 -b .filegen
%patch12 -p1 -b .sprintf
+%patch13 -p1 -b .editline
%patch14 -p1 -b .mlock
%patch15 -p1 -b .clockselect
%patch16 -p1 -b .nosntp
@@ -181,6 +190,8 @@ This package contains NTP documentation
%patch28 -p1 -b .nano
%patch29 -p1 -b .minpoll
%patch30 -p1 -b .freqmode
+%patch31 -p1 -b .clksrc
+%patch32 -p1 -b .multipacket
# clock_gettime needs -lrt
sed -i.gettime 's|^LIBS = @LIBS@|& -lrt|' ntp{d,q,dc,date}/Makefile.in
@@ -190,20 +201,12 @@ sed -i.gettime 's|^LIBS = @LIBS@|& -lrt|
%patch5 -p1 -b .linkfastmath
%endif
-# replace BSD with advertising code in ntp{dc,q} to allow linking with readline
-for f in include/{ntp_rfc2553,rsa_md5}.h \
- libntp/{mktime,memmove,md5c,ntp_rfc2553,ntp_random}.c
-do rm -f $f; touch $f; done
-ln -sf md5.h include/rsa_md5.h
-ln -sf md5.c libntp/md5c.c
-%patch13 -p1 -b .bsdadv
-
for f in COPYRIGHT; do
iconv -f iso8859-1 -t utf8 -o ${f}{_,} && touch -r ${f}{,_} && mv -f ${f}{_,}
done
%build
-export CFLAGS="$RPM_OPT_FLAGS"
+export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
if echo 'int main () { return 0; }' | gcc -pie -fPIE -O2 -xc - -o pietest 2>/dev/null; then
./pietest && export CFLAGS="$CFLAGS -pie -fPIE"
rm -f pietest
@@ -260,7 +263,9 @@ pushd $RPM_BUILD_ROOT
mkdir -p .%{_sysconfdir}/{ntp/crypto,sysconfig,dhcp/dhclient.d} .%{_initrddir}
mkdir -p .%{_localstatedir}/{lib/ntp,log/ntpstats}
touch .%{_localstatedir}/lib/ntp/drift
-sed -e 's|ETCNTP|%{_sysconfdir}/ntp|' -e 's|VARNTP|%{_localstatedir}/lib/ntp|' \
+sed -e 's|VENDORZONE\.|%{vendorzone}|' \
+ -e 's|ETCNTP|%{_sysconfdir}/ntp|' \
+ -e 's|VARNTP|%{_localstatedir}/lib/ntp|' \
< %{SOURCE1} > .%{_sysconfdir}/ntp.conf
touch -r %{SOURCE1} .%{_sysconfdir}/ntp.conf
install -p -m600 %{SOURCE2} .%{_sysconfdir}/ntp/keys
@@ -360,6 +365,15 @@ fi
%{ntpdocdir}/html
%changelog
+* Tue Jul 21 2009 Miroslav Lichvar <mlichvar at redhat.com> 4.2.4p7-3
+- handle system time jumps better
+- don't wake up every second for refclocks without timer
+- don't crash in ntpstat when unknown clock type is received (#505564)
+- make ntpstat process first packet in multipacket response
+- switch to editline
+- set pool.ntp.org vendor zone in spec (#512711)
+- compile with -fno-strict-aliasing
+
* Thu May 28 2009 Miroslav Lichvar <mlichvar at redhat.com> 4.2.4p7-2
- fix frequency calculation when starting with no drift file
- reduce phase adjustments beyond Allan intercept in daemon PLL
--- ntp-4.2.4p4-bsdadv.patch DELETED ---
--- ntp-4.2.4p5-sleep.patch DELETED ---
- Previous message (by thread): rpms/DeviceKit-power/F-11 .cvsignore, 1.11, 1.12 DeviceKit-power.spec, 1.14, 1.15 sources, 1.11, 1.12
- Next message (by thread): rpms/tabled/devel import.log, NONE, 1.1 tabled.init, NONE, 1.1 tabled.spec, NONE, 1.1 tabled.sysconf, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list