From 4465319459bac4e0bb8d7f30a813f089aa15df74 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 21 Mar 2018 11:29:19 +0100 Subject: [PATCH] switch build to dpkg-buildpackage, depend on pve-kernel-4.13 meta package --- Makefile | 37 ++------- conffiles | 2 - changelog.Debian => debian/changelog | 8 ++ control.in => debian/control | 15 ++-- copyright => debian/copyright | 0 .../grub/proxmox-mailgateway.cfg | 0 debian/postinst | 15 ++++ postrm.in => debian/postrm | 0 debian/proxmox-mailgateway.install | 2 + .../proxmox-ve-release-5.x.gpg | Bin debian/rules | 27 +++++++ postinst.in | 75 ------------------ 12 files changed, 70 insertions(+), 111 deletions(-) delete mode 100644 conffiles rename changelog.Debian => debian/changelog (87%) rename control.in => debian/control (67%) rename copyright => debian/copyright (100%) rename grub-defaults.cfg => debian/grub/proxmox-mailgateway.cfg (100%) create mode 100755 debian/postinst rename postrm.in => debian/postrm (100%) create mode 100644 debian/proxmox-mailgateway.install rename proxmox-release-5.x.pubkey => debian/proxmox-ve-release-5.x.gpg (100%) create mode 100644 debian/rules delete mode 100755 postinst.in diff --git a/Makefile b/Makefile index da5b846..6b2941d 100644 --- a/Makefile +++ b/Makefile @@ -1,49 +1,28 @@ RELEASE=5.0 -PKGREL=8 +PKGREL=9 PACKAGE=proxmox-mailgateway DEB=${PACKAGE}_${RELEASE}-${PKGREL}_all.deb -KERNEL_VER=4.13.13 -KREL=6 - -EXTRAVERSION=-${KREL}-pve -KVNAME=${KERNEL_VER}${EXTRAVERSION} +BUILD_DIR=build ARCH=amd64 DIST=stretch -STAGING_REPO=/pve/repoman/staging/pmg/dists/${DIST}/pmg-${RELEASE}/binary-${ARCH}/ - -KERNEL:=$(shell find ${STAGING_REPO} -name "pve-kernel-${KVNAME}_*deb") all: ${DEB} -${DEB}: control copyright changelog.Debian postinst postrm proxmox-release-5.x.pubkey - rm -rf build - test -n "${KERNEL}" || false "kernel ${KERNEL} not found" - mkdir -p build/DEBIAN - mkdir -p build/usr/share/doc/${PACKAGE} - mkdir -p build/etc/apt/trusted.gpg.d - install -m 0644 proxmox-release-5.x.pubkey build/etc/apt/trusted.gpg.d/proxmox-ve-release-5.x.gpg - install -m 0644 conffiles build/DEBIAN/conffiles - install -m 0644 control build/DEBIAN/control - install -m 0755 postinst build/DEBIAN/postinst - install -m 0755 postrm build/DEBIAN/postrm - install -m 0644 copyright build/usr/share/doc/${PACKAGE} - install -m 0644 changelog.Debian build/usr/share/doc/${PACKAGE} - install -D -m 0644 grub-defaults.cfg build/etc/default/grub.d/proxmox-mailgateway.cfg - gzip -n --best build/usr/share/doc/${PACKAGE}/changelog.Debian - dpkg-deb --build build ${DEB} +${DEB}: debian + rm -rf ${BUILD_DIR} + mkdir -p ${BUILD_DIR}/debian + cp -ar debian/* ${BUILD_DIR}/debian/ + cd ${BUILD_DIR}; dpkg-buildpackage -b -uc -us lintian ${DEB} -%: %.in - sed -e 's/@KVNAME@/${KVNAME}/' -e 's/@KERNEL_VER@/${KERNEL_VER}/' -e 's/@RELEASE@/${RELEASE}/' -e 's/@PKGREL@/${PKGREL}/' <$< >$@ - .PHONY: upload upload: ${DEB} tar cf - ${DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist ${DIST} --arch ${ARCH} clean: - rm -rf build control postinst postrm *.deb + rm -rf ${BUILD_DIR} *.deb *.buildinfo *.changes find . -name '*~' -exec rm {} ';' diff --git a/conffiles b/conffiles deleted file mode 100644 index d2cfe33..0000000 --- a/conffiles +++ /dev/null @@ -1,2 +0,0 @@ -/etc/apt/trusted.gpg.d/proxmox-ve-release-5.x.gpg -/etc/default/grub.d/proxmox-mailgateway.cfg diff --git a/changelog.Debian b/debian/changelog similarity index 87% rename from changelog.Debian rename to debian/changelog index 4fba7df..59fbace 100644 --- a/changelog.Debian +++ b/debian/changelog @@ -1,3 +1,11 @@ +proxmox-mailgateway (5.0-9) unstable; urgency=medium + + * switch build to dpkg-buildpackage + + * depend on pve-kernel-4.13 meta package + + -- Proxmox Support Team Wed, 21 Mar 2018 10:58:19 +0100 + proxmox-mailgateway (5.0-8) unstable; urgency=medium * depend on new kernel 4.13.13-6 diff --git a/control.in b/debian/control similarity index 67% rename from control.in rename to debian/control index b72b782..c6690e9 100644 --- a/control.in +++ b/debian/control @@ -1,12 +1,17 @@ -Package: proxmox-mailgateway -Version: @RELEASE@-@PKGREL@ -Architecture: all +Source: proxmox-mailgateway Section: admin Priority: optional -Depends: libc6 (>= 2.7-18), pve-kernel-@KVNAME@, pve-firmware, pmg-api +Build-Depends: debhelper (>=10~), + lintian Maintainer: Proxmox Support Team + +Package: proxmox-mailgateway +Architecture: all +Depends: libc6 (>= 2.7-18), + pve-kernel-4.13, + pmg-api Description: Proxmox Mail Gateway The Proxmox Mail Gateway is an easy to use Open Source SMTP proxy, including efficient Spam and virus filters. This is a meta package which will install everything needed. This package also depends on - the latest available Proxmox kernel from the @KERNEL_VER@ series. + the latest available Proxmox kernel. diff --git a/copyright b/debian/copyright similarity index 100% rename from copyright rename to debian/copyright diff --git a/grub-defaults.cfg b/debian/grub/proxmox-mailgateway.cfg similarity index 100% rename from grub-defaults.cfg rename to debian/grub/proxmox-mailgateway.cfg diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 0000000..aa17f0b --- /dev/null +++ b/debian/postinst @@ -0,0 +1,15 @@ +#!/bin/sh + +# Abort if any command returns an error value +set -e + +case "$1" in + configure) + # setup kernel links for installation CD (rescue boot) + mkdir -p /boot/pve + ln -sf /boot/pve/vmlinuz-4.13 /boot/pve/vmlinuz + ln -sf /boot/pve/initrd.img-4.13 /boot/pve/initrd.img + ;; +esac + +exit 0 diff --git a/postrm.in b/debian/postrm similarity index 100% rename from postrm.in rename to debian/postrm diff --git a/debian/proxmox-mailgateway.install b/debian/proxmox-mailgateway.install new file mode 100644 index 0000000..4be6882 --- /dev/null +++ b/debian/proxmox-mailgateway.install @@ -0,0 +1,2 @@ +debian/proxmox-ve-release-5.x.gpg etc/apt/trusted.gpg.d/ +debian/grub/proxmox-mailgateway.cfg etc/default/grub.d/ diff --git a/proxmox-release-5.x.pubkey b/debian/proxmox-ve-release-5.x.gpg similarity index 100% rename from proxmox-release-5.x.pubkey rename to debian/proxmox-ve-release-5.x.gpg diff --git a/debian/rules b/debian/rules new file mode 100644 index 0000000..91ab708 --- /dev/null +++ b/debian/rules @@ -0,0 +1,27 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +install: + dh_install + dh_installdocs + dh_installchangelogs + dh_installman + dh_strip_nondeterminism + dh_compress + dh_fixperms + +binary: install + dh_strip + dh_makeshlibs + dh_shlibdeps + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +.PHONY: build clean +build clean: diff --git a/postinst.in b/postinst.in deleted file mode 100755 index 2e260bb..0000000 --- a/postinst.in +++ /dev/null @@ -1,75 +0,0 @@ -#! /bin/sh - -# Abort if any command returns an error value -set -e - -# This script is called as the last step of the installation of the -# package. All the package's files are in place, dpkg has already -# done its automatic conffile handling, and all the packages we depend -# of are already fully installed and configured. - -# The following idempotent stuff doesn't generally need protecting -# against being run in the abort-* cases. - -case "$1" in - configure) - # Configure this package. If the package must prompt the user for - # information, do it here. - - # setup kernel links for installation CD (rescue boot) - mkdir -p /boot/pve - ln -sf /boot/vmlinuz-@KVNAME@ /boot/pve/vmlinuz - ln -sf /boot/initrd.img-@KVNAME@ /boot/pve/initrd.img - - # There are three sub-cases: - if test "${2+set}" != set; then - # We're being installed by an ancient dpkg which doesn't remember - # which version was most recently configured, or even whether - # there is a most recently configured version. - : - - elif test -z "$2" -o "$2" = ""; then - # The package has not ever been configured on this system, or was - # purged since it was last configured. - : - - else - # Version $2 is the most recently configured version of this - # package. - : - - fi ;; - abort-upgrade) - # Back out of an attempt to upgrade this package FROM THIS VERSION - # to version $2. Undo the effects of "prerm upgrade $2". - : - - ;; - abort-remove) - if test "$2" != in-favour; then - echo "$0: undocumented call to \`postinst $*'" 1>&2 - exit 0 - fi - # Back out of an attempt to remove this package, which was due to - # a conflict with package $3 (version $4). Undo the effects of - # "prerm remove in-favour $3 $4". - : - - ;; - abort-deconfigure) - if test "$2" != in-favour -o "$5" != removing; then - echo "$0: undocumented call to \`postinst $*'" 1>&2 - exit 0 - fi - # Back out of an attempt to deconfigure this package, which was - # due to package $6 (version $7) which we depend on being removed - # to make way for package $3 (version $4). Undo the effects of - # "prerm deconfigure in-favour $3 $4 removing $6 $7". - : - - ;; - *) echo "$0: didn't understand being called with \`$1'" 1>&2 - exit 0;; -esac - -exit 0 -- 2.39.2