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