From 9015f48fde081cf3077177712de417efdbbc40ce Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 29 Apr 2016 11:22:28 +0200 Subject: [PATCH] add new package to ship compiled docs --- Makefile | 64 ++++++++++++++++++++++++++++++---------- doc-debian/changelog | 6 ++++ doc-debian/compat | 1 + doc-debian/control | 14 +++++++++ doc-debian/copyright | 34 +++++++++++++++++++++ doc-debian/install | 1 + doc-debian/pve-docs.conf | 7 +++++ doc-debian/rules | 11 +++++++ 8 files changed, 123 insertions(+), 15 deletions(-) create mode 100644 doc-debian/changelog create mode 100644 doc-debian/compat create mode 100644 doc-debian/control create mode 100644 doc-debian/copyright create mode 100644 doc-debian/install create mode 100644 doc-debian/pve-docs.conf create mode 100755 doc-debian/rules diff --git a/Makefile b/Makefile index 7590df3..840d1a2 100644 --- a/Makefile +++ b/Makefile @@ -2,14 +2,16 @@ DGDIR=. include ./pve-doc-generator.mk -PACKAGE=pve-doc-generator +GEN_PACKAGE=pve-doc-generator +DOC_PACKAGE=pve-docs # also update debian/changelog PKGREL=1 GITVERSION:=$(shell cat .git/refs/heads/master) -DEB=${PACKAGE}_${DOCRELEASE}-${PKGREL}_amd64.deb +GEN_DEB=${GEN_PACKAGE}_${DOCRELEASE}-${PKGREL}_amd64.deb +DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb COMMAND_LIST= \ pvesubscription \ @@ -36,7 +38,7 @@ SERVICE_LIST= \ CONFIG_LIST=datacenter.cfg qm.conf pct.conf -DEB_SOURCES= \ +GEN_DEB_SOURCES= \ pve-doc-generator.mk \ attributes.txt \ $(addsuffix .adoc, ${COMMAND_LIST}) \ @@ -158,29 +160,61 @@ pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_SOURCES} test -n "$${NOVIEW}" || $(BROWSER) $@ & .PHONY: dinstall -dinstall: ${DEB} - dpkg -i ${DEB} +dinstall: ${GEN_DEB} + dpkg -i ${GEN_DEB} + .PHONY: deb -${DEB} deb: ${DEB_SOURCES} +deb: + rm -f ${GEN_DEB} ${DOC_DEB}; + make ${GEN_DEB}; + make ${DOC_DEB}; + +DOC_DEB_FILES= \ + $(addsuffix .1.html, ${COMMAND_LIST}) \ + $(addsuffix .8.html, ${SERVICE_LIST}) \ + $(addsuffix .5.html, ${CONFIG_LIST}) \ + pve-admin-guide.pdf \ + pve-admin-guide.html \ + pve-admin-guide.epub \ + index.html + +${DOC_DEB}: index.adoc ${PVE_ADMIN_GUIDE_SOURCES} + $(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} + install -m 0644 index.html build/usr/share/${DOC_PACKAGE} + cd build; dpkg-buildpackage -rfakeroot -b -us -uc + lintian ${DOC_DEB} + +${GEN_DEB}: ${GEN_DEB_SOURCES} rm -rf build mkdir build rsync -a debian/ build/debian - mkdir -p build/usr/share/${PACKAGE} - mkdir -p build/usr/share/doc/${PACKAGE} - echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build/usr/share/doc/${PACKAGE}/SOURCE - install -m 0644 ${DEB_SOURCES} build/usr/share/${PACKAGE} - install -m 0755 ${GEN_SCRIPTS} build/usr/share/${PACKAGE} + 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} cd build; dpkg-buildpackage -rfakeroot -b -us -uc - lintian ${DEB} + lintian ${GEN_DEB} .PHONY: upload -upload: ${DEB} +upload: ${GEN_DEB} ${DOC_DEB} umount /pve/${DOCRELEASE}; mount /pve/${DOCRELEASE} -o rw mkdir -p /pve/${DOCRELEASE}/extra - rm -f /pve/${DOCRELEASE}/extra/${PACKAGE}_*.deb + rm -f /pve/${DOCRELEASE}/extra/${GEN_PACKAGE}_*.deb + rm -f /pve/${DOCRELEASE}/extra/${DOC_PACKAGE}_*.deb rm -f /pve/${DOCRELEASE}/extra/Packages* - cp ${DEB} /pve/${DOCRELEASE}/extra + cp ${GEN_DEB} ${DOC_DEB} /pve/${DOCRELEASE}/extra cd /pve/${DOCRELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz umount /pve/${DOCRELEASE}; mount /pve/${DOCRELEASE} -o ro diff --git a/doc-debian/changelog b/doc-debian/changelog new file mode 100644 index 0000000..c06d77e --- /dev/null +++ b/doc-debian/changelog @@ -0,0 +1,6 @@ +pve-docs (4.2-1) unstable; urgency=medium + + * first release + + -- Proxmox Support Team Fri, 29 Apr 2016 10:01:01 +0200 + diff --git a/doc-debian/compat b/doc-debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/doc-debian/compat @@ -0,0 +1 @@ +9 diff --git a/doc-debian/control b/doc-debian/control new file mode 100644 index 0000000..3ffa04c --- /dev/null +++ b/doc-debian/control @@ -0,0 +1,14 @@ +Source: pve-docs +Section: perl +Priority: extra +Maintainer: Proxmox Support Team +Build-Depends: debhelper (>= 7.0.50~), lintian +Standards-Version: 3.8.4 + +Package: pve-docs +Section: doc +Priority: optional +Architecture: all +Depends: apache2 +Description: Proxmox VE Documentation + This package contains the Proxmox VE Documentation files. diff --git a/doc-debian/copyright b/doc-debian/copyright new file mode 100644 index 0000000..1b44193 --- /dev/null +++ b/doc-debian/copyright @@ -0,0 +1,34 @@ +Coryright for files in debian/*: + + Copyright (C) 2016 Proxmox Server Solutions GmbH + + This software is written by Proxmox Server Solutions GmbH + + + This program is free software: you can redistribute it and/or + modify it under the terms of the GNU Affero General Public License + as published by the Free Software Foundation, either version 3 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public + License along with this program. If not, see + . + + +All documentation files (*.adoc, *.html, *.pdf) are release under: + + Copyright (C) 2016 Proxmox Server Solutions GmbH + + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled "GNU + Free Documentation License". + + You can find a copy of the license in /usr/share/common-licenses/GFDL. \ No newline at end of file diff --git a/doc-debian/install b/doc-debian/install new file mode 100644 index 0000000..1412e51 --- /dev/null +++ b/doc-debian/install @@ -0,0 +1 @@ +/usr/share/ diff --git a/doc-debian/pve-docs.conf b/doc-debian/pve-docs.conf new file mode 100644 index 0000000..2b9b8e1 --- /dev/null +++ b/doc-debian/pve-docs.conf @@ -0,0 +1,7 @@ + + AllowOverride None + Order allow,deny + allow from all + + +Alias /pve-docs /usr/share/pve-docs/ diff --git a/doc-debian/rules b/doc-debian/rules new file mode 100755 index 0000000..e6f2769 --- /dev/null +++ b/doc-debian/rules @@ -0,0 +1,11 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + dh $@ + +override_dh_install: + dh_install + install -D -m 0644 debian/pve-docs.conf $(destdir)/etc/apache2/sites-available/pve-docs.conf -- 2.39.2