From: Harlan Stenn Date: Thu, 15 Oct 2009 10:43:07 +0000 (-0700) Subject: Prep for sntp docs X-Git-Tag: NTP_4_2_5P248_RC~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99f9e9fdb6fb4741eb8967add9429603a4842a9b;p=thirdparty%2Fntp.git Prep for sntp docs bk: 4ad6fcbbDVpDZuvJLzkslBb2C60XCA --- diff --git a/Makefile.am b/Makefile.am index 9f77b05bf..703fcf5ff 100644 --- a/Makefile.am +++ b/Makefile.am @@ -100,7 +100,7 @@ ETAGS_ARGS = Makefile.am configure.ac # DIST_HOOK_DIRS = conf html scripts ports # HMS: Keep .gcc-warning first, as that way it gets printed first. -BUILT_SOURCES = .gcc-warning $(srcdir)/COPYRIGHT $(srcdir)/version $(srcdir)/version.m4 $(srcdir)/include/version.def +BUILT_SOURCES = .gcc-warning $(srcdir)/COPYRIGHT $(srcdir)/version $(srcdir)/version.m4 $(srcdir)/include/version.def $(srcdir)/include/version.texi $(srcdir)/COPYRIGHT: $(srcdir)/html/copyright.html ( echo "This file is automatically generated from html/copyright.html" ; lynx -dump $(srcdir)/html/copyright.html ) > $(srcdir)/COPYRIGHT.new && mv $(srcdir)/COPYRIGHT.new $(srcdir)/COPYRIGHT @@ -125,6 +125,10 @@ $(srcdir)/include/version.def: $(srcdir)/packageinfo.sh cd $(srcdir) && \ ./scripts/genver include/version.def +$(srcdir)/include/version.texi: $(srcdir)/packageinfo.sh + cd $(srcdir) && \ + ./scripts/genver include/version.texi + dist-hook: @find $(distdir) -type d -name CVS -print | xargs rm -rf @find $(distdir) -type d -name SCCS -print | xargs rm -rf diff --git a/configure.ac b/configure.ac index 7dcfb88d0..22850d5f6 100644 --- a/configure.ac +++ b/configure.ac @@ -462,7 +462,7 @@ AC_CHECK_HEADER(dns_sd.h, case "$ac_cv_lib_dns_sd_DNSServiceRegister" in yes) LIBS="-ldns_sd $LIBS" ;; esac -AC_CHECK_HEADERS(errno.h fcntl.h ieeefp.h math.h) +AC_CHECK_HEADERS(errno.h fcntl.h ieeefp.h kvm.h math.h) AC_CHECK_HEADERS(md5.h, [], [], [#if HAVE_SYS_TYPES_H @@ -1246,7 +1246,12 @@ esac AC_CHECK_FUNC(inet_ntop, [], [AC_DEFINE(ISC_PLATFORM_NEEDNTOP, 1, [ISC: provide inet_ntop()])]) AC_CHECK_FUNC(inet_pton, [], [AC_DEFINE(ISC_PLATFORM_NEEDPTON, 1, [ISC: provide inet_pton()])]) AC_CHECK_FUNC(inet_aton, [], [AC_DEFINE(ISC_PLATFORM_NEEDATON, 1, [ISC: provide inet_aton()])]) -AC_CHECK_FUNCS(K_open kvm_open memcpy memmove memset) +case "$ac_cv_header_kvm_h" in + yes) + AC_CHECK_FUNCS(kvm_open) + ;; +esac +AC_CHECK_FUNCS(memcpy memmove memset) case "$host" in *-*-sco3.2v5.0.*) # Just stubs. Idiots. diff --git a/include/Makefile.am b/include/Makefile.am index 26ae9c6a6..d9ba2ebb9 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,7 +1,7 @@ #AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies AUTOMAKE_OPTIONS = ETAGS_ARGS = $(srcdir)/Makefile.am -EXTRA_DIST = autogen-version.def copyright.def debug-opt.def homerc.def version.def +EXTRA_DIST = autogen-version.def copyright.def debug-opt.def homerc.def version.def version.texi NULL= noinst_HEADERS = \ diff --git a/scripts/genver b/scripts/genver index 0ce192213..ddf25cd41 100755 --- a/scripts/genver +++ b/scripts/genver @@ -16,6 +16,9 @@ do *version.def) outputs="include/version.def $outputs" ;; + *version.texi) + outputs="include/version.texi $outputs" + ;; *) echo "Unrecognized option: $i" exit 1 ;; @@ -23,7 +26,7 @@ do done case "$outputs" in - '') outputs="version.m4 include/version.def" ;; + '') outputs="version.m4 include/version.def include/version.texi" ;; esac set -e @@ -65,3 +68,21 @@ case "$outputs" in esac ;; esac + +case "$outputs" in + *version.texi*) + echo "@set UPDATED `date +'%d %B %Y'`" > /tmp/version.texi+ + echo "@set EDITION $dversion" >> /tmp/version.texi+ + echo "@set VERSION $dversion" >> /tmp/version.texi+ + cmp -s /tmp/version.texi+ include/version.texi + rc=$? + case "$force$rc" in + 00) + rm -f /tmp/version.texi+ + ;; + *) + mv /tmp/version.texi+ include/version.texi + ;; + esac + ;; +esac diff --git a/sntp/Makefile.am b/sntp/Makefile.am index 0367bb30b..11d3d764f 100644 --- a/sntp/Makefile.am +++ b/sntp/Makefile.am @@ -51,8 +51,10 @@ EXTRA_DIST= bincheck.mf \ $(NULL) OLD_EXTRA_DIST= \ autogen-version.def version.def version.m4 -BUILT_SOURCES= check-autogen-version.def check-version.def check-version.m4 \ - sntp-opts.c sntp-opts.h sntp.1 sntp-opts.texi sntp-opts.menu +BUILT_SOURCES= check-autogen-version.def check-version.def \ + check-version.m4 check-version.texi \ + sntp-opts.c sntp-opts.h sntp-opts.texi sntp-opts.menu \ + sntp.1 sntp.html man_MANS= sntp.1 FRC: @@ -86,6 +88,16 @@ foo3: echo "Installing new sntp/version.m4 file"; \ fi ) +check-version.texi: FRC +foo4: + @cd $(srcdir) \ + && test -r ../include/version.texi \ + && ( if cmp -s ../include/version.texi version.texi; \ + then : ; \ + else cp ../include/version.texi version.texi; \ + echo "Installing new sntp/version.texi file"; \ + fi ) + $(srcdir)/sntp-opts.h: $(srcdir)/sntp-opts.c $(srcdir)/sntp-opts.c: $(srcdir)/sntp-opts.def $(srcdir)/../include/version.def $(run_ag) sntp-opts.def @@ -96,4 +108,7 @@ $(srcdir)/sntp.1: $(srcdir)/sntp-opts.def $(srcdir)/../include/version.def $(srcdir)/sntp-opts.texi $(srcdir)/sntp-opts.menu: $(srcdir)/sntp-opts.def $(srcdir)/../include/version.def $(run_ag) -Taginfo.tpl -DLEVEL=section sntp-opts.def +$(srcdir)/sntp.html: $(srcdir)/sntp-opts.menu $(srcdir)/sntp-opts.texi $(srcdir)/sntp.texi + cd $(srcdir) && makeinfo --force --html --no-split -o sntp.html sntp.texi + include bincheck.mf diff --git a/sntp/sntp-opts.def b/sntp/sntp-opts.def index 46a410e28..a7247672f 100644 --- a/sntp/sntp-opts.def +++ b/sntp/sntp-opts.def @@ -8,7 +8,7 @@ autogen definitions options; prog-name = "sntp"; prog-title = "standard SNTP program"; homerc = $HOME, "."; -argument = '...'; +argument = 'hostname-or-IP ...'; long-opts; @@ -166,7 +166,7 @@ flag = { A Key in a 1-to-8 character ASCII string. M Key in a 1-to-8 character ASCII string using the MD5 authentication scheme. - See more information see ntp.keys(5). + For more information see ntp.keys(5). _EndOfDoc_; }; @@ -175,13 +175,18 @@ flag = { detail = <<- _END_DETAIL .I sntp -can be used as a SNTP client to query a NTP or SNTP server and either display -the time or set the local system's time (given suitable privilege). It can be -run as an interactive command or in a +implements the Simple Network Time Protocol, and is used +to query an NTP or SNTP server and either +display the time +or +set the local system's time (given suitable privilege). +It can be +run interactively from the command line or as a .I cron job. -NTP is the Network Time Protocol (RFC 1305) and SNTP is the -Simple Network Time Protocol (RFC 2030, which supersedes RFC 1769). + +NTP and SNTP are defined by draft-ietf-ntp-ntpv4-proto-11, which +obsoletes RFC 4330 and RFC 1305. _END_DETAIL; prog-man-descrip = <<- _END_PROG_MAN_DESCRIP @@ -285,40 +290,9 @@ and commands. For example: .IP .B sntp -a ntpserver.somewhere -.PP -More information on how to use this utility is given in the -.I README -file in the distribution. In particular, this -.I man -page does not describe how to set it up as a server, which needs special care -to avoid propagating misinformation. .SH RETURN VALUE -When used as a client in non-daemon mode, the program returns a zero exit -status for success, and a non-zero one otherwise. When used as a daemon -(either client or server), it does not return except after a serious error. +The program returns a zero exit +status for success, and a non-zero one otherwise. .SH BUGS -The program implements the SNTP protocol, and does not provide all NTP -facilities. In particular, it contains no checks against any form of spoofing. -If this is a serious concern, some network security mechanism (like a firewall -or even just -.IR tcpwrappers ) -should be installed. -.PP -There are some errors, ambiguities and inconsistencies in the RFCs, and this -code may not interwork with all other NTP implementations. Any unreasonable -restrictions should be reported as bugs to whoever is responsible. It may -be difficult to find out who that is. -.PP -The program will stop as soon as it feels that things have got out of control. -In client daemon mode, it will usually fail during an extended period of -network or server inaccessibility or excessively slow performance, or when the -local clock is reset by another process. It will then need restarting -manually. Experienced system administrators can write a shell script, a -.I cron -job or put it in -.IR inittab , -to do this automatically. -.PP -.SH AUTHOR -.I sntp +Please report bugs to http://bugs.ntp.org . _END_PROG_MAN_DESCRIP;