[pve-devel] [PATCH ha-manager] Add make dsc target

Rhonda D'Vine rhonda at proxmox.com
Mon Jan 7 13:51:54 CET 2019


Pull out the build dir creation into its own target, and add the "dsc"
target.  Also get some static information from the packaging.

Signed-off-by: Rhonda D'Vine <rhonda at proxmox.com>
---
 Makefile | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index 89fa8a4..9b2b7c0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,16 @@
-VERSION=2.0
-PACKAGE=pve-ha-manager
+VERSION != dpkg-parsechangelog -Sversion | cut -d- -f1
+PACKAGE != dpkg-parsechangelog -Ssource
 SIMPACKAGE=pve-ha-simulator
-PKGREL=6
+PKGREL  != dpkg-parsechangelog -Sversion | cut -d- -f2
 
 GITVERSION:=$(shell git rev-parse HEAD)
 
 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
 
+BUILDSRC=${PACKAGE}-${VERSION}
 DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
 SIMDEB=${SIMPACKAGE}_${VERSION}-${PKGREL}_all.deb
+DSC=${PACKAGE}_${VERSION}-${PKGREL}.dsc
 
 
 all: deb
@@ -17,22 +19,31 @@ all: deb
 dinstall: $(DEB) $(SIMDEB)
 	dpkg -i ${DEB} ${SIMDEB}
 
+.PHONY: ${BUILDSRC}
+${BUILDSRC}:
+	rm -rf ${BUILDSRC}
+	mkdir ${BUILDSRC}
+	rsync -a src/ ${BUILDSRC}
+	rsync -a debian/ ${BUILDSRC}/debian
+	echo "git clone git://git.proxmox.com/git/pve-ha-manager.git\\ngit checkout ${GITVERSION}" > ${BUILDSRC}/debian/SOURCE
+
+.PHONY: dsc
+dsc: ${DSC}
+${DSC}: ${BUILDSRC}
+	cd ${BUILDSRC}; dpkg-buildpackage -S -us -uc -d -nc
+	lintian ${DSC}
+
 .PHONY: deb
 deb: ${DEB} ${SIMDEB}
 ${DEB}:
-	rm -rf build
-	mkdir build
-	rsync -a src/ build
-	rsync -a debian/ build/debian
-	echo "git clone git://git.proxmox.com/git/pve-ha-manager.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
-	cd build; dpkg-buildpackage -b -us -uc
+	cd ${BUILDSRC}; dpkg-buildpackage -b -us -uc
 	lintian ${DEB}
 	lintian ${SIMDEB}
 
 .PHONY: clean
 clean:
 	make -C src clean
-	rm -rf build *.deb ${PACKAGE}-*.tar.gz *.changes *.buildinfo
+	rm -rf ${BUILDSRC} *.deb ${PACKAGE}_*.tar.gz *.changes *.buildinfo *.dsc
 	find . -name '*~' -exec rm {} ';'
 
 .PHONY: distclean
-- 
2.11.0





More information about the pve-devel mailing list