postinst is in ledgersmb 1.3.46-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 | #!/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
# Source debconf
if [ -f /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
fi
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
fi
# Do Apache related processing if it is present.
if [ -d "/etc/apache2" ]; then
# If the old ledgersmb-httpd.conf is present, rename it.
dpkg-maintscript-helper mv_conffile \
/etc/apache2/conf.d/ledgersmb-httpd.conf /etc/apache2/conf.d/ledgersmb.conf 1.3.46-1~ ledgersmb -- "$@"
if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
[ -d /etc/apache2/conf-available/ ] && [ ! -e /etc/apache2/conf-available/ledgersmb.conf ] && cp /usr/share/ledgersmb/ledgersmb-httpd-2.4.conf.template /etc/apache2/conf-available/ledgersmb.conf
. /usr/share/apache2/apache2-maintscript-helper
apache2_invoke enconf ledgersmb.conf || exit $?
[ ! -h /etc/ledgersmb/ledgersmb-httpd-2.4.conf ] && ln -s /etc/apache2/conf-available/ledgersmb.conf /etc/ledgersmb/ledgersmb-httpd-2.4.conf
elif dpkg-query -f '${Version}' -W 'apache2.2-common' > /dev/null 2>&1 ; then
# if the configuration uses <IfVersion> uncomment the next line
# a2enmod -q version
[ -d /etc/apache2/conf.d/ ] && [ ! -e /etc/apache2/conf.d/ledgersmb.conf ] && cp /usr/share/ledgersmb/ledgersmb-httpd-2.0-2.2.conf.template /etc/apache2/conf.d/ledgersmb.conf
[ ! -h /etc/ledgersmb/ledgersmb-httpd-2.0-2.2.conf ] && ln -s /etc/apache2/conf.d/ledgersmb.conf /etc/ledgersmb/ledgersmb-httpd-2.0-2.2.conf
# 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
# If enabled, do the debconf supported configuration
db_get ledgersmb/debconf_install
if [ "$RET" = true ]; then
# Get user name.
db_get ledgersmb/admin_login
LSMBDBUSER=$RET
# Get password
db_get ledgersmb/admin_password
LSMBDBPW=$RET
# Configure database administrative user
/usr/share/ledgersmb/tools/config-lsmb-db-user.sh $LSMBDBUSER $LSMBDBPW
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
|