From 51a2d8dfd8d0a11b50f8365cf45278cd0180b697 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Thu, 16 May 2013 12:28:37 +0200 Subject: [PATCH] Set paths in documentation by configure --- .gitignore | 6 ++- Makefile.in | 1 + chrony.conf.5 => chrony.conf.5.in | 8 ++-- chrony.texi => chrony.texi.in | 78 +++++++++++++++---------------- chronyc.1 => chronyc.1.in | 2 +- chronyd.8 => chronyd.8.in | 8 ++-- configure | 44 +++++++++-------- make_release | 7 ++- 8 files changed, 83 insertions(+), 71 deletions(-) rename chrony.conf.5 => chrony.conf.5.in (88%) rename chrony.texi => chrony.texi.in (98%) rename chronyc.1 => chronyc.1.in (95%) rename chronyd.8 => chronyd.8.in (96%) diff --git a/.gitignore b/.gitignore index 6c66b13..ae1a072 100644 --- a/.gitignore +++ b/.gitignore @@ -4,11 +4,15 @@ *.swp RELEASES Makefile +chrony.conf.5 chrony.info chrony.html +chrony.texi chrony.txt chronyc -chronyd* +chronyc.1 +chronyd +chronyd.8 config.h config.log tags diff --git a/Makefile.in b/Makefile.in index 2cfa762..5d239b5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -77,6 +77,7 @@ $(HASH_OBJ) : $(patsubst %.o,%.c,$(HASH_OBJ)) distclean : clean -rm -f Makefile + -rm -f chrony.conf.5 chrony.texi chronyc.1 chronyd.8 clean : -rm -f *.o *.s chronyc chronyd core *~ chrony.info chrony.html chrony.txt diff --git a/chrony.conf.5 b/chrony.conf.5.in similarity index 88% rename from chrony.conf.5 rename to chrony.conf.5.in index af9c928..1792b5f 100644 --- a/chrony.conf.5 +++ b/chrony.conf.5.in @@ -3,7 +3,7 @@ chrony.conf \- chronyd configuration file .SH SYNOPSIS -.B /etc/chrony.conf +.B @SYSCONFDIR@/chrony.conf .SH DESCRIPTION \fIchrony\fR is a pair of programs for maintaining the accuracy of computer @@ -12,7 +12,7 @@ boot time. Assuming that you have found some servers, you need to set up a configuration file to run \fIchrony\fR. The (compiled-in) default location -for this file is \fB/etc/chrony.conf\fR. Assuming that your ntp servers +for this file is \fB@SYSCONFDIR@/chrony.conf\fR. Assuming that your ntp servers are called `a.b.c' and `d.e.f', your \fBchrony.conf\fR file could contain as a minimum @@ -29,9 +29,9 @@ useful configuration file would look something like server a.b.c server d.e.f server g.h.i - keyfile /etc/chrony.keys + keyfile @SYSCONFDIR@/chrony.keys commandkey 1 - driftfile /etc/chrony.drift + driftfile @SYSCONFDIR@/chrony.drift .SH "SEE ALSO" diff --git a/chrony.texi b/chrony.texi.in similarity index 98% rename from chrony.texi rename to chrony.texi.in index b33f971..977a564 100644 --- a/chrony.texi +++ b/chrony.texi.in @@ -564,7 +564,7 @@ use their facilities. Assuming that you have found some servers, you need to set up a configuration file to run chrony. The (compiled-in) default location -for this file is @file{/etc/chrony.conf}. Assuming that your ntp +for this file is @file{@SYSCONFDIR@/chrony.conf}. Assuming that your ntp servers are called @code{a.b.c} and @code{d.e.f}, your @file{chrony.conf} file could contain as a minimum @@ -583,9 +583,9 @@ useful configuration file would look something like server a.b.c server d.e.f server g.h.i -keyfile /etc/chrony.keys +keyfile @SYSCONFDIR@/chrony.keys commandkey 1 -driftfile /etc/chrony.drift +driftfile @SYSCONFDIR@/chrony.drift @end example @c }}} @c {{{ S:Infrequent connection @@ -595,7 +595,7 @@ In this section we discuss how to configure chrony for computers that have occasional connections to the internet. @menu -* Configuration for infrequent connections:: How to set up the @code{/etc/chrony} file +* Configuration for infrequent connections:: How to set up the @code{@SYSCONFDIR@/chrony.conf} file * Advising chronyd of internet availability:: How to tell chronyd when the link is available @end menu @@ -654,14 +654,14 @@ comes before @samp{dns} in the @samp{hosts} line of the In order to notify @code{chronyd} of the presence of the link, you will need to be able to log in to it with the program chronyc. To do this, @code{chronyd} needs to be configured with an administrator password. To set up an -administrator password, you can create a file @file{/etc/chrony.keys} +administrator password, you can create a file @file{@SYSCONFDIR@/chrony.keys} containing a single line @example 1 xyzzy @end example -and add the following line to @file{/etc/chrony.conf} (the order of the +and add the following line to @file{@SYSCONFDIR@/chrony.conf} (the order of the lines does not matter) @example @@ -674,9 +674,9 @@ The smallest useful configuration file would look something like server 1.2.3.4 offline server 5.6.7.8 offline server 9.10.11.12 offline -keyfile /etc/chrony.keys +keyfile @SYSCONFDIR@/chrony.keys commandkey 1 -driftfile /etc/chrony.drift +driftfile @SYSCONFDIR@/chrony.drift @end example The next section describes how to tell @code{chronyd} when the internet link @@ -685,27 +685,27 @@ goes up and down. @node Advising chronyd of internet availability @subsection How to tell chronyd when the internet link is available. To use this option, you will need to configure a command key in -@code{chronyd's} configuration file @file{/etc/chrony.conf}, as described in +@code{chronyd's} configuration file @file{@SYSCONFDIR@/chrony.conf}, as described in the previous section. To tell @code{chronyd} when to start and finish sampling the servers, the @code{online} and @code{offline} commands of chronyc need to be used. To give an example of their use, we assume that @code{pppd} is the program being used to connect to the internet, and that chronyc has been -installed at its default location @file{/usr/local/bin/chronyc}. We +installed at its default location @file{@BINDIR@/chronyc}. We also assume that the command key has been set up as described in the previous section. In the file @file{/etc/ppp/ip-up} we add the command sequence @example -/usr/local/bin/chronyc -a online +@BINDIR@/chronyc -a online @end example and in the file @file{/etc/ppp/ip-down} we add the sequence @example -/usr/local/bin/chronyc -a offline +@BINDIR@/chronyc -a offline @end example @code{chronyd's} polling of the servers will now only occur whilst the @@ -740,9 +740,9 @@ be (assuming the clients are in the 192.168.165.x subnet and that the master's address is 192.168.169.170) @example -driftfile /etc/chrony.drift +driftfile @SYSCONFDIR@/chrony.drift commandkey 25 -keyfile /etc/chrony.keys +keyfile @SYSCONFDIR@/chrony.keys initstepslew 10 client1 client3 client6 local stratum 8 manual @@ -754,10 +754,10 @@ the configuration file might be @example server master -driftfile /etc/chrony.drift +driftfile @SYSCONFDIR@/chrony.drift logdir /var/log/chrony log measurements statistics tracking -keyfile /etc/chrony.keys +keyfile @SYSCONFDIR@/chrony.keys commandkey 24 local stratum 10 initstepslew 20 master @@ -889,7 +889,7 @@ option should not be used if you want your disc to spin down. To illustrate how a dial-up home computer might be configured, example configuration files are shown in this section. -For the @file{/etc/chrony.conf} file, the following can be used as an +For the @file{@SYSCONFDIR@/chrony.conf} file, the following can be used as an example. @emph{NOTE : The @code{server} directives are only applicable to customers of Demon Internet; users of other ISPs will need to use their own ISP's NTP servers or public NTP servers.} @@ -900,13 +900,13 @@ server 158.152.1.76 minpoll 5 maxpoll 10 maxdelay 0.4 offline server 194.159.253.2 minpoll 5 maxpoll 10 maxdelay 0.4 offline logdir /var/log/chrony log statistics measurements tracking -driftfile /etc/chrony.drift -keyfile /etc/chrony.keys +driftfile @SYSCONFDIR@/chrony.drift +keyfile @SYSCONFDIR@/chrony.keys commandkey 25 maxupdateskew 100.0 dumponexit dumpdir /var/log/chrony -rtcfile /etc/chrony.rtc +rtcfile @SYSCONFDIR@/chrony.rtc @end example With Freeserve as the ISP, I use the following server lines : @@ -924,13 +924,13 @@ online and offline respectively. The relevant part of the @file{/etc/ppp/ip-up} file is @example -/usr/local/bin/chronyc -a online +@BINDIR@/chronyc -a online @end example and the relevant part of the @file{/etc/ppp/ip-down} script is @example -/usr/local/bin/chronyc -a < This option can be used to specify an alternate location for the -configuration file (default @file{/etc/chrony.conf}). +configuration file (default @file{@SYSCONFDIR@/chrony.conf}). @item -r This option will reload sample histories for each of the servers being used. These histories are created by using the @code{dump} command in @@ -1125,7 +1125,7 @@ killproc() @{ # kill the named process(es) case "$1" in 'start') - if [ -f /opt/free/sbin/chronyd -a -f /etc/chrony.conf ]; then + if [ -f /opt/free/sbin/chronyd -a -f @SYSCONFDIR@/chrony.conf ]; then /opt/free/sbin/chronyd fi ;; @@ -1150,7 +1150,7 @@ service.) @node Configuration file @section The chronyd configuration file @c {{{ section top -The configuration file is normally called @file{/etc/chrony.conf}; in +The configuration file is normally called @file{@SYSCONFDIR@/chrony.conf}; in fact, this is the compiled-in default. However, other locations can be specified with a command line option. @@ -1568,7 +1568,7 @@ which the true rate actually lies. An example of the driftfile command is @example -driftfile /etc/chrony.drift +driftfile @SYSCONFDIR@/chrony.drift @end example @c }}} @c {{{ dumpdir @@ -1644,7 +1644,7 @@ This is useful when maintaining configuration on multiple hosts to keep the differences in a separate file. @example -include /etc/chrony/local.conf +include @SYSCONFDIR@/chrony/local.conf @end example @c }}} @c {{{ initstepslew @@ -1719,7 +1719,7 @@ ID/key pairs for the following 2 uses: The format of the command is shown in the example below @example -keyfile /etc/chrony.keys +keyfile @SYSCONFDIR@/chrony.keys @end example The argument is simply the name of the file containing the ID/key @@ -2580,7 +2580,7 @@ of the system's real-time clock (RTC). The syntax is illustrated in the following example @example -rtcfile /etc/chrony.rtc +rtcfile @SYSCONFDIR@/chrony.rtc @end example @code{chronyd} saves information in this file when it exits and when the @@ -2951,7 +2951,7 @@ With this option multiple commands can be specified on the command line. Each argument will be interpreted as a whole command. @item -f This option can be used to specify an alternate location of the @code{chronyd} -configuration file (default @file{/etc/chrony.conf}). The configuration file is +configuration file (default @file{@SYSCONFDIR@/chrony.conf}). The configuration file is needed for the `-a' option. @item -a With this option @code{chronyc} will try to authenticate automatically on @@ -2967,7 +2967,7 @@ power to reconfigure the run-time behaviour of @code{chronyd}. Consequently, @code{chronyc} is quite dangerous for the integrity of the target system's clock performance. Having access to @code{chronyd} via chronyc is more or less equivalent to being able to modify @code{chronyd's} configuration -file (typically @file{/etc/chrony.conf}) and to restart @code{chronyd}. +file (typically @file{@SYSCONFDIR@/chrony.conf}) and to restart @code{chronyd}. Chronyc also provides a number of monitoring (as opposed to commanding) commands, which will not affect the behaviour of @code{chronyd}. However, you @@ -4210,7 +4210,7 @@ the computer is currently synchronised. If this is @code{127.127.1.1} it means the computer is not synchronised to any external source and that you have the `local' mode operating (via the @code{local} command in @code{chronyc} (@pxref{local command}), or the @code{local} directive -in the @file{/etc/chrony.conf} file (@pxref{local directive})). +in the @file{@SYSCONFDIR@/chrony.conf} file (@pxref{local directive})). @item Stratum The stratum indicates how many hops away from a computer with an diff --git a/chronyc.1 b/chronyc.1.in similarity index 95% rename from chronyc.1 rename to chronyc.1.in index 3da0229..09d044a 100644 --- a/chronyc.1 +++ b/chronyc.1.in @@ -44,7 +44,7 @@ will be interpreted as a whole command. .TP \fB\-f\fR \fIconf-file\fR This option can be used to specify an alternate location for the -configuration file (default \fI/etc/chrony.conf\fR). The configuration file is +configuration file (default \fI@SYSCONFDIR@/chrony.conf\fR). The configuration file is needed for the \fB-a\fR option. .TP \fB\-a\fR diff --git a/chronyd.8 b/chronyd.8.in similarity index 96% rename from chronyd.8 rename to chronyd.8.in index f2a91f8..dc7a7d7 100644 --- a/chronyd.8 +++ b/chronyd.8.in @@ -24,10 +24,10 @@ gains or loses time, and compensates for this. privileges. If \fBchronyd\fR has been installed to its default location -\fI/usr/local/sbin/chronyd\fR, starting it is simply a matter of entering the +\fI@SBINDIR@/chronyd\fR, starting it is simply a matter of entering the command: -\fI/usr/local/sbin/chronyd\fR +\fI@SBINDIR@/chronyd\fR Information messages and warnings will be logged to syslog. @@ -56,7 +56,7 @@ to syslog. .TP \fB\-f\fR \fIconf-file\fR This option can be used to specify an alternate location for the -configuration file (default \fI/etc/chrony.conf\fR). +configuration file (default \fI@SYSCONFDIR@/chrony.conf\fR). .TP .B \-r This option will reload sample histories for each of the servers being used. @@ -112,7 +112,7 @@ Resolve hostnames only to IPv4 addresses. Resolve hostnames only to IPv6 addresses. .SH FILES -\fI/etc/chrony.conf\fR +\fI@SYSCONFDIR@/chrony.conf\fR .SH BUGS To report bugs, please visit \fIhttp://chrony.tuxfamily.org/\fR diff --git a/configure b/configure index 9966e86..46625db 100755 --- a/configure +++ b/configure @@ -585,26 +585,30 @@ else add_def CHRONY_VERSION "\"DEVELOPMENT\"" fi -sed -e "s%@EXTRA_OBJECTS@%${EXTRA_OBJECTS}%;\ - s%@CC@%${MYCC}%;\ - s%@CFLAGS@%${MYCFLAGS}%;\ - s%@CPPFLAGS@%${CPPFLAGS}%;\ - s%@LIBS@%${LIBS}%;\ - s%@LDFLAGS@%${MYLDFLAGS}%;\ - s%@EXTRA_LIBS@%${EXTRA_LIBS}%;\ - s%@EXTRA_CLI_LIBS@%${EXTRA_CLI_LIBS}%;\ - s%@READLINE_COMPILE@%${READLINE_COMPILE}%;\ - s%@READLINE_LINK@%${READLINE_LINK}%;\ - s%@HASH_OBJ@%${HASH_OBJ}%;\ - s%@HASH_LINK@%${HASH_LINK}%;\ - s%@HASH_COMPILE@%${HASH_COMPILE}%;\ - s%@SYSCONFDIR@%${SYSCONFDIR}%;\ - s%@BINDIR@%${BINDIR}%;\ - s%@SBINDIR@%${SBINDIR}%;\ - s%@DOCDIR@%${DOCDIR}%;\ - s%@MANDIR@%${MANDIR}%;\ - s%@INFODIR@%${INFODIR}%;"\ - < Makefile.in > Makefile +for f in Makefile chrony.conf.5 chrony.texi chronyc.1 chronyd.8 +do + echo Creating $f + sed -e "s%@EXTRA_OBJECTS@%${EXTRA_OBJECTS}%;\ + s%@CC@%${MYCC}%;\ + s%@CFLAGS@%${MYCFLAGS}%;\ + s%@CPPFLAGS@%${CPPFLAGS}%;\ + s%@LIBS@%${LIBS}%;\ + s%@LDFLAGS@%${MYLDFLAGS}%;\ + s%@EXTRA_LIBS@%${EXTRA_LIBS}%;\ + s%@EXTRA_CLI_LIBS@%${EXTRA_CLI_LIBS}%;\ + s%@READLINE_COMPILE@%${READLINE_COMPILE}%;\ + s%@READLINE_LINK@%${READLINE_LINK}%;\ + s%@HASH_OBJ@%${HASH_OBJ}%;\ + s%@HASH_LINK@%${HASH_LINK}%;\ + s%@HASH_COMPILE@%${HASH_COMPILE}%;\ + s%@SYSCONFDIR@%${SYSCONFDIR}%;\ + s%@BINDIR@%${BINDIR}%;\ + s%@SBINDIR@%${SBINDIR}%;\ + s%@DOCDIR@%${DOCDIR}%;\ + s%@MANDIR@%${MANDIR}%;\ + s%@INFODIR@%${INFODIR}%;"\ + < ${f}.in > $f +done # ======================================================================= # vim:et:sw=2:ht=2:sts=2:fdm=marker:cms=#%s diff --git a/make_release b/make_release index ed76ade..a1f2102 100755 --- a/make_release +++ b/make_release @@ -34,13 +34,16 @@ echo $version > version.txt sed -e "s%@@VERSION@@%${version}%" < chrony.spec.sample > chrony.spec -for m in chrony.1 chronyc.1 chrony.conf.5 chronyd.8; do +for m in chrony.1.in chronyc.1.in chrony.conf.5.in chronyd.8.in; do sed -e "s%@VERSION@%${version}%;s%@MAN_DATE@%${mandate}%" \ < $m > ${m}_ mv -f ${m}_ $m done -makeinfo --no-headers --number-sections -o chrony.txt chrony.texi +./configure && make chrony.txt || exit 1 +mv chrony.txt chrony.txt_ +make distclean +mv chrony.txt_ chrony.txt rm -f make_release chrony.spec.sample .gitignore