~ubuntu-branches/ubuntu/trusty/sendmail/trusty

« back to all changes in this revision

Viewing changes to debian/sendmail-base.preinst

  • Committer: Bazaar Package Importer
  • Author(s): Richard A Nelson (Rick)
  • Date: 2009-03-01 18:45:00 UTC
  • mfrom: (8.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090301184500-z6683zxyomgmop6c
Tags: 8.14.3-9
Batting 1000, build-depend on quilt      Closes: #517676

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh -e
 
2
#
 
3
# Debian pre install script
 
4
#
 
5
# Install of already installed package:
 
6
#       1) Upgrade of package:
 
7
#               new-preinst upgrade old-version
 
8
#               *) new-postrm abort-upgrade old-version
 
9
#       2) package had some configuration files from a previous version installed
 
10
#               new-preinst install old-version
 
11
#               *) new-postrm abort-install old-version
 
12
#       3) Otherwise (i.e., the package was completely purged)
 
13
#               new-preinst install
 
14
#               *) new-postrm abort-install
 
15
#
 
16
set -e;
 
17
 
 
18
PACKAGE=sendmail-base;
 
19
 
 
20
case "$1" in
 
21
        install)
 
22
                # DPKG doesn't overwrite directories with symlinks...
 
23
                rm -rf /usr/share/doc/sendmail/examples 2>/dev/null || true;
 
24
                if [ -d /usr/share/doc/$PACKAGE ]; then
 
25
                        rm -rf /usr/share/doc/$PACKAGE;
 
26
                        fi;
 
27
                if [ ! -d /usr/share/doc/sendmail ]; then
 
28
                        mkdir -p /usr/share/doc/sendmail;
 
29
                        chmod a+rx /usr/share/doc/sendmail;
 
30
                        fi;
 
31
                ln -sf sendmail /usr/share/doc/$PACKAGE;
 
32
                ;;
 
33
 
 
34
        upgrade)
 
35
                # DPKG doesn't overwrite directories with symlinks...
 
36
                if [ -d /usr/share/doc/$PACKAGE ]; then
 
37
                        rm -rf /usr/share/doc/$PACKAGE;
 
38
                        fi;
 
39
                if [ ! -d /usr/share/doc/sendmail ]; then
 
40
                        mkdir -p /usr/share/doc/sendmail;
 
41
                        chmod a+rx /usr/share/doc/sendmail;
 
42
                        fi;
 
43
                ln -sf sendmail /usr/share/doc/$PACKAGE;
 
44
 
 
45
                # Prevent cronjob from running during upgrade...
 
46
                if [ -f /etc/cron.d/sendmail ]; then
 
47
                        echo "#preinst" > /etc/cron.d/sendmail;
 
48
                        fi;
 
49
 
 
50
                # Move files to new home
 
51
                if [ -d /etc/mail/ssl ]; then
 
52
                        mv -f /etc/mail/ssl /etc/mail/tls;
 
53
                        fi;
 
54
                ;;
 
55
 
 
56
        abort-upgrade)
 
57
                ;;
 
58
 
 
59
        *)
 
60
                echo "$PACKAGE preinst called with unknown argument \`$1'" >&2;
 
61
                exit 1;
 
62
                ;;
 
63
        esac;
 
64
 
 
65
#DEBHELPER#
 
66
exit 0;