]> git.proxmox.com Git - pve-docs.git/blobdiff - Makefile
pve-doc-generator: install asciidoc-pve binary
[pve-docs.git] / Makefile
index 18b3ccc99963dbdc497376adacee98f17d861707..61923a8ebf191a5fcfc1ca2acb057efc51125acf 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
 DGDIR=.
+ASCIIDOC_PVE=./asciidoc-pve
 
 include ./pve-doc-generator.mk
 
@@ -7,7 +8,7 @@ DOC_PACKAGE=pve-docs
 MEDIAWIKI_PACKAGE=pve-docs-mediawiki
 
 # also update debian/changelog
-PKGREL=11
+PKGREL=5
 
 GITVERSION:=$(shell cat .git/refs/heads/master)
 
@@ -18,6 +19,7 @@ DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
 MEDIAWIKI_DEB=${MEDIAWIKI_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
 
 CHAPTER_LIST=          \
+       pve-installation        \
        sysadmin        \
        pvecm           \
        pmxcfs          \
@@ -53,7 +55,8 @@ COMMAND_LIST=         \
        pvesm           \
        pveum           \
        vzdump          \
-       ha-manager
+       ha-manager      \
+       pveperf
 
 SERVICE_LIST=          \
        pve-firewall    \
@@ -78,6 +81,7 @@ GEN_DEB_SOURCES=                              \
        pve-storage-iscsi.adoc                  \
        pve-storage-iscsidirect.adoc            \
        pve-storage-lvm.adoc                    \
+       pve-storage-lvmthin.adoc                \
        pve-storage-nfs.adoc                    \
        pve-storage-rbd.adoc                    \
        pve-storage-zfspool.adoc                \
@@ -98,12 +102,16 @@ GEN_SCRIPTS=                                       \
        gen-pve-firewall-rules-opts.pl          \
        gen-pve-firewall-vm-opts.pl
 
+INSTALLATION_SOURCES=                          \
+       pve-usbstick.adoc                       \
+       pve-system-requirements.adoc            \
+       pve-installation.adoc
+
 SYSADMIN_PARTS=                                        \
-       getting-help                            \
        pve-network                             \
        pve-package-repos                       \
-       pve-installation                        \
        system-software-updates                 \
+       pve-disk-health-monitoring              \
        local-lvm                               \
        local-zfs
 
@@ -122,6 +130,8 @@ PVE_ADMIN_GUIDE_SOURCES=                    \
        ${SYSADMIN_SOURCES}                     \
        pve-admin-guide.adoc                    \
        pve-intro.adoc                          \
+       getting-help.adoc                       \
+       ${INSTALLATION_SOURCES}                 \
        pmxcfs.adoc                             \
        pmxcfs.8-cli.adoc                       \
        pve-faq.adoc                            \
@@ -143,6 +153,7 @@ PVE_ADMIN_GUIDE_SOURCES=                    \
        ${PVEAM_MAN1_SOURCES}                   \
        ${PVESUBSCRIPTION_MAN1_SOURCES}         \
        ${PVECEPH_MAN1_SOURCES}                 \
+       ${PVEPERF_MAN1_SOURCES}                 \
        pve-bibliography.adoc                   \
        $(addsuffix .adoc, ${COMMAND_LIST})     \
        $(addsuffix .adoc, ${SERVICE_LIST})     \
@@ -150,9 +161,26 @@ PVE_ADMIN_GUIDE_SOURCES=                   \
        GFDL.adoc                               \
        attributes.txt
 
+link-refs.json: scan-adoc-refs ${PVE_ADMIN_GUIDE_SOURCES}
+       ./scan-adoc-refs ${PVE_ADMIN_GUIDE_SOURCES} >link-refs.json
+
+asciidoc-pve: asciidoc-pve.in link-refs.json
+       cat asciidoc-pve.in link-refs.json >asciidoc-pve.tmp
+       sed -e s/@RELEASE@/${DOCRELEASE}/ -i asciidoc-pve.tmp
+       chmod +x asciidoc-pve.tmp
+       mv asciidoc-pve.tmp asciidoc-pve
+
+pve-docs-mediawiki-import: pve-docs-mediawiki-import.in link-refs.json
+       cat pve-docs-mediawiki-import.in link-refs.json >  pve-docs-mediawiki-import.tmp
+       chmod +x pve-docs-mediawiki-import.tmp
+       mv pve-docs-mediawiki-import.tmp pve-docs-mediawiki-import
+
 WIKI_IMPORTS=                                                                  \
-       $(addsuffix -plain.html, $(addprefix sysadmin-, ${SYSADMIN_PARTS}))     \
-       $(addsuffix -plain.html, $(addprefix chapter-, ${CHAPTER_LIST}))        \
+       pve-usbstick-plain.html                                                 \
+       getting-help-plain.html                                                 \
+       pve-system-requirements-plain.html                                      \
+       $(addsuffix -plain.html, ${SYSADMIN_PARTS})                             \
+       $(addsuffix -plain.html, ${CHAPTER_LIST})                               \
        $(addsuffix .5-plain.html, ${CONFIG_LIST})                              \
        $(addsuffix -plain.html, $(addprefix pve-storage-, ${STORAGE_TYPES}))
 
@@ -177,22 +205,16 @@ all: index.html
 %-nwdiag.svg: %.nwdiag
        nwdiag -T svg $*.nwdiag -o $@;
 
-sysadmin-%-plain.html: %.adoc
-       asciidoc -s -a wiki -a 'leveloffset=-1' ${ADOC_STDARG} -o $@ $*.adoc
-
-chapter-sysadmin.html chapter-sysadmin-plain.html: ${SYSADMIN_SOURCES}
-
-chapter-%.html: %.adoc ${PVE_COMMON_DOC_SOURCES}
-       asciidoc ${ADOC_STDARG} -a toc -o $@ $*.adoc
+%-plain.html: asciidoc-pve %.adoc
+       ./asciidoc-pve compile-wiki -o $@ $*.adoc
 
-chapter-%-plain.html: %.adoc ${PVE_COMMON_DOC_SOURCES}
-       asciidoc -s -a wiki ${ADOC_STDARG} -o $@ $*.adoc
+chapter-sysadmin.html sysadmin-plain.html: ${SYSADMIN_SOURCES}
 
-pve-storage-%-plain.html: pve-storage-%.adoc ${PVE_COMMON_DOC_SOURCES}
-       asciidoc -s -a wiki -a 'leveloffset=-1' ${ADOC_STDARG} -o $@ pve-storage-$*.adoc
+chapter-%.html: %.adoc asciidoc-pve ${PVE_COMMON_DOC_SOURCES}
+       ./asciidoc-pve compile-chapter -o $@ $*.adoc
 
-%.1.html: %.adoc %.1-synopsis.adoc ${PVE_COMMON_DOC_SOURCES}
-       asciidoc ${ADOC_MAN1_HTML_ARGS} -o $@ $*.adoc
+%.1.html: %.adoc %.1-synopsis.adoc asciidoc-pve ${PVE_COMMON_DOC_SOURCES}
+       ./asciidoc-pve compile-man-html -o $@ $*.adoc
 
 pmxcfs.8.html: pmxcfs.adoc pmxcfs.8-cli.adoc ${PVE_COMMON_DOC_SOURCES}
        asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ pmxcfs.adoc
@@ -217,15 +239,18 @@ index.html: index.adoc ${API_VIEWER_SOURCES} ${INDEX_INCLUDES}
        asciidoc -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}" index.adoc
 
 pve-admin-guide.html: ${PVE_ADMIN_GUIDE_SOURCES}
