summaryrefslogtreecommitdiff
path: root/debian/sendmail-base.preinst.in
blob: b61d8a1e362221477f08571bf75c7429eafea28a (plain)
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
#!/bin/sh
set -e;

PACKAGE=sendmail-base;

if [ -L @docdir@/$PACKAGE ]; then
	# /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail
	rm @docdir@/$PACKAGE
fi
if [ -L /usr/share/bug/$PACKAGE ]; then
	rm /usr/share/bug/$PACKAGE
fi

if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt "8.14.4-2.2~"; then
	# /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail
	rm -rf @docdir@/sendmail/examples
	rm -f @docdir@/sendmail/Debian-specific.gz
	rm -f @docdir@/sendmail/site.config.m4.gz
fi

if [ "$1" = "upgrade" ]; then
		# Prevent cronjob from running during upgrade...
		if [ -f @sysconfdir@/cron.d/sendmail ]; then
			echo "#preinst" > @sysconfdir@/cron.d/sendmail;
			fi;

		# Move files to new home
		if [ -d @sysconfdir@/mail/ssl ]; then
			mv -f @sysconfdir@/mail/ssl @sysconfdir@/mail/tls;
			fi;
fi

#DEBHELPER#