File: postinst.in

package info (click to toggle)
auctex 9.9p-13
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,328 kB
  • ctags: 761
  • sloc: lisp: 11,769; makefile: 197
file content (121 lines) | stat: -rw-r--r-- 3,347 bytes parent folder | download
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#include "variables"
#!/bin/bash -e
#
# postinst configuration file for Debian <:=$PACKAGE:> package.
# $Id: postinst.in,v 1.8 2000/01/20 14:33:49 salve Exp $
#
<:=@COPYRIGHT:>//

set -o posix

source <:=$CONFMODULE:>
db_version 2.0

#---B-E-G-I-N---O-L-D---S-T-U-F-F---(keep-it,-it-doesn't-hurt)-----------------
for i in /usr/lib/emacs/common/auctex/auto/ /var/lib/emacs/auctex/; do
    if test -d $i
	then rm -rf $i
    fi
done
for i in /usr/lib/emacs/common/auctex /usr/lib/emacs/common; do
    if test -d $i
	then find ${i%/*} -name ${i##*/} -type d -empty | xargs --no-run-if-empty rmdir
    fi
done
#---E-N-D---O-L-D---S-T-U-F-F--------------------------------------------------

conf_autoload () {
    db_get <:=$PACKAGE:>/default || true
    if [ $RET = "true" ]; then umask 022;
	cat <<-EOF ><:=$sstartd:>/<:=$EPRIORITY:><:=$PACKAGE:>.el
		(require 'tex-site);') <- beauty stuff
	EOF
	chmod 644 <:=$sstartd:>/<:=$EPRIORITY:><:=$PACKAGE:>.el
    else
	rm -f <:=$sstartd:>/<:=$EPRIORITY:><:=$PACKAGE:>.el
    fi
    return 0
}

do_auto () {
    db_get <:=$PACKAGE:>/logfile || true
    LOGFILE=$RET
    db_get <:=$PACKAGE:>/doauto || true
    case "$RET" in
	Foreground)
	    rm -f $LOGFILE
	    <:="$sbin/$UPDATE":>
	;;
	Background)
	    # Closing fd 3 is debconf important.
	    <:# debconf's frontend wait for its standard input to be closed:>//
	    <:# before dying, and that means fd 3:>//
	    <:# better don't close fd 0: emacs doesn't take it very well:>//
	    <:# WARNING: DON'T CLOSE FD'S TO BE WRITTEN TO!:>//
	    <:# WARNING: DON'T CLOSE FD'S TO BE READ TO!:>// 
	    <:="$sbin/$UPDATE":> &> $LOGFILE 3>&- &
	    echo -n "update-auctex-elisp[$!]: "
	    echo "Further output will appear in: $LOGFILE"
	;;
	None)
	    rm -f $LOGFILE
	;;
	*)
	    echo "${0##*/}: Debconf passed unknown value \`$RET'." >&2
	;;
    esac
    return 0
}

do_link () {
    test -d /usr/doc -a ! -e /usr/doc/<:=$PACKAGE:> \
	 -a -d /usr/share/doc/<:=$PACKAGE:> \
	 && ln -sf ../share/doc/<:=$PACKAGE:> /usr/doc/<:=$PACKAGE:>
    return 0
}

case "$1" in
    abort-remove|abort-upgrade|configure)
    <:# abort-remove in-favour ${3:newpkg} ${4:newver}
      # (undo prerm remove in-favour $3 $4):>//
    <:# abort-upgrade ${2:newver}
      # (undo prerm upgrade $2):>//
    <:# configure ${2:lastconfver}
      # (or, if there wasn't an old version at all)
      # configure ${2=""|"<unknow>"}
      # (or, if dpkg version is very old)
      # configure
      # (dregistered files and conffiles have been installed):>//
	<:# install byte compiled lisp:>//
	<:=$EINSTALL:> <:=$PACKAGE:>
	<:# parse TeX macros and LaTeX styles:>//
	do_auto
	<:# install compatibility link:>//
	do_link
	<:# install info menu into info dir:>//
	<:=$DINSTALL:> <:="$docbase/$PACKAGE":>
	<:# install info menu into info dir:>//
	<:=$IINSTALL:> <:="$info/$PACKAGE.info.gz":>
	<:# put or remove emacs startup file:>//
	conf_autoload
    ;;
    abort-deconfigure)
    <:# abort-deconfigure in-favour ${3:newpkg} ${4:newver} removing ${6:oldpkg} ${7:oldver}
      # (undo prerm deconfigure in-favour $3 $4 removing $6 $7):>//
	<:# put or remove emacs startup file:>//
	conf_autoload
    ;;
    *)
	echo "${0##*/}: Called with unknown argument \`$1'." >&2
    ;;
esac

<:# to be sure debconf moves on:>//
db_stop

exit 0
<:
# Local Variables:
# mode: shell-script
# End:
:>//