[1668] | 1 | #! /bin/sh
|
---|
| 2 |
|
---|
| 3 | PACKAGES=`pwd`
|
---|
[1704] | 4 | cd ..
|
---|
| 5 | GSDLHOME=`pwd`
|
---|
| 6 | cd $PACKAGES
|
---|
[2987] | 7 |
|
---|
[2952] | 8 | GSDLOS=`uname -s |tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
---|
[2987] | 9 | # check for running bash under cygwin
|
---|
| 10 | if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ;
|
---|
| 11 | then
|
---|
| 12 | GSDLOS=windows
|
---|
| 13 | fi
|
---|
| 14 |
|
---|
[2421] | 15 | prefix=""
|
---|
| 16 | bindir=""
|
---|
[2725] | 17 | HOSTTARGETFLAGS=""
|
---|
[1668] | 18 |
|
---|
[13475] | 19 | # only some of the packages can take environment variables as options to
|
---|
| 20 | # configure
|
---|
| 21 | # format is VAR=value, e.g "LDFLAGS=-static"
|
---|
[13740] | 22 | ENVIRONMENT=""
|
---|
[13475] | 23 |
|
---|
[2380] | 24 | USE_CORBA=false
|
---|
[2642] | 25 | MICO_DIR=default
|
---|
[12494] | 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
|
---|
[13772] | 30 |
|
---|
[1715] | 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 | ;;
|
---|
[1940] | 48 | --enable-z3950)
|
---|
| 49 | USE_Z3950=true
|
---|
| 50 | ;;
|
---|
[12494] | 51 | --disable-yaz)
|
---|
| 52 | USE_YAZ=false
|
---|
| 53 | ;;
|
---|
[2113] | 54 | --enable-corba)
|
---|
| 55 | USE_CORBA=true
|
---|
| 56 | ;;
|
---|
[2173] | 57 | --with-micodir=*)
|
---|
| 58 | if test $1 = ""; then
|
---|
| 59 | $1 = "default"
|
---|
| 60 | fi
|
---|
| 61 | MICO_DIR=$1
|
---|
| 62 | ;;
|
---|
[2421] | 63 | --prefix=*)
|
---|
| 64 | prefix=`echo $1 | sed s/--prefix=//`
|
---|
| 65 | ;;
|
---|
[2019] | 66 | --bindir=*)
|
---|
[2421] | 67 | # where to install binaries to
|
---|
[2169] | 68 | bindir=`echo $1 | sed s/--bindir=//`
|
---|
[2952] | 69 | # turn relative path into an absolute path
|
---|
| 70 | if test -d "$bindir" ; then
|
---|
| 71 | bindir=`cd "$bindir" ; pwd `
|
---|
[2169] | 72 | cd "$PACKAGES"
|
---|
| 73 | elif test -z `echo $bindir | sed '/^\// p;D'` ; then
|
---|
[2952] | 74 | rel_bindir="`echo $bindir | sed s@/.*@@`"
|
---|
| 75 | cd "$rel_bindir"
|
---|
| 76 | bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`"
|
---|
[2169] | 77 | cd "$PACKAGES"
|
---|
| 78 | else
|
---|
| 79 | # bindir doesn't exist, and isn't relative
|
---|
| 80 | true
|
---|
| 81 | fi
|
---|
[2019] | 82 | ;;
|
---|
[2725] | 83 | --host=* | --target=*)
|
---|
| 84 | HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1"
|
---|
| 85 | ;;
|
---|
[1715] | 86 | *)
|
---|
| 87 | # ignore all other options for now
|
---|
| 88 | ;;
|
---|
| 89 | esac
|
---|
| 90 | shift
|
---|
| 91 | done
|
---|
| 92 |
|
---|
[2421] | 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 |
|
---|
[2952] | 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
|
---|
[2421] | 109 |
|
---|
[2169] | 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 |
|
---|
[2380] | 113 | if test $USE_CORBA = true ; then
|
---|
[2173] | 114 | if test $MICO_DIR = default; then
|
---|
| 115 | # configure the MICO CORBA ORB
|
---|
| 116 | echo ""
|
---|
| 117 | echo "Configuring MICO CORBA"
|
---|
| 118 | echo ""
|
---|
[1715] | 119 |
|
---|
[2173] | 120 | cd "$PACKAGES/mico"
|
---|
| 121 | gzip -dc mico-2.3.5.tar.gz | tar -xf -
|
---|
[6334] | 122 | cd mico && \
|
---|
[2173] | 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
|
---|
[2169] | 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 ""
|
---|
[2113] | 136 | fi
|
---|
[1715] | 137 |
|
---|
[2129] | 138 |
|
---|
| 139 |
|
---|
| 140 |
|
---|
[2169] | 141 |
|
---|
[1668] | 142 | # configure the wvWare Word document converter
|
---|
| 143 | echo ""
|
---|
| 144 | echo "Configuring wvWare"
|
---|
[1978] | 145 | echo ""
|
---|
[1668] | 146 |
|
---|
[1996] | 147 | cd "$PACKAGES/wv"
|
---|
[3075] | 148 | gzip -dc wv-0.7.1-gs.tar.gz | tar -xf -
|
---|
[2582] | 149 | # datadir is for default location of wvHtml.xml config file
|
---|
[6334] | 150 | cd wv-gs && \
|
---|
[2725] | 151 | ./configure $CACHE_FILE --prefix=$PACKAGES/wv --bindir="$bindir" --datadir="$prefix/etc/packages" $HOSTTARGETFLAGS
|
---|
[1668] | 152 |
|
---|
[1961] | 153 | # configure the pdftohtml converter
|
---|
| 154 | echo ""
|
---|
| 155 | echo "Configuring pdftohtml"
|
---|
| 156 | echo ""
|
---|
[1668] | 157 |
|
---|
[1996] | 158 | cd "$PACKAGES/pdftohtml"
|
---|
[7284] | 159 | gzip -dc pdftohtml_0_36_gs.tar.gz | tar -xf -
|
---|
| 160 | cd pdftohtml_gs && \
|
---|
[13475] | 161 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[1961] | 162 |
|
---|
[2582] | 163 | # rtftohtml converter
|
---|
| 164 | echo ""
|
---|
| 165 | echo "Configuring rtftohtml"
|
---|
| 166 | echo ""
|
---|
[2349] | 167 |
|
---|
[2582] | 168 | cd "$PACKAGES/rtftohtml"
|
---|
| 169 | gzip -dc rtftohtml-gs.tar.gz | tar -xf -
|
---|
[6334] | 170 | cd rtftohtml_src && \
|
---|
[2902] | 171 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
[2582] | 172 |
|
---|
| 173 |
|
---|
[12494] | 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 |
|
---|
[1715] | 189 | # YAZ Z39.50 toolkit
|
---|
[2052] | 190 | echo ""
|
---|
| 191 | echo "Configuring YAZ"
|
---|
[12494] | 192 | if test x$USE_YAZ = xtrue ;
|
---|
[1940] | 193 | then
|
---|
[12494] | 194 | echo "YAZ library support enabled"
|
---|
| 195 | echo "add --disable-yaz to the configure command to disable this"
|
---|
[1940] | 196 | echo ""
|
---|
[10173] | 197 | cd "$PACKAGES/yaz"
|
---|
| 198 | gzip -dc yaz-2.1.4.tar.gz | tar -xf -
|
---|
| 199 | cd yaz-2.1.4 && \
|
---|
[13018] | 200 | ./configure $CACHE_FILE --prefix="$PACKAGES/yaz" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
[1940] | 201 | else
|
---|
[12494] | 202 | echo "YAZ support disabled"
|
---|
[1940] | 203 | echo ""
|
---|
| 204 | fi
|
---|
[1715] | 205 |
|
---|
[1704] | 206 | # configure wget
|
---|
| 207 | echo ""
|
---|
| 208 | echo "Configuring wget"
|
---|
| 209 | echo ""
|
---|
[3000] | 210 | cd "$PACKAGES/wget"
|
---|
[2349] | 211 | gzip -dc wget.tar.gz | tar -xf -
|
---|
[7672] | 212 | cd "$PACKAGES/wget/wget-1.9" && \
|
---|
[2725] | 213 | ./configure $CACHE_FILE --prefix=$PACKAGES/wget --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
[2169] | 214 |
|
---|
[8658] | 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" && \
|
---|
[13475] | 222 | ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[8658] | 223 |
|
---|
[2809] | 224 | # configure XML::Parser perl module
|
---|
| 225 | echo ""
|
---|
| 226 | echo "Configuring XML::Parser"
|
---|
| 227 | echo ""
|
---|
[2988] | 228 | cd "$PACKAGES/cpan"
|
---|
[8066] | 229 | perl_dir=`echo 'my $vn = $]; $vn =~ s/5\.00(\d).*$/perl-5.$1/; print "$vn" ' | perl`
|
---|
[8658] | 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" \
|
---|
[9402] | 238 | EXPATINCPATH="$GSDLHOME/packages/expat/include" \
|
---|
[8658] | 239 | EXPATLIBPATH="$GSDLHOME/packages/expat/lib"
|
---|
[2169] | 240 |
|
---|
[2985] | 241 | # configure powerpoint converter
|
---|
| 242 | echo ""
|
---|
[2988] | 243 | echo "Configuring xlhtml (powerpoint & excel converter)"
|
---|
[2985] | 244 | echo ""
|
---|
[2988] | 245 | cd "$PACKAGES/xlhtml"
|
---|
[2985] | 246 | gzip -dc xlhtml-0.4.9.0-gs.tar.gz | tar -xf -
|
---|
[6334] | 247 | cd xlhtml-0.4.9.0 && \
|
---|
[2985] | 248 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
[2809] | 249 |
|
---|
[6128] | 250 |
|
---|
| 251 | # configure IsisGdl program
|
---|
| 252 | echo ""
|
---|
[6334] | 253 | echo "Configuring IsisGdl (CDS/ISIS database reader)"
|
---|
[6128] | 254 | echo ""
|
---|
[6334] | 255 | cd "$PACKAGES/isis-gdl" && \
|
---|
[13475] | 256 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[12004] | 257 |
|
---|
[13970] | 258 | # configure HTMLTidy program
|
---|
| 259 | echo ""
|
---|
| 260 | echo "Configuring HTMLTidy"
|
---|
| 261 | echo ""
|
---|
| 262 | cd "$PACKAGES/html-tidy"
|
---|
[14167] | 263 | gzip -dc tidy.tgz | tar -xf -
|
---|
[13970] | 264 | cd "$PACKAGES/html-tidy/tidy" && \
|
---|
| 265 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|