File: postinst

package info (click to toggle)
auctex 9.9j-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 1,248 kB
  • ctags: 767
  • sloc: lisp: 11,580; makefile: 290; sh: 223
file content (103 lines) | stat: -rw-r--r-- 3,428 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
#!/bin/bash -e
#
# postinst configuration file for Debian auctex package.
# $Id: postinst,v 1.25 1998/08/27 16:23:36 salve Exp $
#
# Copyright  Davide G. M. Salvetti <salve@debian.org>, 1998.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to: The Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#
# On Debian GNU/Linux System you can find a copy of the GNU General Public
# License in /usr/doc/copyright/GPL.

set -o posix

PACKAGE=auctex

function run_auto_generate () {
	TMPFILE=$(mktemp /tmp/update-auctex-elisp.XXXXXXX)
	cat <<-EOF

		AUC TeX parses all TeX macro packages and LaTeX style files for
		information.  This improves the performance of AUC TeX a lot.

		As this takes a lot of time when running for the first time, it will be
		done in background.  You will get a log file in:
		    $TMPFILE

		You can update this information an any later time, if needed, by running:
		    /usr/sbin/update-auctex-elisp

	EOF
	/usr/sbin/update-auctex-elisp &> $TMPFILE &
}

# Helmut's stuff: apparently this is a workaround for a defective
# prerm|postrm in that old version.  Better to keep it.
if [ "$1" = "configure" -a "$2" = "9.4g" ]; then 
    install-info --quiet --remove /usr/info/auctex.gz
fi

case "$1" in
    configure)
	/usr/lib/emacsen-common/emacs-package-install $PACKAGE
	install-info --section "Document Preparation" "Document Preparation" \
		     --menuentry="AUC TeX" \
		     --description="An integrated environment for TeX and LaTeX." \
		     --quiet /usr/info/auctex.gz
	if test -x /usr/bin/update-menus; then update-menus; fi
	if [ "$1" = "configure" ]; then
	    # Do we have old stuff still around?
	    for i in /usr/lib/emacs/common/auctex/auto/ /var/lib/emacs/auctex/; do
		if [ -d $i ]; then
		    # We seem to have autos in that old location: let's remove 'em.
		    rm -rf $i
		    echo "Information: old auto generated files have been removed from:"
		    echo "	$i."
		fi
	    done
	    # Delete these relicts if empty.
	    for i in /usr/lib/emacs/common/auctex /usr/lib/emacs/common; do
		if [ -d $i ]; then
		    find ${i%/*} -name ${i##*/} -type d -empty | xargs --no-run-if-empty rmdir
		fi
	    done

	    # Do we need to rebuild autos?

	    # Since its a bit too difficult (dgms) to check if the version
	    # we are upgrading from is lower than some other version, I'll
	    # assume we do always need to rebuild autos.  After all it
	    # does no harm.
	    # Anyway, that some other version should be 9.8i-3: we changed
	    # from /var/lib/emacs/auctex to /var/lib/auctex!
	    if [ $(find /var/lib/ -name auctex -type d -empty) ]; then
		run_auto_generate
	    fi
	fi
    ;;
    abort-upgrade|abort-deconfigure|abort-remove)
	:
    ;;
    *)
	echo "${0##*/}: Called with unknown argument \`$1'." >&2
    ;;
esac

exit 0

### Local Variables:
### mode: shell-script
### End: