]> git.proxmox.com Git - pve-guest-common.git/commitdiff
buildsys: use dpkg-dev makefile helpers for pkg info
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 21 May 2019 19:00:28 +0000 (21:00 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 21 May 2019 19:00:51 +0000 (21:00 +0200)
while we already dynamically resolved the version from the changelog
using dpkg-parsechangelog, and those dpkg-dev helpers also use that
tool, let's switch to them nonetheless to have a bit more stream
lined dev environment.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Makefile

index 6bdfb6daf2bae8788eb3956fe0864138a6bf8701..80bde820d2c2d036e085d79889ad0522b1c93341 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,12 @@
+include /usr/share/dpkg/pkg-info.mk
+include /usr/share/dpkg/architecture.mk
+
 PACKAGE=libpve-guest-common-perl
-PKGVER != dpkg-parsechangelog -Sversion | cut -d- -f1
-PKGREL != dpkg-parsechangelog -Sversion | cut -d- -f2
 
-DEB=${PACKAGE}_${PKGVER}-${PKGREL}_all.deb
-DSC=${PACKAGE}_${PKGVER}-${PKGREL}.dsc
+DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
+DSC=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}.dsc
+
+BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM}
 
 DESTDIR=
 
@@ -12,20 +15,21 @@ DOCDIR=${DESTDIR}/usr/share/doc/${PACKAGE}
 
 all:
 
+${BUILDDIR}:
+       rm -rf ${BUILDDIR}
+       rsync -a * ${BUILDDIR}
+       echo "git clone git://git.proxmox.com/git/pve-guest-common.git\\ngit checkout ${GITVERSION}" > ${BUILDDIR}/debian/SOURCE
+
 .PHONY: deb
 deb: ${DEB}
-${DEB}:
-       rm -rf build
-       rsync -a * build
-       cd build; dpkg-buildpackage -b -us -uc
+${DEB}: ${BUILDDIR}
+       cd ${BUILDDIR}; dpkg-buildpackage -b -us -uc
        lintian ${DEB}
 
 .PHONY: dsc
 dsc: ${DSC}
-${DSC}:
-       rm -rf build
-       rsync -a * build
-       cd build; dpkg-buildpackage -S -us -uc -d -nc
+${DSC}: ${BUILDDIR}
+       cd ${BUILDDIR}; dpkg-buildpackage -S -us -uc -d -nc
        lintian ${DSC}
 
 install: PVE
@@ -46,7 +50,7 @@ upload: ${DEB}
 distclean: clean
 
 clean:
-       rm -rf ./build *.deb *.dsc *.changes *.buildinfo *.tar.gz
+       rm -rf ${BUILDDIR} *.deb *.dsc *.changes *.buildinfo *.tar.gz
 
 .PHONY: dinstall
 dinstall: ${DEB}