postinst is in spip 3.0.14-1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | #! /bin/sh
# postinst script for spip
#
# see: dh_installdeb(1)
set -e
. /usr/share/debconf/confmodule
case "$1" in
configure)
# /etc/apache2/conf.d/spip.conf symlink moved to /etc/apache2/conf-available
if dpkg --compare-versions "$2" lt-nl "3.0.10-2"; then
[ -L /etc/apache2/conf.d/spip.conf ] && rm /etc/apache2/conf.d/spip.conf
fi
# picked up from https://wiki.debian.org/Apache/PackagingFor24#Making_web_applications_compatible_to_both.2C_Apache_2.2_and_2.4
CONF="spip"
COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true)
db_get spip/webserver || true
webserver=$RET
webserver=`echo $webserver|sed -e 's/, */ /g'`
for i in $webserver; do
if [ "$webserver" != "cherokee" ]; then
if [ ! -d /etc/$i/conf-available/ ]; then
install -d -m755 /etc/$i/conf-available/
fi
if [ ! -e /etc/$i/conf-available/spip.conf ]; then
ln -s ../../spip/apache.conf \
/etc/$i/conf-available/spip.conf
if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
. /usr/share/apache2/apache2-maintscript-helper
apache2_invoke enconf spip.conf
elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then
[ -d /etc/apache2/conf.d/ ] && [ ! -L /etc/apache2/conf.d/$CONF.conf ] && ln -s ../conf-available/$CONF.conf /etc/apache2/conf.d/$CONF.conf
fi
if [ -f /etc/init.d/$i ]; then
if which invoke-rc.d >/dev/null 2>&1; then
invoke-rc.d $i reload
else
/etc/init.d/$i reload
fi
fi
fi
else
if [ ! -d /etc/cherokee/sites-available/ ]; then
install -d -m755 /etc/cherokee/sites-available/
fi
if [ ! -e /etc/cherokee/sites-available/spip ]; then
ln -s ../../spip/cherokee.conf \
/etc/cherokee/sites-available/spip
if [ -f /etc/init.d/$i ]; then
if which invoke-rc.d >/dev/null 2>&1; then
invoke-rc.d $i reload
else
/etc/init.d/$i reload
fi
fi
fi
fi
done
chown -R www-data /var/lib/spip/sites/default/IMG
chown -R www-data /var/lib/spip/sites/default/tmp
chown -R www-data /var/lib/spip/sites/default/local
chown -R www-data /var/lib/spip/sites/default/config
chown -R www-data /var/lib/spip/plugins
chown -R www-data /var/lib/spip/local
chown -R www-data /var/lib/spip/IMG
# Replace directory with symlink
dir="/var/lib/spip/squelettes-dist"
if [ -d $dir ] && [ ! -L $dir ]; then
if rmdir $dir 2>/dev/null; then
ln -sf /usr/share/spip/squelettes-dist $dir
fi
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
exit 0
|