* Documentation/user/refman.itely: remove superfluous -'s
[lilypond.git] / buildscripts / lilypond-profile.sh
blob78b49536301703463b81c2b4ebe466533b1fffe8
1 #!/bin/sh
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 # workaround for ZSH posix $0-problem
11 [ -n "$ZSH_NAME" ] && setopt nofunctionargzero
13 if [ `basename "$0"` = "lilypond-profile" ] ; then
14 cat >/dev/stderr <<EOF
16 Error: This script cannot be run in a subshell; it MUST be sourced.
19 EXAMPLE 1: One time use
23 . $0
27 EXAMPLE 2: Install for self
29 * Do
31 cp lilypond-profile $HOME/bin/
33 * Add
35 . $HOME/bin/lilypond-profile
37 to either $HOME/.profile or $HOME/.bash_profile,
39 * Logout.
42 EXAMPLE 3: Install for all users.
44 * Do
46 mv lilypond-profile /etc/profile.d/lilypond.sh
48 * Logout
52 EOF
55 ## If the message above is printed erroneously,
56 ## the following commands kills the current terminal/shell.
57 ## hence the ZSH test above.
59 exit 2
60 else
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/
68 echo "Setting tree to $datadir"
71 # Add the installation directory to the teTeX system tree,
72 # see Documentation/misc/fontinstallation
73 TEXMF="{$datadir,"`kpsexpand \\$TEXMF`"}"
74 export TEXMF
76 # For direct ps output: ps/lilyponddefs.ps
77 ## GS_LIB="$datadir/ps:"${GS_LIB:=""}
78 ## export GS_LIB
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