diff -r 875e0c6a6c1c -r a587bc920c3d debian/littlebird-tc-core.postinst --- a/debian/littlebird-tc-core.postinst Thu Sep 15 14:14:13 2011 +0200 +++ b/debian/littlebird-tc-core.postinst Fri Sep 16 10:16:08 2011 +0200 @@ -24,9 +24,9 @@ case "$1" in configure) - DIR=/srv/www/littlebird/TrustCenter/data - chown -R :www-data "$DIR" - chmod -R g+w "$DIR" + dirs="/var/log/littlebird-tc /var/lib/littlebird-tc" + chown -R :www-data $dirs + chmod -R g+w $dirs # Timezone in /usr/local/zend/etc/php.ini # note: this file is handled as a conffile under ucf control @@ -102,7 +102,7 @@ # tweak the config file, but just the lines following a magical # debconf line - cp /usr/share/doc/littlebird-tc/examples/apache/littlebird-tc $tmp + cp /usr/share/doc/littlebird-tc/examples/apache/littlebird-tc.conf $tmp perl - "$tmp" serveradmin="$serveradmin" servername="$servername" serverport="$serverport" \ crt="$crt" key="$key" <<'_' use strict; @@ -130,14 +130,25 @@ close(F); _ - ucf --debconf-ok $tmp /etc/apache2/conf.d/littlebird-tc + # transition to *.conf + old_conf=/etc/apache2/conf.d/littlebird-tc + conf=/etc/apache2/conf.d/littlebird-tc.conf + + if test -f $old_conf; then + ucf --debconf-ok $old_conf $conf + ucf --purge $old_conf + rm -f $old_conf $old_conf.ucf* + fi + + ucf --debconf-ok $tmp $conf + rm -f $conf.ucf* # need log dir(s) ( . /etc/apache2/envvars - file=`perl -ne '/^\s*errorlog\s+(\S+)/i&&print "$1\n"' /etc/apache2/conf.d/littlebird-tc` + file=`perl -ne '/^\s*errorlog\s+(\S+)/i&&print "$1\n"' $conf` dir=`eval dirname "$file"` mkdir -p "$dir" - file=`perl -ne '/^\s*customlog\s+(\S+)/i&&print "$1\n"' /etc/apache2/conf.d/littlebird-tc` + file=`perl -ne '/^\s*customlog\s+(\S+)/i&&print "$1\n"' $conf` dir=`eval dirname "$file"` mkdir -p "$dir" ) @@ -159,7 +170,7 @@ if ($o{serverport} eq "443") { $o{serverurl} = "https://$o{servername}" } else { $o{serverurl} = "https://$o{servername}:$o{serverport}" } - open(F, "+ ; s|^(\Qresources.db.params.dbname\E\s*=).*|$1 $o{dbname}|mig; @@ -167,7 +178,7 @@ s|^(\Qresources.db.params.username\E\s*=).*|$1 $o{dbuser}|mig; s|^(\Qresources.db.params.password\E\s*=).*|$1 $o{dbpass}|mig; s|^(\Qlittlebird.trustcenter.url\E\s*=).*|$1 $o{serverurl}|mig; - s|/opt/LittleBird/LittleBird(?:-Test)?|/srv/www/littlebird|mig; + s|/opt/LittleBird/LittleBird(?:-Test)?|/usr/lib/littlebird-tc|mig; seek(F, 0, 0); print(F $_); truncate(F, tell F);