]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
pdns-builder: Add docs target
authorPieter Lexis <pieter.lexis@powerdns.com>
Mon, 28 May 2018 08:20:54 +0000 (10:20 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Thu, 27 Sep 2018 11:59:30 +0000 (13:59 +0200)
builder-support/dockerfiles/Dockerfile.target.docs [new file with mode: 0644]
docs/Makefile.sphinx [new file with mode: 0644]
pdns/dnsdistdist/docs/Makefile.sphinx [moved from pdns/dnsdistdist/docs/Makefile with 65% similarity]
pdns/recursordist/docs/Makefile.sphinx [new file with mode: 0644]

diff --git a/builder-support/dockerfiles/Dockerfile.target.docs b/builder-support/dockerfiles/Dockerfile.target.docs
new file mode 100644 (file)
index 0000000..bb8b174
--- /dev/null
@@ -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 (file)
index 0000000..10498de
--- /dev/null
@@ -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
+
+
similarity index 65%
rename from pdns/dnsdistdist/docs/Makefile
rename to pdns/dnsdistdist/docs/Makefile.sphinx
index a0795066998853a8eac3c8d3d9d6e943df46bac6..4c16b320f362d73089a8f4dd088ca50a8e150614 100644 (file)
@@ -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 (file)
index 0000000..7e5c1f3
--- /dev/null
@@ -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
+
+