build: refactor build process

build packages in one go by moving individual .deb targets into install
targets called by dpkg-buildpackage.

all three binary packages are bootstrappable on a straight Debian host,
so there is no need to call dpkg-buildpackage separately for each of
them.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2018-09-12 19:41:53 +02:00 committed by Dietmar Maurer
parent 59b586cb29
commit fa764571f6
8 changed files with 76 additions and 81 deletions

View File

@ -15,7 +15,6 @@ ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
GEN_DEB=${GEN_PACKAGE}_${DOCRELEASE}-${PKGREL}_${ARCH}.deb GEN_DEB=${GEN_PACKAGE}_${DOCRELEASE}-${PKGREL}_${ARCH}.deb
DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
MEDIAWIKI_DEB=${MEDIAWIKI_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb MEDIAWIKI_DEB=${MEDIAWIKI_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
DOC_BUILDDEPS := asciidoc-dblatex, source-highlight, librsvg2-bin
export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp) export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
SOURCE_DATE_HUMAN := $(shell date -d "@${SOURCE_DATE_EPOCH}") SOURCE_DATE_HUMAN := $(shell date -d "@${SOURCE_DATE_EPOCH}")
@ -149,73 +148,63 @@ dinstall: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}
dpkg -i ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} dpkg -i ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}
.PHONY: deb .PHONY: deb
deb: deb: $(DOC_DEB)
$(MEDIAWIKI_DEB) $(GEN_DEB): $(DOC_DEB)
$(DOC_DEB):
rm -f ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} rm -f ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}
make all-debs rm -rf build
rsync -a * build/
.PHONY: all-debs echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
all-debs: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} cd build; dpkg-buildpackage -b -us -uc
lintian $(DOC_DEB) $(GEN_DEB) $(MEDIAWIKI_DEB)
.PHONY: clean-build .PHONY: clean-build
clean-build: clean-build:
rm -rf build rm -rf build
define prepare_build .PHONY: install
rm -rf build-$1 install: gen-install doc-install mediawiki-install
mkdir build-$1
cp -a debian build-$1/debian
mv build-$1/debian/control.in build-$1/debian/control
echo >> build-$1/debian/control
cat debian/$1.control >> build-$1/debian/control
echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build-$1/debian/SOURCE
install -dm755 build-$1/usr/share/$1
install -dm755 build-$1/usr/share/doc/$1
endef
.PHONY: gen-deb .PHONY: gen-install
gen-deb: $(GEN_DEB) gen-install: $(GEN_DEB_SOURCES) asciidoc-pve asciidoc/mediawiki.conf
$(GEN_DEB): $(GEN_DEB_SOURCES) asciidoc-pve asciidoc/mediawiki.conf install -dm755 $(DESTDIR)/usr/share/$(GEN_PACKAGE)
$(call prepare_build,$(GEN_PACKAGE)) install -dm755 $(DESTDIR)/usr/share/doc/$(GEN_PACKAGE)
install -dm755 build-$(GEN_PACKAGE)/usr/bin install -dm755 $(DESTDIR)/usr/bin
# install files # install files
install -m 0644 ${GEN_DEB_SOURCES} build-$(GEN_PACKAGE)/usr/share/${GEN_PACKAGE} install -m 0644 ${GEN_DEB_SOURCES} $(DESTDIR)/usr/share/${GEN_PACKAGE}
install -m 0755 ${GEN_SCRIPTS} build-$(GEN_PACKAGE)/usr/share/${GEN_PACKAGE} install -m 0755 ${GEN_SCRIPTS} $(DESTDIR)/usr/share/${GEN_PACKAGE}
# install asciidoc-pve # install asciidoc-pve
install -m 0755 asciidoc-pve build-$(GEN_PACKAGE)/usr/bin/ install -m 0755 asciidoc-pve $(DESTDIR)/usr/bin/
install -D -m 0644 asciidoc/mediawiki.conf build-$(GEN_PACKAGE)/usr/share/${GEN_PACKAGE}/asciidoc/mediawiki.conf install -D -m 0644 asciidoc/mediawiki.conf $(DESTDIR)/usr/share/${GEN_PACKAGE}/asciidoc/mediawiki.conf
install -m 0644 asciidoc/asciidoc-pve.conf build-$(GEN_PACKAGE)/usr/share/${GEN_PACKAGE}/asciidoc/ install -m 0644 asciidoc/asciidoc-pve.conf $(DESTDIR)/usr/share/${GEN_PACKAGE}/asciidoc/
install -m 0644 asciidoc/pve-html.conf build-$(GEN_PACKAGE)/usr/share/${GEN_PACKAGE}/asciidoc/ install -m 0644 asciidoc/pve-html.conf $(DESTDIR)/usr/share/${GEN_PACKAGE}/asciidoc/
cd build-$(GEN_PACKAGE) && dpkg-buildpackage -rfakeroot -b -us -uc
lintian ${GEN_DEB}
.PHONY: doc-deb .PHONY: doc-install
doc-deb: $(DOC_DEB) doc-install: index.html $(WIKI_IMPORTS) $(API_VIEWER_SOURCES) verify-images
$(DOC_DEB): index.html $(WIKI_IMPORTS) $(API_VIEWER_SOURCES) verify-images install -dm755 $(DESTDIR)/usr/share/$(DOC_PACKAGE)
$(call prepare_build,$(DOC_PACKAGE)) install -dm755 $(DESTDIR)/usr/share/doc/$(DOC_PACKAGE)
sed -i -e '/^Build-Depends/{s/$$/, $(DOC_BUILDDEPS)/}' build-$(DOC_PACKAGE)/debian/control
# install files for pvedocs package # install files for pvedocs package
install -dm755 build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE} install -dm755 $(DESTDIR)/usr/share/${DOC_PACKAGE}
install -dm755 build-$(DOC_PACKAGE)/usr/share/doc/${DOC_PACKAGE} install -dm755 $(DESTDIR)/usr/share/doc/${DOC_PACKAGE}
install -m 0644 index.html ${INDEX_INCLUDES} build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE} install -m 0644 index.html ${INDEX_INCLUDES} $(DESTDIR)/usr/share/${DOC_PACKAGE}
install -m 0644 ${WIKI_IMPORTS} build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE} install -m 0644 ${WIKI_IMPORTS} $(DESTDIR)/usr/share/${DOC_PACKAGE}
# install images # install images
make -C images DESTDIR=../build-$(DOC_PACKAGE) install make -C images install
# install screenshot images # install screenshot images
install -dm755 build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE}/images/screenshot install -dm755 $(DESTDIR)/usr/share/${DOC_PACKAGE}/images/screenshot
install -m 0644 images/screenshot/*.png build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE}/images/screenshot install -m 0644 images/screenshot/*.png $(DESTDIR)/usr/share/${DOC_PACKAGE}/images/screenshot
# install api doc viewer # install api doc viewer
install -dm755 build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE}/api-viewer install -dm755 $(DESTDIR)/usr/share/${DOC_PACKAGE}/api-viewer
install -m 0644 ${API_VIEWER_SOURCES} build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE}/api-viewer install -m 0644 ${API_VIEWER_SOURCES} $(DESTDIR)/usr/share/${DOC_PACKAGE}/api-viewer
cd build-$(DOC_PACKAGE) && dpkg-buildpackage -rfakeroot -b -us -uc
lintian ${DOC_DEB}
.PHONY: mediawiki-deb .PHONY: mediawiki-install
mediawiki-deb: $(MEDIAWIKI_DEB) mediawiki-install: pve-docs-mediawiki-import
$(MEDIAWIKI_DEB): pve-docs-mediawiki-import install -dm755 $(DESTDIR)/usr/share/$(MEDIAWIKI_PACKAGE)
$(call prepare_build,$(MEDIAWIKI_PACKAGE)) install -dm755 $(DESTDIR)/usr/share/doc/$(MEDIAWIKI_PACKAGE)
cp pve-docs-mediawiki-import build-$(MEDIAWIKI_PACKAGE)/debian/tree/pve-docs-mediawiki/pve-docs-mediawiki-import install -dm755 $(DESTDIR)/usr/bin
cd build-$(MEDIAWIKI_PACKAGE) && dpkg-buildpackage -rfakeroot -b -us -uc install -dm755 $(DESTDIR)/usr/share/$(MEDIAWIKI_PACKAGE)
lintian ${MEDIAWIKI_DEB} install -dm755 $(DESTDIR)/usr/share/doc/$(MEDIAWIKI_PACKAGE)
install -m 0755 pve-docs-mediawiki-import $(DESTDIR)/usr/bin/
.PHONY: upload .PHONY: upload
upload: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} upload: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}

30
debian/control vendored Normal file
View File

@ -0,0 +1,30 @@
Source: pve-docs
Section: perl
Priority: extra
Maintainer: Proxmox Support Team <support@proxmox.com>
Build-Depends: debhelper (>= 7.0.50~), lintian, asciidoc-dblatex, source-highlight, librsvg2-bin, graphviz
Standards-Version: 3.8.4
Package: pve-docs
Section: doc
Depends: libjs-extjs
Architecture: all
Description: Proxmox VE Documentation
This package contains the Proxmox VE Documentation files.
Package: pve-doc-generator
Section: perl
Architecture: any
Depends: ${perl:Depends}, libpve-common-perl, asciidoc-dblatex, source-highlight, xmlto
Description: Proxmox VE Documentation helpers
Tool to auto-generate various Proxmox VE Documentation files and
manual pages. This package is required to build most other Proxmox VE
packages.
Package: pve-docs-mediawiki
Architecture: all
Section: doc
Depends: ${misc:Depends}, pve-docs, libhtml-parser-perl
Suggests: apache2
Description: Proxmox VE Documentation - mediawiki plugin
This package contains tools to view Proxmox VE Documentation with mediakiki.

6
debian/control.in vendored
View File

@ -1,6 +0,0 @@
Source: pve-docs
Section: perl
Priority: extra
Maintainer: Proxmox Support Team <support@proxmox.com>
Build-Depends: debhelper (>= 7.0.50~), lintian
Standards-Version: 3.8.4

View File

@ -1,8 +0,0 @@
Package: pve-doc-generator
Section: perl
Architecture: any
Depends: ${perl:Depends}, libpve-common-perl, asciidoc-dblatex, source-highlight, xmlto
Description: Proxmox VE Documentation helpers
Tool to auto-generate various Proxmox VE Documentation files and
manual pages. This package is required to build most other Proxmox VE
packages.

View File

@ -1,7 +0,0 @@
Package: pve-docs-mediawiki
Architecture: all
Section: doc
Depends: ${misc:Depends}, pve-docs, libhtml-parser-perl
Suggests: apache2
Description: Proxmox VE Documentation - mediawiki plugin
This package contains tools to view Proxmox VE Documentation with mediakiki.

View File

@ -1,3 +1,3 @@
debian/tree/pve-docs-mediawiki/pvedocs-include.php /usr/lib/pve-docs/ debian/tree/pve-docs-mediawiki/pvedocs-include.php /usr/lib/pve-docs/
debian/tree/pve-docs-mediawiki/pve-docs-mediawiki-import /usr/bin/ /usr/bin/pve-docs-mediawiki-import
debian/tree/pve-docs-mediawiki/pve-docs.conf /etc/apache2/sites-available/ debian/tree/pve-docs-mediawiki/pve-docs.conf /etc/apache2/sites-available/

View File

@ -1,6 +0,0 @@
Package: pve-docs
Section: doc
Depends: libjs-extjs
Architecture: all
Description: Proxmox VE Documentation
This package contains the Proxmox VE Documentation files.

3
debian/rules vendored
View File

@ -5,3 +5,6 @@
%: %:
dh $@ dh $@
.PHONY: override_dh_auto_build
override_dh_auto_build: