#! /bin/sh PACKAGES=`pwd` cd .. GSDLHOME=`pwd` cd $PACKAGES GSDLOS=`uname -s |tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # check for running bash under cygwin if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ; then GSDLOS=windows fi prefix="" bindir="" HOSTTARGETFLAGS="" # only some of the packages can take environment variables as options to # configure # format is VAR=value, e.g "LDFLAGS=-static" ENVIRONMENT="" USE_CORBA=false MICO_DIR=default # yaz compilation enabled by default, can switch it off with --disable-yaz USE_YAZ=true # z3950 server disabled by default, switch it on with --enable-z3950 USE_Z3950=false # parse any arguments given from toplevel configure while test $# -ne 0; do case "$1" in --cache-file=*) cache_filename=`echo $1 | sed s/--cache-file=//` # turn relative path into an absolute path cache_dir=`echo $cache_filename | sed 's@/[^/]*$@@'` cache_dir=`cd $cache_dir 2>/dev/null && pwd` cache_basefile=`echo $cache_filename | sed 's@.*/@@'` cache_file="$cache_dir/$cache_basefile" if test ! -f "$cache_file"; then CACHE_FILE="" else CACHE_FILE="--cache-file=$cache_file" fi ;; --enable-z3950) USE_Z3950=true ;; --disable-yaz) USE_YAZ=false ;; --enable-corba) USE_CORBA=true ;; --with-micodir=*) if test $1 = ""; then $1 = "default" fi MICO_DIR=$1 ;; --prefix=*) prefix=`echo $1 | sed s/--prefix=//` ;; --bindir=*) # where to install binaries to bindir=`echo $1 | sed s/--bindir=//` # turn relative path into an absolute path if test -d "$bindir" ; then bindir=`cd "$bindir" ; pwd ` cd "$PACKAGES" elif test -z `echo $bindir | sed '/^\// p;D'` ; then rel_bindir="`echo $bindir | sed s@/.*@@`" cd "$rel_bindir" bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`" cd "$PACKAGES" else # bindir doesn't exist, and isn't relative true fi ;; --host=* | --target=*) HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1" ;; *) # ignore all other options for now ;; esac shift done # note! Our GSDL package currently always installs into it's source # directory, ignoring any --prefix given to configure. # When this is fixed, uncomment the relevant lines below... ##if test -z "$prefix" ; then prefix="${GSDLHOME}" ##fi ##if test -z "$bindir" ; then bindir="${prefix}/bin/$GSDLOS" ##fi # This loads the top configure's cache file, with variables already set. if test -f "$cache_file" ; then . $cache_file fi # we assume that gzip and tar are on the search path. # non-GNU versions of tar don't take the -z option. if test $USE_CORBA = true ; then if test $MICO_DIR = default; then # configure the MICO CORBA ORB echo "" echo "Configuring MICO CORBA" echo "" cd "$PACKAGES/mico" gzip -dc mico-2.3.5.tar.gz | tar -xf - cd mico && \ ./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 sed 's/tools//' $PACKAGES/mico/mico/Makefile | sed 's/ldconfig//' >$PACKAGES/mico/mico/Makefile.out mv $PACKAGES/mico/mico/Makefile.out $PACKAGES/mico/mico/Makefile else #MICO is on the system path echo "" echo "Taking MICO from system paths" echo "" fi else echo "corba support disabled - mico compiler not required." echo " add '--enable-corba' to the configure command to include corba support." echo "" fi # configure the wvWare Word document converter echo "" echo "Configuring wvWare" echo "" cd "$PACKAGES/wv" gzip -dc wv-0.7.1-gs.tar.gz | tar -xf - # datadir is for default location of wvHtml.xml config file cd wv-gs && \ ./configure $CACHE_FILE --prefix=$PACKAGES/wv --bindir="$bindir" --datadir="$prefix/etc/packages" $HOSTTARGETFLAGS # configure the pdftohtml converter echo "" echo "Configuring pdftohtml" echo "" cd "$PACKAGES/pdftohtml" gzip -dc pdftohtml_0_36_gs.tar.gz | tar -xf - cd pdftohtml_gs && \ ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT # rtftohtml converter echo "" echo "Configuring rtftohtml" echo "" cd "$PACKAGES/rtftohtml" gzip -dc rtftohtml-gs.tar.gz | tar -xf - cd rtftohtml_src && \ ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS # D2M stuff needed for z3950server echo "" echo "Configuring D2M" if test x$USE_Z3950 = xtrue ; then USE_YAZ=true echo "" cd "$PACKAGES/d2m" ./configure $CACHE_FILE --prefix="$PACKAGES/d2m" $HOSTTARGETFLAGS else echo "Z39.50 support disabled - D2M library not required." echo " add '--enable-z3950' to the configure command to include z39.50 support." echo "" fi # YAZ Z39.50 toolkit echo "" echo "Configuring YAZ" if test x$USE_YAZ = xtrue ; then echo "YAZ library support enabled" echo "add --disable-yaz to the configure command to disable this" echo "" cd "$PACKAGES/yaz" gzip -dc yaz-2.1.4.tar.gz | tar -xf - cd yaz-2.1.4 && \ ./configure $CACHE_FILE --prefix="$PACKAGES/yaz" --bindir="$bindir" $HOSTTARGETFLAGS else echo "YAZ support disabled" echo "" fi # configure wget echo "" echo "Configuring wget" echo "" cd "$PACKAGES/wget" gzip -dc wget.tar.gz | tar -xf - cd "$PACKAGES/wget/wget-1.9" && \ ./configure $CACHE_FILE --prefix=$PACKAGES/wget --bindir="$bindir" $HOSTTARGETFLAGS # configure expat (needs to be done before XML::Parser echo "" echo "Configuring expat" echo "" cd "$PACKAGES/expat" gzip -dc expat-1.95.8.tar.gz | tar -xf - cd "$PACKAGES/expat/expat-1.95.8" && \ ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT # configure XML::Parser perl module echo "" echo "Configuring XML::Parser" echo "" cd "$PACKAGES/cpan" perl_dir=`echo 'my $vn = $]; $vn =~ s/5\.00(\d).*$/perl-5.$1/; print "$vn" ' | perl` gzip -dc XML-Parser-2.34.tar.gz | tar -xf - cd "$PACKAGES/cpan/XML-Parser-2.34" && \ perl Makefile.PL \ INSTALLSITELIB="$GSDLHOME/perllib/cpan/$perl_dir" \ PREFIX="$GSDLHOME/perllib/cpan/XML" \ INSTALLMAN1DIR="$GSDLHOME/perllib/cpan/$perl_dir" \ INSTALLMAN3DIR="$GSDLHOME/perllib/cpan/$perl_dir" \ SITEPREFIX="$GSDLHOME/perllib/cpan" \ EXPATINCPATH="$GSDLHOME/packages/expat/include" \ EXPATLIBPATH="$GSDLHOME/packages/expat/lib" # configure powerpoint converter echo "" echo "Configuring xlhtml (powerpoint & excel converter)" echo "" cd "$PACKAGES/xlhtml" gzip -dc xlhtml-0.4.9.0-gs.tar.gz | tar -xf - cd xlhtml-0.4.9.0 && \ ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS # configure IsisGdl program echo "" echo "Configuring IsisGdl (CDS/ISIS database reader)" echo "" cd "$PACKAGES/isis-gdl" && \ ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT # configure HTMLTidy program echo "" echo "Configuring HTMLTidy" echo "" cd "$PACKAGES/html-tidy" gzip -dc tidy.tgz | tar -xf - cd "$PACKAGES/html-tidy/tidy" && \ ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT