From e90ef71b190bd6b5802dfc42357c6c8dade3a5fa Mon Sep 17 00:00:00 2001 From: Dragan Dosen Date: Thu, 18 Dec 2008 20:42:59 +0100 Subject: [PATCH] * Tranzicijski paket za buduci prelazak na Debian Lenny. * debian/control datoteka: + ovisnost o squirrelmail (>= 2:1.4.9a-3), + ovisnost o debconf (>= 1.4.72), + ovisnost o apache-common paketu je uklonjena; apache-common paket vise nije dostupan u Debian Lenny, + uklonjena preporuka za uw-imap-ssl-cn paket. * Novi dio paketa: debian/config, debian/templates, debian/postrm, squirrelmail-cn.css. * U slucaju da se postavke za $default_left_size i $theme_css unutar /etc/squirrelmail/config.php razlikuju od preporucenih, korisniku je ponudjen izbor da aktivira preporucene postavke (kroz debian/config). * Izmjene unutar debian/postinst datoteke: + funkcija listconffiles() umjesto skripte listconffiles iz apache-common paketa, + podesavanje sirine lijevog okvira unutar Squirrelmail web sucelja na '220', ovisno o korisnikovom odgovoru, + podesavanje CSS datoteke za Squirrelmail web sucelje na 'squirrelmail-cn.css', ovisno o korisnikovom odgovoru. --- debian/changelog | 25 ++++++++++++ debian/config | 58 +++++++++++++++++++++++++++ debian/control | 4 +- debian/postinst | 46 ++++++++++++++++++--- debian/postrm | 10 +++++ debian/templates | 20 +++++++++ squirrelmail/themes/css/squirrelmail-cn.css | 45 +++++++++++++++++++++ 7 files changed, 200 insertions(+), 8 deletions(-) create mode 100644 debian/config create mode 100644 debian/postrm create mode 100644 debian/templates create mode 100644 squirrelmail/themes/css/squirrelmail-cn.css diff --git a/debian/changelog b/debian/changelog index ce46167..b85023e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,28 @@ +squirrelmail-cn (2:1.4.9a-5) stable; urgency=low + + * Tranzicijski paket za buduci prelazak na Debian Lenny. + * Ovisnosti o drugim paketima, debian/control datoteka: + + ovisnost o squirrelmail (>= 2:1.4.9a-3), + + ovisnost o debconf (>= 1.4.72), + + ovisnost o apache-common paketu je uklonjena; apache-common + paket vise nije dostupan u Debian Lenny, + + uklonjena preporuka za uw-imap-ssl-cn paket. + * Novi dio paketa: debian/config, debian/templates, + debian/postrm, squirrelmail-cn.css. + * U slucaju da se postavke za $default_left_size i $theme_css + unutar /etc/squirrelmail/config.php razlikuju od preporucenih, + korisniku je ponudjen izbor da aktivira preporucene postavke + (kroz debian/config). + * Izmjene unutar debian/postinst datoteke: + + funkcija listconffiles() umjesto skripte listconffiles iz + apache-common paketa, + + podesavanje sirine lijevog okvira unutar Squirrelmail web + sucelja na '220', ovisno o korisnikovom odgovoru, + + podesavanje CSS datoteke za Squirrelmail web sucelje na + 'squirrelmail-cn.css', ovisno o korisnikovom odgovoru. + + -- Dragan Dosen Wed, 17 Dec 2008 15:46:35 +0100 + squirrelmail-cn (2:1.4.9a-4) stable; urgency=low * Izmjene unutar debian/preinst datoteke: brisanje divertova diff --git a/debian/config b/debian/config new file mode 100644 index 0000000..8cb2686 --- /dev/null +++ b/debian/config @@ -0,0 +1,58 @@ +#!/bin/sh + +set -e + +# Load debconf +. /usr/share/debconf/confmodule + +if [ "$1" != reconfigure ]; then + for item in leftwidth themecss; do + db_fget squirrelmail-cn/${item} seen + if [ "$RET" = "true" ]; then + exit 0 + fi + done +fi + +SMDIR="/etc/squirrelmail" +SMCONF="$SMDIR/config.php" +change_default=1 + + +# Check $default_left_size in SM's config.php +# +if [ -f "$SMCONF" ]; then + if egrep -q "^[[:space:]]*\\\$default_left_size[[:space:]]*=[[:space:]]*'220'" "$SMCONF"; then + change_default=0 + fi +fi +if [ $change_default -eq 1 ]; then + + # Ask user for changing $default_left_size to '220'. + db_input critical squirrelmail-cn/leftwidth || true + db_go || true +else + db_set squirrelmail-cn/leftwidth false || true + db_fset squirrelmail-cn/leftwidth seen true + change_default=1 +fi + +# Check $theme_css in SM's config.php +# +if [ -f "$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 +if [ $change_default -eq 1 ]; then + + # Ask user for changing $theme_css to 'squirrelmail-cn.css'. + db_input critical squirrelmail-cn/themecss || true + db_go || true +else + db_set squirrelmail-cn/themecss false || true + db_fset squirrelmail-cn/themecss seen true +fi + +exit 0 diff --git a/debian/control b/debian/control index 1022cc9..a2649c6 100644 --- a/debian/control +++ b/debian/control @@ -9,8 +9,8 @@ Standards-Version: 3.6.1 Package: squirrelmail-cn Architecture: all Pre-Depends: apache2-cn (>= 2.2), php5-cn | php4-cn -Depends: squirrelmail (>= 2:1.4.4-11), squirrelmail-locales (>= 1.4.9-20070106-1), apache-common (>= 1.3.34-4.1), carnet-tools-cn (>= 2.0), hostname, locales -Recommends: dovecot-cn | uw-imap-ssl-cn | imap-server +Depends: squirrelmail (>= 2:1.4.9a-3), squirrelmail-locales (>= 1.4.9-20070106-1), debconf (>= 1.4.72), carnet-tools-cn (>= 2.0), hostname, locales +Recommends: dovecot-cn | imap-server Description: Webmail for nuts SquirrelMail is a standards-based webmail package written in PHP. It includes built-in pure PHP support for the IMAP and SMTP protocols, and diff --git a/debian/postinst b/debian/postinst index d387dab..c53e5f0 100644 --- a/debian/postinst +++ b/debian/postinst @@ -4,6 +4,9 @@ set -e [ "$DEBIAN_SCRIPT_DEBUG" ] && set -x +# Source debconf library. +. /usr/share/debconf/confmodule + case "$1" in configure) # continue below @@ -43,6 +46,23 @@ mv_old_backups() { fi } +# listconffiles () +# +# Recursively walks /etc/apache2/apache2.conf for Include directives. +# Returns all configfiles so defined. +# +function listconffiles () { + + local i incs + + incs=`awk 'tolower($1) == "include" { sub("/$","/*",$2); print $2; }' $1` + if [ -n "$incs" ]; then + for i in $incs; do + if [ -e "$i" ]; then echo "$i"; listconffiles "$i"; fi + done + fi +} + reload="" DATE=`date +%Y-%m-%d.%H:%M:%S` @@ -110,10 +130,11 @@ sconf=/etc/apache2/sites-available/ssl # (directory /etc/apache2/conf.d/), but only if we are not present in # Apache2 configuration at all. # -# We're using listconffiles from apache-common Debian package. Yes, -# it works with Apache2 configurations too. +# 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. # -apache2listconf=`/usr/share/apache/listconffiles -V $hconf | tr '' ' ' | grep "$CONF"` || true +apache2listconf=`listconffiles "$hconf" | grep "$CONF"` || true apache2squirrel=`ls -l /etc/apache2/conf.d/ | grep "$CONF"` || true if [ -z "$apache2listconf" -a -z "$apache2squirrel" ]; then @@ -145,13 +166,26 @@ seddef="/^[ ]*\\\$org_logo[ ]*=/s/sm_logo\.jpg/sm_carnet_logo.png/; /^[ ]*\\\$data_dir[ ]*=/s/\.\.\/data\//\/var\/lib\/squirrelmail\/data\//; " -# Check for our uw-imap package; if it is installed, assume it's used. +# Left frame size to 220px. +# $default_left_size = '220'; +# +db_get squirrelmail-cn/leftwidth || true +if [ "$RET" = "true" ]; then + seddef="$seddef/^[ ]*\\\$default_left_size[ ]*=/s/'[0-9]*'/'220'/; + " +fi + +# Change CSS file for Squirrelmail. +# $theme_css = SM_PATH . 'themes/css/squirrelmail-cn.css'; # -if dpkg -l uw-imap-ssl-cn 2>/dev/null | grep -q '^ii'; then - seddef="$seddef/^[ ]*\\\$imap_server_type[ ]*=/ {s/cyrus/uw/;s/other/uw/;} +db_get squirrelmail-cn/themecss || true +if [ "$RET" = "true" ]; then + seddef="$seddef/^[ ]*\\\$theme_css[ ]*=/s/=.*/= SM_PATH . 'themes\/css\/squirrelmail-cn.css';/; " fi +db_stop || true + # Check for our dovecot package; if it is installed, assume it's used. # if dpkg -l dovecot-cn 2>/dev/null | grep -q '^ii'; then diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000..c5f4fc5 --- /dev/null +++ b/debian/postrm @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +if [ "$1" = purge -a -e /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule + db_purge +fi + +exit 0 diff --git a/debian/templates b/debian/templates new file mode 100644 index 0000000..ae8f22c --- /dev/null +++ b/debian/templates @@ -0,0 +1,20 @@ +Template: squirrelmail-cn/leftwidth +Type: boolean +Description: Zelite li aktivirati preporucenu postavku za Squirrelmail? + Provjerom trenutne Squirrelmail konfiguracije (konfiguracijska datoteka + /etc/squirrelmail/config.php), ustanovljeno je da sirina lijevog okvira + unutar Squirrelmail web sucelja nije 220 piksela. + . + Kako bi Squirrelmail web sucelje korisnicima bilo preglednije, + preporucamo da postavite sirinu lijevog okvira na 220 piksela. + +Template: squirrelmail-cn/themecss +Type: boolean +Description: Zelite li aktivirati preporucenu postavku za Squirrelmail? + Provjerom trenutne Squirrelmail konfiguracije (konfiguracijska datoteka + /etc/squirrelmail/config.php), ustanovljeno je da trenutno ne koristite + preporucenu CSS datoteku (squirrelmail-cn.css). + . + Unutar CSS datoteke (squirrelmail-cn.css) dodatno su podeseni fontovi i + njihova velicina kako bi Squirrelmail web sucelje korisnicima bilo + preglednije. diff --git a/squirrelmail/themes/css/squirrelmail-cn.css b/squirrelmail/themes/css/squirrelmail-cn.css new file mode 100644 index 0000000..1a9740a --- /dev/null +++ b/squirrelmail/themes/css/squirrelmail-cn.css @@ -0,0 +1,45 @@ +body, td, th, dd, dt, h1, h2, h3, h4, h5, h6, p, ol, ul, li, input, select { + font-family: Verdana, Arial, Helvetica, sans-serif; +} + +body, small { + font-size: 8pt; +} + +p { + font-size: 9pt; + color: #707070; +} + +a:hover { + text-decoration: none; +} + +a:active { + text-decoration: underline; +} + +ol, ul, li { + font-size: 10pt; +} + +td, th { + font-size: 10pt; +} + +tr { + font-size: 10pt; +} + +dd, dt { + font-size: 10pt; +} + +textarea, pre, nobr { + font-family: monospace; + font-size: 9pt; +} + +input, select { + font-size: 10pt; +} -- 1.7.10.4