diff --git a/debian/README.Debian b/debian/README.Debian index 1a856c59..c3e1e8ad 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -19,6 +19,7 @@ Recommended and Suggested Packages - MySQL or PostgreSQL - Courier or Dovecot + Where to get help ================= @@ -28,3 +29,18 @@ See : - http://postfixadmin.sf.net - #postfixadmin on irc.freenode.net + +How to build this package for Debian/lenny +========================================== + +If you want to build this package for Debian/lenny, you have to execute + + DIST="lenny" dpkg-buildpackage -rfakeroot + +This will include the confd-link.sh script into the package. That script +is included in wwwconfig-common >0.2, but we have an older version in +lenny at the moment. + +We (upstream and myself) want to provide also an lenny ready package, +which will be available via sf.net. Just as an easy way for interested +people which are running lenny. diff --git a/debian/confd-link.sh b/debian/confd-link.sh new file mode 100755 index 00000000..da7ccec8 --- /dev/null +++ b/debian/confd-link.sh @@ -0,0 +1,86 @@ +#!/bin/sh +# File: confd-link.sh +# Changes: +# 20081109 Norman Messtorff +# Initial version. +# +# Needs: $servers - the servers to link configurations in. +# $linkname - specify the link name +# $linkdestination_apache - specify the link destination (Apache config) +# $linkdestination_lighttpd - specify the link destination (lighttpd config) +# Description: Linking configurations into Webservers conf.d +# Sets: $status = {error, nothing, linked, removed} +# $error = error message (if $status = error) + +status="nothing" +error="" + +# +# Checking needed settings... +# +if [ -z "$servers" ]; then + status="error" + error="No servers specified in confd-link.sh" +elif [ -z "$linkname" ]; then + status="error" + error="No linkname specified in confd-link.sh" +else + + # + # The link removal part... + # + if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then + for A in $servers ; do + A=${A%,} + # + # lighttpd has no conf.d + # + if [ "$A" = "lighttpd" ]; then + linkpath="/etc/lighttpd/conf-available" + else + linkpath="/etc/$A/conf.d" + fi + + # + # Is it existing and a symbolic link or are we going to do some unwished things? + # + if [ -L $linkpath/$linkname ]; then + if rm -f $linkpath/$linkname 2>&1 ; then + status="removed" + else + status="error" + error="ERROR! Couln't remove $linkpath/$linkname " + fi + else + status="error" + error="ERROR! $linkpath/$linkname is no symbolic link or doesn't exists." + fi + done + else + for A in $servers ; do + A=${A%,} + # + # lighttpd has no conf.d + # + if [ "$A" = "lighttpd" ]; then + linkpath="/etc/lighttpd/conf-available" + linkdestination=$linkdestination_lighttpd + else + linkpath="/etc/$A/conf.d" + linkdestination=$linkdestination_apache + fi + + if [ -d $linkpath ]; then + if ln -s $linkdestination $linkpath/$linkname >/dev/null 2>&1 ; then + status="linked" + else + status="error" + error="ERROR! 'ln -s' returned an error. Could not create link in $linkpath" + fi + else + status="error" + error="ERROR! $linkpath doesn't exists. Could not create link in $linkpath" + fi + done + fi +fi diff --git a/debian/control b/debian/control index 3a7ee261..fda9ad91 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,7 @@ XS-Vcs-Browse: http://postfixadmin.svn.sourceforge.net/viewvc/postfixadmin/trunk Package: postfixadmin Architecture: all -Depends: debconf (>= 0.5), dbconfig-common, wwwconfig-common (>= 0.2.0), apache2 | lighttpd, libapache2-mod-php5 | php5-cgi | php5, php5-imap, php5-mysql | php5-pgsql, mysql-client | postgresql-client, ${misc:Depends} +Depends: debconf (>= 0.5), dbconfig-common, wwwconfig-common, apache2 | lighttpd, 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 Suggests: squirrelmail-postfixadmin, dovecot-common | courier-authlib-mysql | courier-authlib-postgresql Description: Virtual mail hosting interface for Postfix diff --git a/debian/postfixadmin.postinst b/debian/postfixadmin.postinst index f3b822ea..c722f43c 100644 --- a/debian/postfixadmin.postinst +++ b/debian/postfixadmin.postinst @@ -16,7 +16,11 @@ if [ "$1" = "configure" ]; then linkdestination_apache="../../postfixadmin/apache.conf" linkdestination_lighttpd="../../postfixadmin/lighttpd.conf" linkname="postfixadmin" - . /usr/share/wwwconfig-common/confd-link.sh + if [ -e /usr/share/wwwconfig-common/confd-link.sh ]; then + . /usr/share/wwwconfig-common/confd-link.sh + else + . /usr/share/postfixadmin/confd-link.sh + fi . /usr/share/wwwconfig-common/restart.sh fi diff --git a/debian/postfixadmin.prerm b/debian/postfixadmin.prerm index 08cc6bdf..87241c47 100644 --- a/debian/postfixadmin.prerm +++ b/debian/postfixadmin.prerm @@ -14,7 +14,11 @@ if [ -f /usr/share/debconf/confmodule ]; then db_get postfixadmin/reconfigure-webserver servers="$RET" linkname="postfixadmin" - . /usr/share/wwwconfig-common/confd-link.sh + if [ -e /usr/share/wwwconfig-common/confd-link.sh ]; then + . /usr/share/wwwconfig-common/confd-link.sh + else + . /usr/share/postfixadmin/confd-link.sh + fi fi #DEBHELPER# diff --git a/debian/rules b/debian/rules index 6ca7286f..9ea40725 100755 --- a/debian/rules +++ b/debian/rules @@ -28,6 +28,7 @@ install: build dh_install mv debian/postfixadmin/usr/share/postfixadmin/config.inc.php debian/postfixadmin/etc/postfixadmin/config.inc.php find debian/postfixadmin -name .svn | xargs -r rm -r + if test "${DIST}" = "lenny" ; then cp debian/confd-link.sh debian/postfixadmin/usr/share/postfixadmin/; fi # Build architecture-independent files here. binary-indep: build install