+squirrelmail-cn (2:1.4.23+3) stable; urgency=low
+
+ * Prva inacica paketa za Debian jessie distribuciju.
+ * Azurirane ovisnosti unutar debian/control.
+ * Koristi apache2-maintscript-helper za Apache2 konfiguraciju.
+ * Migracija konfiguracije za Apache2 iz /etc/apache2/conf.d/ direktorija
+ u direktorij /etc/apache2/conf-available/.
+ * Azurirane ostale debian/ datoteke.
+
+ -- Dragan Dosen <Dragan.Dosen@CARNet.hr> Wed, 04 May 2016 16:29:58 +0200
+
squirrelmail-cn (2:1.4.23+2) stable; urgency=high
* Dodan divert za squirrelmail/functions/strings.php zbog problema
Source: squirrelmail-cn
-Section: web
Priority: optional
+Section: web
Maintainer: Dragan Dosen <Dragan.Dosen@CARNet.hr>
-Build-Depends: debhelper (>= 8.0.0), po-debconf
-Standards-Version: 3.9.3
+Build-Depends: debhelper (>> 9), po-debconf
+Standards-Version: 3.9.6
+Homepage: http://www.squirrelmail.org/
Package: squirrelmail-cn
Architecture: all
-Pre-Depends: apache2-cn (>= 2.2.22+1), php5-cn
-Depends: squirrelmail (>= 2:1.4.23~svn20120406-2), squirrelmail-locales (>= 1.4.18-20090526-1), carnet-tools-cn (>= 3.0.4), hostname (>= 3.11), locales, ${misc:Depends}
+Pre-Depends: apache2-cn (>= 2.4.10+1), php5-cn
+Depends: squirrelmail (>= 2:1.4.23~svn20120406-2), squirrelmail-locales (>= 1.4.18-20090526-1), carnet-tools-cn (>= 3.1.0), hostname (>= 3.15), locales, ${misc:Depends}
Recommends: dovecot-cn | imap-server
Description: Webmail for nuts
SquirrelMail is a standards-based webmail package written in PHP. It
including strong MIME support, address books and folder manipulation.
.
This package contains additional CARNet configuration.
-Homepage: http://www.squirrelmail.org/
-Copyright 2013 CARNet
+Copyright 2013-2016 CARNet
You are free to distribute this software package under the terms of the
GNU General Public License.
. /usr/share/carnet-tools/functions.sh
unset CP_ECHO_RETURN
+
+if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then
+ . /usr/share/apache2/apache2-maintscript-helper
+
+ squirrelmail_enable() {
+ cp_echo "CN: Enabling $PKG configuration for Apache2."
+ return 0
+ }
+else
+ cp_echo "CN: Could not load Apache 2.4 maintainer script helper."
+
+ squirrelmail_enable() {
+ return 1
+ }
+fi
+
mv_old_backups () {
# Clean up /etc, nove old jun^H^H^Hbackups where they belong
- glob="$1.old.*-*-*.*:*:*"
+ local glob="$1.old.*-*-*.*:*:*"
# ${glob%/*} (dirname $glob) does not work for files in root
if [ -n "$(find ${glob%/*} -name ${glob##*/})" ]; then
# listconffiles ()
#
-# Recursively walks /etc/apache2/apache2.conf for Include directives.
+# Recursively walks /etc/apache2/apache2.conf for Include and
+# IncludeOptional directives.
# Returns all configfiles so defined.
#
listconffiles () {
local i incs
+ local base_dir="`dirname $1`"
- incs=`awk 'tolower($1) == "include" { sub("/$","/*",$2); print $2; }' $1`
+ incs=`awk 'tolower($1) ~ /include(optional)?/ { sub("/$","/*",$2); print $2; }' $1`
+ incs=`echo "$incs" | sed -r "s#^([^/])#${base_dir}/\1#"`
if [ -n "$incs" ]; then
for i in $incs; do
- if [ -e "$i" ]; then echo "$i"; listconffiles "$i"; fi
+ if [ -e "$i" ]; then echo "`readlink -m -q $i`"; listconffiles "$i"; fi
done
fi
}
}
-need_restart=0
DATE=`date +%Y-%m-%d.%H:%M:%S`
CONFDIR=/etc/squirrelmail
CONF=$CONFDIR/apache.conf
echo -n "CN: Updating Apache2 configuration for Squirrelmail"
perl -n -e 'print if ! m|^Alias\s*/webmail|' "$CONF" > $CONF.tmp
- cp-update -t squirrelmail-cn $CONF.tmp <<-EOF
+ cp-update -t $PKG $CONF.tmp <<-EOF
# Force SSL for /webmail -> you can still use /squirrelmail
Alias /webmail /usr/share/squirrelmail
if ! cmp -s "$CONF" "/var/backups/$backup_name.bak"; then
echo "."
cp_echo "CN: Updated Apache2 configuration for Squirrelmail."
- need_restart=1
else
echo "... no changes."
fi
hconf=/etc/apache2/apache2.conf
sconf=/etc/apache2/sites-available/ssl
-# Include Squirrelmail apache.conf in Apache2 web server configuration
-# (directory /etc/apache2/conf.d/), but only if we are not present in
-# Apache2 configuration at all.
+# Remove obsolete symbolic link.
#
-# We're not using listconffiles from apache-common Debian package.
-# apache-common is no longer available in Debian Lenny. We're using
-# listconffiles() function instead.
+if [ "`readlink -q -m /etc/apache2/conf.d/$PKG.conf`" = "$CONF" ]; then
+ rm -f /etc/apache2/conf.d/$PKG.conf
+fi
+
+# Include Squirrelmail apache.conf in Apache2 web server configuration,
+# but only if we are not present in Apache2 configuration at all.
#
apache2listconf=`listconffiles "$hconf" | grep "$CONF"` || true
-apache2squirrel=`ls -l /etc/apache2/conf.d/ | grep "$CONF"` || true
-if [ -z "$apache2listconf" -a -z "$apache2squirrel" ]; then
- ln -s "$CONF" /etc/apache2/conf.d/squirrelmail-cn.conf
- need_restart=1
+if [ -z "$apache2listconf" ]; then
+ if [ ! -L /etc/apache2/conf-available/$PKG.conf -a ! -f /etc/apache2/conf-available/$PKG.conf ]; then
+ ln -sf "$CONF" /etc/apache2/conf-available/$PKG.conf
+ fi
fi
"
fi
-# Would there be any changes, perhaps?
-#
-if cp_check_and_sed '.' "$seddef" "$CONF"; then
- need_restart=1
-fi
+cp_check_and_sed '.' "$seddef" "$CONF" || true
# Check /etc/hostname and /etc/mailname, because
echo "hr_HR ISO-8859-2" >> /etc/locale.gen
cp_echo "CN: Added hr_HR locale to /etc/locale.gen."
genlocales
- need_restart=1
fi
else
echo "hr_HR ISO-8859-2" > /etc/locale.gen
cp_echo "CN: /etc/locale.gen created."
genlocales
- need_restart=1
-fi
-
-
-# Check Apache2 web server for restart.
-#
-if [ $need_restart -eq 1 ]; then
- if apache2ctl configtest 2>/dev/null; then
- invoke-rc.d apache2 force-reload || true
- else
- cp_echo "CN: Your Apache2 configuration is either broken or nonexistant."
- fi
fi
cp_echo "CN Read mailname(5) man page for details."
cp_echo -mailonly "CN If this machine receives mail for both user@`hostname -f` and "
cp_echo -mailonly "CN user@`hostname -d`, you can also put just the domain in there."
+ cp_echo
+fi
+
+if squirrelmail_enable; then
+ apache2_invoke enconf $PKG
+fi
+
+if ! apache2ctl configtest >/dev/null 2>&1; then
+ cp_echo "CN: Your Apache2 configuration seems to be broken."
+ cp_echo "CN: Please, check the service after the installation finishes!"
fi
# Mail root
#
cp_mail "$PKG"
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
#DEBHELPER#
exit 0
set -e
-case "$1" in
- purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
- dpkg-divert --package squirrelmail-cn --remove --rename \
- --divert /usr/share/squirrelmail/functions/strings.php.squirrelmail \
+# Debconf
+. /usr/share/debconf/confmodule
+
+PKG=squirrelmail-cn
+
+if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then
+ . /usr/share/apache2/apache2-maintscript-helper
+
+ squirrelmail_enable() {
+ echo "CN: Purging $PKG configuration for Apache2."
+ return 0
+ }
+else
+ echo "CN: Could not load Apache 2.4 maintainer script helper."
+
+ squirrelmail_enable() {
+ return 1
+ }
+fi
+
+if [ "$1" = "remove" -o "$1" = "abort-install" -o "$1" = "disappear" ]; then
+ dpkg-divert --package $PKG --remove --rename \
+ --divert /usr/share/squirrelmail/functions/strings.php.squirrelmail \
/usr/share/squirrelmail/functions/strings.php
- ;;
+fi
- *)
- echo "postrm called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
+if [ "$1" = "purge" ] ; then
+ if squirrelmail_enable; then
+ apache2_invoke disconf $PKG
+ fi
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
+ if [ "`readlink -q -m /etc/apache2/conf-available/$PKG.conf`" = /etc/squirrelmail/apache.conf ]; then
+ rm -f /etc/apache2/conf-available/$PKG.conf
+ fi
+fi
#DEBHELPER#
set -e
-# summary of how this script can be called:
-# * <new-preinst> `install'
-# * <new-preinst> `install' <old-version>
-# * <new-preinst> `upgrade' <old-version>
-# * <old-preinst> `abort-upgrade' <new-version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
+PKG=squirrelmail-cn
-
-case "$1" in
- install|upgrade)
- dpkg-divert --package squirrelmail-cn --add --rename \
- --divert /usr/share/squirrelmail/functions/strings.php.squirrelmail \
- /usr/share/squirrelmail/functions/strings.php
- ;;
-
- abort-upgrade)
- ;;
-
- *)
- echo "preinst called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
+dpkg-divert --package $PKG --add --rename \
+ --divert /usr/share/squirrelmail/functions/strings.php.squirrelmail \
+ /usr/share/squirrelmail/functions/strings.php
#DEBHELPER#
set -e
-case "$1" in
- remove|deconfigure)
-
- cp-update -r squirrelmail-cn /etc/squirrelmail/apache.conf
-
- if [ -f /etc/apache2/conf.d/squirrelmail-cn.conf ]; then
- rm -f /etc/apache2/conf.d/squirrelmail-cn.conf
+PKG=squirrelmail-cn
+
+if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then
+ . /usr/share/apache2/apache2-maintscript-helper
+
+ squirrelmail_enable() {
+ echo "CN: Disabling $PKG configuration for Apache2."
+ return 0
+ }
+else
+ echo "CN: Could not load Apache 2.4 maintainer script helper."
+
+ squirrelmail_enable() {
+ return 1
+ }
+fi
+
+if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
+ if [ -f /etc/squirrelmail/apache.conf ]; then
+ cp-update -r $PKG /etc/squirrelmail/apache.conf
fi
- # Restart Apache2 web server.
- #
- if apache2ctl configtest 2>/dev/null; then
- invoke-rc.d apache2 force-reload || true
- else
- echo "CN: Your Apache2 configuration is either broken or nonexistant."
+ if squirrelmail_enable; then
+ apache2_invoke disconf $PKG
fi
-
- break
- ;;
- upgrade)
- :
- ;;
- failed-upgrade)
- ;;
- *)
- echo "prerm called with unknown argument \$1'" >&2
- exit 0
- ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
+fi
#DEBHELPER#