]> git.proxmox.com Git - pve-docs.git/commitdiff
buildsys: split the packages
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 3 Feb 2017 11:19:30 +0000 (12:19 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 3 Feb 2017 13:35:28 +0000 (14:35 +0100)
This way each package can be built separately. This also
allows for much easier package bootstrapping (eg. for
stretch)

Makefile
debian/control [deleted file]
debian/control.in [new file with mode: 0644]
debian/pve-doc-generator.control [new file with mode: 0644]
debian/pve-docs-mediawiki.control [new file with mode: 0644]
debian/pve-docs.control [new file with mode: 0644]

index 4b3e594cb3ba2ef95dfa86ad4b77811af45118d5..1caca8cb1eb747520000be1905151f5f7ddc7a17 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,7 @@ ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
 GEN_DEB=${GEN_PACKAGE}_${DOCRELEASE}-${PKGREL}_${ARCH}.deb
 DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
 MEDIAWIKI_DEB=${MEDIAWIKI_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
+DOC_BUILDDEPS := pve-doc-generator, dblatex, source-highlight, inkscape, imagemagick
 
 
 all: index.html
@@ -148,41 +149,66 @@ dinstall: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}
 
 .PHONY: deb
 deb:
-       rm -f ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB};
-       make ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB};
+       rm -f ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}
+       make all-debs
 
-${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}: index.html ${INDEX_INCLUDES} ${WIKI_IMPORTS} ${API_VIEWER_SOURCES} ${GEN_DEB_SOURCES} asciidoc-pve pve-docs-mediawiki-import asciidoc/mediawiki.conf verify-images
+.PHONY: clean-build
+clean-build:
        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}
+
+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
+       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
+gen-deb: $(GEN_DEB)
+$(GEN_DEB): $(GEN_DEB_SOURCES) asciidoc-pve asciidoc/mediawiki.conf
+       $(call prepare_build,$(GEN_PACKAGE))
+       install -dm755 build-$(GEN_PACKAGE)/usr/bin
+       # 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 asciidoc-pve
-       install -m 0755 asciidoc-pve build/usr/bin/
-       install -D -m 0644 asciidoc/mediawiki.conf build/usr/share/${GEN_PACKAGE}/asciidoc/mediawiki.conf
-       install -m 0644 asciidoc/asciidoc-pve.conf build/usr/share/${GEN_PACKAGE}/asciidoc/
-       install -m 0644 asciidoc/pve-html.conf build/usr/share/${GEN_PACKAGE}/asciidoc/
+       install -m 0755 asciidoc-pve build-$(GEN_PACKAGE)/usr/bin/
+       install -D -m 0644 asciidoc/mediawiki.conf build-$(GEN_PACKAGE)/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/pve-html.conf build-$(GEN_PACKAGE)/usr/share/${GEN_PACKAGE}/asciidoc/
+       cd build-$(GEN_PACKAGE) && dpkg-buildpackage -rfakeroot -b -us -uc
+       lintian ${GEN_DEB}
+
+.PHONY: doc-deb
+doc-deb: $(DOC_DEB)
+$(DOC_DEB): index.html $(WIKI_IMPORTS) $(API_VIEWER_SOURCES) verify-images
+       $(call prepare_build,$(DOC_PACKAGE))
+       sed -i -e '/^Build-Depends/{s/$$/$(DOC_BUILDDEPS)/}' build-$(DOC_PACKAGE)/debian/control
        # install files for pvedocs package
-       mkdir -p build/usr/share/${DOC_PACKAGE}
-       mkdir -p build/usr/share/doc/${DOC_PACKAGE}
-       install -m 0644 index.html ${INDEX_INCLUDES} build/usr/share/${DOC_PACKAGE}
-       install -m 0644 ${WIKI_IMPORTS} build/usr/share/${DOC_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 -m 0644 ${WIKI_IMPORTS} build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE}
        # install screenshot images
-       mkdir -p build/usr/share/${DOC_PACKAGE}/images/screenshot
-       install -m 0644 images/screenshot/*.png build/usr/share/${DOC_PACKAGE}/images/screenshot
+       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 api doc viewer
-       mkdir build/usr/share/${DOC_PACKAGE}/api-viewer
-       install -m 0644 ${API_VIEWER_SOURCES} build/usr/share/${DOC_PACKAGE}/api-viewer
-       # build Debian packages
-       cd build; dpkg-buildpackage -rfakeroot -b -us -uc
-       lintian ${GEN_DEB}
+       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}
+
+.PHONY: mediawiki-deb
+mediawiki-deb: $(MEDIAWIKI_DEB)
+$(MEDIAWIKI_DEB): pve-docs-mediawiki-import
+       $(call prepare_build,$(MEDIAWIKI_PACKAGE))
+       cp pve-docs-mediawiki-import build-$(MEDIAWIKI_PACKAGE)/debian/tree/pve-docs-mediawiki/pve-docs-mediawiki-import
+       cd build-$(MEDIAWIKI_PACKAGE) && dpkg-buildpackage -rfakeroot -b -us -uc
        lintian ${MEDIAWIKI_DEB}
 
 .PHONY: upload
@@ -198,3 +224,4 @@ update: clean
 
 clean: 
        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 .pve-doc-depends pve-doc-generator.mk chapter-index-table.adoc man1-index-table.adoc man5-index-table.adoc man8-index-table.adoc pve-admin-guide-docinfo.xml
+       rm -rf build-*
diff --git a/debian/control b/debian/control
deleted file mode 100644 (file)
index d03db11..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-Source: pve-docs
-Section: perl
-Priority: extra
-Maintainer: Proxmox Support Team <support@proxmox.com>
-Build-Depends: debhelper (>= 7.0.50~), lintian, asciidoc, xmlto, dblatex, source-highlight, inkscape, imagemagick
-Standards-Version: 3.8.4
-
-Package: pve-doc-generator
-Section: perl
-Architecture: any
-Depends: ${perl:Depends}, libpve-common-perl, asciidoc, 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
-Section: doc
-Architecture: all
-Description: Proxmox VE Documentation
- This package contains the Proxmox VE Documentation files.
-
-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.
diff --git a/debian/control.in b/debian/control.in
new file mode 100644 (file)
index 0000000..2e276c8
--- /dev/null
@@ -0,0 +1,7 @@
+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
diff --git a/debian/pve-doc-generator.control b/debian/pve-doc-generator.control
new file mode 100644 (file)
index 0000000..ebe5a9e
--- /dev/null
@@ -0,0 +1,8 @@
+Package: pve-doc-generator
+Section: perl
+Architecture: any
+Depends: ${perl:Depends}, libpve-common-perl, asciidoc, 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.
diff --git a/debian/pve-docs-mediawiki.control b/debian/pve-docs-mediawiki.control
new file mode 100644 (file)
index 0000000..09e4b67
--- /dev/null
@@ -0,0 +1,7 @@
+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.
diff --git a/debian/pve-docs.control b/debian/pve-docs.control
new file mode 100644 (file)
index 0000000..31a8c6e
--- /dev/null
@@ -0,0 +1,5 @@
+Package: pve-docs
+Section: doc
+Architecture: all
+Description: Proxmox VE Documentation
+ This package contains the Proxmox VE Documentation files.