File: postinst

package info (click to toggle)
emacspeak 15-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,596 kB
  • ctags: 3,499
  • sloc: lisp: 33,875; makefile: 592; sh: 495; tcl: 492; perl: 351; cpp: 239
file content (59 lines) | stat: -rw-r--r-- 1,529 bytes parent folder | download | duplicates (2)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
set -e

case "$1" in
    configure)
        # continue below
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
        exit 0;
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2;
        exit 0;
    ;;
esac


# original config file was missing the `$' characters on the variable names
# insert them if necessary
if [ -f /etc/emacspeak.conf ]; then
    sed 's/^if  *\[  *"DTK/if \[ "$DTK/' /etc/emacspeak.conf >/etc/temp.$$
    mv /etc/temp.$$ /etc/emacspeak.conf
    if grep 'export' /etc/emacspeak.conf >/dev/null; then
	true;
    else
	cat >>/etc/emacspeak.conf <<\EOF
export DTK_PROGRAM DTK_PORT DTK_TCL
EOF
    fi
fi

emacspeakconfig -i

#DEBHELPERdefeated#  not included since not using dh_installdeb.
# including the script fragments manually instead:

install-info --quiet --section "Emacs" "Emacs" \
    --description="Speech output for Emacs." /usr/share/info/emacspeak.info

# creation of .server must precede byte-compilation
cat /usr/share/emacs/site-lisp/emacspeak/servers/.servers-* 	\
    > /usr/share/emacs/site-lisp/emacspeak/servers/.servers

/usr/lib/emacsen-common/emacs-package-install emacspeak

if command -v install-docs >/dev/null 2>&1; then
	install-docs -i /usr/share/doc-base/emacspeak
fi

if [ "$1" = "configure" ]; then
	if [ -d /usr/doc -a ! -e /usr/doc/emacspeak -a -d /usr/share/doc/emacspeak ]; then
		ln -sf ../share/doc/emacspeak /usr/doc/emacspeak
	fi
fi

# this is just to silence a lintian warning, since we're not using debhelper
##DEBHELPER##