Skip to content

Commit

Permalink
Insert version number and date into documentation at build time. Bug …
Browse files Browse the repository at this point in the history
…1318.

Write a temp file with macro definitions from the makefile, and include it
from the doc sources.  Pass the version to make from the perl script.

It is still needed to manually update the previous-version number and
changebar indicators (.new/.wen) manually.
  • Loading branch information
Jeremy Harris committed Nov 24, 2012
1 parent 2369bf9 commit 2aee48d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 19 deletions.
16 changes: 14 additions & 2 deletions doc/doc-docbook/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,22 @@ exim.8: spec.xml x2man

########################################################################

.PHONY: local_params
local_params:
echo .macro version > $@
echo $(EXIM_VER) >> $@
echo .endmacro >> $@
echo .macro fulldate >> $@
date "+%d %b %Y" >> $@
echo .endmacro >> $@
echo .macro year >> $@
date "+%Y" >> $@
echo .endmacro >> $@


############################### FILTER #################################

filter.xml: filter.xfpt
filter.xml: local_params filter.xfpt
xfpt filter.xfpt

filter-pr.xml: filter.xml Pre-xml
Expand Down Expand Up @@ -104,7 +116,7 @@ filter.info: filter-info.xml

################################ SPEC ##################################

spec.xml: spec.xfpt
spec.xml: local_params spec.xfpt
xfpt spec.xfpt

spec-pr.xml: spec.xml Pre-xml
Expand Down
21 changes: 15 additions & 6 deletions doc/doc-docbook/filter.xfpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

.include stdflags
.include stdmacs
.include ./local_params
.docbook

. /////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -59,15 +60,23 @@
<bookinfo>
<title>Exim's interfaces to mail filtering</title>
<titleabbrev>Exim filtering</titleabbrev>
<date>23 November 2009</date>
<date>
.fulldate
</date>
<author><firstname>Philip</firstname><surname>Hazel</surname></author>
<authorinitials>PH</authorinitials>
<revhistory><revision>
<revnumber>4.80</revnumber>
<date>17 May 2012</date>
<revnumber>
.version
</revnumber>
<date>
.fulldate
</date>
<authorinitials>PH</authorinitials>
</revision></revhistory>
<copyright><year>2010</year><holder>University of Cambridge</holder></copyright>
<copyright><year>
.year
</year><holder>University of Cambridge</holder></copyright>
</bookinfo>
.literal off

Expand All @@ -77,8 +86,8 @@

.chapter "Forwarding and filtering in Exim" "CHAPforandfilt"
This document describes the user interfaces to Exim's in-built mail filtering
facilities, and is copyright &copy; University of Cambridge 2007. It
corresponds to Exim version 4.80.
facilities, and is copyright &copy; University of Cambridge &year(). It
corresponds to Exim version &version().



Expand Down
27 changes: 17 additions & 10 deletions doc/doc-docbook/spec.xfpt
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@
.book

. /////////////////////////////////////////////////////////////////////////////
. These definitions set some parameters and save some typing. Remember that
. the <bookinfo> element must also be updated for each new edition.
. These definitions set some parameters and save some typing.
. /////////////////////////////////////////////////////////////////////////////

.set previousversion "4.80"
.set version "4.80"
.include ./local_params

.set ACL "access control lists (ACLs)"
.set I "&nbsp;&nbsp;&nbsp;&nbsp;"
Expand Down Expand Up @@ -170,15 +169,23 @@
<bookinfo>
<title>Specification of the Exim Mail Transfer Agent</title>
<titleabbrev>The Exim MTA</titleabbrev>
<date>17 May 2012</date>
<date>
.fulldate
</date>
<author><firstname>Exim</firstname><surname>Maintainers</surname></author>
<authorinitials>EM</authorinitials>
<revhistory><revision>
<revnumber>4.80</revnumber>
<date>17 May 2012</date>
<revnumber>
.version
</revnumber>
<date>
.fulldate
</date>
<authorinitials>EM</authorinitials>
</revision></revhistory>
<copyright><year>2012</year><holder>University of Cambridge</holder></copyright>
<copyright><year>
.year
</year><holder>University of Cambridge</holder></copyright>
</bookinfo>
.literal off

Expand Down Expand Up @@ -367,7 +374,7 @@ contributors.

.new
.cindex "documentation"
This edition of the Exim specification applies to version &version; of Exim.
This edition of the Exim specification applies to version &version() of Exim.
Substantive changes from the &previousversion; edition are marked in some
renditions of the document; this paragraph is so marked if the rendition is
capable of showing a change indicator.
Expand Down Expand Up @@ -1618,7 +1625,7 @@ for only a short time (see &%timeout_frozen_after%& and
.section "Unpacking" "SECID23"
Exim is distributed as a gzipped or bzipped tar file which, when unpacked,
creates a directory with the name of the current release (for example,
&_exim-&version;_&) into which the following files are placed:
&_exim-&version()_&) into which the following files are placed:

.table2 140pt
.irow &_ACKNOWLEDGMENTS_& "contains some acknowledgments"
Expand Down Expand Up @@ -2314,7 +2321,7 @@ INFO_DIRECTORY, as described in section &<<SECTinsinfdoc>>& below.
For the utility programs, old versions are renamed by adding the suffix &_.O_&
to their names. The Exim binary itself, however, is handled differently. It is
installed under a name that includes the version number and the compile number,
for example &_exim-&version;-1_&. The script then arranges for a symbolic link
for example &_exim-&version()-1_&. The script then arranges for a symbolic link
called &_exim_& to point to the binary. If you are updating a previous version
of Exim, the script takes care to ensure that the name &_exim_& is never absent
from the directory (as seen by other processes).
Expand Down
2 changes: 1 addition & 1 deletion release-process/scripts/mk_exim_release.pl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ sub build_documentation {
my $context = shift;

my $docdir = File::Spec->catdir( $context->{release_tree}, 'doc', 'doc-docbook' );
system("cd '$docdir' && ./OS-Fixups && make everything") == 0
system("cd '$docdir' && ./OS-Fixups && make EXIM_VER=$context->{release} everything") == 0
|| croak "Doc build failed";

copy_docbook_files($context);
Expand Down

0 comments on commit 2aee48d

Please sign in to comment.