-       asciidoc -a "revnumber=${DOCRELEASE}" -a "date=$(shell date)" pve-admin-guide.adoc
+       asciidoc -a pvelogo -a "revnumber=${DOCRELEASE}" -a "date=$(shell date)" pve-admin-guide.adoc
 
 pve-admin-guide.chunked: ${PVE_ADMIN_GUIDE_SOURCES}
        rm -rf pve-admin-guide.chunked
        a2x -a docinfo -a docinfo1 -a icons -f chunked pve-admin-guide.adoc
 
 pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_SOURCES} docinfo.xml pve-admin-guide-docinfo.xml
+       inkscape -z -D --export-pdf=proxmox-logo.pdf images/proxmox-logo.svg
+       inkscape -z -D --export-pdf=proxmox-ci-header.pdf images/proxmox-ci-header.svg
        grep ">Release ${DOCRELEASE}<" pve-admin-guide-docinfo.xml || (echo "wrong release in  pve-admin-guide-docinfo.xml" && false);
-       a2x -a docinfo -a docinfo1 -f pdf -L --dblatex-opts "-P latex.output.revhistory=0" --dblatex-opts "-P latex.class.options=12pt" --dblatex-opts "-P doc.section.depth=2 -P toc.section.depth=2" pve-admin-guide.adoc
+       a2x -a docinfo -a docinfo1 -f pdf -L --dblatex-opts "-P latex.output.revhistory=0" --dblatex-opts "-P latex.class.options=12pt" --dblatex-opts "-P doc.section.depth=2 -P toc.section.depth=2" --dblatex-opts "-P doc.publisher.show=0 -s asciidoc-dblatex-custom.sty" pve-admin-guide.adoc
+       rm proxmox-logo.pdf proxmox-ci-header.pdf
 
 pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_SOURCES}
        a2x -f epub pve-admin-guide.adoc
@@ -245,16 +270,19 @@ deb:
        rm -f ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB};
        make ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB};
 
-${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}: index.html ${INDEX_INCLUDES} ${WIKI_IMPORTS} ${API_VIEWER_SOURCES} ${GEN_DEB_SOURCES}
+${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}: index.html ${INDEX_INCLUDES} ${WIKI_IMPORTS} ${API_VIEWER_SOURCES} ${GEN_DEB_SOURCES} asciidoc-pve pve-docs-mediawiki-import
        rm -rf build
        mkdir build
        rsync -a debian/ build/debian
+       cp pve-docs-mediawiki-import build/debian/tree/pve-docs-mediawiki/pve-docs-mediawiki-import
        echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
        # install files for pve-doc-generator package
        mkdir -p build/usr/share/${GEN_PACKAGE}
        mkdir -p build/usr/share/doc/${GEN_PACKAGE}
+       mkdir -p build/usr/bin
        install -m 0644 ${GEN_DEB_SOURCES} build/usr/share/${GEN_PACKAGE}
        install -m 0755 ${GEN_SCRIPTS} build/usr/share/${GEN_PACKAGE}
+       install -m 0755 asciidoc-pve build/usr/bin/
        # install files for pvedocs package
        mkdir -p build/usr/share/${DOC_PACKAGE}
        mkdir -p build/usr/share/doc/${DOC_PACKAGE}
@@ -281,5 +309,5 @@ update: clean
        make all
 
 clean: 
-       rm -rf *.tmp.xml *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build api-viewer/apidoc.js chapter-*.html chapter-*-plain.html chapter-*.html pve-admin-guide.chunked
+       rm -rf *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build api-viewer/apidoc.js chapter-*.html *-plain.html chapter-*.html pve-admin-guide.chunked asciidoc-pve link-refs.json .asciidoc-pve-tmp_* pve-docs-mediawiki-import
        find . -name '*~' -exec rm {} ';'