3 # Setup TeX/LaTeX Ghostscript environment for LilyPond.
5 # Red Hat-like systems should install this in /etc/profile.d/
7 # If run by hand or from you .profile, run as follows
8 # . /PATH/TO/lilypond-profile
10 if [ `basename "$0"` = "lilypond-profile" ] ; then
11 cat >/dev/stderr <<EOF
13 Error: This script cannot be run in a subshell; it MUST be sourced.
16 EXAMPLE 1: One time use
24 EXAMPLE 2: Local installation
28 mv lilypond-profile $HOME/bin/
32 . $HOME/bin/lilypond-profile
34 to either $HOME/.profile or $HOME/.bash_profile,
39 EXAMPLE 3: Global installation
43 mv lilypond-profile /etc/profile.d/lilypond.sh
53 if [ -z "$LILYPONDPREFIX" ]; then
54 datadir=`echo "@local_lilypond_datadir@" | sed 's!//!/!g'`
56 if [ -d "$LILYPONDPREFIX/share" ]; then
57 datadir=$LILYPONDPREFIX/share/lilypond/
59 echo "Setting tree to $datadir"
62 # Add the installation directory to the teTeX system tree,
63 # see Documentation/misc/fontinstallation
64 TEXMF="{$datadir,"`kpsexpand \\$TEXMF`"}"
67 # For direct ps output: ps/lilyponddefs.ps
68 ## GS_LIB="$datadir/ps:"${GS_LIB:=""}
71 # For direct ps output fonts. Add all available TeX Type1 fonts
72 ## GS_FONTPATH=`kpsewhich -expand-path=\\$T1FONTS`:${GS_FONTPATH:=""}