[pve-devel] [PATCH 1/4] bsys: move to dpkg-buildpackage

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Dec 10 17:42:29 CET 2018


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 Makefile                             | 24 +++++++++---------------
 control.in                           |  9 ---------
 changelog.Debian => debian/changelog |  0
 debian/compat                        |  1 +
 debian/control.in                    | 17 +++++++++++++++++
 copyright => debian/copyright        |  0
 debian/rules                         |  9 +++++++++
 7 files changed, 36 insertions(+), 24 deletions(-)
 delete mode 100644 control.in
 rename changelog.Debian => debian/changelog (100%)
 create mode 100644 debian/compat
 create mode 100644 debian/control.in
 rename copyright => debian/copyright (100%)
 create mode 100755 debian/rules

diff --git a/Makefile b/Makefile
index 2c1451f..8322a56 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@ GITVERSION:=$(shell cat .git/refs/heads/master)
 
 DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
 
-all: ${DEB}
+all:
 
 RADOS.c: RADOS.xs typemap
 	xsubpp RADOS.xs -typemap typemap > RADOS.xsc
@@ -49,26 +49,20 @@ 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: deb ${DEB}
+
+.PHONY: deb
 deb: ${DEB}
 ${DEB}:
-	rm -rf debian
-	mkdir debian
-	make DESTDIR=${CURDIR}/debian install
-	install -d -m 0755 debian/DEBIAN
-	sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/ -e "s|@PERLAPI@|perlapi-$(PERL_APIVER)|g" <control.in >debian/DEBIAN/control
-	install -D -m 0644 copyright debian/${DOCDIR}/copyright
-	install -m 0644 changelog.Debian debian/${DOCDIR}/
-	gzip -9 -n debian/${DOCDIR}/changelog.Debian
-	echo "git clone git://git.proxmox.com/git/librados2-perl.git\\ngit checkout ${GITVERSION}" > debian/${DOCDIR}/SOURCE
-	fakeroot dpkg-deb --build debian	
-	mv debian.deb ${DEB}
-	rm -rf debian
+	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
 	lintian ${DEB}
 
 .PHONY: clean
 clean: 	
-	rm -rf debian *.deb ${PACKAGE}-*.tar.gz dist *.1.pod *.1.gz RADOS.so RADOS.c
+	rm -rf *~ build *.deb *.changes *.buildinfo
 	find . -name '*~' -exec rm {} ';'
 
 .PHONY: distclean
diff --git a/control.in b/control.in
deleted file mode 100644
index c2dc77e..0000000
--- a/control.in
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: librados2-perl
-Version: @@VERSION@@-@@PKGRELEASE@@
-Section: perl
-Priority: optional
-Architecture: @@ARCH@@
-Depends: libc6 (>= 2.2.5), perl (>= 5.20.1-5), @PERLAPI@, librados2 (>= 0.67.5), libpve-access-control
-Maintainer: Proxmox Support Team <support at proxmox.com>
-Description: Perl bindings for librados
- This package contains librados perl binding used by Proxmox VE.
diff --git a/changelog.Debian b/debian/changelog
similarity index 100%
rename from changelog.Debian
rename to debian/changelog
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+10
diff --git a/debian/control.in b/debian/control.in
new file mode 100644
index 0000000..64d4262
--- /dev/null
+++ b/debian/control.in
@@ -0,0 +1,17 @@
+Source: librados2-perl
+Section: perl
+Priority: optional
+Maintainer: Proxmox Support Team <support at proxmox.com>
+Build-Depends: debhelper (>= 10~)
+Standards-Version: 3.9.8
+Homepage: http://www.proxmox.com
+
+Package: librados2-perl
+Architecture: any
+Depends: libc6 (>= 2.2.5),
+         libpve-access-control,
+         librados2 (>= 0.67.5),
+         perl (>= 5.20.1-5),
+         @PERLAPI@,
+Description: Perl bindings for librados
+ This package contains librados perl binding used by Proxmox VE.
diff --git a/copyright b/debian/copyright
similarity index 100%
rename from copyright
rename to debian/copyright
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..0c06312
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,9 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+	dh $@
+
-- 
2.19.2





More information about the pve-devel mailing list