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