[exim-cvs] Insert version number and date into documentation…

Góra strony
Delete this message
Reply to this message
Autor: Exim Git Commits Mailing List
Data:  
Dla: exim-cvs
Temat: [exim-cvs] Insert version number and date into documentation at build time. Bug 1318.
Gitweb: http://git.exim.org/exim.git/commitdiff/2aee48d6f2a6526fffe18cd619fde9693f400034
Commit:     2aee48d6f2a6526fffe18cd619fde9693f400034
Parent:     2369bf9c1f5337d3ea493670d214fefda00c8e66
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sat Nov 24 22:51:55 2012 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Sat Nov 24 22:54:08 2012 +0000


    Insert version number and date into documentation at build time.  Bug 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.
---
 doc/doc-docbook/Makefile                   |   16 ++++++++++++++--
 doc/doc-docbook/filter.xfpt                |   21 +++++++++++++++------
 doc/doc-docbook/spec.xfpt                  |   27 +++++++++++++++++----------
 release-process/scripts/mk_exim_release.pl |    2 +-
 4 files changed, 47 insertions(+), 19 deletions(-)


diff --git a/doc/doc-docbook/Makefile b/doc/doc-docbook/Makefile
index 7f3f071..07eb322 100644
--- a/doc/doc-docbook/Makefile
+++ b/doc/doc-docbook/Makefile
@@ -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
@@ -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
diff --git a/doc/doc-docbook/filter.xfpt b/doc/doc-docbook/filter.xfpt
index f235a27..e54909e 100644
--- a/doc/doc-docbook/filter.xfpt
+++ b/doc/doc-docbook/filter.xfpt
@@ -8,6 +8,7 @@

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

 . /////////////////////////////////////////////////////////////////////////////
@@ -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


@@ -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().



diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt
index 6b63062..9d2dc4b 100644
--- a/doc/doc-docbook/spec.xfpt
+++ b/doc/doc-docbook/spec.xfpt
@@ -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;"
@@ -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


@@ -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.
@@ -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"
@@ -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).
diff --git a/release-process/scripts/mk_exim_release.pl b/release-process/scripts/mk_exim_release.pl
index ffb9ecf..d29770d 100755
--- a/release-process/scripts/mk_exim_release.pl
+++ b/release-process/scripts/mk_exim_release.pl
@@ -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);