Commit 2f18e905 authored by Moritz Lipp's avatar Moritz Lipp

Build manpages and update Makefile

parent 7651bc3d
......@@ -142,12 +142,26 @@ dist: clean build-manpages
$(QUIET)mkdir -p ${PROJECT}-${VERSION}
$(QUIET)mkdir -p ${PROJECT}-${VERSION}/tests
$(QUIET)mkdir -p ${PROJECT}-${VERSION}/po
$(QUIET)cp LICENSE Makefile config.mk common.mk README AUTHORS Doxyfile \
$(QUIET)mkdir -p ${PROJECT}-${VERSION}/doc
$(QUIET)cp LICENSE Makefile config.mk common.mk README AUTHORS \
${PROJECT}.1.rst ${PROJECT}rc.5.rst ${OSOURCE} ${HEADER} ${PROJECT}.pc.in \
${PROJECT}.desktop version.h.in \
${PROJECT}.1 ${PROJECT}rc.5 \
${PROJECT}-${VERSION}
$(QUIET)cp -r data ${PROJECT}-${VERSION}
$(QUIET)cp -r \
doc/Makefile \
doc/Doxyfile \
doc/config.mk \
doc/conf.py \
doc/*.rst \
doc/requirements.txt \
doc/api \
doc/configuration \
doc/installation \
doc/man \
doc/usage \
${PROJECT}-${VERSION}/doc
$(QUIET)cp tests/Makefile tests/config.mk tests/*.c \
${PROJECT}-${VERSION}/tests
$(QUIET)cp po/Makefile po/*.po ${PROJECT}-${VERSION}/po
......@@ -170,29 +184,17 @@ po:
update-po:
$(QUIET)${MAKE} -C po update-po
ifneq "$(wildcard ${RSTTOMAN})" ""
%.1 %.5: config.mk
$(QUIET)sed "s/VERSION/${VERSION}/g" < $@.rst > $@.tmp
$(QUIET)${RSTTOMAN} $@.tmp > $@.out.tmp
$(QUIET)mv $@.out.tmp $@
$(QUIET)rm $@.tmp
${PROJECT}.1: ${PROJECT}.1.rst
${PROJECT}rc.5: ${PROJECT}rc.5.rst
build-manpages: ${PROJECT}.1 ${PROJECT}rc.5
else
build-manpages:
endif
$(QUIET)${MAKE} -C doc man
install-manpages: build-manpages
$(ECHO) installing manual pages
$(QUIET)mkdir -m 755 -p ${DESTDIR}${MANPREFIX}/man1 ${DESTDIR}${MANPREFIX}/man5
ifneq "$(wildcard ${PROJECT}.1)" ""
$(QUIET)install -m 644 ${PROJECT}.1 ${DESTDIR}${MANPREFIX}/man1
ifneq "$(wildcard ./doc/_build/man/${PROJECT}.1)" ""
$(QUIET)install -m 644 ./doc/_build/man/${PROJECT}.1 ${DESTDIR}${MANPREFIX}/man1
endif
ifneq "$(wildcard ${PROJECT}rc.5)" ""
$(QUIET)install -m 644 ${PROJECT}rc.5 ${DESTDIR}${MANPREFIX}/man5
ifneq "$(wildcard ./doc/_build/man/${PROJECT}rc.5)" ""
$(QUIET)install -m 644 ./doc/_build/man/${PROJECT}rc.5 ${DESTDIR}${MANPREFIX}/man5
endif
install-headers: ${PROJECT}.pc
......
......@@ -48,9 +48,6 @@ PLUGINDIR ?= ${LIBDIR}/zathura
# locale directory
LOCALEDIR ?= ${PREFIX}/share/locale
# rst2man
RSTTOMAN ?= /usr/bin/rst2man
# libs
GTK_INC ?= $(shell pkg-config --cflags gtk+-3.0)
GTK_LIB ?= $(shell pkg-config --libs gtk+-3.0)
......
......@@ -8,7 +8,7 @@ ifeq ($(shell which $(SPHINX_BIN) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINX_BIN)' command was not found.)
endif
all: init html man
all: html man
init:
$(QUIET)mkdir -p $(SPHINX_BUILDDIR)/
......@@ -22,7 +22,7 @@ html: doxygen
man: doxygen
$(QUIET)$(SPHINX_BIN) -b man $(SPHINX_OPTS) $(SPHINX_BUILDDIR)/man
doxygen:
doxygen: init
$(QUIET)$(DOXYGEN_BIN) Doxyfile
.PHONY: clean html man
......@@ -38,7 +38,8 @@ htmlhelp_basename = 'zathuradoc'
# -- Options for manual page output ---------------------------------------
man_pages = [
('manpage', 'zathura', 'a document viewer', ['pwmt.org'], 1)
('man/zathura.1', 'zathura', 'a document viewer', ['pwmt.org'], 1),
('man/zathurarc.5', 'zathurarc', 'a document viewer', ['pwmt.org'], 5)
]
......
......@@ -20,3 +20,4 @@ Welcome to zathura's documentation!
:hidden:
man/zathura.1
man/zathurarc.5
*****
Usage
*****
.. zathura documentation master file, created by
sphinx-quickstart on Tue Apr 8 18:33:05 2014.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Commandline invocation
======================
Welcome to zathura's documentation!
===================================
.. include:: ../man/_synopsis.txt
.. include:: ../man/_options.txt
.. toctree::
:maxdepth: 2
:numbered:
.. include:: commands.rst
installation/index
usage/index
configuration/index
api/index
faq
.. toctree::
:hidden:
commands
man/zathura.1
man/zathurarc.5
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