From d93352e935a64b3f52a57f4fc6a150d3d7fcb6b7 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 6 Jun 2018 08:20:47 +0200 Subject: [PATCH] buildsys: convert to dpkg-buildpackage and cleanup Signed-off-by: Thomas Lamprecht --- Makefile | 58 +++++++++++----------------- control.in | 9 ----- changelog.Debian => debian/changelog | 0 debian/compat | 1 + debian/control | 13 +++++++ copyright => debian/copyright | 0 debian/rules | 8 ++++ 7 files changed, 44 insertions(+), 45 deletions(-) delete mode 100644 control.in rename changelog.Debian => debian/changelog (100%) create mode 100644 debian/compat create mode 100644 debian/control rename copyright => debian/copyright (100%) create mode 100755 debian/rules diff --git a/Makefile b/Makefile index 9e182f4..b279266 100644 --- a/Makefile +++ b/Makefile @@ -5,62 +5,48 @@ PACKAGE=pve-zsync PKGREL=16 DESTDIR= -PREFIX=/usr -BINDIR=${PREFIX}/bin -SBINDIR=${PREFIX}/sbin -MANDIR=${PREFIX}/share/man -DOCDIR=${PREFIX}/share/doc/${PACKAGE} -PODDIR=${DOCDIR}/pod -MAN1DIR=${MANDIR}/man8/ +SBINDIR=${DESTDIR}/usr/sbin +MAN8DIR=${DESTDIR}/usr/share/man/man8 +DOCDIR=${DESTDIR}/usr/share/doc/${PACKAGE} +WORKDIR=${DESTDIR}/var/lib/pve-zsync + +BUILDDIR=build -#ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) ARCH=all -GITVERSION:=$(shell cat .git/refs/heads/master) +GITVERSION:=$(shell git rev-parse HEAD) DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb -all: ${DEB} +all: .PHONY: dinstall dinstall: deb dpkg -i ${DEB} -%.8.gz: %.8.man - rm -f $@ - gzip -n pve-zsync.8.man -c9 >$@ - -pve-zsync.8.man: pve-zsync - ./pve-zsync printpod | pod2man -c "Proxmox Documentation" -s 8 -r ${RELEASE} -n pve-zsync - pve-zsync.8.man +pve-zsync.8: pve-zsync + ./pve-zsync printpod | pod2man -c "Proxmox Documentation" -s 8 -r ${RELEASE} -n pve-zsync - pve-zsync.8 .PHONY: install -install: pve-zsync.8.man pve-zsync.8.gz - install -d ${DESTDIR}${SBINDIR} - install -m 0755 pve-zsync ${DESTDIR}${SBINDIR} - install -d ${DESTDIR}/usr/share/man/man8 - install -d ${DESTDIR}${PODDIR} - install -m 0644 pve-zsync.8.gz ${DESTDIR}/usr/share/man/man8/ +install: pve-zsync.8 + install -d ${SBINDIR} + install -m 0755 pve-zsync ${SBINDIR}/pve-zsync + install -d ${WORKDIR} + install -d ${MAN8DIR} + install -m 0644 pve-zsync.8 ${MAN8DIR}/pve-zsync.8 + install -d ${DOCDIR} + echo "git clone git://git.proxmox.com/git/pve-zsync.git\\ngit checkout ${GITVERSION}" > ${DOCDIR}/SOURCE .PHONY: deb deb: ${DEB} ${DEB}: - rm -rf debian - mkdir debian - install -d debian/var/lib/pve-zsync - make DESTDIR=${CURDIR}/debian install - install -d -m 0755 debian/DEBIAN - sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/ debian/DEBIAN/control - install -D -m 0644 copyright debian/${DOCDIR}/copyright - install -m 0644 changelog.Debian debian/${DOCDIR}/ - gzip -n -9 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 ${BUILDDIR} + rsync -a * build + cd build; dpkg-buildpackage -b -us -uc lintian ${DEB} - rm -rf debian .PHONY: clean clean: - rm -rf debian *.deb ${PACKAGE}-*.tar.gz dist *.8.man *.8.gz *.buildinfo + rm -rf ${BUILDDIR} *.deb *.buildinfo *.changes find . -name '*~' -exec rm {} ';' .PHONY: distclean diff --git a/control.in b/control.in deleted file mode 100644 index e56ab8b..0000000 --- a/control.in +++ /dev/null @@ -1,9 +0,0 @@ -Package: pve-zsync -Version: @@VERSION@@-@@PKGRELEASE@@ -Section: perl -Priority: optional -Architecture: @@ARCH@@ -Depends: perl (>= 5.6.0-16) -Maintainer: Proxmox Support Team -Description: Proxmox VE storage management library - This package contains the Proxmox VE ZFS sync Tool. 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 b/debian/control new file mode 100644 index 0000000..50597b4 --- /dev/null +++ b/debian/control @@ -0,0 +1,13 @@ +Source: pve-zsync +Section: perl +Priority: optional +Maintainer: Proxmox Support Team +Standards-Version: 3.8.4 + +Package: pve-zsync +Section: perl +Priority: optional +Architecture: all +Depends: ${perl:Depends}, +Description: Proxmox VE ZFS syncing tool + Tool for automated syncing of ZFS subvolumes and pools. 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..64b89e0 --- /dev/null +++ b/debian/rules @@ -0,0 +1,8 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + +%: + dh $@ + -- 2.39.2