Upgrade paketa za Debian lenny.
authorDragan Dosen <bane@nekkar.carnet.hr>
Sat, 18 Apr 2009 20:43:49 +0000 (22:43 +0200)
committerDragan Dosen <bane@nekkar.carnet.hr>
Sat, 18 Apr 2009 20:43:49 +0000 (22:43 +0200)
debian/changelog
debian/config
debian/control
debian/postinst
debian/preinst [deleted file]
debian/prerm

index 3c1a132..d8304b1 100644 (file)
@@ -1,9 +1,10 @@
 squirrelmail-cn (2:1.4.15-2) stable; urgency=low
 
+  * Upgrade paketa za Debian lenny.
   * Datoteka debian/postinst:
     + definicija listconffiles() funkcije (rijeseno: #6225).
 
- -- Dragan Dosen <ddosen@ffzg.hr>  Thu, 19 Feb 2009 23:05:38 +0100
+ -- Dragan Dosen <ddosen@ffzg.hr>  Sat, 18 Apr 2009 21:00:19 +0200
 
 squirrelmail-cn (2:1.4.15-1) stable; urgency=low
 
index 8cb2686..866772f 100644 (file)
@@ -16,11 +16,11 @@ fi
 
 SMDIR="/etc/squirrelmail"
 SMCONF="$SMDIR/config.php"
-change_default=1
 
 
 # Check $default_left_size in SM's config.php
 #
+change_default=1
 if [ -f "$SMCONF" ]; then
         if egrep -q "^[[:space:]]*\\\$default_left_size[[:space:]]*=[[:space:]]*'220'" "$SMCONF"; then
             change_default=0
@@ -39,9 +39,9 @@ fi
 
 # Check $theme_css in SM's config.php
 #
+change_default=1
 if [ -f "$SMCONF" ]; then
-        if egrep -q "^[[:space:]]*\\\$theme_css[[:space:]]*=[[:space:]]*SM_PATH[[:space:]]*\.
-[[:space:]]*'themes\/css\/squirrelmail-cn\.css'" "$SMCONF"; then
+        if egrep -q "^[[:space:]]*\\\$theme_css[[:space:]]*=[[:space:]]*SM_PATH[[:space:]]*\.[[:space:]]*'themes\/css\/squirrelmail-cn\.css'" "$SMCONF"; then
             change_default=0
         fi
 fi
index 3a3d8c2..2f6bf37 100644 (file)
@@ -1,17 +1,16 @@
 Source: squirrelmail-cn
 Section: web
-Origin: carnet
 Priority: optional
 Maintainer: Dragan Dosen <ddosen@ffzg.hr>
 Build-Depends: debhelper (>= 4.0.0)
-Standards-Version: 3.6.1
+Standards-Version: 3.7.2
 
 Package: squirrelmail-cn
 Architecture: all
-Pre-Depends: apache2-cn (>= 2.2), php5-cn | php4-cn
-Depends: squirrelmail (>= 2:1.4.15-4~cn1), squirrelmail-locales (>= 1.4.13-20071220-1~cn1), debconf (>= 1.4.72), carnet-tools-cn (>= 2.0), hostname, locales
+Pre-Depends: apache2-cn (>= 2.2), php5-cn
+Depends: squirrelmail (>= 2:1.4.15-4), squirrelmail-locales (>= 1.4.13-20071220-1), carnet-tools-cn (>= 2.8.1), hostname, locales, ${misc:Depends}
 Recommends: dovecot-cn | imap-server
-Description: Webmail for nuts
+Description: Webmail for nuts (CARNet configuration)
  SquirrelMail is a standards-based webmail package written in PHP. It
  includes built-in pure PHP support for the IMAP and SMTP protocols, and
  is designed for maximum compatibility across browsers. SquirrelMail has
@@ -23,4 +22,4 @@ Description: Webmail for nuts
  .
  Homepage: http://www.squirrelmail.org/
  .
- This package provides CARNet specific configuration.
+ This package contains additional CARNet configuration.
index db2cbc4..f64830a 100644 (file)
@@ -64,7 +64,7 @@ listconffiles () {
 }
 
 
-reload=""
+need_restart=0
 DATE=`date +%Y-%m-%d.%H:%M:%S`
 CONFDIR=/etc/squirrelmail
 CONF=$CONFDIR/apache.conf
@@ -115,7 +115,7 @@ if [ -f "$CONF" ]; then
                if ! cmp -s "$CONF" "/var/backups/$backup_name.bak"; then
                        echo "."
                        cp_echo "CN: Updated Apache2 configuration for Squirrelmail."
-                       reload="reload"
+                       need_restart=1
                else
                        echo "... no changes."
                fi
@@ -139,7 +139,7 @@ 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
-       reload=reload
+       need_restart=1
 fi
 
 
@@ -196,58 +196,17 @@ fi
 # Would there be any changes, perhaps?
 #
 if cp_check_and_sed '.' "$seddef" "$CONF"; then
-       changed=1
+       need_restart=1
 fi
 
-if grep -q x62 "$CONF"; then
-       really_old_config=1
-fi
-
-
-#
-# MORE FIXES...
-#
 
-# Global $config_version;
+# Check /etc/hostname and /etc/mailname, because
+#   $domain = trim(implode('', file('/etc/'.(file_exists('/etc/mailname')?'mail':'host').'name')));
 #
-if ! egrep -q '^[      ]*global[       ]+\$config_version' "$CONF"; then
-       really_old_config=1
-       #echo "CN: Adding \"global \$config_version;\" to config.php."
-       perl -p -e 'print "global \$config_version;\n" if (/^\s*\$config_version/);' \
-               "$CONF" > "$CONF.tmp"
-       cp_mv "$CONF.tmp" "$CONF"
-fi
-
-# This was missing on some machines
-#
-if ! egrep -q '^[      ]*\$allow_thread_sort' $CONF; then
-       to_add='\$allow_thread_sort = false;\n'
-       cp_echo "CN: Adding \"\$allow_thread_sort\"."
-       perl -p -e 'if (! $a && /^\s*\$edit_name/) {
-                 $_ .= "'"$to_add"'"; $a = 1; }
-              elsif (! $a && /^\?>/) {
-                 $_ = "'"$to_add"'" . $_; $a = 1; }' \
-       $CONF > "$CONF.tmp"
-       cp_mv "$CONF.tmp" "$CONF"
-fi
-
-# Shouldn't use /etc/hostname, especially if it contains only the host part
-# replace
-#   $domain = implode('', file('/etc/hostname'));
-# with
-#   $domain = trim(implode('',file('/etc/'.(file_exists('/etc/mailname')?'mail':'host').'name')));
-#
-if egrep -q "^[[:blank:]]*\\\$domain[[:blank:]]*=[[:blank:]]*implode\\('',[[:blank:]]*file\\('/etc/hostname'\\)\\);" $CONF; then
-       nodots=
-       nomailname=
-       grep -q '\.' /etc/hostname || nodots=1
-       [ -e /etc/mailname ] || nomailname=1
-       if cp_check_and_sed "^[[:blank:]]*\\\$domain[[:blank:]]*=[[:blank:]]*implode\\('',[[:blank:]]*file\\('/etc/hostname'\\)\\);" \
-                   "s|^[ \t]*\\\$domain[ \t]*=[ \t]*implode('',[ \t]*file('/etc/hostname'));|\$domain = trim(implode('',file('/etc/'.(file_exists('/etc/mailname')?'mail':'host').'name')));|" \
-                   $CONF; then
-               cp_echo "CN: config.php updated to use either /etc/mailname or /etc/hostname"
-       fi
-fi
+nodots=
+nomailname=
+grep -q '\.' /etc/hostname || nodots=1
+[ -e /etc/mailname ] || nomailname=1
 
 
 # Generate hr_HR locale if needed.
