]> git.donarmstrong.com Git - lilypond.git/blob - buildscripts/lilypond-profile.sh
* scripts/ly2dvi.py (include_path): bugfix: use outbase
[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 if [ `basename "$0"` = "lilypond-profile" ] ; then
11     cat >/dev/stderr <<EOF
12     
13 Error: This script cannot be run in a subshell; it MUST be sourced.
14
15
16 EXAMPLE 1: One time use 
17
18         Do
19
20             . $0
21
22
23
24 EXAMPLE 2: Local installation
25
26         * Do
27
28             mv lilypond-profile $HOME/bin/
29
30         * Add
31
32             .  $HOME/bin/lilypond-profile
33
34         to either $HOME/.profile or $HOME/.bash_profile, 
35
36         * Logout.
37
38
39 EXAMPLE 3: Global installation
40
41         * Do
42
43              mv lilypond-profile /etc/profile.d/lilypond.sh
44
45         * Logout
46
47
48
49 EOF
50     exit 2 
51 fi
52
53 if [ -z "$LILYPONDPREFIX" ]; then
54     datadir=`echo "@local_lilypond_datadir@" | sed 's!//!/!g'`
55 else
56     if [ -d "$LILYPONDPREFIX/share" ]; then
57         datadir=$LILYPONDPREFIX/share/lilypond/
58     fi
59     echo "Setting tree to $datadir"
60 fi
61
62 # Add the installation directory to the teTeX system tree, 
63 # see Documentation/misc/fontinstallation
64 TEXMF="{$datadir,"`kpsexpand  \\$TEXMF`"}"
65 export TEXMF
66
67 # For direct ps output: ps/lilyponddefs.ps
68 ## GS_LIB="$datadir/ps:"${GS_LIB:=""}
69 ## export GS_LIB
70
71 # For direct ps output fonts. Add all available TeX Type1 fonts
72 ## GS_FONTPATH=`kpsewhich -expand-path=\\$T1FONTS`:${GS_FONTPATH:=""}
73 ## export GS_FONTPATH
74
75         
76
77