From: Pieter Lexis Date: Mon, 28 May 2018 08:20:54 +0000 (+0200) Subject: pdns-builder: Add docs target X-Git-Tag: dnsdist-1.3.3~83^2~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9e4b5717df80b019b429cd44109611c0565dd0c6;p=thirdparty%2Fpdns.git pdns-builder: Add docs target --- diff --git a/builder-support/dockerfiles/Dockerfile.target.docs b/builder-support/dockerfiles/Dockerfile.target.docs new file mode 100644 index 0000000000..bb8b174297 --- /dev/null +++ b/builder-support/dockerfiles/Dockerfile.target.docs @@ -0,0 +1,61 @@ +# Sphinx +FROM ubuntu:bionic as pdns-docs +RUN apt-get update && apt-get -y dist-upgrade && apt-get -y --no-install-recommends install \ + ghostscript \ + git \ + latexmk \ + make \ + python-minimal \ + python2.7 \ + texlive \ + texlive-font-utils \ + texlive-fonts-extra \ + texlive-latex-extra \ + virtualenv + +RUN mkdir -p /pdns /dist /sdist + +ADD builder/helpers/ /pdns/builder/helpers/ + +@IF [ ! -z "$M_authoritative$M_all" ] +ADD docs/ /pdns/docs +@ENDIF + +@IF [ ! -z "$M_recursor$M_all" ] +ADD pdns/recursordist/docs/ /pdns/pdns/recursordist/docs +@ENDIF + +@IF [ ! -z "$M_dnsdist$M_all" ] +ADD pdns/dnsdistdist/docs/ /pdns/pdns/dnsdistdist/docs +@ENDIF + +ARG BUILDER_VERSION +ARG PIP_INDEX_URL +ARG PIP_TRUSTED_HOST + +@IF [ ! -z "$M_authoritative$M_all" ] +WORKDIR /pdns/docs +RUN rm -rf .venv _build +RUN make -f Makefile.sphinx html || (cat /tmp/sphinx-err*; exit 1) +RUN make -f Makefile.sphinx latexpdf || (cat /tmp/sphinx-err*; exit 1) +RUN mkdir -p /dist/auth +RUN cp -R _build/html _build/latex/PowerDNS*.pdf /dist/auth +@ENDIF + +@IF [ ! -z "$M_recursor$M_all" ] +WORKDIR /pdns/pdns/recursordist/docs +RUN rm -rf .venv _build +RUN make -f Makefile.sphinx html || (cat /tmp/sphinx-err*; exit 1) +RUN make -f Makefile.sphinx latexpdf || (cat /tmp/sphinx-err*; exit 1) +RUN mkdir -p /dist/rec +RUN cp -R _build/html _build/latex/PowerDNS*.pdf /dist/rec +@ENDIF + +@IF [ ! -z "$M_dnsdist$M_all" ] +WORKDIR /pdns/pdns/dnsdistdist/docs +RUN rm -rf .venv _build +RUN make -f Makefile.sphinx html || (cat /tmp/sphinx-err*; exit 1) +RUN make -f Makefile.sphinx latexpdf || (cat /tmp/sphinx-err*; exit 1) +RUN mkdir -p /dist/dnsdist +RUN cp -R _build/html _build/latex/dnsdist*.pdf /dist/dnsdist +@ENDIF diff --git a/docs/Makefile.sphinx b/docs/Makefile.sphinx new file mode 100644 index 0000000000..10498de5e8 --- /dev/null +++ b/docs/Makefile.sphinx @@ -0,0 +1,27 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = .venv/bin/sphinx-build +SPHINXPROJ = PowerDNSAuthoritativeServer +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: .venv + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile.sphinx + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile.sphinx .venv + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.venv: + virtualenv .venv + .venv/bin/pip install -U pip setuptools setuptools-git + .venv/bin/pip install -r requirements.txt + + diff --git a/pdns/dnsdistdist/docs/Makefile b/pdns/dnsdistdist/docs/Makefile.sphinx similarity index 65% rename from pdns/dnsdistdist/docs/Makefile rename to pdns/dnsdistdist/docs/Makefile.sphinx index a079506699..4c16b320f3 100644 --- a/pdns/dnsdistdist/docs/Makefile +++ b/pdns/dnsdistdist/docs/Makefile.sphinx @@ -3,23 +3,25 @@ # You can set these variables from the command line. SPHINXOPTS = -SPHINXBUILD = sphinx-build +SPHINXBUILD = .venv/bin/sphinx-build SPHINXPROJ = dnsdist SOURCEDIR = . BUILDDIR = _build # Put it first so that "make" without argument is like "make help". -help: +help: .venv @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -upload: html latexpdf - rsync -r $(BUILDDIR)/html/* mango.plexis.eu:/srv/www/dump.plexis.eu/pdns/dnsdist-docs/html - rsync $(BUILDDIR)/latex/dnsdist.pdf mango.plexis.eu:/srv/www/dump.plexis.eu/pdns/dnsdist-docs - - -.PHONY: help Makefile +.PHONY: help Makefile.sphinx # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile +%: Makefile.sphinx .venv @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.venv: + virtualenv .venv + .venv/bin/pip install -U pip setuptools setuptools-git + .venv/bin/pip install -r requirements.txt + + diff --git a/pdns/recursordist/docs/Makefile.sphinx b/pdns/recursordist/docs/Makefile.sphinx new file mode 100644 index 0000000000..7e5c1f3e9a --- /dev/null +++ b/pdns/recursordist/docs/Makefile.sphinx @@ -0,0 +1,27 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = .venv/bin/sphinx-build +SPHINXPROJ = PowerDNSRecursor +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: .venv + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile.sphinx + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile.sphinx .venv + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.venv: + virtualenv .venv + .venv/bin/pip install -U pip setuptools setuptools-git + .venv/bin/pip install -r requirements.txt + +