Sophie

Sophie

distrib > Mandriva > 10.2 > i586 > media > contrib > by-pkgid > f24b685bf2bfc9583811b865777f5939 > scriptlet

squirrelmail-1.4.4-5mdk.noarch.rpm

PREIN

/bin/sh
/usr/share/rpm-helper/add-user squirrelmail $1 apache /var/www /bin/sh 
#Check config file sanity
if [ -e /usr/sbin/ap13chkconfig ]; then /usr/sbin/ap13chkconfig;fi

POSTIN

/bin/sh
# The FIXME alias is because rpmlint says it's dangerous to use perl 
# in post scripts. We know that, but there is no safer solution.
alias FIXME="perl -pi -e"
#Upgrade: remove line and reinstall it (only for Apache 1.3)
if [ $1 -gt 1 ]; then
   for config in /etc/httpd/conf/{httpd,httpd-perl}.conf; do
     if [ -e $config ]; then
	FIXME 's/.*//s if (/Include.*squirrelmail.conf$/i);' $config
	echo "Include conf.d/73_squirrelmail.conf" >> $config
     fi
   done
fi
#Install
if [ $1 = "1" ]; then
   for config in /etc/httpd/conf/{httpd,httpd-perl}.conf; do
     if [ -e $config ]; then
	echo "Include conf.d/73_squirrelmail.conf" >> $config
     fi
   done
fi
# Put correct hostname in config. We do this every time, since we change the
# .rpmnew as well. This is safe even if someone already modified the config,
# because the script will not find __HOSTNAME__ in the file and will do
# nothing.
for f in /etc/squirrelmail/config.php /etc/squirrelmail/config.php.rpmnew \
	/var/www/html/squirrelmail/plugins/avelsieve/config.php \
	/var/www/html/squirrelmail/plugins/avelsieve/addrule_html.php; do
    FIXME "s|__HOSTNAME__|$HOSTNAME|g" $f 2>/dev/null
done
if [ -e /usr/sbin/ADVXctl ]; then /usr/sbin/ADVXctl update;fi

POSTUN

/bin/sh
alias FIXME="perl -pi -e"
#Uninstall (only for Apache 1.3)
if [ $1 = "0" ]; then
   for config in /etc/httpd/conf/{httpd,httpd-perl}.conf; do
     if [ -e $config ]; then
	FIXME 's/.*//s if (/Include.*squirrelmail.conf$/i);' $config
     fi
   done
fi
if [ -e /usr/sbin/ADVXctl ]; then /usr/sbin/ADVXctl update;fi