Commit da6fa068 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

Merge branch 'install-doc' into 'master'

Add install-*-local targets for generated documentation

Somehow doc/Makefile.am had missing install-{pdf,html,info} targets - this adds support for installing sphinx-build generated files.

See merge request !366
parents be28e405 a7fca1e5
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = libtap src tests tests-fuzz samples doc man
SUBDIRS = libtap src tests tests-fuzz samples doc
singlehtml install-singlehtml:
$(MAKE) -C doc $@
AM_DISTCHECK_CONFIGURE_FLAGS = \
--disable-code-coverage
......@@ -84,4 +87,4 @@ code-coverage-clean:
-find . -name "*.gcda" -o -name "*.gcov" -delete
endif
.PHONY: check-code-coverage code-coverage-initial code-coverage-capture code-coverage-html code-coverage-summary code-coverage-clean
.PHONY: check-code-coverage code-coverage-initial code-coverage-capture code-coverage-html code-coverage-summary code-coverage-clean singlehtml install-singlehtml
......@@ -393,7 +393,6 @@ AM_CONDITIONAL([HAVE_MAKEINFO], test "$MAKEINFO" != "false")
AC_CONFIG_FILES([Makefile
doc/Makefile
man/Makefile
samples/Makefile
libtap/Makefile
src/Makefile
......@@ -405,15 +404,6 @@ AC_CONFIG_FILES([Makefile
src/dnssec/tests/Makefile
src/dnssec/utils/Makefile
doc/conf_autotools.py
man/kdig.1
man/keymgr.8
man/khost.1
man/knot.conf.5
man/knot1to2.1
man/knotc.8
man/knotd.8
man/knsec3hash.1
man/knsupdate.1
])
AC_OUTPUT
......
......@@ -27,7 +27,22 @@ EXTRA_DIST = \
SPHINXBUILDDIR = _build
ALLSPHINXOPTS = -n -D latex_paper_size=a4 $(SPHINXOPTS) .
.PHONY: html-local singlehtml pdf-local info-local man
.PHONY: html-local singlehtml pdf-local info-local man install-html-local install-singlehtml install-pdf-local install-info-local
MANPAGES =
MANPAGES_IN =
if HAVE_DAEMON
MANPAGES += man/knot.conf.5 man/knotc.8 man/knotd.8
MANPAGES_IN += reference.rst man_knotc.rst man_knotd.rst
endif # HAVE_DAEMON
if HAVE_UTILS
MANPAGES += man/kdig.1 man/khost.1 man/knsupdate.1 man/knot1to2.1 man/knsec3hash.1 man/keymgr.8
MANPAGES_IN += man_kdig.rst man_khost.rst man_knsupdate.rst man_knot1to2.rst man_knsec3hash.rst man_keymgr.rst
endif # HAVE_UTILS
dist_man_MANS = $(MANPAGES)
if HAVE_DOCS
......@@ -35,20 +50,37 @@ if HAVE_SPHINXBUILD
html-local:
$(SPHINXBUILD) -b html -d $(SPHINXBUILDDIR)/doctrees-html $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(SPHINXBUILDDIR)/html."
@echo "Build finished. The HTML pages are in $(SPHINXBUILDDIR)/html/."
install-html-local:
$(INSTALL) -d $(DESTDIR)/$(docdir) $(DESTDIR)/$(docdir)/_static $(DESTDIR)/$(docdir)/_sources
$(INSTALL) -D $(SPHINXBUILDDIR)/html/*.html $(DESTDIR)/$(docdir)/
$(INSTALL_DATA) $(SPHINXBUILDDIR)/html/_sources/* $(DESTDIR)/$(docdir)/_sources/
$(INSTALL_DATA) $(SPHINXBUILDDIR)/html/_static/* $(DESTDIR)/$(docdir)/_static/
singlehtml:
$(SPHINXBUILD) -b singlehtml -d $(SPHINXBUILDDIR)/doctrees-singlehtml $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(SPHINXBUILDDIR)/singlehtml."
@echo "Build finished. The HTML page is in $(SPHINXBUILDDIR)/singlehtml/."
install-singlehtml: singlehtml
$(INSTALL) -d $(DESTDIR)/$(docdir) $(DESTDIR)/$(docdir)/_static
$(INSTALL_DATA) $(SPHINXBUILDDIR)/singlehtml/*.html $(DESTDIR)/$(docdir)/
$(INSTALL_DATA) $(SPHINXBUILDDIR)/singlehtml/_static/* $(DESTDIR)/$(docdir)/_static/
if HAVE_PDFLATEX
pdf-local:
$(SPHINXBUILD) -b latex -d $(SPHINXBUILDDIR)/doctrees-latex $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(SPHINXBUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(SPHINXBUILDDIR)/latex."
@echo
@echo "Build finished. The PDF file is in $(SPHINXBUILDDIR)/latex/."
install-pdf-local:
$(INSTALL) -d $(DESTDIR)/$(docdir)
$(INSTALL_DATA) $(SPHINXBUILDDIR)/latex/knot.pdf $(DESTDIR)/$(docdir)/
else
pdf-local install-pdf-local:
@echo "You need to install pdflatex and re-run configure to be"
@echo "able to generate PDF documentation."
endif
......@@ -56,21 +88,32 @@ endif
if HAVE_MAKEINFO
info-local:
$(SPHINXBUILD) -b texinfo -d $(SPHINXBUILDDIR)/doctrees-texinfo $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
$(MAKE) -C $(SPHINXBUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(SPHINXBUILDDIR)/texinfo."
@echo
@echo "Build finished. The Info file is in $(SPHINXBUILDDIR)/texinfo/."
install-info-local:
$(INSTALL) -d $(DESTDIR)/$(infodir)
$(INSTALL_DATA) $(SPHINXBUILDDIR)/texinfo/knot.info $(DESTDIR)/$(infodir)/
else
info-local install-info-local:
@echo "You need to install GNU Texinfo and re-run configure to be"
@echo "able to generate info pages."
endif
man:
$(SPHINXBUILD) -b man -D version="__VERSION__" -D today="__DATE__" -d $(SPHINXBUILDDIR)/doctrees-man $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/man
man: $(MANPAGES)
$(MANPAGES): $(MANPAGES_IN) ../configure.ac
$(SPHINXBUILD) -b man -D version="@VERSION@" -D today="@RELEASE_DATE@" -d $(SPHINXBUILDDIR)/doctrees-man $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/man
mkdir -p man
for f in $(SPHINXBUILDDIR)/man/*; do \
sed -e '/^.TP$$/{n;s/^.B //}' "$$f" > "man/$$(basename $$f)"; \
done
@echo
@echo "Build finished. The man pages are in $(SPHINXBUILDDIR)/man."
@echo "Build finished. The man pages are in man/."
else
html-local singlehtml pdf-local info-local man:
html-local singlehtml pdf-local info-local man install-html-local install-singlehtml install-pdf-local install-info-local:
@echo "Please install sphinx (python-sphinx) to generate Knot DNS documentation."
endif # HAVE_SPHINXBUILD
......
......@@ -193,7 +193,7 @@ latex_elements = {
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'KnotDNS.tex', 'Knot DNS Documentation', copyright, 'manual'),
('index', 'knot.tex', 'Knot DNS Documentation', copyright, 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
......@@ -243,7 +243,7 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'KnotDNS', 'Knot DNS Documentation', author)
('index', 'knot', 'Knot DNS Documentation', author)
]
# Documents to append as an appendix to all manuals.
......
.\" Man page generated from reStructuredText.
.
.TH "KDIG" "1" "@RELEASE_DATE@" "@VERSION@" "Knot DNS"
.TH "KDIG" "1" "2015-04-28" "2.0.0-beta" "Knot DNS"
.SH NAME
kdig \- Advanced DNS lookup utility
.
......
.\" Man page generated from reStructuredText.
.
.TH "KEYMGR" "8" "@RELEASE_DATE@" "@VERSION@" "Knot DNS"
.TH "KEYMGR" "8" "2015-04-28" "2.0.0-beta" "Knot DNS"
.SH NAME
keymgr \- DNSSEC key management utility
.
......
.\" Man page generated from reStructuredText.
.
.TH "KHOST" "1" "@RELEASE_DATE@" "@VERSION@" "Knot DNS"
.TH "KHOST" "1" "2015-04-28" "2.0.0-beta" "Knot DNS"
.SH NAME
khost \- Simple DNS lookup utility
.
......
.\" Man page generated from reStructuredText.
.
.TH "KNOT.CONF" "5" "@RELEASE_DATE@" "@VERSION@" "Knot DNS"
.TH "KNOT.CONF" "5" "2015-04-28" "2.0.0-beta" "Knot DNS"
.SH NAME
knot.conf \- Knot DNS configuration file
.
......
.\" Man page generated from reStructuredText.
.
.TH "KNOT1TO2" "1" "@RELEASE_DATE@" "@VERSION@" "Knot DNS"
.TH "KNOT1TO2" "1" "2015-04-28" "2.0.0-beta" "Knot DNS"
.SH NAME
knot1to2 \- Knot DNS configuration conversion utility
.
......
.\" Man page generated from reStructuredText.
.
.TH "KNOTC" "8" "@RELEASE_DATE@" "@VERSION@" "Knot DNS"
.TH "KNOTC" "8" "2015-04-28" "2.0.0-beta" "Knot DNS"
.SH NAME
knotc \- Knot DNS control utility
.
......
.\" Man page generated from reStructuredText.
.
.TH "KNOTD" "8" "@RELEASE_DATE@" "@VERSION@" "Knot DNS"
.TH "KNOTD" "8" "2015-04-28" "2.0.0-beta" "Knot DNS"
.SH NAME
knotd \- Knot DNS server daemon
.
......
.\" Man page generated from reStructuredText.
.
.TH "KNSEC3HASH" "1" "@RELEASE_DATE@" "@VERSION@" "Knot DNS"
.TH "KNSEC3HASH" "1" "2015-04-28" "2.0.0-beta" "Knot DNS"
.SH NAME
knsec3hash \- Simple utility to compute NSEC3 hash
.
......
.\" Man page generated from reStructuredText.
.
.TH "KNSUPDATE" "1" "@RELEASE_DATE@" "@VERSION@" "Knot DNS"
.TH "KNSUPDATE" "1" "2015-04-28" "2.0.0-beta" "Knot DNS"
.SH NAME
knsupdate \- Dynamic DNS update utility
.
......
MANPAGES =
if HAVE_DAEMON
MANPAGES += knot.conf.5 knotc.8 knotd.8
endif # HAVE_DAEMON
if HAVE_UTILS
MANPAGES += kdig.1 khost.1 knsupdate.1 knot1to2.1 knsec3hash.1 keymgr.8
endif # HAVE_UTILS
dist_man_MANS = $(MANPAGES)
clean-local:
-rm *.1 *.5 *.8
#!/bin/bash
#
# The script
# 1. Generates manual pages from Sphinx.
# 2. Removes bold from definition lists (bug in Sphinx).
# https://github.com/sphinx-doc/sphinx/issues/1498
# 3. Replaces version placeholders
#
pushd "$(dirname "$(readlink -e "$0")")/../doc"
make man
for f in ./_build/man/*; do
file=`basename $f`
echo "Processing '${file}' file..."
sed -e '/^.TP$/{n;s/^.B //}' \
-e "s/__VERSION__/@VERSION@/g; s/__DATE__/@RELEASE_DATE@/g" \
"${f}" > "../man/${file}.in"
done
popd
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment