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
12 # workaround for ZSH posix $0-problem
14 # for zsh: start removing here
15 if [ -n "$ZSH_NAME" ] ; then
16 echo "You are running this script under zsh. Edit this script by hand. "
18 echo "(failed to source lilypond-profile)"
22 if [ `basename "$0"` = "lilypond-profile" ] ; then
23 cat >/dev/stderr <<EOF
25 Error: This script cannot be run in a subshell; it MUST be sourced.
28 EXAMPLE 1: One time use
36 EXAMPLE 2: Install for self
40 cp lilypond-profile $HOME/bin/
44 . $HOME/bin/lilypond-profile
46 to either $HOME/.profile or $HOME/.bash_profile,
51 EXAMPLE 3: Install for all users.
55 mv lilypond-profile /etc/profile.d/lilypond.sh
65 if [ -z "$LILYPONDPREFIX" ]; then
66 datadir=`echo "@local_lilypond_datadir@" | sed 's!//!/!g'`
68 if [ -d "$LILYPONDPREFIX/share" ]; then
69 datadir=$LILYPONDPREFIX/share/lilypond/
71 echo "Setting tree to $datadir"
74 # Add the installation directory to the teTeX system tree,
75 # see Documentation/misc/fontinstallation
76 if [ -z `echo $TEXMF | grep "$datadir"` ]; then
77 TEXMF="{$datadir,"`kpsexpand \\$TEXMF`"}"
82 # For direct ps output: ps/lilyponddefs.ps
83 ## GS_LIB="$datadir/ps:"${GS_LIB:=""}
86 # For direct ps output fonts. Add all available TeX Type1 fonts
87 ## GS_FONTPATH=`kpsewhich -expand-path=\\$T1FONTS`:${GS_FONTPATH:=""}