Debian Codegraph @

debian/firebird3.0-server.postinst

raw
1 #!/bin/sh
2 # postinst script for firebird3.0-superclassic
3
4 set -e
5 . /usr/share/debconf/confmodule
6 set -u
7
8 if [ -n "${DEBIAN_FIREBIRD_DEBUG:-}" ]; then
9 set -x
10 fi
11 # summary of how this script can be called:
12 # * <postinst> `configure' <most-recently-configured-version>
13 # * <old-postinst> `abort-upgrade' <new version>
14 # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
15 # <new-version>
16 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
17 # <failed-install-package> <version> `removing'
18 # <conflicting-package> <version>
19 # for details, see http://www.debian.org/doc/debian-policy/ or
20 # the debian-policy package
21 #
22 # quoting from the policy:
23 # Any necessary prompting should almost always be confined to the
24 # post-installation script, and should be protected with a conditional
25 # so that unnecessary prompting doesn't happen if a package's
26 # installation fails and the `postinst' is called with `abort-upgrade',
27 # `abort-remove' or `abort-deconfigure'.
28
29 FB_VER=3.0
30 . /usr/share/firebird${FB_VER}-common/functions.sh
31
32 checkFirebirdAccount() {
33 getent passwd firebird > /dev/null || \
34 adduser --system --quiet --home /var/lib/firebird \
35 --group --gecos "Firebird Database Administator" firebird
36 }
37
38 debhelper_hook()
39 {
40 # This is here in order to make debhelper_hook() a valid
41 # shell procedure in the case when debhelper has nothing
42 # for us
43 DuMmYnOtUsEd="dummy"
44
45 #DEBHELPER#
46 }
47
48
49 case "$1" in
50 configure)
51 checkFirebirdAccount
52
53 firebird_config_postinst "$@"
54
55 # move the log files from /var/log to /var/log/firebird
56 if [ -n "${2:-}" ] \
57 && dpkg --compare-versions "$2" lt "3.0.0~svn+61473.ds4-1~"
58 then
59 find /var/log -maxdepth 1 -name 'firebird3.0.log*' \
60 -exec mv --backup=numbered '{}' /var/log/firebird/ \;
61 fi
62 ;;
63
64 *)
65 debhelper_hook "$@"
66 ;;
67 esac
68
69 exit 0
70
71 # vi: set sw=4 ts=8 filetype=sh sts=4 :