[pve-devel] [PATCH access-control] change from dpkg-deb to dpkg-buildpackage

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Jun 9 17:44:29 CEST 2017


add debian directory and move the respective files there and add
missing (rules, compat).

Add a Source section to the control.in file.

Move the verify_api check to the new "test" target, which gets
executed before the dh_auto_install target.

Cleanup the "clean" target.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

diffoscope tells me also here that the changes do not affect the resulting
.deb file

 Makefile                             | 29 +++++++++++++----------------
 changelog.Debian => debian/changelog |  0
 debian/compat                        |  1 +
 control.in => debian/control.in      | 10 +++++++---
 copyright => debian/copyright        |  0
 debian/docs                          |  1 +
 debian/rules                         | 13 +++++++++++++
 triggers => debian/triggers          |  0
 8 files changed, 35 insertions(+), 19 deletions(-)
 rename changelog.Debian => debian/changelog (100%)
 create mode 100644 debian/compat
 rename control.in => debian/control.in (75%)
 rename copyright => debian/copyright (100%)
 create mode 100644 debian/docs
 create mode 100755 debian/rules
 rename triggers => debian/triggers (100%)

diff --git a/Makefile b/Makefile
index a9512ea..e8ff5b4 100644
--- a/Makefile
+++ b/Makefile
@@ -13,6 +13,8 @@ BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/
 
 export PERLDIR=${PREFIX}/share/perl5
 
+export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
+
 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
 GITVERSION:=$(shell cat .git/refs/heads/master)
 
@@ -22,7 +24,7 @@ DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
 export NOVIEW=1
 include /usr/share/pve-doc-generator/pve-doc-generator.mk
 
-all: ${DEB}
+all:
 
 .PHONY: dinstall
 dinstall: deb
@@ -39,30 +41,25 @@ install: pveum.1 oathkeygen pveum.bash-completion
 	install -m 0755 pveum ${DESTDIR}${SBINDIR}
 	install -m 0755 oathkeygen ${DESTDIR}${BINDIR}
 	make -C PVE install
-	perl -I. ./pveum verifyapi
-	perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->verify_api();"
 	install -d ${DESTDIR}/${MAN1DIR}
 	install -d ${DESTDIR}/${DOCDIR}
 	install -m 0644 pveum.1 ${DESTDIR}/${MAN1DIR}
 	gzip -9 -n ${DESTDIR}/${MAN1DIR}/pveum.1
 	install -m 0644 -D pveum.bash-completion ${DESTDIR}${BASHCOMPLDIR}/pveum
 
+.PHONY: test
+test:
+	perl -I. ./pveum verifyapi
+	perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->verify_api();"
+
 .PHONY: deb
 deb: ${DEB}
 ${DEB}:
 	rm -rf build
-	mkdir build
-	make DESTDIR=`pwd`/build install
-	install -d -m 0755 build/DEBIAN
-	sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/ <control.in >build/DEBIAN/control
-	echo "git clone git://git.proxmox.com/git/pve-access-control.git\\ngit checkout ${GITVERSION}" >  build/${DOCDIR}/SOURCE
-	install -m 0644 triggers build/DEBIAN
-	install -D -m 0644 copyright build/${DOCDIR}/copyright
-	install -m 0644 changelog.Debian build/${DOCDIR}/
-	gzip -9 -n build/${DOCDIR}/changelog.Debian
-	fakeroot dpkg-deb --build build
-	mv build.deb ${DEB}
-	#rm -rf build
+	rsync -a * build
+	sed -e s/@@ARCH@@/${ARCH}/ <debian/control.in >build/debian/control
+	echo "git clone git://git.proxmox.com/git/pve-access-control.git\\ngit checkout ${GITVERSION}" >build/debian/SOURCE
+	cd build; dpkg-buildpackage -rfakeroot -b -us -uc
 	lintian ${DEB}
 
 .PHONY: upload
@@ -72,7 +69,7 @@ upload: ${DEB}
 .PHONY: clean
 clean:
 	make cleanup-docgen
-	rm -rf build *~ *.deb ${PACKAGE}-*.tar.gz pveum.1
+	rm -rf build *.deb *.buildinfo *.changes
 	find . -name '*~' -exec rm {} ';'
 
 .PHONY: distclean
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..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/control.in b/debian/control.in
similarity index 75%
rename from control.in
rename to debian/control.in
index 758e9a0..f34adc2 100644
--- a/control.in
+++ b/debian/control.in
@@ -1,10 +1,14 @@
-Package: libpve-access-control
-Version: @@VERSION@@-@@PKGRELEASE@@
+Source: libpve-access-control
 Section: perl
 Priority: optional
+Maintainer: Proxmox Support Team <support at proxmox.com>
+Build-Depends: debhelper (>= 7.0.50~), libpve-common-perl, perl (>= 5.10.0-19), lintian, pve-doc-generator
+Standards-Version: 3.9.5
+Homepage: http://www.proxmox.com
+
+Package: libpve-access-control
 Architecture: @@ARCH@@
 Depends: libc6 (>= 2.3), perl (>= 5.6.0-16), libcrypt-openssl-rsa-perl, libcrypt-openssl-random-perl, libjson-xs-perl, libjson-perl, libterm-readline-gnu-perl,libnet-ldap-perl, libpve-common-perl, pve-cluster, libauthen-pam-perl, libnet-ssleay-perl, liburi-perl, libwww-perl, libmime-base32-perl
-Maintainer: Proxmox Support Team <support at proxmox.com>
 Description: Proxmox VE access control library
  This package contains the role based user management and access
  control function 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/docs b/debian/docs
new file mode 100644
index 0000000..8696672
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1 @@
+debian/SOURCE
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..955dd78
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,13 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+	dh $@
diff --git a/triggers b/debian/triggers
similarity index 100%
rename from triggers
rename to debian/triggers
-- 
2.11.0





More information about the pve-devel mailing list