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