source: gsdl/trunk/gs2build/packages/configure@ 16565

Last change on this file since 16565 was 16565, checked in by davidb, 16 years ago

Extra Makefile, configure and supporting files for build-time

  • Property svn:executable set to *
File size: 5.3 KB
Line 
1#! /bin/sh
2
3PACKAGES=`pwd`
4cd ../..
5GSDLHOME=`pwd`
6cd $PACKAGES
7
8GSDLOS=`uname -s |tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
9# check for running bash under cygwin
10if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ;
11then
12 GSDLOS=windows
13fi
14
15prefix=""
16bindir=""
17HOSTTARGETFLAGS=""
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"
22ENVIRONMENT=""
23
24# SQLite support enabled by default, can switch it off with --disable-sqlite
25USE_SQLITE=true
26# yaz compilation enabled by default, can switch it off with --disable-yaz
27USE_YAZ=true
28# z3950 server disabled by default, switch it on with --enable-z3950
29USE_Z3950=false
30# CORBA support disabled by default, switch it on with --enable-corba
31USE_CORBA=false
32MICO_DIR=default
33
34# parse any arguments given from toplevel configure
35while test $# -ne 0; do
36 case "$1" in
37 --cache-file=*)
38 cache_filename=`echo $1 | sed s/--cache-file=//`
39 # turn relative path into an absolute path
40 cache_dir=`echo $cache_filename | sed 's@/[^/]*$@@'`
41 cache_dir=`cd $cache_dir 2>/dev/null && pwd`
42
43 cache_basefile=`echo $cache_filename | sed 's@.*/@@'`
44 cache_file="$cache_dir/$cache_basefile"
45 if test ! -f "$cache_file"; then
46 CACHE_FILE=""
47 else
48 CACHE_FILE="--cache-file=$cache_file"
49 fi
50 ;;
51 --disable-sqlite)
52 USE_SQLITE=false
53 ;;
54 --disable-yaz)
55 USE_YAZ=false
56 ;;
57 --enable-z3950)
58 USE_Z3950=true
59 ;;
60 --enable-corba)
61 USE_CORBA=true
62 ;;
63 --with-micodir=*)
64 if test $1 = ""; then
65 $1 = "default"
66 fi
67 MICO_DIR=$1
68 ;;
69 --prefix=*)
70 prefix=`echo $1 | sed s/--prefix=//`
71 ;;
72 --bindir=*)
73 # where to install binaries to
74 bindir=`echo $1 | sed s/--bindir=//`
75 # turn relative path into an absolute path
76 if test -d "$bindir" ; then
77 bindir=`cd "$bindir" ; pwd `
78 cd "$PACKAGES"
79 elif test -z `echo $bindir | sed '/^\// p;D'` ; then
80 rel_bindir="`echo $bindir | sed s@/.*@@`"
81 cd "$rel_bindir"
82 bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`"
83 cd "$PACKAGES"
84 else
85 # bindir doesn't exist, and isn't relative
86 true
87 fi
88 ;;
89 --host=* | --target=*)
90 HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1"
91 ;;
92 *)
93 # ignore all other options for now
94 ;;
95 esac
96 shift
97done
98
99# note! Our GSDL package currently always installs into it's source
100# directory, ignoring any --prefix given to configure.
101# When this is fixed, uncomment the relevant lines below...
102
103##if test -z "$prefix" ; then
104prefix="${GSDLHOME}"
105##fi
106
107##if test -z "$bindir" ; then
108bindir="${prefix}/bin/$GSDLOS"
109##fi
110
111# This loads the top configure's cache file, with variables already set.
112if test -f "$cache_file" ; then
113 . $cache_file
114fi
115
116# we assume that gzip and tar are on the search path.
117# non-GNU versions of tar don't take the -z option.
118
119
120# configure the wvWare Word document converter
121echo ""
122echo "Configuring wvWare"
123echo ""
124
125cd "$PACKAGES/wv"
126gzip -dc wv-0.7.1-gs.tar.gz | tar -xf -
127# datadir is for default location of wvHtml.xml config file
128cd wv-gs && \
129./configure $CACHE_FILE --prefix=$PACKAGES/wv --bindir="$bindir" --datadir="$prefix/etc/packages" $HOSTTARGETFLAGS
130
131# configure the pdftohtml converter
132echo ""
133echo "Configuring pdftohtml"
134echo ""
135
136cd "$PACKAGES/pdftohtml"
137gzip -dc pdftohtml_0_36_gs.tar.gz | tar -xf -
138cd pdftohtml_gs && \
139./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
140
141# rtftohtml converter
142echo ""
143echo "Configuring rtftohtml"
144echo ""
145
146cd "$PACKAGES/rtftohtml"
147gzip -dc rtftohtml-gs.tar.gz | tar -xf -
148cd rtftohtml_src && \
149./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
150
151
152
153# configure wget
154echo ""
155echo "Configuring wget"
156echo ""
157cd "$PACKAGES/wget"
158gzip -dc wget.tar.gz | tar -xf -
159cd "$PACKAGES/wget/wget-1.11.4" && \
160./configure $CACHE_FILE --prefix=$PACKAGES/wget --bindir="$bindir" $HOSTTARGETFLAGS
161
162
163# configure XML::Parser perl module
164echo ""
165echo "Configuring XML::Parser"
166echo ""
167cd "$PACKAGES/cpan"
168perl_dir=`echo 'my $vn = $]; $vn =~ s/5\.00(\d).*$/perl-5.$1/; print "$vn" ' | perl`
169gzip -dc XML-Parser-2.34.tar.gz | tar -xf -
170cd "$PACKAGES/cpan/XML-Parser-2.34" && \
171perl Makefile.PL \
172 PREFIX="$GSDLHOME/perllib/cpan/XML" \
173 INSTALLSITELIB="$GSDLHOME/perllib/cpan/$perl_dir" \
174 INSTALLSITEARCH="$GSDLHOME/perllib/cpan/$perl_dir" \
175 INSTALLMAN1DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
176 INSTALLMAN3DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
177 SITEPREFIX="$GSDLHOME/perllib/cpan" \
178 EXPATINCPATH="$GSDLHOME/packages/expat/include" \
179 EXPATLIBPATH="$GSDLHOME/packages/expat/lib"
180
181# configure powerpoint converter
182echo ""
183echo "Configuring xlhtml (powerpoint & excel converter)"
184echo ""
185cd "$PACKAGES/xlhtml"
186gzip -dc xlhtml-0.4.9.0-gs.tar.gz | tar -xf -
187cd xlhtml-0.4.9.0 && \
188./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
189
190
191# configure IsisGdl program
192echo ""
193echo "Configuring IsisGdl (CDS/ISIS database reader)"
194echo ""
195cd "$PACKAGES/isis-gdl" && \
196./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
197
198# configure HTMLTidy program
199echo ""
200echo "Configuring HTMLTidy"
201echo ""
202cd "$PACKAGES/html-tidy"
203gzip -dc tidy.tgz | tar -xf -
204cd "$PACKAGES/html-tidy/tidy" && \
205./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
206
Note: See TracBrowser for help on using the repository browser.