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 |
|
---|
22 | # parse any arguments given from toplevel configure
|
---|
23 | while test $# -ne 0; do
|
---|
24 | case "$1" in
|
---|
25 | --cache-file=*)
|
---|
26 | cache_filename=`echo $1 | sed s/--cache-file=//`
|
---|
27 | # turn relative path into an absolute path
|
---|
28 | cache_dir=`echo $cache_filename | sed 's@/[^/]*$@@'`
|
---|
29 | cache_dir=`cd $cache_dir 2>/dev/null && pwd`
|
---|
30 |
|
---|
31 | cache_basefile=`echo $cache_filename | sed 's@.*/@@'`
|
---|
32 | cache_file="$cache_dir/$cache_basefile"
|
---|
33 | if test ! -f "$cache_file"; then
|
---|
34 | CACHE_FILE=""
|
---|
35 | else
|
---|
36 | CACHE_FILE="--cache-file=$cache_file"
|
---|
37 | fi
|
---|
38 | ;;
|
---|
39 | --enable-z3950)
|
---|
40 | USE_Z3950=true
|
---|
41 | ;;
|
---|
42 | --enable-corba)
|
---|
43 | USE_CORBA=true
|
---|
44 | ;;
|
---|
45 | --with-micodir=*)
|
---|
46 | if test $1 = ""; then
|
---|
47 | $1 = "default"
|
---|
48 | fi
|
---|
49 | MICO_DIR=$1
|
---|
50 | ;;
|
---|
51 | --prefix=*)
|
---|
52 | prefix=`echo $1 | sed s/--prefix=//`
|
---|
53 | ;;
|
---|
54 | --bindir=*)
|
---|
55 | # where to install binaries to
|
---|
56 | bindir=`echo $1 | sed s/--bindir=//`
|
---|
57 | # turn relative path into an absolute path
|
---|
58 | if test -d "$bindir" ; then
|
---|
59 | bindir=`cd "$bindir" ; pwd `
|
---|
60 | cd "$PACKAGES"
|
---|
61 | elif test -z `echo $bindir | sed '/^\// p;D'` ; then
|
---|
62 | rel_bindir="`echo $bindir | sed s@/.*@@`"
|
---|
63 | cd "$rel_bindir"
|
---|
64 | bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`"
|
---|
65 | cd "$PACKAGES"
|
---|
66 | else
|
---|
67 | # bindir doesn't exist, and isn't relative
|
---|
68 | true
|
---|
69 | fi
|
---|
70 | ;;
|
---|
71 | --host=* | --target=*)
|
---|
72 | HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1"
|
---|
73 | ;;
|
---|
74 | *)
|
---|
75 | # ignore all other options for now
|
---|
76 | ;;
|
---|
77 | esac
|
---|
78 | shift
|
---|
79 | done
|
---|
80 |
|
---|
81 | # note! Our GSDL package currently always installs into it's source
|
---|
82 | # directory, ignoring any --prefix given to configure.
|
---|
83 | # When this is fixed, uncomment the relevant lines below...
|
---|
84 |
|
---|
85 | ##if test -z "$prefix" ; then
|
---|
86 | prefix="${GSDLHOME}"
|
---|
87 | ##fi
|
---|
88 |
|
---|
89 | ##if test -z "$bindir" ; then
|
---|
90 | bindir="${prefix}/bin/$GSDLOS"
|
---|
91 | ##fi
|
---|
92 |
|
---|
93 | # This loads the top configure's cache file, with variables already set.
|
---|
94 | if test -f "$cache_file" ; then
|
---|
95 | . $cache_file
|
---|
96 | fi
|
---|
97 |
|
---|
98 | # we assume that gzip and tar are on the search path.
|
---|
99 | # non-GNU versions of tar don't take the -z option.
|
---|
100 |
|
---|
101 | if test $USE_CORBA = true ; then
|
---|
102 | if test $MICO_DIR = default; then
|
---|
103 | # configure the MICO CORBA ORB
|
---|
104 | echo ""
|
---|
105 | echo "Configuring MICO CORBA"
|
---|
106 | echo ""
|
---|
107 |
|
---|
108 | cd "$PACKAGES/mico"
|
---|
109 | gzip -dc mico-2.3.5.tar.gz | tar -xf -
|
---|
110 | cd mico
|
---|
111 | ./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
|
---|
112 | sed 's/tools//' $PACKAGES/mico/mico/Makefile | sed 's/ldconfig//' >$PACKAGES/mico/mico/Makefile.out
|
---|
113 | mv $PACKAGES/mico/mico/Makefile.out $PACKAGES/mico/mico/Makefile
|
---|
114 | else
|
---|
115 | #MICO is on the system path
|
---|
116 | echo ""
|
---|
117 | echo "Taking MICO from system paths"
|
---|
118 | echo ""
|
---|
119 | fi
|
---|
120 | else
|
---|
121 | echo "corba support disabled - mico compiler not required."
|
---|
122 | echo " add '--enable-corba' to the configure command to include corba support."
|
---|
123 | echo ""
|
---|
124 | fi
|
---|
125 |
|
---|
126 |
|
---|
127 |
|
---|
128 |
|
---|
129 |
|
---|
130 | # configure the wvWare Word document converter
|
---|
131 | echo ""
|
---|
132 | echo "Configuring wvWare"
|
---|
133 | echo ""
|
---|
134 |
|
---|
135 | cd "$PACKAGES/wv"
|
---|
136 | gzip -dc wv-0.7.1-gs.tar.gz | tar -xf -
|
---|
137 | cd wv-gs
|
---|
138 | # datadir is for default location of wvHtml.xml config file
|
---|
139 | ./configure $CACHE_FILE --prefix=$PACKAGES/wv --bindir="$bindir" --datadir="$prefix/etc/packages" $HOSTTARGETFLAGS
|
---|
140 |
|
---|
141 | # configure the pdftohtml converter
|
---|
142 | echo ""
|
---|
143 | echo "Configuring pdftohtml"
|
---|
144 | echo ""
|
---|
145 |
|
---|
146 | cd "$PACKAGES/pdftohtml"
|
---|
147 | gzip -dc pdftohtml_0_34.tar.gz | tar -xf -
|
---|
148 | cd pdftohtml_0_34
|
---|
149 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
150 |
|
---|
151 | # rtftohtml converter
|
---|
152 | echo ""
|
---|
153 | echo "Configuring rtftohtml"
|
---|
154 | echo ""
|
---|
155 |
|
---|
156 | cd "$PACKAGES/rtftohtml"
|
---|
157 | gzip -dc rtftohtml-gs.tar.gz | tar -xf -
|
---|
158 | cd rtftohtml_src
|
---|
159 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
160 |
|
---|
161 |
|
---|
162 | # YAZ Z39.50 toolkit
|
---|
163 | echo ""
|
---|
164 | echo "Configuring YAZ"
|
---|
165 | if test x$USE_Z3950 = xtrue ;
|
---|
166 | then
|
---|
167 | echo ""
|
---|
168 | cd "$PACKAGES/yaz"
|
---|
169 | ./configure $CACHE_FILE $HOSTTARGETFLAGS
|
---|
170 | else
|
---|
171 | echo "Z39.50 support disabled - YAZ library not required."
|
---|
172 | echo " add '--enable-z3950' to the configure command to include z39.50 support."
|
---|
173 | echo ""
|
---|
174 | fi
|
---|
175 |
|
---|
176 | # configure wget
|
---|
177 | echo ""
|
---|
178 | echo "Configuring wget"
|
---|
179 | echo ""
|
---|
180 | cd "$PACKAGES/wget"
|
---|
181 | gzip -dc wget.tar.gz | tar -xf -
|
---|
182 | cd "$PACKAGES/wget/wget-1.5.3"
|
---|
183 | ./configure $CACHE_FILE --prefix=$PACKAGES/wget --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
184 |
|
---|
185 | # configure XML::Parser perl module
|
---|
186 | echo ""
|
---|
187 | echo "Configuring XML::Parser"
|
---|
188 | echo ""
|
---|
189 | cd "$PACKAGES/cpan"
|
---|
190 | gzip -dc XML-Parser-2.27.tar.gz | tar -xf -
|
---|
191 | cd "$PACKAGES/cpan/XML-Parser-2.27"
|
---|
192 | perl Makefile.PL "$GSDLHOME"
|
---|
193 |
|
---|
194 |
|
---|
195 | # configure powerpoint converter
|
---|
196 | echo ""
|
---|
197 | echo "Configuring xlhtml (powerpoint & excel converter)"
|
---|
198 | echo ""
|
---|
199 | cd "$PACKAGES/xlhtml"
|
---|
200 | gzip -dc xlhtml-0.4.9.0-gs.tar.gz | tar -xf -
|
---|
201 | cd xlhtml-0.4.9.0
|
---|
202 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
203 |
|
---|