[pve-devel] [PATCH librados2-perl] build: use a common BUILDSRC target for dsc and deb

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Dec 11 10:42:53 CET 2018


And use $(PACKAGE)-$(VERSION) instead of 'build/' as
directory name, as it is also what the source package's
tarball ends up with inside.

Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
 Makefile | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile
index ad27550..c868aff 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,8 @@ VERSION=1.0
 PACKAGE=librados2-perl
 PKGREL=5
 
+BUILDSRC := $(PACKAGE)-$(VERSION)
+
 DESTDIR=
 PREFIX=/usr
 BINDIR=${PREFIX}/bin
@@ -50,25 +52,23 @@ install: PVE/RADOS.pm RADOS.so
 	install -D -m 0644 PVE/RADOS.pm ${DESTDIR}${PERLDIR}/PVE/RADOS.pm
 	install -D -m 0644 -s RADOS.so ${DESTDIR}${PERLSODIR}/PVE/RADOS/RADOS.so
 
+.PHONY: $(BUILDSRC)
+$(BUILDSRC):
+	rm -rf $(BUILDSRC)
+	rsync -a * $(BUILDSRC)
+	sed -e "s|@PERLAPI@|perlapi-$(PERL_APIVER)|g" debian/control.in >$(BUILDSRC)/debian/control
+	echo "git clone git://git.proxmox.com/git/librados2-perl.git\\ngit checkout ${GITVERSION}" > $(BUILDSRC)/debian/SOURCE
 
 .PHONY: deb
 deb: ${DEB}
-${DEB}:
-	rm -rf build
-	rsync -a * build
-	sed -e "s|@PERLAPI@|perlapi-$(PERL_APIVER)|g" debian/control.in >build/debian/control
-	echo "git clone git://git.proxmox.com/git/librados2-perl.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
-	cd build; dpkg-buildpackage -b -us -uc
+${DEB}: $(BUILDSRC)
+	cd $(BUILDSRC); dpkg-buildpackage -b -us -uc
 	lintian ${DEB}
 
 .PHONY: dsc
 dsc: ${DSC}
-${DSC}:
-	rm -rf build
-	rsync -a * build
-	sed -e "s|@PERLAPI@|perlapi-$(PERL_APIVER)|g" debian/control.in >build/debian/control
-	echo "git clone git://git.proxmox.com/git/librados2-perl.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
-	cd build; dpkg-buildpackage -S -us -uc -d -nc
+${DSC}: $(BUILDSRC)
+	cd $(BUILDSRC); dpkg-buildpackage -S -us -uc -d -nc
 	lintian ${DSC}
 
 .PHONY: clean
-- 
2.11.0





More information about the pve-devel mailing list