[pve-devel] [PATCH apiclient 1/3] Add "make dsc" target

Rhonda D'Vine rhonda at proxmox.com
Fri Dec 28 18:24:05 CET 2018


This target is required to make the package build automatically.

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

diff --git a/Makefile b/Makefile
index ec67f2d..7401d08 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,9 @@ PACKAGE=libpve-apiclient-perl
 PKGVER=2.0
 PKGREL=4
 
+BUILDSRC := $(PACKAGE)-$(PKGVER)
 DEB=${PACKAGE}_${PKGVER}-${PKGREL}_all.deb
+DSC=${PACKAGE}_${PKGVER}-${PKGREL}.dsc
 
 DESTDIR=
 
@@ -12,16 +14,25 @@ DOCDIR=${DESTDIR}/usr/share/doc/${PACKAGE}
 PVE_COMMON_FILES=    		\
 	Exception.pm
 
+
 all: ${DEB}
 
+.PHONY: $(BUILDSRC)
+$(BUILDSRC):
+	rm -rf $(BUILDSRC)
+	rsync -a debian $(BUILDSRC)
+	make DESTDIR=./$(BUILDSRC) install
+
 .PHONY: deb
-deb ${DEB}:
-	rm -rf build
-	rsync -a debian build
-	make DESTDIR=./build install
-	cd build; dpkg-buildpackage -rfakeroot -b -us -uc
+deb ${DEB}: $(BUILDSRC)
+	cd $(BUILDSRC); dpkg-buildpackage -rfakeroot -b -us -uc
 	lintian ${DEB}
 
+.PHONY: dsc
+dsc: $(BUILDSRC)
+	cd $(BUILDSRC); dpkg-buildpackage -S -us -uc -d -nc
+	lintian ${DSC}
+
 install:
 	install -D -m 0644 PVE/APIClient/LWP.pm ${PERL5DIR}/PVE/APIClient/LWP.pm
 	install -m 0644 PVE/APIClient/Exception.pm ${PERL5DIR}/PVE/APIClient/Exception.pm
@@ -41,7 +52,7 @@ upload: ${DEB}
 distclean: clean
 
 clean:
-	rm -rf ./build *.deb *.changes *.buildinfo
+	rm -rf ./$(BUILDSRC) *.deb *.changes *.buildinfo *.dsc *.tar.gz
 	find . -name '*~' -exec rm {} ';'
 
 .PHONY: dinstall
-- 
2.11.0





More information about the pve-devel mailing list