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