annotate install.sh @ 10:f962189bab94

Added tag 1.1.29.e2 for changeset 0f248ad86f9f
author Peter Gervai <grin@grin.hu>
date Thu, 16 Oct 2008 00:16:50 +0200
parents a84c32f131df
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
1 #!/bin/sh
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
2 # -*-ksh-*-
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
3
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
4 # This is the BINS install procedure.
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
5 # Run it as root to install BINS system wide
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
6 # or run it with your user to install it only for this user
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
7
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
8 # PREFIX, RC and DESTDIR environment variables can be set to choose
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
9 # installation paths
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
10
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
11 # $Id: install.sh,v 1.34 2005/08/24 21:29:44 jerome Exp $
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
12
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
13 set -o errexit
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
14 set -o nounset
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
15
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
16 langs="fr de pl it ru es zh_TW nl ja eo fi hu ca"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
17 templates="swigs joi satyap marc petrus mwolson martin"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
18
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
19 DESTDIR="${DESTDIR:-}" # prefix to append to the install dirs
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
20 # this is used by the Mandrake and Debian packages
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
21 PREFIX="${PREFIX:-/usr/local}"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
22 ETC="${ETC:-/etc}"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
23 RC="${RC:-/etc/bins}"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
24 GLOBAL_RC="$RC"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
25
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
26 DESTDIR=`echo "$DESTDIR"|sed 's%/$%%'`
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
27 PREFIX=$DESTDIR/`echo "$PREFIX"|sed 's%^/%%'`
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
28 PREFIX=`echo "$PREFIX"|sed 's%/$%%'`
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
29 ETC=$DESTDIR/`echo "$ETC"|sed 's%^/%%'`
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
30 ETC=`echo "$ETC"|sed 's%/$%%'`
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
31 RC=$DESTDIR/`echo "$RC"|sed 's%^/%%'`
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
32 RC=`echo "$RC"|sed 's%/$%%'`
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
33
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
34 BIN="$PREFIX/bin"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
35 SHARE="$PREFIX/share"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
36 DATA="$SHARE/bins"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
37 GLADE="$DATA"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
38 LOCALE="$SHARE/locale"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
39 MAN="$PREFIX/man/man1"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
40
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
41 cd `dirname $0`
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
42
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
43 cat <<!EoF
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
44
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
45 This will install BINS program and configuration files in the following paths :
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
46 PREFIX = $PREFIX
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
47 BIN = $BIN
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
48 SHARE = $GLADE
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
49 MAN = $MAN
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
50 LOCALE = $LOCALE
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
51 RC = $RC
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
52
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
53 ***************************** WARNING ********************************
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
54 Note that this may replace your old programs, configuration files and
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
55 HTML templates by new ones, so you should backup them if you have
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
56 modified something for personalization.
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
57 **********************************************************************
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
58
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
59 Press Enter to go on or Crtl-C to stop now...
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
60 !EoF
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
61
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
62 read dummy
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
63
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
64 install_binaries()
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
65 {
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
66 mkdir -p $BIN 2>/dev/null || true
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
67 if [ -w $BIN ] ; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
68 echo "Installing program files in $BIN"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
69 # bins_cleanupgallery anti_bins
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
70 cp bins bins_edit bins-edit-gui $BIN
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
71 chmod a+rx $BIN/bins
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
72 chmod a+rx $BIN/bins_edit
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
73 chmod a+rx $BIN/bins_cleanupgallery
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
74 chmod a+rx $BIN/bins-edit-gui
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
75 chmod a+rx $BIN/anti_bins
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
76 # perl -pi -e "s{/usr/local/share}{$SHARE}g" \
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
77 # $BIN/bins $BIN/bins_edit $BIN/bins-edit-gui
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
78 # perl -pi -e "s{/etc/bins}{$RC}g" \
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
79 # $BIN/bins $BIN/bins_edit $BIN/bins-edit-gui
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
80 return 0
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
81 else
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
82 echo "Cannot write to $BIN directory."
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
83 return 1
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
84 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
85 }
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
86
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
87 install_config()
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
88 {
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
89 mkdir -p $RC 2>/dev/null || true
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
90 if [ -w $RC ]; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
91 echo "Installing configuration file in $RC"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
92 cp binsrc $RC
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
93 for T in $templates
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
94 do
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
95 if [ -d "$RC/templates.$T" ]; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
96 echo "Removing old template.$T in $RC"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
97 rm -Rf "$RC/templates.$T"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
98 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
99 done
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
100 chmod -R a+r $RC/*
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
101 else
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
102 echo "Cannot write to $RC."
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
103 return 1
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
104 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
105 }
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
106
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
107 install_data()
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
108 {
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
109 mkdir -p $DATA 2>/dev/null || true
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
110 if [ -w $DATA ]; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
111 for T in $templates
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
112 do
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
113 echo "Installing default HTML templates in $DATA/templates.$T"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
114 if [ ! -d $DATA/templates.$T ] ; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
115 mkdir $DATA/templates.$T
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
116 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
117 cp templates.$T/*.html $DATA/templates.$T
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
118 if ls templates.$T/*.js >/dev/null 2>&1 ; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
119 cp templates.$T/*.js $DATA/templates.$T
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
120 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
121 if [ -d templates.$T/static ] ; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
122 cp -R templates.$T/static $DATA/templates.$T
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
123 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
124 done
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
125 chmod -R a+r $DATA/*
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
126 return 0
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
127 else
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
128 echo "Cannot write to $DATA."
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
129 return 1
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
130 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
131 }
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
132
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
133
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
134 # program files
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
135 set +o errexit
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
136 install_binaries
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
137 if [ "$?" -eq "1" ] ; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
138 BIN=~/bin
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
139 echo "Trying $BIN..."
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
140 install_binaries
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
141 if [ "$?" -eq "1" ] ; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
142 echo "Error: unable to find a directory to write program files, aborting."
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
143 exit 2
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
144 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
145 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
146
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
147 # config file
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
148 install_config
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
149 if [ "$?" -eq "1" ] ; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
150 RC=~/.bins
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
151 echo "Trying $RC..."
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
152 install_config
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
153 if [ "$?" -eq "1" ] ; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
154 echo "Error: unable to find a directory to write configuration file, aborting."
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
155 exit 2
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
156 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
157 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
158
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
159 # templates
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
160 install_data
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
161 if [ "$?" -eq "1" ] ; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
162 DATA=~/.bins
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
163 echo "Trying $DATA..."
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
164 install_data
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
165 if [ "$?" -eq "1" ] ; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
166 echo "Error: unable to find a directory to write templates, aborting."
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
167 exit 2
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
168 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
169 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
170 set -o errexit
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
171
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
172 # additionnal files
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
173 mkdir -p $GLADE 2>/dev/null || true
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
174 if [ -w $GLADE ] ; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
175 echo "Installing additionnal files in $GLADE"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
176 cp bins-edit-gui.glade $GLADE
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
177 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
178
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
179 # man pages
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
180 mkdir -p $MAN 2>/dev/null || true
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
181 if [ -w $MAN ] ; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
182 echo "Installing man page in $MAN"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
183 cp doc/*.1 $MAN
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
184 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
185
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
186 # bash completion
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
187 if [ -w $ETC/bash_completion.d ] ; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
188 echo "Installing bash completion system wide."
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
189 cp -f bash_completion $ETC/bash_completion.d/bins
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
190 else
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
191 mkdir ~/.bash_completion 2>/dev/null || true
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
192 if [ -w ~/.bash_completion ] ; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
193 echo "Installing bash completion for user `whoami`."
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
194 cp -f bash_completion ~/.bash_completion/bins
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
195 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
196 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
197
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
198 # I18N files
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
199 mkdir -p $LOCALE 2>/dev/null || true
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
200 if [ -w $LOCALE ] ; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
201 echo "Installing internationalization messages files."
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
202 for L in $langs
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
203 do
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
204 mkdir -p $LOCALE/$L/LC_MESSAGES 2>/dev/null || true
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
205 cp intl/$L.mo $LOCALE/$L/LC_MESSAGES/bins.mo
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
206 if [ -f intl/gui-$L.mo ]; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
207 cp intl/gui-$L.mo $LOCALE/$L/LC_MESSAGES/bins-edit-gui.mo
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
208 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
209 done
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
210 else
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
211 cat <<!EoF
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
212
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
213 ***************************** Warning **********************************
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
214 Cannot install internationalization messages files and additional
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
215 files. If you want to generate HTML albums in non-english langage,
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
216 use bins-edit-gui or install the man pages, then you must run this
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
217 install program as root.
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
218 ************************************************************************
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
219
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
220 !EoF
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
221 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
222
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
223 set +o errexit
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
224 # set directory paths in source code
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
225 echo -n "setting directory paths in programs :"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
226 for FILE in "$BIN/bins" "$BIN/bins_edit" "$BIN/bins-edit-gui"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
227 do
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
228 echo -n " $FILE"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
229 ed "$FILE" <<EoF 2>/dev/null
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
230 1,\$s%/usr/local/share%$SHARE%g
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
231 1,\$s%/etc/bins%$GLOBAL_RC%g
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
232 wq
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
233 EoF
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
234 done
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
235 echo .
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
236 echo
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
237 echo "Installation complete"