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
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 "
19 echo " . lilypond-profile"
21 echo "Continuing anyway ..."
25 if [ -z "$ZSH_NAME" -a `basename "$0"` = "lilypond-profile" ] ; then
26 cat >/dev/stderr <<EOF
28 Error: This script cannot be run in a subshell; it MUST be sourced.
31 EXAMPLE 1: One time use
39 EXAMPLE 2: Install for self
43 cp lilypond-profile $HOME/bin/
47 . $HOME/bin/lilypond-profile
49 to either $HOME/.profile or $HOME/.bash_profile,
54 EXAMPLE 3: Install for all users.
58 mv lilypond-profile /etc/profile.d/lilypond.sh
66 if [ -z "$LILYPONDPREFIX" ]; then
67 datadir=`echo "@local_lilypond_datadir@" | sed 's!//!/!g'`
69 if [ -d "$LILYPONDPREFIX/share" ]; then
70 datadir=$LILYPONDPREFIX/share/lilypond/
72 echo "Setting tree to $datadir"
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`"}"