documentation: Remove usage of version and version2.texi, replace with portable sed.
authorNils Gillmann <ng0@n0.is>
Sun, 21 Oct 2018 13:36:09 +0000 (13:36 +0000)
committerNils Gillmann <ng0@n0.is>
Sun, 21 Oct 2018 13:53:45 +0000 (13:53 +0000)
Signed-off-by: Nils Gillmann <ng0@n0.is>
doc/documentation/Makefile.am
doc/documentation/gnunet-c-tutorial.texi
doc/documentation/gnunet.texi
doc/documentation/run-gendocs.sh

index 7eed6efb68261e1e60d7f9edeb00329ade754c34..cd3fca8544522309542557132c580a393fd8a5ea 100644 (file)
@@ -126,6 +126,7 @@ EXTRA_DIST =                                                        \
        $(gnunet_TEXINFOS)                                      \
        $(gnunet_tutorial_examples)                             \
        htmlxref.cnf                                            \
+       gversion.texi
        run-gendocs.sh                                          \
        docstyle.css
 
@@ -160,27 +161,20 @@ lego_stack.png: images/lego_stack.svg
        convert images/lego_stack.svg images/lego_stack.png &&
        pngcrush images/lego_stack.png images/lego_stack.png
 
-# FIXME: The usage of 'date' strings causes a warning.
-# version.texi:
-#      echo "@set UPDATED $(date +'%d %B %Y')" > $@
-#      echo "@set UPDATED-MONTH $(date +'%B %Y')" >> $@
-#      echo "@set EDITION $(PACKAGE_VERSION)" >> $@
-#      echo "@set VERSION $(PACKAGE_VERSION)" >> $@
-
-# Workaround for makeinfo error. Which in turn introduces more
-# date-related 'warnings' for GNUism. Well.
-version2.texi:
-       echo "@set UPDATED $(date +'%d %B %Y')" > $@
-       echo "@set UPDATED-MONTH $(date +'%B %Y')" >> $@
-       echo "@set EDITION $(PACKAGE_VERSION)" >> $@
-       echo "@set VERSION $(PACKAGE_VERSION)" >> $@
+# XXX: is this sed invocation portable enough? otherwise try tr(1).
+version.texi/replacement: version.texi/replacement/revert
+       @sed -i "s/GPACKAGE_VERSION/$(PACKAGE_VERSION)/g" gversion.texi
+
+version.texi/replacement/revert:
+       @echo "@set VERSION GPACKAGE_VERSION" > gversion.texi
+       @echo "@set EDITION GPACKAGE_VERSION" >> gversion.texi
 
 if SECTION7
-gnunet-c-tutorial.7: version2.texi
+gnunet-c-tutorial.7: version.texi/replacement
        @echo Attempting to output an mdoc formatted section 7 document
        @texi2mdoc -I$(pwd):$(pwd)/chapters gnunet-c-tutorial.texi > ../man/gnunet-c-tutorial.7
 
-gnunet-documentation.7: version2.texi
+gnunet-documentation.7: version.texi/replacement
        @echo Attempting to output an mdoc formatted section 7 document
        @texi2mdoc -I$(pwd):$(pwd)/chapters gnunet.texi > ../man/gnunet-documentation.7
 
@@ -191,6 +185,8 @@ endif
 #doc-clean:
 #      @rm *.aux *.log *.toc *.cp *.cps
 
+all: version.texi/replacement
+
 doc-all-install:
        @mkdir -p $(DESTDIR)/$(docdir)
        @mkdir -p $(DESTDIR)/$(infoimagedir)
@@ -208,7 +204,7 @@ doc-gendoc-install:
 
 #      @cp -r images $(DESTDIR)/$(infoimagedir)
 
-dev-build: version.texi version2.texi
+dev-build: version.texi/replacement
        @makeinfo --pdf gnunet.texi
        @makeinfo --pdf gnunet-c-tutorial.texi
        @makeinfo --html gnunet.texi
@@ -217,7 +213,7 @@ dev-build: version.texi version2.texi
        @makeinfo --no-split gnunet-c-tutorial.texi
 
 # TODO: Add more to clean.
-clean:
+clean: version.texi/replacement/revert
        @rm -f gnunet.pdf
        @rm -f gnunet.html
        @rm -f gnunet.info
index a41075a1736557bc76ec0d48ecd0d2ff1688ed26..cf42d8e8b6f82e3658bb3285e8c1f2532eff5501 100644 (file)
@@ -3,11 +3,10 @@
 @setfilename gnunet-c-tutorial.info
 @documentencoding UTF-8
 @settitle GNUnet C Tutorial
-@exampleindent 2
+@c @exampleindent 2
 @c %**end of header
 
-@c including 'version.texi' makes makeinfo throw errors.
-@include version2.texi
+@include gversion.texi
 
 @copying
 Copyright @copyright{} 2001-2018 GNUnet e.V.
index 3781b866b2bcc9d150cf1cdb5e15354a820556f1..003ad8143eb1cb10d390ec2d56f69ca3ce5ce06c 100644 (file)
@@ -3,15 +3,14 @@
 @setfilename gnunet.info
 @documentencoding UTF-8
 @settitle GNUnet Reference Manual
-@exampleindent 2
-
-@include version.texi
+@c @exampleindent 2
 
 @c Set Versions which might be used in more than one place:
 @set GNUFTP-URL https://ftp.gnu.org/gnu/gnunet
 @set PYPI-URL https://pypi.python.org/packages/source
 @set GNURL-VERSION-CURRENT 7.55.1
 @set GNUNET-DIST-URL https://gnunet.org/sites/default/files/
+@include gversion.texi
 @c @set OPENPGP-SIGNING-KEY-ID
 
 @copying
@@ -59,7 +58,6 @@ Foundation Web site at @url{http://www.gnu.org/licenses/gpl.html}.
 @page
 @vskip 0pt plus 1filll
 Edition @value{EDITION} @*
-@value{UPDATED} @*
 
 @insertcopying
 @end titlepage
index d0257017722dc707a4f451251552ee23697e0dd8..5e60a2d0f0b735ff17d89fea5e4cf734328f139a 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
-make version.texi
-make version2.texi
+make version.texi/replacement
+
 ./gendocs.sh --email gnunet-developers@gnu.org gnunet-c-tutorial "GNUnet C Tutorial" -o "manual/gnunet-c-tutorial"
 #cd manual
 #mkdir gnunet-c-tutorial