2016-04-06 10:35:58 +02:00
DGDIR = .
i n c l u d e . / p v e - d o c - g e n e r a t o r . m k
2016-01-05 11:20:35 +01:00
2016-04-29 11:22:28 +02:00
GEN_PACKAGE = pve-doc-generator
DOC_PACKAGE = pve-docs
2016-04-06 09:38:55 +02:00
# also update debian/changelog
2016-04-29 14:39:02 +02:00
GEN_PKGREL = 1
# also update doc-debian/changelog
DOC_PKGREL = 2
2016-04-06 09:38:55 +02:00
2016-04-07 12:19:44 +02:00
GITVERSION := $( shell cat .git/refs/heads/master)
2016-04-29 14:39:02 +02:00
GEN_DEB = ${ GEN_PACKAGE } _${ DOCRELEASE } -${ GEN_PKGREL } _amd64.deb
DOC_DEB = ${ DOC_PACKAGE } _${ DOCRELEASE } -${ DOC_PKGREL } _all.deb
2016-04-06 09:38:55 +02:00
2016-04-29 20:01:12 +02:00
CHAPTER_LIST = \
sysadmin \
pvecm \
pmxcfs \
pvesm \
qm \
pve-firewall \
pveum \
pct \
ha-manager \
vzdump \
pve-faq \
pve-bibliography
2016-04-10 15:13:59 +02:00
COMMAND_LIST = \
pvesubscription \
pvecm \
qm \
qmrestore \
2016-04-10 15:39:35 +02:00
pveceph \
2016-04-10 15:13:59 +02:00
pct \
pveam \
pvesm \
pveum \
vzdump \
ha-manager
2016-04-09 11:05:23 +02:00
2016-04-10 10:33:40 +02:00
SERVICE_LIST = \
pve-firewall \
pve-ha-crm \
pve-ha-lrm \
pvestatd \
pmxcfs \
pveproxy \
2016-04-10 14:35:23 +02:00
spiceproxy \
2016-04-10 10:33:40 +02:00
pvedaemon
2016-04-09 11:05:23 +02:00
CONFIG_LIST = datacenter.cfg qm.conf pct.conf
2016-04-29 11:22:28 +02:00
GEN_DEB_SOURCES = \
2016-04-09 11:05:23 +02:00
pve-doc-generator.mk \
attributes.txt \
$( addsuffix .adoc, ${ COMMAND_LIST } ) \
$( addsuffix .adoc, ${ SERVICE_LIST } ) \
$( addsuffix .adoc, ${ CONFIG_LIST } ) \
pve-storage-dir.adoc \
pve-storage-glusterfs.adoc \
pve-storage-iscsi.adoc \
pve-storage-iscsidirect.adoc \
pve-storage-lvm.adoc \
pve-storage-nfs.adoc \
pve-storage-rbd.adoc \
pve-storage-zfspool.adoc \
2016-04-09 13:28:57 +02:00
pmxcfs.8-cli.adoc \
2016-04-09 11:05:23 +02:00
pve-copyright.adoc \
2016-04-06 09:38:55 +02:00
docinfo.xml
GEN_SCRIPTS = \
2016-04-06 12:31:14 +02:00
gen-datacenter.cfg.5-opts.pl \
gen-pct.conf.5-opts.pl \
2016-04-09 09:46:54 +02:00
gen-qm.conf.5-opts.pl \
2016-04-14 12:51:38 +02:00
gen-vzdump.conf.5-opts.pl \
2016-04-06 09:38:55 +02:00
gen-pve-firewall-cluster-opts.pl \
gen-pve-firewall-host-opts.pl \
gen-pve-firewall-macros-adoc.pl \
gen-pve-firewall-rules-opts.pl \
2016-04-06 12:31:14 +02:00
gen-pve-firewall-vm-opts.pl
2016-04-06 09:38:55 +02:00
2016-04-09 11:05:23 +02:00
SYSADMIN_SOURCES = \
getting-help.adoc \
pve-package-repos.adoc \
pve-installation.adoc \
system-software-updates.adoc \
2016-01-19 17:03:26 +01:00
sysadmin.adoc
2016-04-29 14:13:12 +02:00
API_VIEWER_SOURCES = \
api-viewer/index.html \
api-viewer/apidoc.js
2016-04-09 11:05:23 +02:00
PVE_ADMIN_GUIDE_SOURCES = \
${ DATACENTER_CONF_MAN5_SOURCES } \
${ QM_CONF_MAN5_SOURCES } \
${ PCT_CONF_MAN5_SOURCES } \
${ SYSADMIN_SOURCES } \
pve-admin-guide.adoc \
pve-intro.adoc \
pmxcfs.adoc \
2016-04-09 13:28:57 +02:00
pmxcfs.8-cli.adoc \
2016-04-09 11:05:23 +02:00
pve-faq.adoc \
${ PVE_FIREWALL_MAN8_SOURCES } \
${ PVESM_MAN1_SOURCES } \
${ PCT_MAN1_SOURCES } \
${ PVECM_MAN1_SOURCES } \
${ PVEUM_MAN1_SOURCES } \
${ QM_MAN1_SOURCES } \
${ QMRESTORE_MAN1_SOURCES } \
${ HA_MANAGER_MAN1_SOURCES } \
2016-04-10 14:35:23 +02:00
${ PVESTATD_MAN8_SOURCES } \
${ PVEDAEMON_MAN8_SOURCES } \
${ PVEPROXY_MAN8_SOURCES } \
${ SPICEPROXY_MAN8_SOURCES } \
2016-04-09 11:05:23 +02:00
${ PVE_HA_CRM_MAN8_SOURCES } \
${ PVE_HA_LRM_MAN8_SOURCES } \
2016-04-10 15:00:38 +02:00
${ VZDUMP_MAN1_SOURCES } \
${ PVEAM_MAN1_SOURCES } \
2016-04-10 15:13:59 +02:00
${ PVESUBSCRIPTION_MAN1_SOURCES } \
2016-04-10 15:39:35 +02:00
${ PVECEPH_MAN1_SOURCES } \
2016-04-09 11:05:23 +02:00
images/cluster-nwdiag.svg \
images/node-nwdiag.svg \
pve-bibliography.adoc \
$( addsuffix .adoc, ${ COMMAND_LIST } ) \
$( addsuffix .adoc, ${ SERVICE_LIST } ) \
$( addsuffix .adoc, ${ CONFIG_LIST } ) \
GFDL.adoc \
2016-01-05 11:20:35 +01:00
attributes.txt
ADOC_STDARG = -a icons -a data-uri -a " date= $( shell date) "
2016-04-06 10:35:58 +02:00
ADOC_MAN1_HTML_ARGS = -a "manvolnum=1" ${ ADOC_STDARG } -a " revnumber= ${ DOCRELEASE } "
ADOC_MAN5_HTML_ARGS = -a "manvolnum=5" ${ ADOC_STDARG } -a " revnumber= ${ DOCRELEASE } "
ADOC_MAN8_HTML_ARGS = -a "manvolnum=8" ${ ADOC_STDARG } -a " revnumber= ${ DOCRELEASE } "
2016-01-05 11:20:35 +01:00
2016-03-03 10:01:14 +01:00
BROWSER ?= xdg-open
2016-01-23 10:01:28 +01:00
2016-03-23 10:31:15 +01:00
all : pve -admin -guide .html
2016-01-05 11:20:35 +01:00
%-nwdiag.svg : %.nwdiag
nwdiag -T svg $* .nwdiag -o $@ ;
2016-04-29 20:01:12 +02:00
chapter-%.html : %.adoc ${PVE_COMMON_DOC_SOURCES }
asciidoc ${ ADOC_STDARG } -o $@ $* .adoc
test -n " $$ {NOVIEW} " || $( BROWSER) $@ &
2016-04-09 13:28:57 +02:00
%.1.html : %.adoc %.1-synopsis .adoc ${PVE_COMMON_DOC_SOURCES }
2016-01-05 11:20:35 +01:00
asciidoc ${ ADOC_MAN1_HTML_ARGS } -o $@ $* .adoc
2016-04-06 09:38:55 +02:00
test -n " $$ {NOVIEW} " || $( BROWSER) $@ &
2016-01-05 11:20:35 +01:00
2016-04-09 13:40:31 +02:00
pmxcfs.8.html : pmxcfs .adoc pmxcfs .8-cli .adoc ${PVE_COMMON_DOC_SOURCES }
asciidoc ${ ADOC_MAN8_HTML_ARGS } -o $@ pmxcfs.adoc
test -n " $$ {NOVIEW} " || $( BROWSER) $@ &
2016-01-05 11:20:35 +01:00
2016-04-09 13:40:31 +02:00
%.8.html : %.adoc %.8-synopsis .adoc ${PVE_COMMON_DOC_SOURCES }
2016-01-05 11:20:35 +01:00
asciidoc ${ ADOC_MAN8_HTML_ARGS } -o $@ $* .adoc
2016-04-06 09:38:55 +02:00
test -n " $$ {NOVIEW} " || $( BROWSER) $@ &
2016-03-23 10:51:03 +01:00
2016-04-09 13:40:31 +02:00
%.5.html : %.adoc %.5-opts .adoc ${PVE_COMMON_DOC_SOURCES }
2016-03-23 07:32:27 +01:00
asciidoc ${ ADOC_MAN5_HTML_ARGS } -o $@ $* .adoc
2016-04-06 09:38:55 +02:00
test -n " $$ {NOVIEW} " || $( BROWSER) $@ &
2016-03-23 07:32:27 +01:00
2016-04-29 14:13:12 +02:00
index.html : index .adoc ${PVE_ADMIN_GUIDE_SOURCES } ${API_VIEWER_SOURCES }
2016-01-05 11:20:35 +01:00
$( MAKE) NOVIEW = 1 pve-admin-guide.pdf pve-admin-guide.html pve-admin-guide.epub
2016-04-09 11:05:23 +02:00
$( MAKE) NOVIEW = 1 $( addsuffix .1.html, ${ COMMAND_LIST } ) $( addsuffix .8.html, ${ SERVICE_LIST } ) $( addsuffix .5.html, ${ CONFIG_LIST } )
2016-04-29 20:01:12 +02:00
$( MAKE) NOVIEW = 1 $( addsuffix .html, $( addprefix chapter-, ${ CHAPTER_LIST } ) )
2016-04-06 10:35:58 +02:00
asciidoc -a " date= $( shell date) " -a " revnumber= ${ DOCRELEASE } " index.adoc
2016-04-06 09:38:55 +02:00
test -n " $$ {NOVIEW} " || $( BROWSER) index.html &
2016-01-05 11:20:35 +01:00
pve-admin-guide.html : ${PVE_ADMIN_GUIDE_SOURCES }
2016-04-06 10:35:58 +02:00
asciidoc -a " revnumber= ${ DOCRELEASE } " -a " date= $( shell date) " pve-admin-guide.adoc
2016-04-06 09:38:55 +02:00
test -n " $$ {NOVIEW} " || $( BROWSER) $@ &
2016-01-05 11:20:35 +01:00
2016-04-29 18:16:33 +02:00
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
test -n " $$ {NOVIEW} " || $( BROWSER) $@ /index.html &
2016-01-05 17:36:56 +01:00
pve-admin-guide.pdf : ${PVE_ADMIN_GUIDE_SOURCES } docinfo .xml pve -admin -guide -docinfo .xml
2016-04-06 10:35:58 +02:00
grep " >Release ${ DOCRELEASE } < " pve-admin-guide-docinfo.xml || ( echo "wrong release in pve-admin-guide-docinfo.xml" && false ) ;
2016-04-02 12:59:13 +02:00
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
2016-04-06 09:38:55 +02:00
test -n " $$ {NOVIEW} " || $( BROWSER) $@ &
2016-01-05 11:20:35 +01:00
pve-admin-guide.epub : ${PVE_ADMIN_GUIDE_SOURCES }
a2x -f epub pve-admin-guide.adoc
2016-04-06 09:38:55 +02:00
test -n " $$ {NOVIEW} " || $( BROWSER) $@ &
2016-04-29 14:13:12 +02:00
api-viewer/apidata.js : extractapi .pl
2016-04-29 12:22:23 +02:00
./extractapi.pl >$@
2016-04-29 14:13:12 +02:00
api-viewer/apidoc.js : api -viewer /apidata .js api -viewer /PVEAPI .js
cat api-viewer/apidata.js api-viewer/PVEAPI.js >$@
2016-04-29 12:22:23 +02:00
2016-04-06 09:38:55 +02:00
.PHONY : dinstall
2016-04-29 14:33:58 +02:00
dinstall : ${GEN_DEB } ${DOC_DEB }
dpkg -i ${ GEN_DEB } ${ DOC_DEB }
2016-04-29 11:22:28 +02:00
2016-04-06 09:38:55 +02:00
.PHONY : deb
2016-04-29 11:22:28 +02:00
deb :
rm -f ${ GEN_DEB } ${ DOC_DEB } ;
make ${ GEN_DEB } ;
make ${ DOC_DEB } ;
2016-04-29 20:01:12 +02:00
DOC_DEB_FILES = \
$( addsuffix .html, $( addprefix chapter-, ${ CHAPTER_LIST } ) ) \
$( addsuffix .1.html, ${ COMMAND_LIST } ) \
$( addsuffix .8.html, ${ SERVICE_LIST } ) \
$( addsuffix .5.html, ${ CONFIG_LIST } ) \
2016-04-29 11:22:28 +02:00
pve-admin-guide.pdf \
pve-admin-guide.html \
pve-admin-guide.epub \
index.html
2016-04-29 14:13:12 +02:00
${DOC_DEB} : index .adoc ${PVE_ADMIN_GUIDE_SOURCES } ${API_VIEWER_SOURCES }
2016-04-29 11:22:28 +02:00
$( MAKE) NOVIEW = 1 pve-admin-guide.pdf pve-admin-guide.html pve-admin-guide.epub
$( MAKE) NOVIEW = 1 $( addsuffix .1.html, ${ COMMAND_LIST } ) $( addsuffix .8.html, ${ SERVICE_LIST } ) $( addsuffix .5.html, ${ CONFIG_LIST } )
asciidoc -a " date= $( shell date) " -a " revnumber= ${ DOCRELEASE } " index.adoc
rm -rf build
mkdir build
rsync -a doc-debian/ build/debian
mkdir -p build/usr/share/${ DOC_PACKAGE }
mkdir -p build/usr/share/doc/${ DOC_PACKAGE }
echo " git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${ GITVERSION } " > build/usr/share/doc/${ DOC_PACKAGE } /SOURCE
# install doc files
install -m 0644 ${ DOC_DEB_FILES } build/usr/share/${ DOC_PACKAGE }
2016-04-29 12:22:23 +02:00
# install api doc viewer
2016-04-29 14:13:12 +02:00
mkdir build/usr/share/${ DOC_PACKAGE } /api-viewer
install -m 0644 ${ API_VIEWER_SOURCES } build/usr/share/${ DOC_PACKAGE } /api-viewer
2016-04-29 11:22:28 +02:00
cd build; dpkg-buildpackage -rfakeroot -b -us -uc
lintian ${ DOC_DEB }
${GEN_DEB} : ${GEN_DEB_SOURCES }
2016-04-06 09:38:55 +02:00
rm -rf build
mkdir build
rsync -a debian/ build/debian
2016-04-29 11:22:28 +02:00
mkdir -p build/usr/share/${ GEN_PACKAGE }
mkdir -p build/usr/share/doc/${ GEN_PACKAGE }
echo " git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${ GITVERSION } " > build/usr/share/doc/${ GEN_PACKAGE } /SOURCE
install -m 0644 ${ GEN_DEB_SOURCES } build/usr/share/${ GEN_PACKAGE }
install -m 0755 ${ GEN_SCRIPTS } build/usr/share/${ GEN_PACKAGE }
2016-04-06 09:38:55 +02:00
cd build; dpkg-buildpackage -rfakeroot -b -us -uc
2016-04-29 11:22:28 +02:00
lintian ${ GEN_DEB }
2016-04-06 09:38:55 +02:00
2016-04-06 10:45:54 +02:00
.PHONY : upload
2016-04-29 11:22:28 +02:00
upload : ${GEN_DEB } ${DOC_DEB }
2016-04-06 10:45:54 +02:00
umount /pve/${ DOCRELEASE } ; mount /pve/${ DOCRELEASE } -o rw
mkdir -p /pve/${ DOCRELEASE } /extra
2016-04-29 11:22:28 +02:00
rm -f /pve/${ DOCRELEASE } /extra/${ GEN_PACKAGE } _*.deb
rm -f /pve/${ DOCRELEASE } /extra/${ DOC_PACKAGE } _*.deb
2016-04-06 10:45:54 +02:00
rm -f /pve/${ DOCRELEASE } /extra/Packages*
2016-04-29 11:22:28 +02:00
cp ${ GEN_DEB } ${ DOC_DEB } /pve/${ DOCRELEASE } /extra
2016-04-06 10:45:54 +02:00
cd /pve/${ DOCRELEASE } /extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
umount /pve/${ DOCRELEASE } ; mount /pve/${ DOCRELEASE } -o ro
2016-01-05 11:20:35 +01:00
2016-03-23 07:32:27 +01:00
update : clean
rm -f *.5-opts.adoc .1-synopsis.adoc .8-synopsis.adoc
make all
2016-01-05 11:20:35 +01:00
clean :
2016-04-29 20:01:12 +02:00
rm -rf *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build api-viewer/apidata.js api-viewer/apidoc.js chapter-*.html pve-admin-guide.chunked
2016-04-29 14:45:54 +02:00
find . -name '*~' -exec rm { } ';'
2016-04-06 09:38:55 +02:00