]> git.donarmstrong.com Git - lilypond.git/blob - buildscripts/lilypond-profile.sh
add @finalout.
[lilypond.git] / buildscripts / lilypond-profile.sh
1 #!/bin/sh
2
3 # Setup TeX/LaTeX Ghostscript environment for LilyPond.
4
5 # Red Hat-like systems should install this in /etc/profile.d/
6
7 # If run by hand or from you .profile, run as follows
8 #   . /PATH/TO/lilypond-profile
9
10
11
12
13
14 # In ZSH, $0 is set to the script name, regardless of whether sourced
15 # or run in a subshell.
16 if [ -n "$ZSH_NAME" ] ; then
17     echo "Make sure that this script is sourced, ie. run as "
18     echo 
19     echo "   . lilypond-profile"
20     echo ""
21     echo "Continuing anyway ..."
22     return 2
23 fi
24
25 if [ -z "$ZSH_NAME" -a `basename "$0"` = "lilypond-profile" ] ; then 
26     cat >/dev/stderr <<EOF
27     
28 Error: This script cannot be run in a subshell; it MUST be sourced.
29
30
31 EXAMPLE 1: One time use 
32
33         * Do
34
35             . $0
36
37
38
39 EXAMPLE 2: Install for self
40
41         * Do
42
43             cp lilypond-profile $HOME/bin/
44
45         * Add
46
47             .  $HOME/bin/lilypond-profile
48
49         to either $HOME/.profile or $HOME/.bash_profile, 
50
51         * Logout.
52
53
54 EXAMPLE 3: Install for all users.
55
56         * Do
57
58              mv lilypond-profile /etc/profile.d/lilypond.sh
59
60         * Logout
61
62 EOF
63
64     return 2
65 else
66         if [ -z "$LILYPONDPREFIX" ]; then
67             datadir=`echo "@local_lilypond_datadir@" | sed 's!//!/!g'`
68         else
69             if [ -d "$LILYPONDPREFIX/share" ]; then
70                 datadir=$LILYPONDPREFIX/share/lilypond/
71             fi
72             echo "Setting tree to $datadir"
73         fi
74
75         # Add the installation directory to the teTeX system tree, 
76         # see Documentation/misc/fontinstallation
77         if [ -z `echo $TEXMF | grep "$datadir"` ]; then
78                 TEXMF="{$datadir,"`kpsexpand  \\$TEXMF`"}"
79                 export TEXMF
80         fi
81 fi
82         
83
84