summaryrefslogtreecommitdiff
path: root/recipes/ntp
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/ntp
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/ntp')
-rw-r--r--recipes/ntp/files/configure.patch362
-rw-r--r--recipes/ntp/files/gcc4.patch52
-rw-r--r--recipes/ntp/files/ipv6only-workaround.patch13
-rwxr-xr-xrecipes/ntp/files/ntp31
-rw-r--r--recipes/ntp/files/ntp.conf13
-rwxr-xr-xrecipes/ntp/files/ntpd62
-rwxr-xr-xrecipes/ntp/files/ntpdate34
-rw-r--r--recipes/ntp/files/ntpdc.Makefile.am.maybe-layout.patch11
-rw-r--r--recipes/ntp/files/readline.patch44
-rw-r--r--recipes/ntp/ntp-4.2.2p3/ipv6only-workaround.patch13
-rw-r--r--recipes/ntp/ntp-4.2.2p3/tickadj.c.patch32
-rw-r--r--recipes/ntp/ntp-ssl_4.1.2.bb9
-rw-r--r--recipes/ntp/ntp.inc32
-rw-r--r--recipes/ntp/ntp_4.1.2.bb46
-rw-r--r--recipes/ntp/ntp_4.2.0.bb45
-rw-r--r--recipes/ntp/ntp_4.2.2p3.bb40
16 files changed, 839 insertions, 0 deletions
diff --git a/recipes/ntp/files/configure.patch b/recipes/ntp/files/configure.patch
new file mode 100644
index 0000000000..dc36b1bd12
--- /dev/null
+++ b/recipes/ntp/files/configure.patch
@@ -0,0 +1,362 @@
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- ntp-4.1.2/./configure.in~configure
++++ ntp-4.1.2/./configure.in
+@@ -1,12 +1,13 @@
+ dnl -*-fundamental-*-
+ dnl Process this file with autoconf to produce a configure script.
+-AC_INIT(ntpd/ntp_refclock.c)
+-AC_CANONICAL_SYSTEM
++AC_INIT
++AC_CONFIG_SRCDIR([ntpd/ntp_refclock.c])
++AC_CANONICAL_TARGET([])
+ AC_DEFINE_UNQUOTED(STR_SYSTEM, "$host", [canonical system (cpu-vendor-os) string])
+ AM_CONFIG_HEADER(config.h)
+ AC_ARG_PROGRAM
+ AM_INIT_AUTOMAKE(ntp, 4.1.2)
+-AC_PREREQ(2.53)
++AC_PREREQ(2.57)
+
+ ac_cv_var_atom_ok=no
+ ac_cv_var_oncore_ok=no
+@@ -22,7 +23,7 @@
+
+ dnl we need to check for cross compile tools for vxWorks here
+ AC_PROG_CC
+-AC_PROG_CC_STDC
++
+ AC_PROG_CPP
+
+ case "$host" in
+@@ -294,19 +295,15 @@
+ AC_CHECK_HEADER(nlist.h,
+ [AC_DEFINE(NLIST_STRUCT, 1, [nlist stuff])
+ AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
+-[AC_TRY_COMPILE([#include <nlist.h>],
+-[struct nlist n; n.n_un.n_name = 0;],
+-ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]], [[struct nlist n; n.n_un.n_name = 0;]])],[ac_cv_struct_nlist_n_un=yes],[ac_cv_struct_nlist_n_un=no])])
+ if test $ac_cv_struct_nlist_n_un = yes; then
+ AC_DEFINE(NLIST_NAME_UNION, 1, [does struct nlist use a name union?])
+ fi
+ ])dnl
+
+ AC_CACHE_CHECK(for basic volatile support, ac_cv_c_volatile,
+-[AC_TRY_COMPILE([],[
+-volatile int x;],
+- ac_cv_c_volatile=yes,
+- ac_cv_c_volatile=no)
++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
++volatile int x;]])],[ac_cv_c_volatile=yes],[ac_cv_c_volatile=no])
+ ])
+ case "$ac_cv_c_volatile" in
+ yes)
+@@ -324,10 +321,10 @@
+ ;;
+ esac
+ AC_CACHE_CHECK(if C compiler permits function prototypes, ac_cv_have_prototypes,
+-[AC_TRY_COMPILE([
++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ extern int foo (short);
+-int foo(short i) { return i; }],[
+-int i;], ac_cv_have_prototypes=yes, ac_cv_have_prototypes=no)
++int foo(short i) { return i; }]], [[
++int i;]])],[ac_cv_have_prototypes=yes],[ac_cv_have_prototypes=no])
+ ])
+ if test "$ac_cv_have_prototypes" = yes; then
+ AC_DEFINE(HAVE_PROTOTYPES, 1, [Are function prototypes OK?])
+@@ -376,9 +373,8 @@
+ esac
+
+ dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
+-dnl [AC_TRY_LINK([#include <sys/types.h>
+-dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
+-dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
++dnl [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
++dnl #include <utmp.h>]], [[struct utmp ut; ut.ut_host;]])],[dnl ac_cv_func_ut_host_in_utmp=yes],[ac_cv_func_ut_host_in_utmp=no])])
+ dnl if test $su_cv_func_ut_host_in_utmp = yes; then
+ dnl AC_DEFINE(HAVE_UT_HOST)
+ dnl fi
+@@ -401,12 +397,8 @@
+ struct sigaction for sa_sigaction,
+ ac_cv_struct_sigaction_has_sa_sigaction,
+ [
+- AC_TRY_COMPILE(
+- [#include <signal.h>],
+- [struct sigaction act; act.sa_sigaction = 0;],
+- ac_cv_struct_sigaction_has_sa_sigaction=yes,
+- ac_cv_struct_sigaction_has_sa_sigaction=no
+- )
++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], [[struct sigaction act; act.sa_sigaction = 0;]])],[ac_cv_struct_sigaction_has_sa_sigaction=yes],[ac_cv_struct_sigaction_has_sa_sigaction=no
++ ])
+ ]
+ )
+ if test $ac_cv_struct_sigaction_has_sa_sigaction = yes; then
+@@ -414,7 +406,7 @@
+ fi
+
+ AC_CACHE_CHECK(for struct ppsclockev, ac_cv_struct_ppsclockev,
+-[AC_TRY_COMPILE([
++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <sys/types.h>
+ #ifdef HAVE_SYS_TERMIOS_H
+ # include <sys/termios.h>
+@@ -424,24 +416,20 @@
+ #endif
+ #ifdef HAVE_SYS_PPSCLOCK_H
+ # include <sys/ppsclock.h>
+-#endif],[
++#endif]], [[
+ extern struct ppsclockev *pce;
+-return pce->serial;],
+- ac_cv_struct_ppsclockev=yes,
+- ac_cv_struct_ppsclockev=no)
++return pce->serial;]])],[ac_cv_struct_ppsclockev=yes],[ac_cv_struct_ppsclockev=no])
+ ])
+ if test $ac_cv_struct_ppsclockev = yes; then
+ AC_DEFINE(HAVE_STRUCT_PPSCLOCKEV, 1, [Does a system header define struct ppsclockev?])
+ fi
+
+ AC_CACHE_CHECK(struct sockaddr for sa_len, ac_cv_struct_sockaddr_has_sa_len,
+-[AC_TRY_COMPILE([
++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <sys/types.h>
+-#include <sys/socket.h>],[
++#include <sys/socket.h>]], [[
+ extern struct sockaddr *ps;
+-return ps->sa_len;],
+- ac_cv_struct_sockaddr_has_sa_len=yes,
+- ac_cv_struct_sockaddr_has_sa_len=no)
++return ps->sa_len;]])],[ac_cv_struct_sockaddr_has_sa_len=yes],[ac_cv_struct_sockaddr_has_sa_len=no])
+ ])
+ if test $ac_cv_struct_sockaddr_has_sa_len = yes; then
+ AC_DEFINE(HAVE_SA_LEN_IN_STRUCT_SOCKADDR, 1, [Should be obvious...])
+@@ -450,17 +438,15 @@
+ case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
+ *yes*)
+ AC_CACHE_CHECK([for struct snd_size], ac_cv_struct_snd_size,
+-[AC_TRY_COMPILE([
++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #ifdef HAVE_MACHINE_SOUNDCARD_H
+ # include <machine/soundcard.h>
+ #endif
+ #ifdef HAVE_SYS_SOUNDCARD_H
+ # include <sys/soundcard.h>
+-#endif],[
++#endif]], [[
+ extern struct snd_size *ss;
+-return ss->rec_size;],
+- ac_cv_struct_snd_size=yes,
+- ac_cv_struct_snd_size=no)
++return ss->rec_size;]])],[ac_cv_struct_snd_size=yes],[ac_cv_struct_snd_size=no])
+ ])
+ case "$ac_cv_struct_snd_size" in
+ yes) AC_DEFINE(HAVE_STRUCT_SND_SIZE, 1,[Do we have struct snd_size?]) ;;
+@@ -469,31 +455,27 @@
+ esac
+
+ AC_CACHE_CHECK(struct clockinfo for hz, ac_cv_struct_clockinfo_has_hz,
+-[AC_TRY_COMPILE([
+-#include <sys/time.h>],[
++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
++#include <sys/time.h>]], [[
+ extern struct clockinfo *pc;
+-return pc->hz;],
+- ac_cv_struct_clockinfo_has_hz=yes,
+- ac_cv_struct_clockinfo_has_hz=no)
++return pc->hz;]])],[ac_cv_struct_clockinfo_has_hz=yes],[ac_cv_struct_clockinfo_has_hz=no])
+ ])
+ if test $ac_cv_struct_clockinfo_has_hz = yes; then
+ AC_DEFINE(HAVE_HZ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
+ fi
+
+ AC_CACHE_CHECK(struct clockinfo for tickadj, ac_cv_struct_clockinfo_has_tickadj,
+-[AC_TRY_COMPILE([
+-#include <sys/time.h>],[
++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
++#include <sys/time.h>]], [[
+ extern struct clockinfo *pc;
+-return pc->tickadj;],
+- ac_cv_struct_clockinfo_has_tickadj=yes,
+- ac_cv_struct_clockinfo_has_tickadj=no)
++return pc->tickadj;]])],[ac_cv_struct_clockinfo_has_tickadj=yes],[ac_cv_struct_clockinfo_has_tickadj=no])
+ ])
+ if test $ac_cv_struct_clockinfo_has_tickadj = yes; then
+ AC_DEFINE(HAVE_TICKADJ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
+ fi
+
+ AC_CACHE_CHECK([for struct timespec], ac_cv_struct_timespec,
+-[AC_TRY_COMPILE([
++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <sys/time.h>
+ /* Under SunOS, timespec is in sys/timepps.h, which needs errno.h and FRAC */
+ #ifdef HAVE_ERRNO_H
+@@ -502,19 +484,15 @@
+ #ifdef HAVE_SYS_TIMEPPS_H
+ # define FRAC 4294967296
+ # include <sys/timepps.h>
+-#endif],
+-[struct timespec n;],
+-ac_cv_struct_timespec=yes, ac_cv_struct_timespec=no)])
++#endif]], [[struct timespec n;]])],[ac_cv_struct_timespec=yes],[ac_cv_struct_timespec=no])])
+ if test $ac_cv_struct_timespec = yes; then
+ AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, [Do we have struct timespec?])
+ fi
+
+ AC_CACHE_CHECK([for struct ntptimeval], ac_cv_struct_ntptimeval,
+-[AC_TRY_COMPILE([
++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <sys/time.h>
+-#include <sys/timex.h>],
+-[struct ntptimeval n;],
+-ac_cv_struct_ntptimeval=yes, ac_cv_struct_ntptimeval=no)])
++#include <sys/timex.h>]], [[struct ntptimeval n;]])],[ac_cv_struct_ntptimeval=yes],[ac_cv_struct_ntptimeval=no])])
+ if test $ac_cv_struct_ntptimeval = yes; then
+ AC_DEFINE(HAVE_STRUCT_NTPTIMEVAL, 1, [Do we have struct ntptimeval?])
+ fi
+@@ -575,7 +553,7 @@
+ # (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
+ # (returning ENOSYS). I didn't check 4.2. If, in the future,
+ # IBM pulls its thumbs out long enough to implement clock_settime,
+- # this conditional will need to change. Maybe use AC_TRY_RUN
++ # this conditional will need to change. Maybe use AC_RUN_IFELSE([AC_LANG_SOURCE([[]])],[],[],[])
+ # instead to try to set the time to itself and check errno.
+ ;;
+ *) AC_CHECK_FUNCS(clock_gettime clock_settime)
+@@ -587,10 +565,8 @@
+ [AC_MSG_CHECKING(for isfinite with <math.h>)
+ _libs=$LIBS
+ LIBS="$LIBS -lm"
+- AC_TRY_LINK([#include <math.h>], [float f = 0.0; isfinite(f)],
+- [AC_MSG_RESULT(yes)
+- AC_DEFINE(HAVE_ISFINITE)],
+- AC_MSG_RESULT(no))
++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[float f = 0.0; isfinite(f)]])],[AC_MSG_RESULT(yes)
++ AC_DEFINE(HAVE_ISFINITE)],[AC_MSG_RESULT(no)])
+ LIBS=$_libs])])
+ AC_CHECK_FUNCS(getbootfile getclock getdtablesize getrusage)
+ AC_CHECK_FUNC(gettimeofday, ,[
+@@ -691,26 +667,24 @@
+ AC_CHECK_FUNCS(uname updwtmp updwtmpx vsprintf)
+
+ AC_CACHE_CHECK(number of arguments to gettimeofday(), ac_cv_func_Xettimeofday_nargs,
+-[AC_TRY_COMPILE([#include <sys/time.h>],[
++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>]], [[
+ gettimeofday((struct timeval*)0,(struct timezone*)0);
+ settimeofday((struct timeval*)0,(struct timezone*)0);
+-],
+- ac_cv_func_Xettimeofday_nargs=2, ac_cv_func_Xettimeofday_nargs=1)
++]])],[ac_cv_func_Xettimeofday_nargs=2],[ac_cv_func_Xettimeofday_nargs=1])
+ ])
+ if test $ac_cv_func_Xettimeofday_nargs = 1; then
+ AC_DEFINE(SYSV_TIMEOFDAY, 1, [Does Xettimeofday take 1 arg?])
+ fi
+
+ AC_CACHE_CHECK(number of arguments taken by setpgrp(), ac_cv_func_setpgrp_nargs,
+-[AC_TRY_COMPILE([
++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+-],[setpgrp(0,0);],
+- ac_cv_func_setpgrp_nargs=2, ac_cv_func_setpgrp_nargs=0)
++]], [[setpgrp(0,0);]])],[ac_cv_func_setpgrp_nargs=2],[ac_cv_func_setpgrp_nargs=0])
+ ])
+ if test $ac_cv_func_setpgrp_nargs = 0; then
+ AC_DEFINE(HAVE_SETPGRP_0, 1, [define if setpgrp takes 0 arguments])
+@@ -721,7 +695,7 @@
+
+ AC_CACHE_CHECK(argument pointer type of qsort()'s compare function and base,
+ ac_cv_func_qsort_argtype,
+-[AC_TRY_COMPILE([
++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include "l_stdlib.h"
+
+ #ifdef HAVE_PROTOTYPES
+@@ -735,10 +709,9 @@
+ int sortfunc(a, b)
+ const void *a;
+ const void *b; { return 0; }
+-],[
++]], [[
+ qsort(base, 2, sizeof(char *), sortfunc);
+-],
+- ac_cv_func_qsort_argtype=void, ac_cv_func_qsort_argtype=char)
++]])],[ac_cv_func_qsort_argtype=void],[ac_cv_func_qsort_argtype=char])
+ ])
+ case "$ac_cv_func_qsort_argtype" in
+ void)
+@@ -749,11 +722,9 @@
+ CFLAGS=$save_CFLAGS
+
+ AC_CACHE_CHECK(if we need to declare 'errno', ac_cv_decl_errno,
+-[AC_TRY_COMPILE([#ifdef HAVE_ERRNO_H
++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_ERRNO_H
+ #include <errno.h>
+-#endif],
+- [errno = 0;],
+- ac_cv_decl_errno=no, ac_cv_decl_errno=yes)])
++#endif]], [[errno = 0;]])],[ac_cv_decl_errno=no],[ac_cv_decl_errno=yes])])
+ case "$ac_cv_decl_errno" in
+ yes) AC_DEFINE(DECL_ERRNO, 1, [Declare errno?]) ;;
+ esac
+@@ -767,7 +738,7 @@
+ dnl without breaking any other platforms.
+ dnl
+ AC_CACHE_CHECK(if we may declare 'h_errno', ac_cv_decl_h_errno,
+-[AC_TRY_COMPILE([#include <sys/types.h>
++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+ #ifdef HAVE_NETINET_IN_H
+ #include <netinet/in.h>
+ #endif
+@@ -779,28 +750,24 @@
+ #endif
+ #ifdef HAVE_RESOLV_H
+ #include <resolv.h>
+-#endif],
+- [extern int h_errno;],
+- ac_cv_decl_h_errno=yes, ac_cv_decl_h_errno=no)])
++#endif]], [[extern int h_errno;]])],[ac_cv_decl_h_errno=yes],[ac_cv_decl_h_errno=no])])
+ case "$ac_cv_decl_h_errno" in
+ yes) AC_DEFINE(DECL_H_ERRNO, 1, [Declare h_errno?]) ;;
+ esac
+
+ dnl See if char *sys_errlist[] is OK.
+ AC_CACHE_CHECK([[if declaring 'char *sys_errlist[]' is ok]], ac_cv_decl_sys_errlist,
+-[AC_TRY_COMPILE([#include <stdio.h>
++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
+ #ifdef HAVE_ERRNO_H
+ #include <errno.h>
+-#endif],
+- [extern char *sys_errlist[];
+-],
+- ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no)])
++#endif]], [[extern char *sys_errlist[];
++]])],[ac_cv_decl_sys_errlist=yes],[ac_cv_decl_sys_errlist=no])])
+ case "$ac_cv_decl_sys_errlist" in
+ yes) AC_DEFINE(CHAR_SYS_ERRLIST, 1, [Declare char *sys_errlist array]) ;;
+ esac
+
+ AC_CACHE_CHECK(if declaring 'syscall()' is ok, ac_cv_decl_syscall,
+-[AC_TRY_COMPILE([
++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+@@ -812,9 +779,7 @@
+ #else
+ #define P(x) ()
+ #endif
+-],
+- [extern int syscall P((int, ...));],
+- ac_cv_decl_syscall=yes, ac_cv_decl_syscall=no)])
++]], [[extern int syscall P((int, ...));]])],[ac_cv_decl_syscall=yes],[ac_cv_decl_syscall=no])])
+ case "$ac_cv_decl_syscall" in
+ yes) AC_DEFINE(DECL_SYSCALL, 1, [Declare syscall()?]) ;;
+ esac
diff --git a/recipes/ntp/files/gcc4.patch b/recipes/ntp/files/gcc4.patch
new file mode 100644
index 0000000000..b7ae44a769
--- /dev/null
+++ b/recipes/ntp/files/gcc4.patch
@@ -0,0 +1,52 @@
+Index: ntp-4.2.0/include/ntp_stdlib.h
+===================================================================
+--- ntp-4.2.0.orig/include/ntp_stdlib.h 2003-07-17 11:27:16.000000000 +0100
++++ ntp-4.2.0/include/ntp_stdlib.h 2005-11-26 18:39:14.000000000 +0000
+@@ -133,10 +133,6 @@
+ extern u_char * cache_key; /* key pointer */
+ extern u_int cache_keylen; /* key length */
+
+-/* clocktypes.c */
+-struct clktype;
+-extern struct clktype clktypes[];
+-
+ /* getopt.c */
+ extern char * ntp_optarg; /* global argument pointer */
+ extern int ntp_optind; /* global argv index */
+Index: ntp-4.2.0/include/ntpd.h
+===================================================================
+--- ntp-4.2.0.orig/include/ntpd.h 2003-09-13 04:08:04.000000000 +0100
++++ ntp-4.2.0/include/ntpd.h 2005-11-26 18:38:45.000000000 +0000
+@@ -226,8 +226,6 @@
+ #endif
+
+ /* ntp_control.c */
+-struct ctl_trap;
+-extern struct ctl_trap ctl_trap[];
+ extern int num_ctl_traps;
+ extern keyid_t ctl_auth_keyid; /* keyid used for authenticating write requests */
+
+Index: ntp-4.2.0/include/ntp_refclock.h
+===================================================================
+--- ntp-4.2.0.orig/include/ntp_refclock.h 2003-07-17 11:27:16.000000000 +0100
++++ ntp-4.2.0/include/ntp_refclock.h 2005-11-26 18:40:23.000000000 +0000
+@@ -65,6 +65,7 @@
+ const char *clocktype; /* long description */
+ const char *abbrev; /* short description */
+ };
++extern struct clktype clktypes[];
+
+ /*
+ * Configuration flag values
+Index: ntp-4.2.0/include/ntp_control.h
+===================================================================
+--- ntp-4.2.0.orig/include/ntp_control.h 2003-08-14 08:31:47.000000000 +0100
++++ ntp-4.2.0/include/ntp_control.h 2005-11-26 18:41:22.000000000 +0000
+@@ -266,6 +267,7 @@
+ u_char tr_flags; /* trap flags */
+ u_char tr_version; /* version number of trapper */
+ };
++extern struct ctl_trap ctl_trap[];
+
+ /*
+ * Flag bits
diff --git a/recipes/ntp/files/ipv6only-workaround.patch b/recipes/ntp/files/ipv6only-workaround.patch
new file mode 100644
index 0000000000..998d2bdad9
--- /dev/null
+++ b/recipes/ntp/files/ipv6only-workaround.patch
@@ -0,0 +1,13 @@
+Patch taken from Debian: http://bugs.debian.org/249216
+------------------------------------------------------------------------
+--- ntp-4.2.0/ntpdate/ntpdate.c~ipv6only-workaround
++++ ntp-4.2.0/ntpdate/ntpdate.c
+@@ -1698,8 +1698,6 @@
+ if (res->ai_family == AF_INET6)
+ if (setsockopt(fd[nbsock], IPPROTO_IPV6, IPV6_V6ONLY, (void*) &optval, sizeof(optval)) < 0) {
+ netsyslog(LOG_ERR, "setsockopt() IPV6_V6ONLY failed: %m");
+- exit(1);
+- /*NOTREACHED*/
+ }
+ #endif
+
diff --git a/recipes/ntp/files/ntp b/recipes/ntp/files/ntp
new file mode 100755
index 0000000000..e91a52869a
--- /dev/null
+++ b/recipes/ntp/files/ntp
@@ -0,0 +1,31 @@
+#! /bin/sh
+
+FLAGS="defaults 23"
+
+test -f /usr/bin/ntpd || exit 0
+
+case "$1" in
+ start)
+ echo -n "Starting NTP server: ntpd"
+ start-stop-daemon --start --quiet --exec /usr/bin/ntpd
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping NTP server: ntpd"
+ start-stop-daemon --stop --quiet --exec /usr/bin/ntpd
+ echo "."
+ ;;
+ restart|force-reload)
+ echo -n "Restarting NTP server: ntpd... "
+ start-stop-daemon --stop --quiet --exec /usr/bin/ntpd
+ sleep 2
+ start-stop-daemon --start --quiet --exec /usr/bin/ntpd
+ echo "done."
+ ;;
+ *)
+ echo "Usage: /etc/init.d/ntp {start|stop|restart|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/recipes/ntp/files/ntp.conf b/recipes/ntp/files/ntp.conf
new file mode 100644
index 0000000000..02a44b0d01
--- /dev/null
+++ b/recipes/ntp/files/ntp.conf
@@ -0,0 +1,13 @@
+# This is the most basic ntp configuration file
+# The driftfile must remain in a place specific to this
+# machine - it records the machine specific clock error
+driftfile /etc/ntp.drift
+# This obtains a random server which will be close
+# (in IP terms) to the machine. Add other servers
+# as required, or change this.
+server pool.ntp.org
+# Using local hardware clock as fallback
+server 127.127.1.0
+fudge 127.127.1.0 stratum 14
+# Defining a default security setting
+restrict default nomodify nopeer
diff --git a/recipes/ntp/files/ntpd b/recipes/ntp/files/ntpd
new file mode 100755
index 0000000000..ae50f135d0
--- /dev/null
+++ b/recipes/ntp/files/ntpd
@@ -0,0 +1,62 @@
+#! /bin/sh
+#
+# ntpd init.d script for ntpdc from ntp.isc.org
+test -x /usr/bin/ntpd -a -r /etc/ntp.conf || exit 0
+# rcS contains TICKADJ
+test -r /etc/default/rcS && . /etc/default/rcS
+
+# Functions to do individual actions
+settick(){
+ # If TICKADJ is set we *must* adjust it before we start, because the
+ # driftfile relies on the correct setting
+ test -n "$TICKADJ" -a -x /usr/bin/tickadj && {
+ echo -n "Setting tick to $TICKADJ: "
+ /usr/bin/tickadj "$TICKADJ"
+ echo "done"
+ }
+}
+startdaemon(){
+ # The -g option allows ntpd to step the time to correct it just
+ # once. The daemon will exit if the clock drifts too much after
+ # this. If ntpd seems to disappear after a while assume TICKADJ
+ # above is set to a totally incorrect value.
+ echo -n "Starting ntpd: "
+ start-stop-daemon --start -x /usr/bin/ntpd -- -p /var/run/ntp.pid "$@"
+ echo "done"
+}
+stopdaemon(){
+ echo -n "Stopping ntpd: "
+ start-stop-daemon --stop -p /var/run/ntp.pid
+ echo "done"
+}
+
+case "$1" in
+ start)
+ settick
+ startdaemon -g
+ ;;
+ stop)
+ stopdaemon
+ ;;
+ force-reload)
+ stopdaemon
+ settick
+ startdaemon -g
+ ;;
+ restart)
+ # Don't reset the tick here
+ stopdaemon
+ startdaemon -g
+ ;;
+ reload)
+ # Must do this by hand, but don't do -g
+ stopdaemon
+ startdaemon
+ ;;
+ *)
+ echo "Usage: ntpd { start | stop | restart | reload }" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/recipes/ntp/files/ntpdate b/recipes/ntp/files/ntpdate
new file mode 100755
index 0000000000..b9963b772a
--- /dev/null
+++ b/recipes/ntp/files/ntpdate
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/bin
+
+test -f /usr/bin/ntpdate || exit 0
+
+if test -f /etc/default/ntpdate ; then
+. /etc/default/ntpdate
+else
+NTPSERVERS="pool.ntp.org"
+fi
+
+test -n "$NTPSERVERS" || exit 0
+
+case "$1" in
+start|force-reload)
+ echo -n "Running ntpdate to synchronize clock"
+ /usr/bin/ntpdate -u -b -s $NTPOPTIONS $NTPSERVERS
+ echo "."
+ ;;
+restart|reload)
+ # Drop -b to slew clock rather than step it if called after system is up
+ echo -n "Running ntpdate to synchronize clock"
+ /usr/bin/ntpdate -u -s $NTPOPTIONS $NTPSERVERS
+ echo "."
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: /etc/init.d/ntpdate {start|stop|restart|reload|force-reload}"
+ exit 1
+esac
+
+exit 0
diff --git a/recipes/ntp/files/ntpdc.Makefile.am.maybe-layout.patch b/recipes/ntp/files/ntpdc.Makefile.am.maybe-layout.patch
new file mode 100644
index 0000000000..826b5014d1
--- /dev/null
+++ b/recipes/ntp/files/ntpdc.Makefile.am.maybe-layout.patch
@@ -0,0 +1,11 @@
+--- ntp-4.2.0/ntpdc/Makefile.am~nochecklayout Fri Jan 14 23:19:16 2005
++++ ntp-4.2.0/ntpdc/Makefile.am Fri Jan 14 23:19:24 2005
+@@ -3,7 +3,7 @@
+ bin_PROGRAMS= ntpdc
+ EXTRA_PROGRAMS= ntpdc-layout
+ EXTRA_DATA= check-layout
+-BUILT_SOURCES= maybe-layout
++BUILT_SOURCES= # maybe-layout
+ INCLUDES= -I$(top_srcdir)/include
+ # LDADD might need RESLIB and ADJLIB
+ ntpdc_LDADD= version.o ../libntp/libntp.a @READLINE_LIBS@
diff --git a/recipes/ntp/files/readline.patch b/recipes/ntp/files/readline.patch
new file mode 100644
index 0000000000..52d17db032
--- /dev/null
+++ b/recipes/ntp/files/readline.patch
@@ -0,0 +1,44 @@
+--- ntp-4.1.2/configure.in.old 2004-12-31 23:50:21.000000000 +0000
++++ ntp-4.1.2/configure.in 2004-12-31 23:58:45.000000000 +0000
+@@ -211,16 +211,17 @@
+ AC_CHECK_HEADERS(readline/history.h readline/readline.h)
+ case "$ac_cv_header_readline_history_h$ac_cv_header_readline_readline_h" in
+ *no*) ;;
+- *) AC_CHECK_LIB(readline, readline, ,
++ *) AC_CHECK_LIB(readline, readline, READLINE_LIBS="-lreadline",
+ AC_MSG_NOTICE([Trying again with -lcurses])
+ unset ac_cv_lib_readline_readline
+ AC_CHECK_LIB(readline, readline,
+- LIBS="-lreadline -lcurses $LIBS"
++ READLINE_LIBS="-lreadline -lcurses"
+ AC_DEFINE(HAVE_LIBREADLINE)
+ AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?])
+ , , -lcurses))
+ ;;
+ esac
++AC_SUBST(READLINE_LIBS)
+
+ dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
+ dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
+--- ntp-4.1.2/ntpdc/Makefile.am.old 2004-12-31 23:52:58.000000000 +0000
++++ ntp-4.1.2/ntpdc/Makefile.am 2005-01-01 00:04:43.000000000 +0000
+@@ -4,6 +4,7 @@
+ INCLUDES = -I$(top_srcdir)/include
+ # LDADD might need RESLIB and ADJLIB
+ LDADD = version.o ../libntp/libntp.a @LIBRSAREF@
++LIBADD = @READLINE_LIBS@
+ DISTCLEANFILES = .version version.c
+ noinst_HEADERS = ntpdc.h
+ #EXTRA_DIST = ntpdc.mak
+--- ntp-4.1.2/ntpq/Makefile.am.old 2004-12-31 23:52:54.000000000 +0000
++++ ntp-4.1.2/ntpq/Makefile.am 2005-01-01 00:04:54.000000000 +0000
+@@ -3,7 +3,8 @@
+ bin_PROGRAMS = ntpq
+ INCLUDES = -I$(top_srcdir)/include
+ # LDADD might need RESLIB and ADJLIB
+-LDADD = version.o ../libntp/libntp.a @LIBRSAREF@
++LDADD = version.o ../libntp/libntp.a @LIBRSAREF@
++LIBADD = @READLINE_LIBS@
+ DISTCLEANFILES = .version version.c
+ noinst_HEADERS = ntpq.h
+ #EXTRA_DIST = ntpq.mak
diff --git a/recipes/ntp/ntp-4.2.2p3/ipv6only-workaround.patch b/recipes/ntp/ntp-4.2.2p3/ipv6only-workaround.patch
new file mode 100644
index 0000000000..5301621dc2
--- /dev/null
+++ b/recipes/ntp/ntp-4.2.2p3/ipv6only-workaround.patch
@@ -0,0 +1,13 @@
+Index: ntp-4.2.2p3/ntpdate/ntpdate.c
+===================================================================
+--- ntp-4.2.2p3.orig/ntpdate/ntpdate.c
++++ ntp-4.2.2p3/ntpdate/ntpdate.c
+@@ -1777,8 +1777,6 @@ init_io(void)
+ if (res->ai_family == AF_INET6)
+ if (setsockopt(fd[nbsock], IPPROTO_IPV6, IPV6_V6ONLY, (void*) &optval, sizeof(optval)) < 0) {
+ netsyslog(LOG_ERR, "setsockopt() IPV6_V6ONLY failed: %m");
+- exit(1);
+- /*NOTREACHED*/
+ }
+ #endif
+
diff --git a/recipes/ntp/ntp-4.2.2p3/tickadj.c.patch b/recipes/ntp/ntp-4.2.2p3/tickadj.c.patch
new file mode 100644
index 0000000000..9ef9de9e1f
--- /dev/null
+++ b/recipes/ntp/ntp-4.2.2p3/tickadj.c.patch
@@ -0,0 +1,32 @@
+Index: ntp-4.2.2p3-r0/ntp-4.2.2p3/util/tickadj.c
+===================================================================
+--- ntp-4.2.2p3/util/tickadj.c 2004-02-25 06:58:33.000000000 +0100
++++ ntp-4.2.2p3/util/tickadj.c 2007-07-07 01:00:54.000000000 +0200
+@@ -21,7 +21,8 @@
+ # include <unistd.h>
+ #endif /* HAVE_UNISTD_H */
+
+-#ifdef HAVE___ADJTIMEX /* Linux */
++/* proper handling here has been moved to upstream ntp bugzilla */
++#ifdef linux
+
+ #include <sys/timex.h>
+ struct timex txc;
+@@ -91,7 +92,7 @@
+ }
+
+ if (!errflg) {
+- if (__adjtimex(&txc) < 0)
++ if (adjtimex(&txc) < 0)
+ perror("adjtimex");
+ else if (!quiet)
+ printf("tick = %ld\ntick_adj = %d\n",
+@@ -146,7 +147,7 @@
+ #endif
+ }
+
+- if (__adjtimex(&txc) < 0)
++ if (adjtimex(&txc) < 0)
+ {
+ perror("adjtimex");
+ }
diff --git a/recipes/ntp/ntp-ssl_4.1.2.bb b/recipes/ntp/ntp-ssl_4.1.2.bb
new file mode 100644
index 0000000000..dd8ca66f25
--- /dev/null
+++ b/recipes/ntp/ntp-ssl_4.1.2.bb
@@ -0,0 +1,9 @@
+require ntp_${PV}.bb
+DEPENDS = "openssl"
+PR = "r2"
+
+S = "${WORKDIR}/ntp-${PV}"
+
+EXTRA_OECONF = "--with-openssl-libdir=${STAGING_LIBDIR} \
+ --with-openssl-incdir=${STAGING_INCDIR}/openssl"
+
diff --git a/recipes/ntp/ntp.inc b/recipes/ntp/ntp.inc
new file mode 100644
index 0000000000..7ef6d672d1
--- /dev/null
+++ b/recipes/ntp/ntp.inc
@@ -0,0 +1,32 @@
+DESCRIPTION = "The Network Time Protocol (NTP) is used to \
+synchronize the time of a computer client or server to \
+another server or reference time source, such as a radio \
+or satellite receiver or modem."
+HOMEPAGE = "http://ntp.isc.org/bin/view/Main/WebHome"
+SECTION = "console/network"
+PRIORITY = "optional"
+LICENSE = "ntp"
+RSUGGESTS = "iana-etc"
+
+SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \
+ file://ipv6only-workaround.patch;patch=1 \
+ file://ntpd \
+ file://ntp.conf \
+ file://ntpdate"
+
+inherit autotools update-rc.d
+
+INITSCRIPT_NAME = "ntpd"
+# No dependencies, so just go in at the standard level (20)
+INITSCRIPT_PARAMS = "defaults"
+
+# The ac_cv_header_readline_history is to stop ntpdc depending on either
+# readline or curses
+EXTRA_OECONF = "--without-openssl --without-crypto ac_cv_header_readline_history_h=no"
+CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED"
+
+PACKAGES += "ntpdate ntp-bin ntp-tickadj ntp-utils"
+# NOTE: you don't need ntpdate, use "ntpdc -q -g -x"
+
+# This should use rc.update
+FILES_ntpdate = "${bindir}/ntpdate ${sysconfdir}/init.d/ntpdate"
diff --git a/recipes/ntp/ntp_4.1.2.bb b/recipes/ntp/ntp_4.1.2.bb
new file mode 100644
index 0000000000..7091f05394
--- /dev/null
+++ b/recipes/ntp/ntp_4.1.2.bb
@@ -0,0 +1,46 @@
+require ntp.inc
+
+PR = "r5"
+
+SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.1/ntp-${PV}.tar.gz \
+ file://configure.patch;patch=1 \
+ file://readline.patch;patch=1 \
+ file://ntpdate \
+ file://ntp"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d
+ install -m 755 ${WORKDIR}/ntpdate ${D}${sysconfdir}/init.d
+ install -m 755 ${WORKDIR}/ntp ${D}${sysconfdir}/init.d
+ echo "server pool.ntp.org" >${D}${sysconfdir}/ntp.conf
+}
+
+pkg_postinst_ntpdate() {
+if test "x$D" != "x"; then
+ exit 1
+else
+ if ! grep -q ntpdate /etc/cron/crontabs/root >/dev/null 2>&1; then
+ echo "adding crontab"
+ test -d /etc/cron/crontabs || mkdir -p /etc/cron/crontabs
+ echo "30 * * * * ${bindir}/ntpdate -s -u pool.ntp.org" >> /etc/cron/crontabs/root
+ fi
+
+ # Dunno why this is here, ask the "nylon" guys :)
+ test -x /etc/init.d/busybox-cron && update-rc.d -s busybox-cron defaults
+
+ update-rc.d -s ntpdate defaults 30
+fi
+}
+
+pkg_postrm_ntpdate() {
+ update-rc.d -f ntpdate remove
+}
+
+pkg_postinst_ntp() {
+ update-rc.d -s ntp defaults 31
+}
+
+pkg_postrm_ntp(){
+ update-rc.d -f ntp remove
+}
+
diff --git a/recipes/ntp/ntp_4.2.0.bb b/recipes/ntp/ntp_4.2.0.bb
new file mode 100644
index 0000000000..f2825a03c9
--- /dev/null
+++ b/recipes/ntp/ntp_4.2.0.bb
@@ -0,0 +1,45 @@
+require ntp.inc
+
+PR = "r9"
+
+SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \
+ file://ntpdc.Makefile.am.maybe-layout.patch;patch=1 \
+ file://ipv6only-workaround.patch;patch=1 \
+ file://gcc4.patch;patch=1 \
+ file://ntpd \
+ file://ntp.conf \
+ file://ntpdate"
+
+PROVIDES = "ntpdate-${PV} ntpdate-${PV}-${PR} ntpdate"
+
+#This is too painful - perl is only needed for ntp-wait and ntptrace, which are
+#perl scripts, and installing perl is an enormous overhead for a user who only
+#needs ntpq
+#RDEPENDS_ntp-bin = perl
+# ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms
+# with wonky clocks (e.g. OpenSlug)
+RDEPENDS_${PN} = "${PN}-tickadj"
+FILES_${PN}-bin = "${bindir}/ntp-wait ${bindir}/ntpdc ${bindir}/ntpq ${bindir}/ntptime ${bindir}/ntptrace"
+FILES_${PN} = "${bindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd"
+FILES_${PN}-tickadj = "${bindir}/tickadj"
+
+do_install_append() {
+ install -d ${D}/${sysconfdir}/init.d
+ install -m 644 ${WORKDIR}/ntp.conf ${D}/${sysconfdir}
+ install -m 755 ${WORKDIR}/ntpdate ${D}/${sysconfdir}/init.d
+ install -m 755 ${WORKDIR}/ntpd ${D}/${sysconfdir}/init.d
+}
+
+pkg_postinst_ntpdate_nylon() {
+if test "x$D" != "x"; then
+ exit 1
+else
+ if ! grep -q ntpdate /etc/cron/crontabs/root; then
+ echo "adding crontab"
+ test -d /etc/cron/crontabs || mkdir -p /etc/cron/crontabs
+ echo "30 * * * * /usr/bin/ntpdate -s -u pool.ntp.org" >> /etc/cron/crontabs/root
+ fi
+ update-rc.d -s busybox-cron defaults
+ update-rc.d -s ntpdate defaults 30
+fi
+}
diff --git a/recipes/ntp/ntp_4.2.2p3.bb b/recipes/ntp/ntp_4.2.2p3.bb
new file mode 100644
index 0000000000..22d2e1bff6
--- /dev/null
+++ b/recipes/ntp/ntp_4.2.2p3.bb
@@ -0,0 +1,40 @@
+require ntp.inc
+
+PR = "r1"
+
+SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \
+ file://ipv6only-workaround.patch;patch=1 \
+ file://tickadj.c.patch;patch=1 \
+ file://ntpd \
+ file://ntp.conf \
+ file://ntpdate"
+
+
+# ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms
+# with wonky clocks (e.g. OpenSlug)
+RDEPENDS_${PN} = "${PN}-tickadj"
+FILES_${PN}-bin = "${bindir}/ntp-wait ${bindir}/ntpdc ${bindir}/ntpq ${bindir}/ntptime ${bindir}/ntptrace"
+FILES_${PN} = "${bindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd"
+FILES_${PN}-tickadj = "${bindir}/tickadj"
+FILES_ntp-utils = "${bindir}/*"
+
+do_install_append() {
+ install -d ${D}/${sysconfdir}/init.d
+ install -m 644 ${WORKDIR}/ntp.conf ${D}/${sysconfdir}
+ install -m 755 ${WORKDIR}/ntpdate ${D}/${sysconfdir}/init.d
+ install -m 755 ${WORKDIR}/ntpd ${D}/${sysconfdir}/init.d
+}
+
+pkg_postinst_ntpdate() {
+if test "x$D" != "x"; then
+ exit 1
+else
+ if ! grep -q ntpdate /etc/cron/crontabs/root; then
+ echo "adding crontab"
+ test -d /etc/cron/crontabs || mkdir -p /etc/cron/crontabs
+ echo "30 * * * * /usr/bin/ntpdate -s -u pool.ntp.org" >> /etc/cron/crontabs/root
+ fi
+ update-rc.d -s busybox-cron defaults
+ update-rc.d -s ntpdate defaults 30
+fi
+}