[16565] | 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 |
|
---|
[22058] | 24 | # GDBM compilation enabled by default, can switch it off with --disable-gdbm
|
---|
| 25 | USE_GDBM=true
|
---|
| 26 | # JDBM compilation enabled by default, can switch it off with --disable-jdbm
|
---|
| 27 | USE_JDBM=true
|
---|
[16565] | 28 | # SQLite support enabled by default, can switch it off with --disable-sqlite
|
---|
| 29 | USE_SQLITE=true
|
---|
| 30 | # yaz compilation enabled by default, can switch it off with --disable-yaz
|
---|
| 31 | USE_YAZ=true
|
---|
| 32 | # z3950 server disabled by default, switch it on with --enable-z3950
|
---|
| 33 | USE_Z3950=false
|
---|
| 34 | # CORBA support disabled by default, switch it on with --enable-corba
|
---|
| 35 | USE_CORBA=false
|
---|
| 36 | MICO_DIR=default
|
---|
| 37 |
|
---|
| 38 | # parse any arguments given from toplevel configure
|
---|
| 39 | while test $# -ne 0; do
|
---|
| 40 | case "$1" in
|
---|
| 41 | --cache-file=*)
|
---|
| 42 | cache_filename=`echo $1 | sed s/--cache-file=//`
|
---|
| 43 | # turn relative path into an absolute path
|
---|
| 44 | cache_dir=`echo $cache_filename | sed 's@/[^/]*$@@'`
|
---|
| 45 | cache_dir=`cd $cache_dir 2>/dev/null && pwd`
|
---|
| 46 |
|
---|
| 47 | cache_basefile=`echo $cache_filename | sed 's@.*/@@'`
|
---|
| 48 | cache_file="$cache_dir/$cache_basefile"
|
---|
| 49 | if test ! -f "$cache_file"; then
|
---|
| 50 | CACHE_FILE=""
|
---|
| 51 | else
|
---|
| 52 | CACHE_FILE="--cache-file=$cache_file"
|
---|
| 53 | fi
|
---|
| 54 | ;;
|
---|
[22058] | 55 | --disable-gdbm)
|
---|
| 56 | USE_GDBM=false
|
---|
| 57 | ;;
|
---|
| 58 | --disable-jdbm)
|
---|
| 59 | USE_JDBM=false
|
---|
| 60 | ;;
|
---|
[16565] | 61 | --disable-sqlite)
|
---|
| 62 | USE_SQLITE=false
|
---|
| 63 | ;;
|
---|
| 64 | --disable-yaz)
|
---|
| 65 | USE_YAZ=false
|
---|
| 66 | ;;
|
---|
| 67 | --enable-z3950)
|
---|
| 68 | USE_Z3950=true
|
---|
| 69 | ;;
|
---|
| 70 | --enable-corba)
|
---|
| 71 | USE_CORBA=true
|
---|
| 72 | ;;
|
---|
| 73 | --with-micodir=*)
|
---|
| 74 | if test $1 = ""; then
|
---|
| 75 | $1 = "default"
|
---|
| 76 | fi
|
---|
| 77 | MICO_DIR=$1
|
---|
| 78 | ;;
|
---|
| 79 | --prefix=*)
|
---|
| 80 | prefix=`echo $1 | sed s/--prefix=//`
|
---|
| 81 | ;;
|
---|
| 82 | --bindir=*)
|
---|
| 83 | # where to install binaries to
|
---|
| 84 | bindir=`echo $1 | sed s/--bindir=//`
|
---|
| 85 | # turn relative path into an absolute path
|
---|
| 86 | if test -d "$bindir" ; then
|
---|
| 87 | bindir=`cd "$bindir" ; pwd `
|
---|
| 88 | cd "$PACKAGES"
|
---|
| 89 | elif test -z `echo $bindir | sed '/^\// p;D'` ; then
|
---|
| 90 | rel_bindir="`echo $bindir | sed s@/.*@@`"
|
---|
| 91 | cd "$rel_bindir"
|
---|
| 92 | bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`"
|
---|
| 93 | cd "$PACKAGES"
|
---|
| 94 | else
|
---|
| 95 | # bindir doesn't exist, and isn't relative
|
---|
| 96 | true
|
---|
| 97 | fi
|
---|
| 98 | ;;
|
---|
| 99 | --host=* | --target=*)
|
---|
| 100 | HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1"
|
---|
| 101 | ;;
|
---|
| 102 | *)
|
---|
| 103 | # ignore all other options for now
|
---|
| 104 | ;;
|
---|
| 105 | esac
|
---|
| 106 | shift
|
---|
| 107 | done
|
---|
| 108 |
|
---|
| 109 | # note! Our GSDL package currently always installs into it's source
|
---|
| 110 | # directory, ignoring any --prefix given to configure.
|
---|
| 111 | # When this is fixed, uncomment the relevant lines below...
|
---|
| 112 |
|
---|
| 113 | ##if test -z "$prefix" ; then
|
---|
| 114 | prefix="${GSDLHOME}"
|
---|
| 115 | ##fi
|
---|
| 116 |
|
---|
| 117 | ##if test -z "$bindir" ; then
|
---|
| 118 | bindir="${prefix}/bin/$GSDLOS"
|
---|
| 119 | ##fi
|
---|
| 120 |
|
---|
| 121 | # This loads the top configure's cache file, with variables already set.
|
---|
| 122 | if test -f "$cache_file" ; then
|
---|
| 123 | . $cache_file
|
---|
| 124 | fi
|
---|
| 125 |
|
---|
| 126 | # we assume that gzip and tar are on the search path.
|
---|
| 127 | # non-GNU versions of tar don't take the -z option.
|
---|
| 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 | # datadir is for default location of wvHtml.xml config file
|
---|
| 138 | cd wv-gs && \
|
---|
| 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_36_gs.tar.gz | tar -xf -
|
---|
| 148 | cd pdftohtml_gs && \
|
---|
| 149 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
| 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 |
|
---|
| 163 | # configure wget
|
---|
| 164 | echo ""
|
---|
| 165 | echo "Configuring wget"
|
---|
| 166 | echo ""
|
---|
| 167 | cd "$PACKAGES/wget"
|
---|
| 168 | gzip -dc wget.tar.gz | tar -xf -
|
---|
| 169 | cd "$PACKAGES/wget/wget-1.11.4" && \
|
---|
| 170 | ./configure $CACHE_FILE --prefix=$PACKAGES/wget --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
| 171 |
|
---|
| 172 |
|
---|
| 173 | # configure XML::Parser perl module
|
---|
| 174 | echo ""
|
---|
| 175 | echo "Configuring XML::Parser"
|
---|
| 176 | echo ""
|
---|
| 177 | cd "$PACKAGES/cpan"
|
---|
| 178 | perl_dir=`echo 'my $vn = $]; $vn =~ s/5\.00(\d).*$/perl-5.$1/; print "$vn" ' | perl`
|
---|
| 179 | gzip -dc XML-Parser-2.34.tar.gz | tar -xf -
|
---|
| 180 | cd "$PACKAGES/cpan/XML-Parser-2.34" && \
|
---|
| 181 | perl Makefile.PL \
|
---|
| 182 | PREFIX="$GSDLHOME/perllib/cpan/XML" \
|
---|
| 183 | INSTALLSITELIB="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
| 184 | INSTALLSITEARCH="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
| 185 | INSTALLMAN1DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
| 186 | INSTALLMAN3DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
| 187 | SITEPREFIX="$GSDLHOME/perllib/cpan" \
|
---|
[18244] | 188 | EXPATINCPATH="$GSDLHOME/common-src/packages/expat/include" \
|
---|
| 189 | EXPATLIBPATH="$GSDLHOME/common-src/packages/expat/lib"
|
---|
[16565] | 190 |
|
---|
| 191 | # configure powerpoint converter
|
---|
| 192 | echo ""
|
---|
| 193 | echo "Configuring xlhtml (powerpoint & excel converter)"
|
---|
| 194 | echo ""
|
---|
| 195 | cd "$PACKAGES/xlhtml"
|
---|
[22144] | 196 | gzip -dc xlhtml-0.5-gs.tar.gz | tar -xf -
|
---|
| 197 | cd xlhtml-0.5 && \
|
---|
[16565] | 198 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
| 199 |
|
---|
| 200 |
|
---|
| 201 | # configure IsisGdl program
|
---|
| 202 | echo ""
|
---|
| 203 | echo "Configuring IsisGdl (CDS/ISIS database reader)"
|
---|
| 204 | echo ""
|
---|
| 205 | cd "$PACKAGES/isis-gdl" && \
|
---|
| 206 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
| 207 |
|
---|
| 208 | # configure HTMLTidy program
|
---|
| 209 | echo ""
|
---|
| 210 | echo "Configuring HTMLTidy"
|
---|
| 211 | echo ""
|
---|
| 212 | cd "$PACKAGES/html-tidy"
|
---|
| 213 | gzip -dc tidy.tgz | tar -xf -
|
---|
| 214 | cd "$PACKAGES/html-tidy/tidy" && \
|
---|
| 215 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
| 216 |
|
---|