2 # postinst script for @OLDPACKAGE@
4 # see: dh_installdeb(1)
7 # set -x # Be verbose, be very verbose.
9 # summary of how this script can be called:
10 # * <postinst> `configure' <most-recently-configured-version>
11 # * <old-postinst> `abort-upgrade' <new version>
12 # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
14 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
15 # <failed-install-package> <version> `removing'
16 # <conflicting-package> <version>
17 # for details, see /usr/share/doc/packaging-manual/
19 # quoting from the policy:
20 # Any necessary prompting should almost always be confined to the
21 # post-installation script, and should be protected with a conditional
22 # so that unnecessary prompting doesn't happen if a package's
23 # installation fails and the `postinst' is called with `abort-upgrade',
24 # `abort-remove' or `abort-deconfigure'.
26 . /usr/share/debconf/confmodule
30 # Patch NSS configuration files
31 /usr/share/@OLDPACKAGE@/bin/install-nsspgsql.sh configure-files
33 # There's probably no /etc/nss-pgsql.conf yet (none provided by default with libnss-pgsql2)
34 if [ ! -f /etc/nss-pgsql.conf ]; then
35 # Install default version, identical to the one managed with ucf : ucf won't prompt us this time
36 cp /etc/nss-pgsql.conf.gforge-new /etc/nss-pgsql.conf
38 ucf --debconf-ok /etc/nss-pgsql.conf.@OLDPACKAGE@-new /etc/nss-pgsql.conf
39 ucfr @OLDPACKAGE@-shell-postgresql /etc/nss-pgsql.conf
41 # There's probably no /etc/nss-pgsql.conf yet (none provided by default with libnss-pgsql2)
42 if [ ! -f /etc/nss-pgsql-root.conf ]; then
43 # Install default version, identical to the one managed with ucf : ucf won't prompt this time
44 cp /etc/nss-pgsql-root.conf.@OLDPACKAGE@-new /etc/nss-pgsql-root.conf
46 ucf --debconf-ok /etc/nss-pgsql-root.conf.@OLDPACKAGE@-new /etc/nss-pgsql-root.conf
47 ucfr @OLDPACKAGE@-shell-postgresql /etc/nss-pgsql-root.conf
49 # There should be a nsswitch.conf, so we have to manage it
50 ucf --debconf-ok /etc/nsswitch.conf.@OLDPACKAGE@-new /etc/nsswitch.conf
51 ucfr @OLDPACKAGE@-shell-postgresql /etc/nsswitch.conf
53 rm /etc/nss-pgsql.conf.@OLDPACKAGE@-new
54 rm /etc/nss-pgsql-root.conf.@OLDPACKAGE@-new
55 rm /etc/nsswitch.conf.@OLDPACKAGE@-new
57 # Install the chroot environment
58 /usr/share/@OLDPACKAGE@/bin/install-chroot.sh configure
61 abort-upgrade|abort-remove|abort-deconfigure)
65 echo "postinst called with unknown argument \`$1'" >&2
70 # dh_installdeb will replace this with shell code automatically
71 # generated by other debhelper scripts.