From: Dragan Dosen Date: Tue, 24 May 2016 21:20:46 +0000 (+0200) Subject: Prva inacica paketa za Debian jessie distribuciju. X-Git-Tag: debian/2%1.4.23+3^0 X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=commitdiff_plain;h=HEAD;p=squirrelmail-cn.git Prva inacica paketa za Debian jessie distribuciju. --- diff --git a/debian/changelog b/debian/changelog index 8c68ff1..a4f3808 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +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 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 diff --git a/debian/compat b/debian/compat index 45a4fb7..ec63514 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -8 +9 diff --git a/debian/config b/debian/config old mode 100644 new mode 100755 diff --git a/debian/control b/debian/control index 00179a5..6098a5d 100644 --- a/debian/control +++ b/debian/control @@ -1,14 +1,15 @@ Source: squirrelmail-cn -Section: web Priority: optional +Section: web Maintainer: Dragan Dosen -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 @@ -21,4 +22,3 @@ Description: Webmail for nuts including strong MIME support, address books and folder manipulation. . This package contains additional CARNet configuration. -Homepage: http://www.squirrelmail.org/ diff --git a/debian/copyright b/debian/copyright index dd9254d..235dba3 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,4 +1,4 @@ -Copyright 2013 CARNet +Copyright 2013-2016 CARNet You are free to distribute this software package under the terms of the GNU General Public License. diff --git a/debian/postinst b/debian/postinst old mode 100644 new mode 100755 index ac161dc..1f30bd6 --- a/debian/postinst +++ b/debian/postinst @@ -31,9 +31,25 @@ FQDN=`hostname --fqdn` . /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 @@ -47,16 +63,19 @@ mv_old_backups () { # 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 } @@ -75,7 +94,6 @@ genlocales () { } -need_restart=0 DATE=`date +%Y-%m-%d.%H:%M:%S` CONFDIR=/etc/squirrelmail CONF=$CONFDIR/apache.conf @@ -97,7 +115,7 @@ if [ -f "$CONF" ]; then 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 @@ -125,7 +143,6 @@ EOF 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 @@ -136,20 +153,21 @@ 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 @@ -203,11 +221,7 @@ if dpkg -l dovecot-cn 2>/dev/null | grep -q '^ii'; then " 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 @@ -226,24 +240,11 @@ if [ -f /etc/locale.gen ]; then 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 @@ -257,15 +258,22 @@ if [ "$nodots" -o "$nomailname" ]; then 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 diff --git a/debian/postrm b/debian/postrm old mode 100644 new mode 100755 index f867340..0ff797d --- a/debian/postrm +++ b/debian/postrm @@ -2,21 +2,41 @@ 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# diff --git a/debian/preinst b/debian/preinst old mode 100644 new mode 100755 index cfcffc8..ff5f26f --- a/debian/preinst +++ b/debian/preinst @@ -2,33 +2,11 @@ set -e -# summary of how this script can be called: -# * `install' -# * `install' -# * `upgrade' -# * `abort-upgrade' -# 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# diff --git a/debian/prerm b/debian/prerm old mode 100644 new mode 100755 index 80f154e..019ab28 --- a/debian/prerm +++ b/debian/prerm @@ -2,38 +2,32 @@ 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#