[pve-devel] [PATCH storage] change from dpkg-deb to dpkg-buildpackage
Thomas Lamprecht
t.lamprecht at proxmox.com
Fri Jun 9 17:20:09 CEST 2017
add debian directory and move the respective files there and add
missing (rules, compat).
Move control.in to control as no sed search & replacement must be
done. Add a Source section to the control file.
Rename the "check" Makefile target to "test" so that the dh_auto_test
helper executes it automatically on build.
Move the verify_api check to this target.
Cleanup the "clean" target and remove outdated commented out stuff
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
diffoscope tells me that the changes do not affect the resulting .deb file
Makefile | 33 +++++++++++++--------------------
changelog.Debian => debian/changelog | 0
debian/compat | 1 +
control.in => debian/control | 14 +++++++++-----
copyright => debian/copyright | 0
debian/docs | 1 +
debian/rules | 13 +++++++++++++
triggers => debian/triggers | 0
8 files changed, 37 insertions(+), 25 deletions(-)
rename changelog.Debian => debian/changelog (100%)
create mode 100644 debian/compat
rename control.in => debian/control (64%)
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 b4b0561..a74bf4b 100644
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,8 @@ BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/
export PERLDIR=${PREFIX}/share/perl5
-#ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
+
ARCH=all
GITVERSION:=$(shell cat .git/refs/heads/master)
@@ -23,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
@@ -34,7 +35,7 @@ pvesm.bash-completion:
mv $@.tmp $@
.PHONY: install
-install: pvesm.1 pvesm.bash-completion
+install: PVE pvesm.1 pvesm.bash-completion
install -d ${DESTDIR}${SBINDIR}
install -m 0755 pvesm ${DESTDIR}${SBINDIR}
make -C PVE install
@@ -45,30 +46,22 @@ install: pvesm.1 pvesm.bash-completion
.PHONY: deb
deb: ${DEB}
-${DEB}: check
- rm -rf debian
- mkdir debian
- make DESTDIR=${CURDIR}/debian install
- perl -I. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->verify_api();"
- install -d -m 0755 debian/DEBIAN
- sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/ <control.in >debian/DEBIAN/control
- install -D -m 0644 copyright debian/${DOCDIR}/copyright
- install -m 0644 changelog.Debian debian/${DOCDIR}/
- install -m 0644 triggers debian/DEBIAN
- gzip -9 -n debian/${DOCDIR}/changelog.Debian
- echo "git clone git://git.proxmox.com/git/pve-storage.git\\ngit checkout ${GITVERSION}" > debian/${DOCDIR}/SOURCE
- fakeroot dpkg-deb --build debian
- mv debian.deb ${DEB}
- rm -rf debian
+${DEB}:
+ rm -rf build
+ rsync -a * build
+ echo "git clone git://git.proxmox.com/git/pve-storage.git\\ngit checkout ${GITVERSION}" >build/debian/SOURCE
+ cd build; dpkg-buildpackage -rfakeroot -b -us -uc
lintian ${DEB}
-check:
+.PHONY: test
+test:
+ perl -I. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->verify_api();"
make -C test
.PHONY: clean
clean:
make cleanup-docgen
- rm -rf debian *.deb ${PACKAGE}-*.tar.gz dist *.1 *.tmp pvesm.bash-completion
+ 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
similarity index 64%
rename from control.in
rename to debian/control
index 07cce0b..d88ac39 100644
--- a/control.in
+++ b/debian/control
@@ -1,9 +1,13 @@
-Package: libpve-storage-perl
-Version: @@VERSION@@-@@PKGRELEASE@@
+Source: libpve-storage-perl
Section: perl
-Priority: optional
-Architecture: @@ARCH@@
-Depends: perl (>= 5.6.0-16), nfs-common, udev, libpve-common-perl, lvm2, thin-provisioning-tools, libfile-chdir-perl, glusterfs-client (>= 3.4.0-2), cstream, libnet-dbus-perl, smartmontools
+Priority: extra
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-storage-perl
+Architecture: all
+Depends: perl (>= 5.6.0-16), nfs-common, udev, libpve-common-perl, lvm2, thin-provisioning-tools, libfile-chdir-perl, glusterfs-client (>= 3.4.0-2), cstream, libnet-dbus-perl, smartmontools
Description: Proxmox VE storage management library
This package contains the storage management library 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