[pve-devel] [PATCH manager 5/5] change from dpkg-deb to dpkg-buildpackage

Dominik Csapak d.csapak at proxmox.com
Fri Jun 9 09:55:28 CEST 2017


for better building pve-manager

this moves the copyright file to debian/
the debian/changelog.Debian to debian/changelog

we do not need the debian/conffiles anymore (gets autogenerated from
files in ./etc/)

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
note that the control.in files still generates a few warnings,
but i cannot send a patch for those, as long as the Depends line is
longer than 998 lines (thank to smtp rfc)
 Makefile                               | 33 +++++++--------------------------
 debian/{changelog.Debian => changelog} |  0
 debian/compat                          |  1 +
 debian/conffiles                       | 15 ---------------
 debian/control.in                      |  6 ++++++
 copyright => debian/copyright          |  0
 debian/docs                            |  1 +
 debian/rules                           | 17 +++++++++++++++++
 8 files changed, 32 insertions(+), 41 deletions(-)
 rename debian/{changelog.Debian => changelog} (100%)
 create mode 100644 debian/compat
 delete mode 100644 debian/conffiles
 rename copyright => debian/copyright (100%)
 create mode 100644 debian/docs
 create mode 100755 debian/rules

diff --git a/Makefile b/Makefile
index 0b7cf3e1..5cf69099 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 include defines.mk
 
-export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -l debian/changelog.Debian -STimestamp)
+export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
 
 DESTDIR=
 
@@ -29,30 +29,14 @@ country.dat: country.pl
 .PHONY: deb
 deb: $(DEB)
 $(DEB):
-	${MAKE} -C bin/test check
-	make clean
 	rm -rf dest
 	mkdir dest
-	make DESTDIR=`pwd`/dest install
-	mkdir dest/DEBIAN
-	sed -e s/@VERSION@/${VERSION}/ -e s/@PACKAGE@/${PACKAGE}/ -e s/@PACKAGERELEASE@/${PACKAGERELEASE}/ debian/control.in >dest/DEBIAN/control
-	install -m 0644 debian/conffiles dest/DEBIAN
-	install -m 0755 debian/config dest/DEBIAN
-	install -m 0644 debian/templates dest/DEBIAN
-	install -m 0755 debian/preinst dest/DEBIAN
-	install -m 0755 debian/postinst dest/DEBIAN
-	install -m 0755 debian/prerm dest/DEBIAN
-	install -m 0755 debian/postrm dest/DEBIAN
-	install -m 0644 debian/triggers dest/DEBIAN
-	install -m 0644 -D debian/lintian-overrides dest/usr/share/lintian/overrides/${PACKAGE}
-	echo "git clone git://git.proxmox.com/git/pve-manager.git\\ngit checkout ${GITVERSION}" >  dest/usr/share/doc/${PACKAGE}/SOURCE
-	gzip -n --best dest/usr/share/man/*/*
-	gzip -n --best dest/usr/share/doc/${PACKAGE}/changelog.Debian
-	dpkg-deb --build dest
-	mv dest.deb ${DEB}
-	rm -rf dest
+	rsync -a * dest
+	sed -e s/@VERSION@/${VERSION}/ -e s/@PACKAGE@/${PACKAGE}/ -e s/@PACKAGERELEASE@/${PACKAGERELEASE}/ debian/control.in >dest/debian/control
+	echo "git clone git://git.proxmox.com/git/pve-manager.git\\ngit checkout ${GITVERSION}" >  dest/debian/SOURCE
+	cd dest; dpkg-buildpackage -rfakeroot -b -us -uc
 	# supress lintian error: statically-linked-binary usr/bin/pvemailforward
-	lintian -X binaries ${DEB}	
+	lintian -X binaries ${DEB}
 
 .PHONY: upload
 upload: ${DEB} check
@@ -87,11 +71,8 @@ install: country.dat vzdump.conf vzdump-hook-script.pl pve-apt.conf mtu bridgevl
 
 	install -m 0644 vzdump-hook-script.pl ${DOCDIR}/examples/vzdump-hook-script.pl
 	install -m 0644 spice-example-sh ${DOCDIR}/examples/spice-example-sh
-	install -m 0644 copyright ${DOCDIR}
-	install -m 0644 debian/changelog.Debian ${DOCDIR}
 	install -m 0644 country.dat ${DESTDIR}/usr/share/${PACKAGE}
-	# temporary: set ExtJS 6 migration devel directory
-	install -d ${DESTDIR}/usr/share/${PACKAGE}/manager6
+
 	set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
 
 .PHONY: distclean
diff --git a/debian/changelog.Debian b/debian/changelog
similarity index 100%
rename from debian/changelog.Debian
rename to debian/changelog
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 00000000..ec635144
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/conffiles b/debian/conffiles
deleted file mode 100644
index d2f93716..00000000
--- a/debian/conffiles
+++ /dev/null
@@ -1,15 +0,0 @@
-/etc/init.d/pve-manager
-/etc/init.d/pvedaemon
-/etc/init.d/pveproxy
-/etc/init.d/spiceproxy
-/etc/init.d/pvestatd
-/etc/vzdump.conf
-/etc/logrotate.d/pve
-/etc/apt/apt.conf.d/75pveconf
-/etc/apt/sources.list.d/pve-enterprise.list
-/etc/network/if-up.d/mtu
-/etc/network/if-pre-up.d/vlan
-/etc/network/if-post-down.d/vlan
-/etc/network/if-up.d/bridgevlan
-/etc/network/if-up.d/bridgevlanport
-/etc/modprobe.d/pve-blacklist.conf
diff --git a/debian/control.in b/debian/control.in
index 2fbfa65a..91226c55 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -1,3 +1,9 @@
+Source: @PACKAGE@
+Section: admin
+Priority: optional
+Build-Depends: liblocale-po-perl
+Maintainer: Proxmox Support Team <support at proxmox.com>
+
 Package: @PACKAGE@
 Version: @VERSION at -@PACKAGERELEASE@
 Section: admin
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 00000000..86966720
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1 @@
+debian/SOURCE
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 00000000..b9eb7da0
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,17 @@
+#!/usr/bin/make -f
+
+override_dh_compress:
+	dh_compress -Xaplinfo.dat
+
+override_dh_strip_nondeterminism:
+	dh_strip_nondeterminism -X.png
+
+override_dh_fixperms:
+	dh_fixperms
+	find debian -name 'pvemailforward' -exec chmod 2755 {} +
+	find debian -name 'pvemailforward' -exec chown root:www-data {} +
+	find debian -type d -name 'pveproxy' -exec chown www-data:www-data {} +
+	find debian -type d -name 'pveproxy' -exec chmod 700 {} +
+
+%:
+	dh $@
-- 
2.11.0





More information about the pve-devel mailing list