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