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