[9749] | 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=""
|
---|
[13405] | 18 | # only some of the packages can take environment variables as options to
|
---|
| 19 | # configure
|
---|
| 20 | # format is VAR=value, e.g "LDFLAGS=-static"
|
---|
[13485] | 21 | ENVIRONMENT=""
|
---|
[9749] | 22 |
|
---|
[13512] | 23 | # accentfolding enabled by default - switch it off with --disable-accentfold
|
---|
| 24 | ENABLE_ACCENTFOLD=true
|
---|
| 25 |
|
---|
[9749] | 26 | # parse any arguments given from toplevel configure
|
---|
| 27 | while test $# -ne 0; do
|
---|
| 28 | case "$1" in
|
---|
| 29 | --cache-file=*)
|
---|
| 30 | cache_filename=`echo $1 | sed s/--cache-file=//`
|
---|
| 31 | # turn relative path into an absolute path
|
---|
| 32 | cache_dir=`echo $cache_filename | sed 's@/[^/]*$@@'`
|
---|
| 33 | cache_dir=`cd $cache_dir 2>/dev/null && pwd`
|
---|
| 34 |
|
---|
| 35 | cache_basefile=`echo $cache_filename | sed 's@.*/@@'`
|
---|
| 36 | cache_file="$cache_dir/$cache_basefile"
|
---|
| 37 | if test ! -f "$cache_file"; then
|
---|
| 38 | CACHE_FILE=""
|
---|
| 39 | else
|
---|
| 40 | CACHE_FILE="--cache-file=$cache_file"
|
---|
| 41 | fi
|
---|
| 42 | ;;
|
---|
[13512] | 43 | --disable-accentfold)
|
---|
| 44 | ENABLE_ACCENTFOLD=false
|
---|
| 45 | ;;
|
---|
[9749] | 46 | --prefix=*)
|
---|
| 47 | prefix=`echo $1 | sed s/--prefix=//`
|
---|
| 48 | ;;
|
---|
| 49 | --bindir=*)
|
---|
| 50 | # where to install binaries to
|
---|
| 51 | bindir=`echo $1 | sed s/--bindir=//`
|
---|
| 52 | # turn relative path into an absolute path
|
---|
| 53 | if test -d "$bindir" ; then
|
---|
| 54 | bindir=`cd "$bindir" ; pwd `
|
---|
| 55 | cd "$PACKAGES"
|
---|
| 56 | elif test -z `echo $bindir | sed '/^\// p;D'` ; then
|
---|
| 57 | rel_bindir="`echo $bindir | sed s@/.*@@`"
|
---|
| 58 | cd "$rel_bindir"
|
---|
| 59 | bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`"
|
---|
| 60 | cd "$PACKAGES"
|
---|
| 61 | else
|
---|
| 62 | # bindir doesn't exist, and isn't relative
|
---|
| 63 | true
|
---|
| 64 | fi
|
---|
| 65 | ;;
|
---|
| 66 | --host=* | --target=*)
|
---|
| 67 | HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1"
|
---|
| 68 | ;;
|
---|
| 69 | *)
|
---|
| 70 | # ignore all other options for now
|
---|
| 71 | ;;
|
---|
| 72 | esac
|
---|
| 73 | shift
|
---|
| 74 | done
|
---|
| 75 |
|
---|
| 76 | # note! Our GSDL package currently always installs into it's source
|
---|
| 77 | # directory, ignoring any --prefix given to configure.
|
---|
| 78 | # When this is fixed, uncomment the relevant lines below...
|
---|
| 79 |
|
---|
| 80 | ##if test -z "$prefix" ; then
|
---|
| 81 | prefix="${GSDLHOME}"
|
---|
| 82 | ##fi
|
---|
| 83 |
|
---|
| 84 | ##if test -z "$bindir" ; then
|
---|
| 85 | bindir="${prefix}/bin/$GSDLOS"
|
---|
| 86 | ##fi
|
---|
| 87 |
|
---|
| 88 | # This loads the top configure's cache file, with variables already set.
|
---|
| 89 | if test -f "$cache_file" ; then
|
---|
| 90 | . $cache_file
|
---|
| 91 | fi
|
---|
| 92 |
|
---|
| 93 | # we assume that gzip and tar are on the search path.
|
---|
| 94 | # non-GNU versions of tar don't take the -z option.
|
---|
| 95 |
|
---|
| 96 | # configure the wvWare Word document converter
|
---|
| 97 | echo ""
|
---|
| 98 | echo "Configuring wvWare"
|
---|
| 99 | echo ""
|
---|
| 100 |
|
---|
| 101 | cd "$PACKAGES/wv"
|
---|
| 102 | gzip -dc wv-0.7.1-gs.tar.gz | tar -xf -
|
---|
| 103 | # datadir is for default location of wvHtml.xml config file
|
---|
| 104 | cd wv-gs && \
|
---|
| 105 | ./configure $CACHE_FILE --prefix=$PACKAGES/wv --bindir="$bindir" --datadir="$prefix/etc/packages" $HOSTTARGETFLAGS
|
---|
| 106 |
|
---|
| 107 | # configure the pdftohtml converter
|
---|
| 108 | echo ""
|
---|
| 109 | echo "Configuring pdftohtml"
|
---|
| 110 | echo ""
|
---|
| 111 |
|
---|
| 112 | cd "$PACKAGES/pdftohtml"
|
---|
| 113 | gzip -dc pdftohtml_0_36_gs.tar.gz | tar -xf -
|
---|
| 114 | cd pdftohtml_gs && \
|
---|
[13405] | 115 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[9749] | 116 |
|
---|
| 117 | # rtftohtml converter
|
---|
| 118 | echo ""
|
---|
| 119 | echo "Configuring rtftohtml"
|
---|
| 120 | echo ""
|
---|
| 121 |
|
---|
| 122 | cd "$PACKAGES/rtftohtml"
|
---|
| 123 | gzip -dc rtftohtml-gs.tar.gz | tar -xf -
|
---|
| 124 | cd rtftohtml_src && \
|
---|
| 125 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
| 126 |
|
---|
| 127 | # configure wget
|
---|
| 128 | echo ""
|
---|
| 129 | echo "Configuring wget"
|
---|
| 130 | echo ""
|
---|
| 131 | cd "$PACKAGES/wget"
|
---|
| 132 | gzip -dc wget.tar.gz | tar -xf -
|
---|
| 133 | cd "$PACKAGES/wget/wget-1.9" && \
|
---|
| 134 | ./configure $CACHE_FILE --prefix=$PACKAGES/wget --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
| 135 |
|
---|
| 136 | # configure expat (needs to be done before XML::Parser
|
---|
| 137 | echo ""
|
---|
| 138 | echo "Configuring expat"
|
---|
| 139 | echo ""
|
---|
| 140 | cd "$PACKAGES/expat"
|
---|
| 141 | gzip -dc expat-1.95.8.tar.gz | tar -xf -
|
---|
| 142 | cd "$PACKAGES/expat/expat-1.95.8" && \
|
---|
[13405] | 143 | ./configure $CACHE_FILE --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[9749] | 144 |
|
---|
| 145 | # configure XML::Parser perl module
|
---|
| 146 | echo ""
|
---|
| 147 | echo "Configuring XML::Parser"
|
---|
| 148 | echo ""
|
---|
| 149 | cd "$PACKAGES/cpan"
|
---|
| 150 | perl_dir=`echo 'my $vn = $]; $vn =~ s/5\.00(\d).*$/perl-5.$1/; print "$vn" ' | perl`
|
---|
| 151 | gzip -dc XML-Parser-2.34.tar.gz | tar -xf -
|
---|
| 152 | cd "$PACKAGES/cpan/XML-Parser-2.34" && \
|
---|
| 153 | perl Makefile.PL \
|
---|
| 154 | INSTALLSITELIB="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
| 155 | PREFIX="$GSDLHOME/perllib/cpan/XML" \
|
---|
| 156 | INSTALLMAN1DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
| 157 | INSTALLMAN3DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
| 158 | SITEPREFIX="$GSDLHOME/perllib/cpan" \
|
---|
| 159 | EXPATINCPATH="$GSDLHOME/packages/expat/include" \
|
---|
| 160 | EXPATLIBPATH="$GSDLHOME/packages/expat/lib"
|
---|
| 161 |
|
---|
| 162 | # configure powerpoint converter
|
---|
| 163 | echo ""
|
---|
| 164 | echo "Configuring xlhtml (powerpoint & excel converter)"
|
---|
| 165 | echo ""
|
---|
| 166 | cd "$PACKAGES/xlhtml"
|
---|
| 167 | gzip -dc xlhtml-0.4.9.0-gs.tar.gz | tar -xf -
|
---|
| 168 | cd xlhtml-0.4.9.0 && \
|
---|
| 169 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
| 170 |
|
---|
| 171 |
|
---|
| 172 | # configure IsisGdl program
|
---|
| 173 | echo ""
|
---|
| 174 | echo "Configuring IsisGdl (CDS/ISIS database reader)"
|
---|
| 175 | echo ""
|
---|
| 176 | cd "$PACKAGES/isis-gdl" && \
|
---|
[13405] | 177 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[13507] | 178 |
|
---|
| 179 | # configure unac program
|
---|
| 180 | echo ""
|
---|
| 181 | echo "Configuring unac"
|
---|
| 182 | echo ""
|
---|
| 183 | if test x$ENABLE_ACCENTFOLD = xtrue ;
|
---|
| 184 | then
|
---|
| 185 | echo "Accent folding support enabled, configuring unac library."
|
---|
| 186 | echo "add --disable-accentfold to the configure command to disable this"
|
---|
| 187 |
|
---|
| 188 | cd "$PACKAGES/unac"
|
---|
| 189 | ./configure $CACHE_FILE $HOSTTARGETFLAGS
|
---|
| 190 | else
|
---|
| 191 | echo "Accent folding support disabled."
|
---|
| 192 | echo ""
|
---|
| 193 | fi
|
---|