]> git.donarmstrong.com Git - lilypond.git/blob - debian/preinst
release: 1.1.33
[lilypond.git] / debian / preinst
1 #!/bin/sh
2 #
3 # preinst script for the Debian GNU/Linux lilypond package
4 #   by Anthony Fok <foka@debian.org>
5 #   This is free software; see the GNU General Public Licence
6 #   version 2 or later for copying conditions.  There is NO warranty.
7 #   Last modified:  Tue, 10 Nov 1998 23:47:00 -0700
8
9 set -e
10
11 package=lilypond
12 font_supplier=public
13 font_typeface=lilypond
14 std_TEXMFMAIN=/usr/lib/texmf
15 std_VARTEXFONTS=/var/spool/texmf
16
17 #DEBHELPER#
18
19 TEXMFMAIN=`/usr/bin/kpsewhich -expand-var '$TEXMFMAIN'`
20 : ${TEXMFMAIN:=$std_TEXMFMAIN}
21 VARTEXFONTS=`/usr/bin/kpsewhich -expand-var '$VARTEXFONTS'`
22 : ${VARTEXFONTS=$std_VARTEXFONTS}
23
24 LILYTEXINPUTS=$TEXMFMAIN/tex/$package
25 LILYMFINPUTS=$TEXMFMAIN/fonts/source/$font_supplier/$font_typeface
26
27 case "$1" in
28     install|upgrade)
29         # Clear out the old TFM and PK files in case the fonts were
30         # left-over from previous installations
31         rm -rf $VARTEXFONTS/tfm/$font_supplier/$font_typeface
32         rm -rf $VARTEXFONTS/pk/*/$font_supplier/$font_typeface
33
34         # Fix a silly bug in Debian's lilypond 1.0.17-1.  :-)
35         if [ "$2" = "1.0.17-1" ]; then
36             rm -rf $VARTEXFONTS/tfm/$font_supplier/mf
37             rm -rf $VARTEXFONTS/pk/*/$font_supplier/mf
38         fi
39
40         # Since 1.0.17-1, /usr/lib/texmf/tex/lilypond has been changed
41         # to a symbolic directory.  Remove the old real directory to
42         # prevent problems during upgrade.
43         for i in $LILYTEXINPUTS $LILYMFINPUTS; do
44             if [ -d $i -a ! -L $i ]; then
45                 rm -rf $i
46             fi
47         done
48     ;;
49
50     abort-upgrade)
51     ;;
52
53     *)
54         echo "$0 called with unknown argument \`$1'" >&2
55         exit 0
56     ;;
57
58 esac