[pve-devel] [PATCH libarchive-perl 2/2] Add make dsc target

Rhonda D'Vine rhonda at proxmox.com
Thu Jan 10 13:37:22 CET 2019


This splits out the copying of the BUILDSRC into its own target. It also
adds the missing git SOURCE file to the package, and doesn't rely on a
hardcoded ARCH in the Makefile.

Signed-off-by: Rhonda D'Vine <rhonda at proxmox.com>
---
 Makefile    | 35 +++++++++++++++++++++++++----------
 debian/docs |  1 +
 2 files changed, 26 insertions(+), 10 deletions(-)
 create mode 100644 debian/docs

diff --git a/Makefile b/Makefile
index 890d4fb..9eed3b1 100644
--- a/Makefile
+++ b/Makefile
@@ -6,27 +6,42 @@ PKGREL  != dpkg-parsechangelog -Sversion | cut -d- -f2
 # h2xs -an LibArchive /usr/include/archive.h /usr/include/archive_entry.h
 # perl Makefile.PL PREFIX=/usr
 
-#OPKGNAME = libarchive-2.2.4
-#DEB = libarchive1_2.2.4-1_i386.deb
-#DEVDEB = libarchive-dev_2.2.4-1_i386.deb
 
 PPSRC = LibArchive
-DEB = libarchive-perl_3.2.1-1_amd64.deb
+
+ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+GITVERSION:=$(shell git rev-parse HEAD)
+
+BUILDSRC=${PACKAGE}-${VERSION}
+DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
+DSC=${PACKAGE}_${VERSION}-${PKGREL}.dsc
 
 all: ${DEB}
 
-${DEB}: ${PPSRC}/LibArchive.xs
-	-rm -rf build
-	rsync -a --exclude .svn ${PPSRC}/ build/
-	cp -a debian build
-	cd build; dpkg-buildpackage -b -us -uc -rfakeroot
+.PHONY: ${BUILDSRC}
+${BUILDSRC}:
+	rm -rf ${BUILDSRC}
+	rsync -a --exclude .svn ${PPSRC}/ ${BUILDSRC}
+	cp -a debian ${BUILDSRC}
+	echo "git clone git://git.proxmox.com/git/pve-storage.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}
+${DEB}: ${PPSRC}/LibArchive.xs ${BUILDSRC}
+	cd ${BUILDSRC}; dpkg-buildpackage -b -us -uc -rfakeroot
 	lintian ${DEB}
 
 .phony: upload
 upload: ${DEB}
 	tar cf - ${DEB} | ssh -X repoman at repo.proxmox.com -- upload --product pmg --dist stretch
 
-CLEANFILES = *~ build *.deb libarchive_* ${OPKGNAME} libarchive-perl_*
+CLEANFILES = *~ build *.deb libarchive_* libarchive-perl_* ${BUILDSRC}
 
 .phony: clean
 clean:
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..8696672
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1 @@
+debian/SOURCE
-- 
2.11.0





More information about the pve-devel mailing list