@@ -261,42 +220,25 @@ if ! egrep -q '^hr_HR ISO-8859-2\b' /etc/locale.gen; then
                cp_echo "CN: /etc/locale.gen created."
        fi
        dpkg-reconfigure -f noninteractive locales
+       need_restart=1
 fi
 
 
-# Check Apache2 web server for restart/reload.
+# Check Apache2 web server for restart.
 #
-if [ -n "$reload" ]; then
+if [ $need_restart -eq 1 ]; then
 
        # Restart Apache2 web server.
        if [ -x "/etc/init.d/apache2" ]; then
                if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
-                    invoke-rc.d apache2 "$reload" || exit $?
+                    invoke-rc.d apache2 restart || exit $?
                else
-                    /etc/init.d/apache2 "$reload" || exit $?
+                    /etc/init.d/apache2 restart || exit $?
                fi
        fi
 fi
 
 
-# Warn user of really old config file
-#
-if [ "$really_old_config" ]; then
-       echo
-       echo "CN: You have a really old config file."
-       cp_echo -m "CN: Old \"$CONF\" detected during installation."
-       cp_echo "CN  The known bad options were fixed, but it is _strongly_ recommended that"
-       cp_echo "CN  you either copy over the new template, and reconfigure this package"
-       cp_echo
-       cp_echo "    cp $TMPL $CONF"
-       cp_echo "    dpkg-reconfigure squirrelmail-cn"
-       cp_echo
-       cp_echo "CN  or use squirrelmail-configure (conf.pl) to generate a fresh"
-       cp_echo "    ${CONF} file."
-       echo
-fi
-
-
 # Mailname info...
 #
 if [ "$nodots" -o "$nomailname" ]; then
