3 # Skeleton maintainer script showing all the possible cases.
4 # Written by Charles Briscoe-Smith, March-June 1998. Public Domain.
6 # Abort if any command returns an error value
8 . /usr/share/debconf/confmodule
10 # This script is called as the last step of the installation of the
11 # package. All the package's files are in place, dpkg has already done
12 # its automatic conffile handling, and all the packages we depend of
13 # are already fully installed and configured.
15 # The following idempotent stuff doesn't generally need protecting
16 # against being run in the abort-* cases.
18 #### Install info files into the dir file
19 ###: install-info --quiet --section "section pattern" "Section Title" \
20 ###: --description="Name of the document" /usr/info/foo.info
22 #### Create stub directories under /usr/local
23 ###: if test ! -d /usr/local/lib/foo; then
24 ###: if test ! -d /usr/local/lib; then
25 ###: if mkdir /usr/local/lib; then
26 ###: chown root.staff /usr/local/lib || true
27 ###: chmod 2775 /usr/local/lib || true
30 ###: if mkdir /usr/local/lib/foo; then
31 ###: chown root.staff /usr/local/lib/foo || true
32 ###: chmod 2775 /usr/local/lib/foo || true
36 #### Ensure the menu system is updated
37 ###: [ ! -x /usr/bin/update-menus ] || /usr/bin/update-menus
39 #### Arrange for a daemon to be started at system boot time
40 ###: update-rc.d foo default >/dev/null
44 # Configure this package. If the package must prompt the user for
45 # information, do it here.
47 mkdir -p /var/lib/citadel/www/static
48 # Activate menu-methods script
49 #: chmod a+x /etc/menu-methods/foo
54 # Make our version of a program available
55 #: update-alternatives \
56 #: --install /usr/bin/program program /usr/bin/alternative 50 \
57 #: --slave /usr/share/man/man1/program.1.gz program.1.gz \
58 #: /usr/share/man/man1/alternative.1.gz
60 # Tell ucf that the file in /usr/share/foo is the latest
61 # maintainer version, and let it handle how to manage the real
62 # confuguration file in /etc. This is how a static configuration
63 # file can be handled:
64 cd /var/lib/citadel/www/static; md5sum * |grep -v ".gz" |grep -v md5sums>/tmp/md5sums
65 gunzip -c /usr/share/doc/citadel-webcit/examples/static/md5sums > /tmp/newsums
66 if diff /tmp/newsums /tmp/md5sums >/dev/null; then
69 cd /usr/share/doc/citadel-webcit/examples/static; for i in `echo *|sed "s;md5sums.gz;;"`; do
72 j=`echo $i|sed "s;.gz;;"`
73 gunzip -c "/usr/share/doc/citadel-webcit/examples/static/$i" >"/tmp/$j"
77 cp "/usr/share/doc/citadel-webcit/examples/static/$i" "/tmp"
80 origsum=`grep " $i" /tmp/md5sums |sed "s; .*;;"`
81 newsum=`grep " $i" /tmp/newsums |sed "s; .*;;"`
82 if test -z "$origsum"; then
83 ucf "/tmp/$i" "/var/lib/citadel/www/static/$i"
85 if test "$origsum" != "$newsum"; then
86 ucf "/tmp/$i" "/var/lib/citadel/www/static/$i"
91 rm -f /tmp/newsums /tmp/md5sums
92 if test ! -d /var/lib/citadel/keys; then
93 mkdir -p /var/lib/citadel/keys
95 if test ! -d /var/run/citadel/keys; then
96 mkdir -p /var/run/citadel/keys
99 db_get citadel/WebcitHttpPort && http_port="$RET"
100 db_get citadel/WebcitHttpsPort && https_port="$RET"
102 echo "aplying your settings"
103 if grep -q "webserver" /etc/inittab; then
111 "|/usr/lib/citadel-webcit/setup -q
114 " |/usr/lib/citadel-webcit/setup -q
118 #### There are three sub-cases:
119 ###if test "${2+set}" != set; then
120 ### # We're being installed by an ancient dpkg which doesn't remember
121 ### # which version was most recently configured, or even whether
122 ### # there is a most recently configured version.
125 ###elif test -z "$2" -o "$2" = "<unknown>"; then
126 ### # The package has not ever been configured on this system, or was
127 ### # purged since it was last configured.
131 ### # Version $2 is the most recently configured version of this
138 # Back out of an attempt to upgrade this package FROM THIS VERSION
139 # to version $2. Undo the effects of "prerm upgrade $2".
144 ###if test "$2" != in-favour; then
145 ### echo "$0: undocumented call to \`postinst $*'" 1>&2
148 #### Back out of an attempt to remove this package, which was due to
149 #### a conflict with package $3 (version $4). Undo the effects of
150 #### "prerm remove in-favour $3 $4".
155 ###if test "$2" != in-favour -o "$5" != removing; then
156 ### echo "$0: undocumented call to \`postinst $*'" 1>&2
159 #### Back out of an attempt to deconfigure this package, which was
160 #### due to package $6 (version $7) which we depend on being removed
161 #### to make way for package $3 (version $4). Undo the effects of
162 #### "prerm deconfigure in-favour $3 $4 removing $6 $7".
166 *) echo "$0: didn't understand being called with \`$1'" 1>&2