[pmg-devel] [PATCH v2 proxmox-mailgateway] create new meta package for container environment

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Mar 13 14:55:27 CET 2019


If PMG gets installed in a container environment, e.g., in PVE CTs,
the installation does not requires its own kernel, as the host kernel
is used anyway. So add a new separate meta package which can be used
to install, or to switch, to such a setup.

A user can save well a third of the additional space required on top
of a quite minimal Debian installation, i.e., proxmox-mailgateway:

> 0 upgraded, 183 newly installed, 0 to remove and 0 not upgraded.
> Need to get 153 MB of archives.
> After this operation, 638 MB of additional disk space will be used.

vs. with new proxmox-mailgateway-container:

> 0 upgraded, 169 newly installed, 0 to remove and 0 not upgraded.
> Need to get 59.9 MB of archives.
> After this operation, 206 MB of additional disk space will be used.

This quite big difference does not comes only from the kernel, but
also it's dependencies like grub, initramfs-tools, pve-firmware, ...

On new CT installations you can just setup the PMG by installing:
> apt install proxmox-mailgateway-container
and be done, if you need to switch to a system with kernel you can do
so by installing proxmox-mailgateway .

To make a switch on an existing system you need to do the following:
> apt install proxmox-mailgateway-container
> apt purge pve-kernel-*
> apt autoremove --purge

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

changes v1 -> v2:
* s/virtualized/container/ to reduce confusion possibillity, else people think
  this works in any virtualized environment, like KVM, HyperV, ...
* add better Makefile support for the new package

 Makefile       | 11 ++++++++---
 debian/control | 12 ++++++++++++
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 08a15fa..57c3da1 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,9 @@ PKGREL=10
 PACKAGE=proxmox-mailgateway
 
 DEB=${PACKAGE}_${RELEASE}-${PKGREL}_all.deb
+CT_DEB=${PACKAGE}-container_${RELEASE}-${PKGREL}_all.deb
+
+DEBS=${DEB} ${CT_DEB}
 
 BUILD_DIR=build
 
@@ -12,16 +15,18 @@ DIST=stretch
 
 all: ${DEB}
 
+.PHONY: deb
+deb ${CT_DEB}: ${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}
+	lintian ${DEBS}
 
 .PHONY: upload
-upload: ${DEB}
-	tar cf - ${DEB}|ssh -X repoman at repo.proxmox.com -- upload --product pmg --dist ${DIST} --arch ${ARCH}
+upload: ${DEBS}
+	tar cf - ${DEBS}|ssh -X repoman at repo.proxmox.com -- upload --product pmg --dist ${DIST} --arch ${ARCH}
 
 clean:
 	rm -rf ${BUILD_DIR} *.deb *.buildinfo *.changes
diff --git a/debian/control b/debian/control
index 5a0d487..2a24137 100644
--- a/debian/control
+++ b/debian/control
@@ -15,3 +15,15 @@ Description: Proxmox Mail Gateway
  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.
+
+Package: proxmox-mailgateway-container
+Architecture: all
+Depends: libc6, pmg-api
+Replaces: proxmox-mailgateway
+Breaks: proxmox-mailgateway
+Provides: proxmox-mailgateway
+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 in a virtualized environment
+ where no kernel is necessary.
-- 
2.20.1




More information about the pmg-devel mailing list