]> git.proxmox.com Git - pve-container.git/commitdiff
buildsys: use dpkg-dev makefile helpers for pkg info
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 22 May 2019 10:37:58 +0000 (12:37 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 22 May 2019 10:37:58 +0000 (12:37 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Makefile

index 7f18b7c8f94cb9abfe606fbaad77c306a59420e6..579c01b148c792ff00fdc9af919b2704f14c0ef4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,12 @@
+include /usr/share/dpkg/pkg-info.mk
+
 PACKAGE=pve-container
-PKGVER != dpkg-parsechangelog -Sversion | cut -d- -f1
-PKGREL != dpkg-parsechangelog -Sversion | cut -d- -f2
 
 GITVERSION:=$(shell git rev-parse HEAD)
-BUILDDIR ?= build
-
-ARCH:=all
+BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM}
 
-DEB=${PACKAGE}_${PKGVER}-${PKGREL}_${ARCH}.deb
-DSC=${PACKAGE}_${PKGVER}-${PKGREL}.dsc
+DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
+DSC=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}.dsc
 
 all: ${DEB}
 
@@ -18,14 +16,13 @@ dinstall: ${DEB}
 
 ${BUILDDIR}:
        rm -rf ${BUILDDIR}
-       rsync -a src/ ${BUILDDIR}
-       rsync -a debian ${BUILDDIR}/
+       rsync -a src/ debian ${BUILDDIR}
        echo "git clone git://git.proxmox.com/git/pve-container\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
 
 .PHONY: deb
 deb: ${DEB}
 ${DEB}: ${BUILDDIR}
-       cd build; dpkg-buildpackage -b -us -uc
+       cd ${BUILDDIR}; dpkg-buildpackage -b -us -uc
        lintian ${DEB}
 
 
@@ -38,7 +35,7 @@ ${DSC}: ${BUILDDIR}
 .PHONY: clean
 clean:
        make -C src clean
-       rm -rf *.deb ${PACKAGE}*.tar.gz *.changes *.buildinfo ${DSC} ${BUILDDIR}
+       rm -rf *.deb ${PACKAGE}*.tar.gz *.changes *.buildinfo ${DSC} ${PACKAGE}-*/
        find . -name '*~' -exec rm {} ';'
 
 .PHONY: distclean