]> git.donarmstrong.com Git - lilypond.git/blob - buildscripts/lilypond-profile.sh
* Documentation/user/{appendices,introduction,refman,tutorial}.itely:
[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
11
12 # workaround for ZSH posix $0-problem
13
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. "
17     echo 
18     echo "(failed to source lilypond-profile)"
19     return 2
20 fi
21
22 if [ `basename "$0"` = "lilypond-profile" ] ; then 
23     cat >/dev/stderr <<EOF
24     
25 Error: This script cannot be run in a subshell; it MUST be sourced.
26
27
28 EXAMPLE 1: One time use 
29
30         * Do
31
32             . $0
33
34
35
36 EXAMPLE 2: Install for self
37
38         * Do
39
40             cp lilypond-profile $HOME/bin/
41
42         * Add
43
44             .  $HOME/bin/lilypond-profile
45
46         to either $HOME/.profile or $HOME/.bash_profile, 
47
48         * Logout.
49
50
51 EXAMPLE 3: Install for all users.
52
53         * Do
54
55              mv lilypond-profile /etc/profile.d/lilypond.sh
56
57         * Logout
58
59 EOF
60
61     return 2
62 else
63 #  for zsh: till here
64
65         if [ -z "$LILYPONDPREFIX" ]; then
66             datadir=`echo "@local_lilypond_datadir@" | sed 's!//!/!g'`
67         else
68             if [ -d "$LILYPONDPREFIX/share" ]; then
69                 datadir=$LILYPONDPREFIX/share/lilypond/
70             fi
71             echo "Setting tree to $datadir"
72         fi
73
74         # Add the installation directory to the teTeX system tree, 
75         # see Documentation/misc/fontinstallation
76         TEXMF="{$datadir,"`kpsexpand  \\$TEXMF`"}"
77         export TEXMF
78
79         # For direct ps output: ps/lilyponddefs.ps
80         ## GS_LIB="$datadir/ps:"${GS_LIB:=""}
81         ## export GS_LIB
82
83         # For direct ps output fonts. Add all available TeX Type1 fonts
84         ## GS_FONTPATH=`kpsewhich -expand-path=\\$T1FONTS`:${GS_FONTPATH:=""}
85         ## export GS_FONTPATH
86
87 fi # remove for zsh
88         
89
90