[pve-devel] [PATCH qemu-server] change from dpkg-deb to dpkg-buildpackage

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Jun 9 18:37:03 CEST 2017


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

Add a Source section to the control.in file and "build" (sed
control.in >control) in the $DEB target as done in most other
packages

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

Remove the obsolete vzsyscalls.ph target, vzsyscalls.h is gone for a
while now

Cleanup "clean" target.

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

All good things are three.
diffoscope tells me also here that the changes do not affect the resulting
.deb file

Note:
* some general cleanup would be still nice, i.e. move the top level perl
  "binaries" and the few C helpers to a bin (?) directory and the .cfg/.conf to
  a own or the debian sub directory - but that's not too important for now,
  imo.

It would be maybe better to add the line which allows easier comparison of the
pre- and after dpkg-buildpackage fd .deb file in an own patch, as Dominik has
done. You can add it temporarily yourself if you want to do an check with
diffoscope:

export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -l debian/changelog.Debian -STimestamp)

sorry for any inconvenience caused


 Makefile                             | 42 ++++++++++++------------------------
 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, 36 insertions(+), 31 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 b8b7d4b..04ad279 100644
--- a/Makefile
+++ b/Makefile
@@ -28,18 +28,14 @@ DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
 export NOVIEW=1
 include /usr/share/pve-doc-generator/pve-doc-generator.mk
 
-all: ${DEB}
+export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
+
+all:
 
 .PHONY: dinstall
 dinstall: deb
 	dpkg -i ${DEB}
 
-control: control.in
-	sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/<$< >$@
-
-vzsyscalls.ph: vzsyscalls.h
-	 h2ph -d . vzsyscalls.h
-
 vmtar: vmtar.c utils.c
 	gcc ${CFLAGS} -o vmtar vmtar.c
 
@@ -54,7 +50,7 @@ qmrestore.bash-completion:
 	PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::qmrestore; PVE::CLI::qmrestore->generate_bash_completions();" >$@.tmp
 	mv $@.tmp $@
 
-PKGSOURCES=qm qm.1 qmrestore qmrestore.1 qmextract sparsecp vmtar control qm.conf.5 qm.bash-completion qmrestore.bash-completion
+PKGSOURCES=qm qm.1 qmrestore qmrestore.1 qmextract sparsecp vmtar qm.conf.5 qm.bash-completion qmrestore.bash-completion
 
 .PHONY: install
 install: ${PKGSOURCES}
@@ -90,26 +86,17 @@ install: ${PKGSOURCES}
 
 .PHONY: deb
 deb: ${DEB}
-${DEB}: ${PKGSOURCES} check
-	rm -f *.deb
+${DEB}:
 	rm -rf build
-	mkdir build
-	make DESTDIR=${CURDIR}/build install
-	PVE_GENERATING_DOCS=1 perl -I. ./qm verifyapi
-	install -d -m 0755 build/DEBIAN
-	install -m 0644 control build/DEBIAN
-	install -m 0644 triggers build/DEBIAN
-	echo "/etc/modules-load.d/qemu-server.conf" >>build/DEBIAN/conffiles
-	install -D -m 0644 copyright build/${DOCDIR}/${PACKAGE}/copyright
-	install -m 0644 changelog.Debian build/${DOCDIR}/${PACKAGE}/
-	gzip -9 -n build/${DOCDIR}/${PACKAGE}/changelog.Debian
-	echo "git clone git://git.proxmox.com/git/qemu-server.git\\ngit checkout ${GITVERSION}" > build/${DOCDIR}/${PACKAGE}/SOURCE
-	fakeroot dpkg-deb --build build
-	mv build.deb ${DEB}
+	rsync -a * build
+	sed -e s/@@ARCH@@/${ARCH}/ <debian/control.in >build/debian/control
+	echo "git clone git://git.proxmox.com/git/qemu-server.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
+	cd build; dpkg-buildpackage -rfakeroot -b -us -uc
 	lintian ${DEB}
 
-.PHONY: check
-check: test
+.PHONY: test
+test:
+	PVE_GENERATING_DOCS=1 perl -I. ./qm verifyapi
 	make -C test
 
 .PHONY: upload
@@ -117,10 +104,9 @@ upload: ${DEB}
 	tar cf - ${DEB} | ssh repoman at repo.proxmox.com upload --product pve --dist stretch
 
 .PHONY: clean
-clean: 	
+clean:
 	make cleanup-docgen
-	rm -rf build *.deb control vzsyscalls.ph _h2ph_pre.ph ${PACKAGE}-*.tar.gz dist *.1 *.5 *.pod vmtar sparsecp *.tmp *.bash-completion
-	rm -f *.buildinfo
+	rm -rf build *.deb *.buildinfo *.changes
 	find . -name '*~' -exec rm {} ';'
 
 
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 d0601ac..9619f55 100644
--- a/control.in
+++ b/debian/control.in
@@ -1,9 +1,13 @@
-Package: qemu-server
-Version: @@VERSION@@-@@PKGRELEASE@@
+Source: qemu-server
 Section: admin
 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: qemu-server
 Architecture: @@ARCH@@
 Depends: libc6 (>= 2.7-18), perl (>= 5.10.0-19), libterm-readline-gnu-perl, pve-qemu-kvm (>= 2.2-1), libpve-access-control, libpve-storage-perl, pve-cluster, libjson-perl, libjson-xs-perl, libio-multiplex-perl, libnet-ssleay-perl, socat, pve-firewall, libuuid-perl, pve-ha-manager, dbus, libpve-common-perl (>= 4.0-92), libpve-guest-common-perl
-Maintainer: Proxmox Support Team <support at proxmox.com>
 Description: Qemu Server Tools
  This package contains the Qemu Server tools 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