From 08cf7a8e6e9d5972a7a75372a38c8d7bf8563ab3 Mon Sep 17 00:00:00 2001 From: Justin Warren Date: Mon, 8 Jun 2026 18:06:44 +1000 Subject: [PATCH] Improve native (.deb) packaging for Debian/Ubuntu 24.04 (#1041) thanks @jpwarren --- .gitignore | 11 +++++++++++ composer.json | 2 +- debian/changelog | 8 ++++++++ debian/compat | 1 - debian/postfixadmin.install | 2 +- debian/rules | 8 ++++++-- 6 files changed, 27 insertions(+), 5 deletions(-) delete mode 100644 debian/compat diff --git a/.gitignore b/.gitignore index ed493673..5c8d08c7 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,14 @@ /build /tests/postfixadmin.sqlite.*.test /phpstorm-docker-dev/ +debian/files +debian/postfixadmin/ +debian/postfixadmin.substvars +debian/postfixadmin.postinst.debhelper +debian/postfixadmin.postrm.debhelper +debian/postfixadmin.preinst.debhelper +debian/postfixadmin.prerm.debhelper +build-stamp +debian/.debhelper/ +.pc/ +.devcontainer/ diff --git a/composer.json b/composer.json index 108c04f2..06b5972e 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ ], "check-format": "@php vendor/bin/php-cs-fixer fix --ansi --dry-run --diff", "format": "@php vendor/bin/php-cs-fixer fix --ansi", - "lint": "@php ./vendor/bin/parallel-lint --exclude vendor/ .", + "lint": "@php ./vendor/bin/parallel-lint --exclude vendor/ --exclude debian/ .", "test": "@php ./vendor/bin/phpunit --coverage-clover ./clover.xml --do-not-cache-result tests/", "test-fixup": "mkdir -p templates_c ; test -f config.local.php || touch config.local.php", "psalm": "@php ./vendor/bin/psalm.phar --no-cache --show-info=false ", diff --git a/debian/changelog b/debian/changelog index 3a150abf..295180bf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +postfixadmin (4.0.1-1) unstable; urgency=medium + + * Remove debian/compat that is no longer needed + * Swap unused lib/ for composer's vendor/ path in debian install rules + * Update debian/rules to make prep more readable + + -- Justin Warren Mon, 13 Apr 2026 06:47:48 +1000 + postfixadmin (3.3.10-2) unstable; urgency=medium * remove unnessesary fix for mysqli instead of mysql diff --git a/debian/compat b/debian/compat deleted file mode 100644 index 7f8f011e..00000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -7 diff --git a/debian/postfixadmin.install b/debian/postfixadmin.install index 9ef93ceb..49761f17 100644 --- a/debian/postfixadmin.install +++ b/debian/postfixadmin.install @@ -2,10 +2,10 @@ public usr/share/postfixadmin configs usr/share/postfixadmin languages usr/share/postfixadmin -lib usr/share/postfixadmin model usr/share/postfixadmin scripts usr/share/postfixadmin templates usr/share/postfixadmin configs usr/share/postfixadmin +vendor usr/share/postfixadmin debian/lighttpd/90-postfixadmin.conf etc/lighttpd/conf-available debian/apache/postfixadmin.conf etc/apache2/conf-available diff --git a/debian/rules b/debian/rules index fa3e8041..2bee8341 100755 --- a/debian/rules +++ b/debian/rules @@ -8,10 +8,14 @@ export VERSION = $(shell grep -E "version = '.*';" functions.inc.php |sed -e " export DEBVERSION = $(shell grep -E "postfixadmin .([0-9]+|\.)+" debian/changelog |head -1 |sed -e "s/postfixadmin .//" |sed -e "s/-.*//") -# Create a needed tar.gz file to build a non-nativ .dpkg +# Create a needed tar.gz file to build a non-native .dpkg prep: rm -f ../postfixadmin_*orig.tar.gz - cd ..; tar --exclude-vcs --exclude=$(notdir ${CURDIR})/debian --exclude=$(notdir ${CURDIR})/.pc -cvzf postfixadmin_${DEBVERSION}.orig.tar.gz $(notdir ${CURDIR}) + cd ..; tar cvzf \ + --exclude-vcs \ + --exclude=$(notdir ${CURDIR})/debian \ + --exclude=$(notdir ${CURDIR})/.pc \ + postfixadmin_${DEBVERSION}.orig.tar.gz $(notdir ${CURDIR}) build: build-arch build-indep build-arch: build-stamp