]> git.donarmstrong.com Git - lilypond.git/blob - buildscripts/lilypond-profile.sh
*** empty log message ***
[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 echo $0
11 # workaround for ZSH posix $0-problem
12 [ -n "$ZSH_NAME" ] && setopt nofunctionargzero
13
14 if [ `basename "$0"` = "lilypond-profile" ] ; then
15     cat >/dev/stderr <<EOF
16     
17 Error: This script cannot be run in a subshell; it MUST be sourced.
18
19
20 EXAMPLE 1: One time use 
21
22         Do
23
24             . $0
25
26
27
28 EXAMPLE 2: Install for self
29
30         * Do
31
32             cp lilypond-profile $HOME/bin/
33
34         * Add
35
36             .  $HOME/bin/lilypond-profile
37
38         to either $HOME/.profile or $HOME/.bash_profile, 
39
40         * Logout.
41
42
43 EXAMPLE 3: Install for all users.
44
45         * Do
46
47              mv lilypond-profile /etc/profile.d/lilypond.sh
48
49         * Logout
50
51
52
53 EOF
54
55
56 ## If the message above is printed erroneously,
57 ## the following commands  kills the current terminal/shell.
58 ## hence the ZSH  test above.
59
60     exit 2 
61 else
62
63         if [ -z "$LILYPONDPREFIX" ]; then
64             datadir=`echo "@local_lilypond_datadir@" | sed 's!//!/!g'`
65         else
66             if [ -d "$LILYPONDPREFIX/share" ]; then
67                 datadir=$LILYPONDPREFIX/share/lilypond/
68             fi
69             echo "Setting tree to $datadir"
70         fi
71
72         # Add the installation directory to the teTeX system tree, 
73         # see Documentation/misc/fontinstallation
74         TEXMF="{$datadir,"`kpsexpand  \\$TEXMF`"}"
75         export TEXMF
76
77         # For direct ps output: ps/lilyponddefs.ps
78         ## GS_LIB="$datadir/ps:"${GS_LIB:=""}
79         ## export GS_LIB
80
81         # For direct ps output fonts. Add all available TeX Type1 fonts
82         ## GS_FONTPATH=`kpsewhich -expand-path=\\$T1FONTS`:${GS_FONTPATH:=""}
83         ## export GS_FONTPATH
84
85 fi
86         
87
88