diff --git a/debian/preinst b/debian/preinst
deleted file mode 100644 (file)
index 50f4853..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/sh
-
-set -e
-
-case "$1" in
-       install|upgrade)
-       ;;
-
-       abort-upgrade)
-       exit 0
-       ;;
-
-       *)
-       echo "preinst called with unknown argument '$1'" >&2
-       exit 1
-       ;;
-esac
-
-if dpkg-divert --list | \
-       egrep -q 'diversion of .*locale/hr_HR/.* .* by squirrelmail-cn'; then
-
-       dpkg-divert --quiet --package squirrelmail-cn --remove --rename --divert \
-               /usr/share/squirrelmail/locale/hr_HR/LC_MESSAGES/squirrelmail.mo.squirrelmail \
-               /usr/share/squirrelmail/locale/hr_HR/LC_MESSAGES/squirrelmail.mo || true
-
-       dpkg-divert --quiet --package squirrelmail-cn --remove --rename --divert \
-               /usr/share/squirrelmail/locale/hr_HR/LC_MESSAGES/squirrelmail.po.squirrelmail \
-               /usr/share/squirrelmail/locale/hr_HR/LC_MESSAGES/squirrelmail.po || true
-fi
-
-if dpkg-divert --list | \
-       egrep -q 'diversion of .*images/sec_remove_hr_HR.png .* by squirrelmail-cn'; then
-
-       dpkg-divert --quiet --package squirrelmail-cn --remove --rename --divert \
-               /usr/share/squirrelmail/images/sec_remove_hr_HR.png.squirrelmail \
-               /usr/share/squirrelmail/images/sec_remove_hr_HR.png || true
-fi
-
-# leftover from 1.2.6-2
-if dpkg-divert --list | \
-       egrep -q 'diversion of .*functions/display_messages.php .* by squirrelmail-cn'; then
-
-       rm -f /usr/share/squirrelmail/functions/display_messages.php
-
-       dpkg-divert --package squirrelmail-cn --remove --rename --divert \
-               /usr/share/squirrelmail/functions/display_messages.php.divert-cn \
-               /usr/share/squirrelmail/functions/display_messages.php
-fi
-
-exit 0
index db2980a..459bac8 100644 (file)
@@ -15,9 +15,9 @@ case "$1" in
        #
        if [ -x "/etc/init.d/apache2" ]; then
                if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
-                    invoke-rc.d apache2 force-reload || exit $?
+                    invoke-rc.d apache2 restart || exit $?
                else
-                    /etc/init.d/apache2 force-reload || exit $?
+                    /etc/init.d/apache2 restart || exit $?
                fi
        fi