diff --git a/debian/changelog b/debian/changelog index 4b4a10b5..3210d278 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,31 +1,6 @@ -postfixadmin (2.3.4) unstable; urgency=low +postfixadmin (2.3.5-1) unstable; urgency=low - * New upstream release (2.3.4) + * Initial Debian release (Closes: #247225) - -- David Goodwin Fri, 16 Sep 2011 19:33:00 +0100 - -postfixadmin (2.3.3) unstable; urgency=low - - * New upstream release (2.3.3) - - -- David Goodwin Mon, 14 Mar 2011 22:20:00 +0100 - -postfixadmin (2.3.2) unstable; urgency=low - - * New upstream release - - -- David Goodwin Mon, 23 Aug 2010 11:24:00 +0100 - -postfixadmin (2.3.1) unstable; urgency=low - - * New upstream release - * Updated .deb standards (thanks normes) - - -- David Goodwin Thu, 08 Jul 2010 22:20:14 +0100 - -postfixadmin (2.3) unstable; urgency=low - - * Initial release (Closes: #247225) - - -- Norman Messtorff Sun, 21 Feb 2010 22:36:26 +0200 + -- Norman Messtorff Sun, 15 Jan 2012 12:27:28 +0100 diff --git a/debian/control b/debian/control index 82d04bcb..c48c87c1 100644 --- a/debian/control +++ b/debian/control @@ -3,14 +3,13 @@ Section: admin Priority: optional Maintainer: Norman Messtorff Build-Depends: debhelper (>= 7), po-debconf, quilt (>= 0.46) -Standards-Version: 3.8.4 +Standards-Version: 3.9.2 Homepage: http://postfixadmin.sourceforge.net -XS-Vcs-Svn: https://postfixadmin.svn.sourceforge.net/svnroot/postfixadmin/trunk Package: postfixadmin Architecture: all Depends: debconf (>= 0.5), dbconfig-common, wwwconfig-common, apache2 | lighttpd | httpd, libapache2-mod-php5 | php5-cgi | php5, php5-imap, php5-mysql | php5-pgsql, mysql-client | postgresql-client, ${misc:Depends} -Recommends: postfix-mysql | postfix-pgsql, mysql-server | postgresql-server +Recommends: postfix-mysql | postfix-pgsql, mysql-server | postgresql-server | postgresql Suggests: squirrelmail-postfixadmin, dovecot-common | courier-authlib-mysql | courier-authlib-postgresql Description: Virtual mail hosting interface for Postfix Postfixadmin is a web interface to managing virtual users and domains diff --git a/debian/patches/20110414_db-credentials b/debian/patches/20110414_db-credentials deleted file mode 100644 index 0cf3d066..00000000 --- a/debian/patches/20110414_db-credentials +++ /dev/null @@ -1,31 +0,0 @@ -Index: postfixadmin-trunk/config.inc.php -=================================================================== ---- postfixadmin-trunk.orig/config.inc.php 2010-02-21 19:04:32.000000000 +0100 -+++ postfixadmin-trunk/config.inc.php 2010-02-21 19:05:26.000000000 +0100 -@@ -23,7 +23,7 @@ - * Doing this implies you have changed this file as required. - * i.e. configuring database etc; specifying setup.php password etc. - */ --$CONF['configured'] = false; -+$CONF['configured'] = true; - - // In order to setup Postfixadmin, you MUST specify a hashed password here. - // To create the hash, visit setup.php in a browser and type a password into the field, -@@ -46,11 +46,11 @@ - // mysql = MySQL 3.23 and 4.0, 4.1 or 5 - // mysqli = MySQL 4.1+ - // pgsql = PostgreSQL --$CONF['database_type'] = 'mysql'; --$CONF['database_host'] = 'localhost'; --$CONF['database_user'] = 'postfix'; --$CONF['database_password'] = 'postfixadmin'; --$CONF['database_name'] = 'postfix'; -+$CONF['database_type'] = '_DBC_DBTYPE_'; -+$CONF['database_host'] = '_DBC_DBSERVER_'; -+$CONF['database_user'] = '_DBC_DBUSER_'; -+$CONF['database_password'] = '_DBC_DBPASS_'; -+$CONF['database_name'] = '_DBC_DBNAME_'; - // If you need to specify a different port for a MYSQL database connection, use e.g. - // $CONF['database_host'] = '172.30.33.66:3308'; - // If you need to specify a different port for POSTGRESQL database connection - diff --git a/debian/patches/db_credentials b/debian/patches/db_credentials new file mode 100644 index 00000000..1ca2e366 --- /dev/null +++ b/debian/patches/db_credentials @@ -0,0 +1,56 @@ +Description: This patch sets the dbconfig placeholders in config.inc.php. +Forwarded: not-needed +Author: Norman Messtorff +Last-Update: 2011-12-18 + +Index: postfixadmin-2.3/config.inc.php +=================================================================== +--- postfixadmin-2.3.orig/config.inc.php 2012-01-14 12:42:16.000000000 +0100 ++++ postfixadmin-2.3/config.inc.php 2012-01-14 12:56:28.000000000 +0100 +@@ -16,6 +16,11 @@ + * Contains configuration options. + */ + ++// This loads the automatic generated DB credentials from /etc/postfixadmin/dbconfig.inc.php ++require_once('dbconfig.inc.php'); ++if (!isset($dbserver) || empty($dbserver)) ++ $dbserver='localhost'; ++ + /***************************************************************** + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * You have to set $CONF['configured'] = true; before the +@@ -23,7 +28,7 @@ + * Doing this implies you have changed this file as required. + * i.e. configuring database etc; specifying setup.php password etc. + */ +-$CONF['configured'] = false; ++$CONF['configured'] = true; + + // In order to setup Postfixadmin, you MUST specify a hashed password here. + // To create the hash, visit setup.php in a browser and type a password into the field, +@@ -33,7 +38,7 @@ + // Postfix Admin Path + // Set the location of your Postfix Admin installation here. + // YOU MUST ENTER THE COMPLETE URL e.g. http://domain.tld/postfixadmin +-$CONF['postfix_admin_url'] = ''; ++$CONF['postfix_admin_url'] = '/postfixadmin'; + + // shouldn't need changing. + $CONF['postfix_admin_path'] = dirname(__FILE__); +@@ -46,11 +51,11 @@ + // mysql = MySQL 3.23 and 4.0, 4.1 or 5 + // mysqli = MySQL 4.1+ + // pgsql = PostgreSQL +-$CONF['database_type'] = 'mysql'; +-$CONF['database_host'] = 'localhost'; +-$CONF['database_user'] = 'postfix'; +-$CONF['database_password'] = 'postfixadmin'; +-$CONF['database_name'] = 'postfix'; ++$CONF['database_type'] = $dbtype; ++$CONF['database_host'] = $dbserver; ++$CONF['database_user'] = $dbuser; ++$CONF['database_password'] = $dbpass; ++$CONF['database_name'] = $dbname; + // If you need to specify a different port for a MYSQL database connection, use e.g. + // $CONF['database_host'] = '172.30.33.66:3308'; + // If you need to specify a different port for POSTGRESQL database connection diff --git a/debian/patches/series b/debian/patches/series index eaed553b..96306ea7 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1 @@ -20110414_db-credentials +db_credentials diff --git a/debian/postfixadmin.docs b/debian/postfixadmin.docs index f328795f..19c0edd7 100755 --- a/debian/postfixadmin.docs +++ b/debian/postfixadmin.docs @@ -1,2 +1 @@ DOCUMENTS -CHANGELOG.TXT diff --git a/debian/postfixadmin.postinst b/debian/postfixadmin.postinst index c722f43c..ee7c7042 100644 --- a/debian/postfixadmin.postinst +++ b/debian/postfixadmin.postinst @@ -2,14 +2,14 @@ set -e if [ "$1" = "configure" ]; then + # configure DB stuff via dbconfig-common + dbc_generate_include=php:/etc/postfixadmin/dbconfig.inc.php + dbc_generate_include_args="-O root:www-data -m 640 -U" . /usr/share/debconf/confmodule - db_version 2.0 - dbc_generate_include='template:/etc/postfixadmin/config.inc.php' - dbc_generate_include_owner='root:www-data' - dbc_generate_include_perms='640' - dbc_generate_include_args="-U -o template_infile=/usr/share/postfixadmin/config.inc.php" . /usr/share/dbconfig-common/dpkg/postinst dbc_go postfixadmin $@ + + # configure webserver stuff db_get postfixadmin/reconfigure-webserver servers="$RET" restart="$servers" diff --git a/debian/postfixadmin.postrm b/debian/postfixadmin.postrm index 69059264..1ef33b06 100644 --- a/debian/postfixadmin.postrm +++ b/debian/postfixadmin.postrm @@ -11,7 +11,9 @@ if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then servers="$RET" restart=$servers linkname="postfixadmin" - . /usr/share/wwwconfig-common/restart.sh + if [ -e /usr/share/wwwconfig-common/restart.sh ]; then + . /usr/share/wwwconfig-common/restart.sh + fi fi if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then @@ -19,6 +21,16 @@ if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then dbc_go postfixadmin $@ fi fi + + if [ "$1" = "purge" ]; then + rm -f /etc/postfixadmin/dbconfig.inc.php + if which ucf >/dev/null 2>&1; then + ucf --purge /etc/postfixadmin/dbconfig.inc.php + fi + + db_purge || true + + fi fi #DEBHELPER# diff --git a/debian/rules b/debian/rules index 48c9faa9..14dfbc9f 100755 --- a/debian/rules +++ b/debian/rules @@ -4,19 +4,33 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -include /usr/share/quilt/quilt.make +export PFADIR = $(shell pwd) +export VERSION = $(shell grep -E "version = '.*';" functions.inc.php |sed -e "s/.version = '//" |sed -e "s/';.*//" |sed -e "s/ /-/g") +export DEBVERSION = $(shell grep -E "postfixadmin .([0-9]+|\.)+" debian/changelog |head -1 |sed -e "s/postfixadmin .//" |sed -e "s/-.*//") -build: build-stamp +include /usr/share/quilt/quilt.make +build: build-arch build-indep +build-arch: build-stamp +build-indep: build-stamp build-stamp: $(QUILT_STAMPFN) dh_testdir #dh_testroot touch build-stamp +# Create a needed tar.gz file to build a non-nativ .dpkg +prep: + rm -f ../postfixadmin_*orig.tar.gz + cd ..; tar --exclude-vcs --exclude=*.svn* --exclude=postfixadmin/debian --exclude=postfixadmin/.pc -czf postfixadmin_${DEBVERSION}.orig.tar.gz postfixadmin-2.3 + +# Call this target to build a shiny new .dpkg file. +build-package: + dh_testdir + cd ${PFADIR}; dpkg-buildpackage -rfakeroot clean: unpatch dh_testdir - dh_testroot + #dh_testroot dh_clean debconf-updatepo diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/watch b/debian/watch new file mode 100644 index 00000000..94f42471 --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://sf.net/postfixadmin/postfixadmin_(.+)\.tar\.gz