1 | #! /bin/sh
|
---|
2 |
|
---|
3 | PACKAGES=`pwd`
|
---|
4 | cd ..
|
---|
5 | GSDLHOME=`pwd`
|
---|
6 | cd $PACKAGES
|
---|
7 |
|
---|
8 | GSDLOS=`uname -s |tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
---|
9 | # check for running bash under cygwin
|
---|
10 | if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ;
|
---|
11 | then
|
---|
12 | GSDLOS=windows
|
---|
13 | fi
|
---|
14 |
|
---|
15 | prefix=""
|
---|
16 | bindir=""
|
---|
17 | HOSTTARGETFLAGS=""
|
---|
18 |
|
---|
19 | USE_CORBA=false
|
---|
20 | MICO_DIR=default
|
---|
21 | # yaz compilation enabled by default, can switch it off with --disable-yaz
|
---|
22 | USE_YAZ=true
|
---|
23 | # z3950 server disabled by default, switch it on with --enable-z3950
|
---|
24 | USE_Z3950=false
|
---|
25 | # accentfolding enabled by default - switch it off with --disable-accentfold
|
---|
26 | ENABLE_ACCENTFOLD=true
|
---|
27 | # parse any arguments given from toplevel configure
|
---|
28 | while test $# -ne 0; do
|
---|
29 | case "$1" in
|
---|
30 | --cache-file=*)
|
---|
31 | cache_filename=`echo $1 | sed s/--cache-file=//`
|
---|
32 | # turn relative path into an absolute path
|
---|
33 | cache_dir=`echo $cache_filename | sed 's@/[^/]*$@@'`
|
---|
34 | cache_dir=`cd $cache_dir 2>/dev/null && pwd`
|
---|
35 |
|
---|
36 | cache_basefile=`echo $cache_filename | sed 's@.*/@@'`
|
---|
37 | cache_file="$cache_dir/$cache_basefile"
|
---|
38 | if test ! -f "$cache_file"; then
|
---|
39 | CACHE_FILE=""
|
---|
40 | else
|
---|
41 | CACHE_FILE="--cache-file=$cache_file"
|
---|
42 | fi
|
---|
43 | ;;
|
---|
44 | --enable-z3950)
|
---|
45 | USE_Z3950=true
|
---|
46 | ;;
|
---|
47 | --disable-yaz)
|
---|
48 | USE_YAZ=false
|
---|
49 | ;;
|
---|
50 | --enable-corba)
|
---|
51 | USE_CORBA=true
|
---|
52 | ;;
|
---|
53 | --with-micodir=*)
|
---|
54 | if test $1 = ""; then
|
---|
55 | $1 = "default"
|
---|
56 | fi
|
---|
57 | MICO_DIR=$1
|
---|
58 | ;;
|
---|
59 | --disable-accentfold)
|
---|
60 | ENABLE_ACCENTFOLD=false
|
---|
61 | ;;
|
---|
62 | --prefix=*)
|
---|
63 | prefix=`echo $1 | sed s/--prefix=//`
|
---|
64 | ;;
|
---|
65 | --bindir=*)
|
---|
66 | # where to install binaries to
|
---|
67 | bindir=`echo $1 | sed s/--bindir=//`
|
---|
68 | # turn relative path into an absolute path
|
---|
69 | if test -d "$bindir" ; then
|
---|
70 | bindir=`cd "$bindir" ; pwd `
|
---|
71 | cd "$PACKAGES"
|
---|
72 | elif test -z `echo $bindir | sed '/^\// p;D'` ; then
|
---|
73 | rel_bindir="`echo $bindir | sed s@/.*@@`"
|
---|
74 | cd "$rel_bindir"
|
---|
75 | bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`"
|
---|
76 | cd "$PACKAGES"
|
---|
77 | else
|
---|
78 | # bindir doesn't exist, and isn't relative
|
---|
79 | true
|
---|
80 | fi
|
---|
81 | ;;
|
---|
82 | --host=* | --target=*)
|
---|
83 | HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1"
|
---|
84 | ;;
|
---|
85 | *)
|
---|
86 | # ignore all other options for now
|
---|
87 | ;;
|
---|
88 | esac
|
---|
89 | shift
|
---|
90 | done
|
---|
91 |
|
---|
92 | # note! Our GSDL package currently always installs into it's source
|
---|
93 | # directory, ignoring any --prefix given to configure.
|
---|
94 | # When this is fixed, uncomment the relevant lines below...
|
---|
95 |
|
---|
96 | ##if test -z "$prefix" ; then
|
---|
97 | prefix="${GSDLHOME}"
|
---|
98 | ##fi
|
---|
99 |
|
---|
100 | ##if test -z "$bindir" ; then
|
---|
101 | bindir="${prefix}/bin/$GSDLOS"
|
---|
102 | ##fi
|
---|
103 |
|
---|
104 | # This loads the top configure's cache file, with variables already set.
|
---|
105 | if test -f "$cache_file" ; then
|
---|
106 | . $cache_file
|
---|
107 | fi
|
---|
108 |
|
---|
109 | # we assume that gzip and tar are on the search path.
|
---|
110 | # non-GNU versions of tar don't take the -z option.
|
---|
111 |
|
---|
112 | if test $USE_CORBA = true ; then
|
---|
113 | if test $MICO_DIR = default; then
|
---|
114 | # configure the MICO CORBA ORB
|
---|
115 | echo ""
|
---|
116 | echo "Configuring MICO CORBA"
|
---|
117 | echo ""
|
---|
118 |
|
---|
119 | cd "$PACKAGES/mico"
|
---|
120 | gzip -dc mico-2.3.5.tar.gz | tar -xf -
|
---|
121 | cd mico && \
|
---|
122 | ./configure $CACHE_FILE --prefix=$PACKAGES/mico/ --disable-coss --disable-naming --disable-relship --disable-events --disable-streams --disable-property --disable-trader --disable-time --disable-debug --enable-optimize --enable-final --enable-speed-tune
|
---|
123 | sed 's/tools//' $PACKAGES/mico/mico/Makefile | sed 's/ldconfig//' >$PACKAGES/mico/mico/Makefile.out
|
---|
124 | mv $PACKAGES/mico/mico/Makefile.out $PACKAGES/mico/mico/Makefile
|
---|
125 | else
|
---|
126 | #MICO is on the system path
|
---|
127 | echo ""
|
---|
128 | echo "Taking MICO from system paths"
|
---|
129 | echo ""
|
---|
130 | fi
|
---|
131 | else
|
---|
132 | echo "corba support disabled - mico compiler not required."
|
---|
133 | echo " add '--enable-corba' to the configure command to include corba support."
|
---|
134 | echo ""
|
---|
135 | fi
|
---|
136 |
|
---|
137 |
|
---|
138 |
|
---|
139 |
|
---|
140 |
|
---|
141 | # configure the wvWare Word document converter
|
---|
142 | echo ""
|
---|
143 | echo "Configuring wvWare"
|
---|
144 | echo ""
|
---|
145 |
|
---|
146 | cd "$PACKAGES/wv"
|
---|
147 | gzip -dc wv-0.7.1-gs.tar.gz | tar -xf -
|
---|
148 | # datadir is for default location of wvHtml.xml config file
|
---|
149 | cd wv-gs && \
|
---|
150 | ./configure $CACHE_FILE --prefix=$PACKAGES/wv --bindir="$bindir" --datadir="$prefix/etc/packages" $HOSTTARGETFLAGS
|
---|
151 |
|
---|
152 | # configure the pdftohtml converter
|
---|
153 | echo ""
|
---|
154 | echo "Configuring pdftohtml"
|
---|
155 | echo ""
|
---|
156 |
|
---|
157 | cd "$PACKAGES/pdftohtml"
|
---|
158 | gzip -dc pdftohtml_0_36_gs.tar.gz | tar -xf -
|
---|
159 | cd pdftohtml_gs && \
|
---|
160 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
161 |
|
---|
162 | # rtftohtml converter
|
---|
163 | echo ""
|
---|
164 | echo "Configuring rtftohtml"
|
---|
165 | echo ""
|
---|
166 |
|
---|
167 | cd "$PACKAGES/rtftohtml"
|
---|
168 | gzip -dc rtftohtml-gs.tar.gz | tar -xf -
|
---|
169 | cd rtftohtml_src && \
|
---|
170 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
171 |
|
---|
172 |
|
---|
173 | # D2M stuff needed for z3950server
|
---|
174 | echo ""
|
---|
175 | echo "Configuring D2M"
|
---|
176 | if test x$USE_Z3950 = xtrue ;
|
---|
177 | then
|
---|
178 | USE_YAZ=true
|
---|
179 | echo ""
|
---|
180 | cd "$PACKAGES/d2m"
|
---|
181 | ./configure $CACHE_FILE --prefix="$PACKAGES/d2m" $HOSTTARGETFLAGS
|
---|
182 | else
|
---|
183 | echo "Z39.50 support disabled - D2M library not required."
|
---|
184 | echo " add '--enable-z3950' to the configure command to include z39.50 support."
|
---|
185 | echo ""
|
---|
186 | fi
|
---|
187 |
|
---|
188 | # YAZ Z39.50 toolkit
|
---|
189 | echo ""
|
---|
190 | echo "Configuring YAZ"
|
---|
191 | if test x$USE_YAZ = xtrue ;
|
---|
192 | then
|
---|
193 | echo "YAZ library support enabled"
|
---|
194 | echo "add --disable-yaz to the configure command to disable this"
|
---|
195 | echo ""
|
---|
196 | cd "$PACKAGES/yaz"
|
---|
197 | gzip -dc yaz-2.1.4.tar.gz | tar -xf -
|
---|
198 | cd yaz-2.1.4 && \
|
---|
199 | ./configure $CACHE_FILE --prefix="$PACKAGES/yaz" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
200 | else
|
---|
201 | echo "YAZ support disabled"
|
---|
202 | echo ""
|
---|
203 | fi
|
---|
204 |
|
---|
205 | # configure wget
|
---|
206 | echo ""
|
---|
207 | echo "Configuring wget"
|
---|
208 | echo ""
|
---|
209 | cd "$PACKAGES/wget"
|
---|
210 | gzip -dc wget.tar.gz | tar -xf -
|
---|
211 | cd "$PACKAGES/wget/wget-1.9" && \
|
---|
212 | ./configure $CACHE_FILE --prefix=$PACKAGES/wget --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
213 |
|
---|
214 | # configure expat (needs to be done before XML::Parser
|
---|
215 | echo ""
|
---|
216 | echo "Configuring expat"
|
---|
217 | echo ""
|
---|
218 | cd "$PACKAGES/expat"
|
---|
219 | gzip -dc expat-1.95.8.tar.gz | tar -xf -
|
---|
220 | cd "$PACKAGES/expat/expat-1.95.8" && \
|
---|
221 | ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
222 |
|
---|
223 | # configure XML::Parser perl module
|
---|
224 | echo ""
|
---|
225 | echo "Configuring XML::Parser"
|
---|
226 | echo ""
|
---|
227 | cd "$PACKAGES/cpan"
|
---|
228 | perl_dir=`echo 'my $vn = $]; $vn =~ s/5\.00(\d).*$/perl-5.$1/; print "$vn" ' | perl`
|
---|
229 | gzip -dc XML-Parser-2.34.tar.gz | tar -xf -
|
---|
230 | cd "$PACKAGES/cpan/XML-Parser-2.34" && \
|
---|
231 | perl Makefile.PL \
|
---|
232 | INSTALLSITELIB="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
233 | PREFIX="$GSDLHOME/perllib/cpan/XML" \
|
---|
234 | INSTALLMAN1DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
235 | INSTALLMAN3DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
236 | SITEPREFIX="$GSDLHOME/perllib/cpan" \
|
---|
237 | EXPATINCPATH="$GSDLHOME/packages/expat/include" \
|
---|
238 | EXPATLIBPATH="$GSDLHOME/packages/expat/lib"
|
---|
239 |
|
---|
240 | # configure powerpoint converter
|
---|
241 | echo ""
|
---|
242 | echo "Configuring xlhtml (powerpoint & excel converter)"
|
---|
243 | echo ""
|
---|
244 | cd "$PACKAGES/xlhtml"
|
---|
245 | gzip -dc xlhtml-0.4.9.0-gs.tar.gz | tar -xf -
|
---|
246 | cd xlhtml-0.4.9.0 && \
|
---|
247 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
248 |
|
---|
249 |
|
---|
250 | # configure IsisGdl program
|
---|
251 | echo ""
|
---|
252 | echo "Configuring IsisGdl (CDS/ISIS database reader)"
|
---|
253 | echo ""
|
---|
254 | cd "$PACKAGES/isis-gdl" && \
|
---|
255 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
256 |
|
---|
257 | # configure unac program
|
---|
258 | echo ""
|
---|
259 | echo "Configuring unac"
|
---|
260 | echo ""
|
---|
261 | if test x$ENABLE_ACCENTFOLD = xtrue ;
|
---|
262 | then
|
---|
263 | echo "Accent folding support enabled, configuring unac library."
|
---|
264 | echo "add --disable-accentfold to the configure command to disable this"
|
---|
265 |
|
---|
266 | cd "$PACKAGES/unac"
|
---|
267 | ./configure $CACHE_FILE $HOSTTARGETFLAGS
|
---|
268 | else
|
---|
269 | echo "Accent folding support disabled."
|
---|
270 | echo ""
|
---|
271 | fi
|
---|