summaryrefslogtreecommitdiff
path: root/dh_installemacsen
blob: e87cecef687151d8959fe318b84e7bd1997547d8 (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
34
#!/bin/sh -e
#
# Registration with emacsen-common.

PATH=debian:$PATH:/usr/lib/debhelper
. dh_lib

for PACKAGE in $DH_DOPACKAGES; do
	TMP=`tmpdir $PACKAGE`

	emacsen_install=`pkgfile $PACKAGE emacsen-install`
	emacsen_remove=`pkgfile $PACKAGE emacsen-remove`

	if [ "$emacsen_install" ]; then
		if [ ! -d "$TMP/usr/lib/emacsen-common/packages/install" ]; then
			doit "install -d $TMP/usr/lib/emacsen-common/packages/install"
		fi
		doit "install $emacsen_install $TMP/usr/lib/emacsen-common/packages/install/$PACKAGE"
	fi

	if [ "$emacsen_remove" ]; then
		if [ ! -d "$TMP/usr/lib/emacsen-common/packages/remove" ]; then
			doit "install -d $TMP/usr/lib/emacsen-common/packages/remove"
		fi
		doit "install $emacsen_remove $TMP/usr/lib/emacsen-common/packages/remove/$PACKAGE"
	fi

	if [ "$emacsen_install" -o "$emacsen_remove" ]; then
		if [ ! "$DH_NOSCRIPTS" ]; then
			autoscript "postinst" "postinst-emacsen"
			autoscript "prerm" "prerm-emacsen"
		fi
	fi	
done