mirror of
https://git.proxmox.com/git/pmg-docs
synced 2025-05-29 14:03:38 +00:00
bsys: refactor build process
build packages in one go by moving individual .deb targets into install targets called by dpkg-buildpackage. ported from pve-docs:fa764571f6a0c5bfc62ee1cda6bffcfae40e9ec9 and pve-docs:60955877b11cde0865a258ece040bd124fb07bdc Additionally I added the fixups from Thomas in pve-docs:2d11c86883c4b1150afcc97eedfbf1b2a07de105 pve-docs:fd880d44c7d3876add7acd659641668bfa09c71b Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
This commit is contained in:
parent
9dd45bd776
commit
1a8e71a93b
80
Makefile
80
Makefile
@ -7,11 +7,12 @@ DOC_PACKAGE=pmg-docs
|
||||
# also update debian/changelog
|
||||
PKGREL=4
|
||||
|
||||
GITVERSION:=$(shell git rev-parse HEAD)
|
||||
|
||||
ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
|
||||
|
||||
GEN_DEB=${GEN_PACKAGE}_${DOCRELEASE}-${PKGREL}_${ARCH}.deb
|
||||
DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
|
||||
DOC_BUILDDEPS := dblatex, source-highlight, imagemagick, librsvg2-bin
|
||||
|
||||
|
||||
all: index.html
|
||||
@ -30,7 +31,7 @@ pmg-doc-generator.mk: .pmg-doc-depends pmg-doc-generator.mk.in
|
||||
cat pmg-doc-generator.mk.in .pmg-doc-depends > $@.tmp
|
||||
mv $@.tmp $@
|
||||
|
||||
include ./pmg-doc-generator.mk
|
||||
-include ./pmg-doc-generator.mk
|
||||
|
||||
GEN_DEB_SOURCES= \
|
||||
pmg-doc-generator.mk \
|
||||
@ -128,61 +129,50 @@ dinstall: ${GEN_DEB} ${DOC_DEB}
|
||||
dpkg -i ${GEN_DEB} ${DOC_DEB}
|
||||
|
||||
.PHONY: deb
|
||||
deb:
|
||||
rm -f ${GEN_DEB} ${DOC_DEB}
|
||||
make all-debs
|
||||
deb: ${DOC_DEB}
|
||||
|
||||
.PHONY: all-debs
|
||||
all-debs: ${GEN_DEB} ${DOC_DEB}
|
||||
${GEN_DEB}: ${DOC_DEB}
|
||||
|
||||
${DOC_DEB}:
|
||||
rm -f ${GEN_DEB} ${DOC_DEB}
|
||||
rm -rf build
|
||||
rsync -a * build/
|
||||
echo "git clone git://git.proxmox.com/git/pmg-docs.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
|
||||
cd build; dpkg-buildpackage -b -us -uc
|
||||
lintian $(DOC_DEB) $(GEN_DEB)
|
||||
|
||||
.PHONY: clean-build
|
||||
clean-build:
|
||||
rm -rf build
|
||||
|
||||
define prepare_build
|
||||
rm -rf build-$1
|
||||
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
|
||||
install -dm755 build-$1/usr/share/$1
|
||||
install -dm755 build-$1/usr/share/doc/$1
|
||||
endef
|
||||
.PHONY: install
|
||||
install: gen-install doc-install
|
||||
|
||||
.PHONY: gen-deb
|
||||
gen-deb: $(GEN_DEB)
|
||||
$(GEN_DEB): $(GEN_DEB_SOURCES) asciidoc-pmg
|
||||
$(call prepare_build,$(GEN_PACKAGE))
|
||||
install -dm755 build-$(GEN_PACKAGE)/usr/bin
|
||||
.PHONY: gen-install
|
||||
gen-install: $(GEN_DEB_SOURCES) asciidoc-pmg
|
||||
install -dm755 ${DESTDIR}/usr/bin
|
||||
install -dm755 $(DESTDIR)/usr/share/${GEN_PACKAGE}
|
||||
# install files
|
||||
install -m 0644 ${GEN_DEB_SOURCES} build-$(GEN_PACKAGE)/usr/share/${GEN_PACKAGE}
|
||||
install -m 0755 ${GEN_SCRIPTS} build-$(GEN_PACKAGE)/usr/share/${GEN_PACKAGE}
|
||||
install -m 0644 ${GEN_DEB_SOURCES} $(DESTDIR)/usr/share/${GEN_PACKAGE}
|
||||
install -m 0755 ${GEN_SCRIPTS} $(DESTDIR)/usr/share/${GEN_PACKAGE}
|
||||
# install asciidoc-pmg
|
||||
install -m 0755 asciidoc-pmg build-$(GEN_PACKAGE)/usr/bin/
|
||||
install -dm755 build-$(GEN_PACKAGE)/usr/share/${GEN_PACKAGE}/asciidoc/
|
||||
install -m 0644 asciidoc/asciidoc-pmg.conf build-$(GEN_PACKAGE)/usr/share/${GEN_PACKAGE}/asciidoc/
|
||||
install -m 0644 asciidoc/pmg-html.conf build-$(GEN_PACKAGE)/usr/share/${GEN_PACKAGE}/asciidoc/
|
||||
cd build-$(GEN_PACKAGE) && dpkg-buildpackage -rfakeroot -b -us -uc
|
||||
lintian ${GEN_DEB}
|
||||
install -m 0755 asciidoc-pmg $(DESTDIR)/usr/bin/
|
||||
install -dm755 $(DESTDIR)/usr/share/${GEN_PACKAGE}/asciidoc/
|
||||
install -m 0644 asciidoc/asciidoc-pmg.conf $(DESTDIR)/usr/share/${GEN_PACKAGE}/asciidoc/
|
||||
install -m 0644 asciidoc/pmg-html.conf $(DESTDIR)/usr/share/${GEN_PACKAGE}/asciidoc/
|
||||
|
||||
.PHONY: doc-deb
|
||||
doc-deb: $(DOC_DEB)
|
||||
$(DOC_DEB): index.html $(API_VIEWER_SOURCES) verify-images
|
||||
$(call prepare_build,$(DOC_PACKAGE))
|
||||
sed -i -e '/^Build-Depends/{s/$$/, $(DOC_BUILDDEPS)/}' build-$(DOC_PACKAGE)/debian/control
|
||||
.PHONY: doc-install
|
||||
doc-install: index.html $(API_VIEWER_SOURCES) verify-images
|
||||
# install files for pmgdocs package
|
||||
install -dm755 build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE}
|
||||
install -dm755 build-$(DOC_PACKAGE)/usr/share/doc/${DOC_PACKAGE}
|
||||
install -m 0644 index.html ${INDEX_INCLUDES} build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE}
|
||||
install -dm755 $(DESTDIR)/usr/share/${DOC_PACKAGE}
|
||||
install -dm755 $(DESTDIR)/usr/share/doc/${DOC_PACKAGE}
|
||||
install -m 0644 index.html ${INDEX_INCLUDES} $(DESTDIR)/usr/share/${DOC_PACKAGE}
|
||||
# install screenshot images
|
||||
install -dm755 build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE}/images/screenshot
|
||||
install -m 0644 images/screenshot/*.png build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE}/images/screenshot
|
||||
install -dm755 $(DESTDIR)/usr/share/${DOC_PACKAGE}/images/screenshot
|
||||
install -m 0644 images/screenshot/*.png $(DESTDIR)/usr/share/${DOC_PACKAGE}/images/screenshot
|
||||
# install api doc viewer
|
||||
install -dm755 build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE}/api-viewer
|
||||
install -m 0644 ${API_VIEWER_SOURCES} build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE}/api-viewer
|
||||
cd build-$(DOC_PACKAGE) && dpkg-buildpackage -rfakeroot -b -us -uc
|
||||
lintian ${DOC_DEB}
|
||||
install -dm755 $(DESTDIR)/usr/share/${DOC_PACKAGE}/api-viewer
|
||||
install -m 0644 ${API_VIEWER_SOURCES} $(DESTDIR)/usr/share/${DOC_PACKAGE}/api-viewer
|
||||
|
||||
.PHONY: upload
|
||||
upload: ${GEN_DEB} ${DOC_DEB}
|
||||
@ -201,4 +191,4 @@ clean:
|
||||
rm -f api-viewer/apidoc.js chapter-*.html *-plain.html chapter-*.html pmg-admin-guide.chunked asciidoc-pmg link-refs.json .asciidoc-pmg-tmp_* pmg-smtp-filter.8-synopsis.adoc pmgpolicy.8-synopsis.adoc pmgsh.1-synopsis.adoc
|
||||
rm -rf .pmg-doc-depends
|
||||
rm -f pmg-doc-generator.mk chapter-index-table.adoc man1-index-table.adoc man5-index-table.adoc man8-index-table.adoc pmg-admin-guide-docinfo.xml
|
||||
rm -rf build-*
|
||||
rm -rf build*
|
||||
|
22
debian/control
vendored
Normal file
22
debian/control
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
Source: pmg-docs
|
||||
Section: perl
|
||||
Priority: extra
|
||||
Maintainer: Proxmox Support Team <support@proxmox.com>
|
||||
Build-Depends: asciidoc-dblatex, debhelper (>= 9~), libdbi-perl, libfile-sync-perl, liblockfile-simple-perl, libmime-tools-perl, libnet-ldap-perl, librrds-perl, lintian
|
||||
Standards-Version: 3.8.4
|
||||
|
||||
|
||||
Package: pmg-doc-generator
|
||||
Section: perl
|
||||
Architecture: any
|
||||
Depends: ${perl:Depends}, libpve-common-perl, asciidoc-base, xmlto
|
||||
Description: Proxmox Mail Gateway Documentation helpers
|
||||
Tool to auto-generate various Proxmox Mail gateway Documentation files and
|
||||
manual pages. This package is required to build most other Proxmox Mail
|
||||
Gateway packages.
|
||||
|
||||
Package: pmg-docs
|
||||
Section: doc
|
||||
Architecture: all
|
||||
Description: Proxmox Mail Gateway Documentation
|
||||
This package contains the Proxmox Mail Gateway documentation files.
|
6
debian/control.in
vendored
6
debian/control.in
vendored
@ -1,6 +0,0 @@
|
||||
Source: pmg-docs
|
||||
Section: perl
|
||||
Priority: extra
|
||||
Maintainer: Proxmox Support Team <support@proxmox.com>
|
||||
Build-Depends: asciidoc-dblatex, debhelper (>= 9~), libdbi-perl, libfile-sync-perl, liblockfile-simple-perl, libmime-tools-perl, libnet-ldap-perl, librrds-perl, lintian
|
||||
Standards-Version: 3.8.4
|
8
debian/pmg-doc-generator.control
vendored
8
debian/pmg-doc-generator.control
vendored
@ -1,8 +0,0 @@
|
||||
Package: pmg-doc-generator
|
||||
Section: perl
|
||||
Architecture: any
|
||||
Depends: ${perl:Depends}, libpve-common-perl, asciidoc-base, xmlto
|
||||
Description: Proxmox Mail Gateway Documentation helpers
|
||||
Tool to auto-generate various Proxmox Mail gateway Documentation files and
|
||||
manual pages. This package is required to build most other Proxmox Mail
|
||||
Gateway packages.
|
5
debian/pmg-docs.control
vendored
5
debian/pmg-docs.control
vendored
@ -1,5 +0,0 @@
|
||||
Package: pmg-docs
|
||||
Section: doc
|
||||
Architecture: all
|
||||
Description: Proxmox Mail Gateway Documentation
|
||||
This package contains the Proxmox Mail Gateway documentation files.
|
3
debian/rules
vendored
3
debian/rules
vendored
@ -5,3 +5,6 @@
|
||||
|
||||
%:
|
||||
dh $@
|
||||
|
||||
.PHONY: override_dh_auto_build
|
||||
override_dh_auto_build:
|
||||
|
Loading…
Reference in New Issue
Block a user