postinst is in ledgersmb 1.3.25-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 | #!/bin/sh
# postinst script for ledgersmb
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
# Set old_version variable for use later in the script.
old_version=$2
# Remove these settings for /etc/ledgersmb/*, as dpkg-statoverride
# is no longer being used in debian/postinst to set it
drop_statoverride() {
for file in /etc/ledgersmb /etc/ledgersmb/images \
/etc/ledgersmb/images/demo /etc/ledgersmb/template ;
do
if dpkg-statoverride --list $file >/dev/null; then
dpkg-statoverride --remove $file
fi
done
}
dbc_first_version="1.3.14-2"
dbc_dbtypes="pgsql"
. /usr/share/debconf/confmodule
. /usr/share/dbconfig-common/dpkg/postinst.pgsql
case "$1" in
configure)
# Only do these if this is the initial install.
if [ -z "$old_version" ]; then
# Create initial default set of css files from the examples
if [ ! -d "/var/lib/ledgersmb/css" ]; then
cp -r /usr/share/ledgersmb/css /var/lib/ledgersmb
chown -R www-data:www-data /var/lib/ledgersmb/css
fi
# Create initial default set of templates from the examples
if [ ! -d "/var/lib/ledgersmb/templates" ]; then
cp -r /usr/share/ledgersmb/templates /var/lib/ledgersmb
chown -R www-data:www-data /var/lib/ledgersmb/templates
fi
# Do Apache related processing if it is present.
if [ -d "/etc/apache2" ]; then
# Enable Apache mod_rewrite
if [ -x "`which a2enmod 2>/dev/null`" ]; then
a2enmod rewrite
fi
# Restart apache
if [ -x "/etc/init.d/apache2" ]; then
invoke-rc.d apache2 restart 3>/dev/null || true
fi
fi
fi
# Remove these settings for /etc/ledgersmb/*, as dpkg-statoverride
# is no longer being used in debian/postinst to set it.
if [ -n "$old_version" ] && dpkg --compare-versions $old_version lt 1.3.9-2; then
drop_statoverride
fi
# If enabled, do the debconf supported configuration
db_get ledgersmb/debconf_install
if [ "$RET" = true ]; then
dbc_go ledgersmb $@
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
|