[xml/sgml-commit] [linuxdoc-tools] 04/12: Makefile.in, doc/Makedoc.sh: More versatile doc format selection. Build pdf, not dvi+ps.
Agustín Martín Domingo
agmartin at moszumanska.debian.org
Thu Oct 8 17:28:11 UTC 2015
This is an automated email from the git hooks/post-receive script.
agmartin pushed a commit to branch upstream
in repository linuxdoc-tools.
commit f682d3d457d6f23326b164da28967489585d7dee
Author: Agustin Martin Domingo <agmartin at debian.org>
Date: Thu Oct 8 16:17:51 2015 +0200
Makefile.in, doc/Makedoc.sh: More versatile doc format selection. Build pdf, not dvi+ps.
* Use a more versatile doc format selection for build, based
in BUILDDOC_FORMATS variable with possible values
txt pdf info lyx html rtf dvi+ps
This needs to be made configurable from configure.
* Build by default newly added pdf format instead of old but still
supported dvi+ps.
* Do not try dvips if latex is not available.
* Minor cosmetic changes.
Signed-off-by: Agustin Martin Domingo <agmartin at debian.org>
---
ChangeLog | 2 ++
Makefile.in | 2 ++
doc/Makedoc.sh | 97 +++++++++++++++++++++++++++++++++++++++-------------------
3 files changed, 69 insertions(+), 32 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8d2153a..99ab7f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,8 @@ please see "doc/CHANGES.Debian-native".
======
* Build documentation in build target, not in install target
(Debian #800537).
+ * More versatile handling of doc formats. Add pdf format and built it
+ instead of dvi+ps.
0.9.69:
=======
diff --git a/Makefile.in b/Makefile.in
index 61f6030..d8698d4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -30,6 +30,7 @@ INSTALL_DATA = @INSTALL_DATA@
BUILD_SGMLSASP = @BUILD_SGMLSASP@
BUILD_ENTITY_MAP = @BUILD_ENTITY_MAP@
BUILD_ISO_ENTITIES = @BUILD_ISO_ENTITIES@
+BUILDDOC_FORMATS = txt pdf info lyx html rtf
# Now real destination dirs, honouring $(DESTDIR)
auxbin_ddir = $(DESTDIR)$(auxbindir)
@@ -95,6 +96,7 @@ endif
PKGPERL5LIB=$(CURDIR)/perl5lib \
PKGDATADIR=$(CURDIR)/lib \
PKGENTITYMAPDIR=$(CURDIR)/entity-map \
+ BUILDDOC_FORMATS="$(BUILDDOC_FORMATS)" \
bash Makedoc.sh)
install:: bin/linuxdoc
diff --git a/doc/Makedoc.sh b/doc/Makedoc.sh
index 064cc0b..3871f6a 100644
--- a/doc/Makedoc.sh
+++ b/doc/Makedoc.sh
@@ -61,40 +61,73 @@ sed < ../bin/linuxdoc.in > $TMPDIR/linuxdoc \
chmod u+x $TMPDIR/linuxdoc
-if [ -n "`which groff`" ]; then
- ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2txt
- echo "- Building txt docs" >&2
- $TMPDIR/sgml2txt -b 1 ./guide
+# Unless otherwise instructed, build docs for all formats
+if [ -z "${BUILDDOC_FORMATS}" ]; then
+ echo "- ++ Warning: \"\${BUILDDOC_FORMATS}\" unset. Building all doc formats:" >&2
+ BUILDDOC_FORMATS="txt pdf info lyx html rtf dvi+ps"
fi
-if [ -n "`which latex`" ]; then
- ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2latex
- echo "- Building latex docs" >&2
- $TMPDIR/sgml2latex --pass="\usepackage{times}" -o dvi ./guide
-fi
-
-if [ -n "`which dvips`" ]; then
- echo " + dvips" >&2
- dvips -t letter -o ./guide.ps ./guide.dvi
- if [ -n "`which gzip`" -a -f ./guide.ps ]; then
- gzip -fN ./guide.ps
- fi
-fi
-
-
-echo "- Building info docs" >&2
-$TMPDIR/linuxdoc -B info ./guide.sgml
-
-echo "- Building lyx docs" >&2
-$TMPDIR/linuxdoc -B lyx ./guide.sgml
-
-echo "- Building html docs" >&2
-$TMPDIR/linuxdoc -I -B html ./guide && mv -f ./guide*.html ./html
-
-echo "- Building rtf docs" >&2
-$TMPDIR/linuxdoc -B rtf ./guide && if [ ! -d ./rtf ]; \
- then mkdir -m 755 ./rtf; fi && mv -f ./guide*.rtf ./rtf
-
+# Build actual documentation
+echo "- Building documentation for formats: ${BUILDDOC_FORMATS}" >&2
+for docformat in ${BUILDDOC_FORMATS}; do
+ case ${docformat} in
+ txt)
+ echo "- Building txt docs" >&2
+ if [ -n "`which groff`" ]; then
+ $TMPDIR/linuxdoc --backend=txt --blanks=1 ./guide.sgml
+ else
+ echo "- ++ Warning: groff not available, cannot build \"${docformat}\" format." >&2
+ fi
+ ;;
+ pdf)
+ echo "- Building pdf docs" >&2
+ $TMPDIR/linuxdoc --backend=latex --output=pdf \
+ --pass="\usepackage{times}" ./guide.sgml
+ ;;
+ info)
+ echo "- Building info docs" >&2
+ $TMPDIR/linuxdoc --backend=info ./guide.sgml
+ ;;
+ lyx)
+ echo "- Building lyx docs" >&2
+ $TMPDIR/linuxdoc --backend=lyx ./guide.sgml
+ ;;
+ html)
+ echo "- Building html docs" >&2
+ $TMPDIR/linuxdoc --imagebuttons --backend=html ./guide.sgml \
+ && mv -f ./guide*.html ./html
+ ;;
+ rtf)
+ echo "- Building rtf docs" >&2
+ $TMPDIR/linuxdoc --backend=rtf ./guide.sgml && if [ ! -d ./rtf ]; \
+ then mkdir -m 755 ./rtf; fi && mv -f ./guide*.rtf ./rtf
+ ;;
+ dvi+ps)
+ echo "- Building latex docs" >&2
+ if [ -n "`which latex`" ]; then
+ echo "- Building dvi docs" >&2
+ $TMPDIR/linuxdoc --backend=latex --output=dvi \
+ --pass="\usepackage{times}" ./guide.sgml
+
+ if [ -n "`which dvips`" ]; then
+ echo " + dvips" >&2
+ dvips -t letter -o ./guide.ps ./guide.dvi
+ if [ -n "`which gzip`" -a -f ./guide.ps ]; then
+ gzip -fN ./guide.ps
+ fi
+ else
+ echo "- ++ Warning: dvips not available, cannot build \"guide.ps\"." >&2
+ fi
+ else
+ echo "- ++ Warning: latex not available, cannot build \"${docformat}\" format." >&2
+ fi
+ ;;
+ *)
+ echo "- ++ Warning: Ignoring unknown \"${docformat}\" format." >&2
+ esac
+done
+
+# Remove temporary directory.
rm -rf $TMPDIR
exit 0
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-xml-sgml/linuxdoc-tools.git
More information about the debian-xml-sgml-commit
mailing list