20 COUCHDB_VERSION
=`cat ./version`
21 export COUCHDB_VERSION
23 COUCH_DIR
=build
/couch-
$COUCHDB_VERSION/ebin
24 COUCHDB_INSTALL_DIR
=/usr
/local
/
27 BUILD_FABRIC_TESTS
=false
29 while test $# != 0; do
32 ac_option
=`expr "x$1" : 'x\([^=]*\)='`
33 ac_optarg
=`expr "x$1" : 'x[^=]*=\(.*\)'`
41 *) # This is not an option, so the user has probably given explicit
44 ac_need_defaults
=false
;;
49 echo "Building CouchDb with Fabric Tests"
50 BUILD_FABRIC_TESTS
=true
55 COUCHDB_INSTALL_DIR
=$ac_optarg
59 echo "The only available options at the moment are --install which installs CouchDb and --with-fabric-tests that additionally builds the FabricTests"
64 echo "Unkown option. Try --help"
70 if [ -z "$ERLC" ]; then
75 if [ ! -x "$ERLC" ]; then
76 echo "Cannot find erlc. Please set ERLC manually. (e.g. export ERLC=/usr/local/erlang/bin/erlc)"
80 if [ ! -x "$JAVA" ]; then
81 echo "Cannot find java. Please put the directory where java resides into your PATH. (e.g. export PATH=$PATH:/usr/local/java/bin/)"
85 if [ ! -e "$ERLANG_INCLUDE_DIR/erl_driver.h" ]; then
86 echo "Cannot find erl_driver.h. Please set ERLANG_INCLUDE_DIR manually. (e.g. export ERLANG_INCLUDE_DIR=/usr/local/erlang/lib/usr/include)"
90 if [ ! -d "$COUCH_DIR" ]; then
95 if [ "$BUILD_FABRIC_TESTS" = "true" ]; then
96 $MAKE $BUILD_DIR/FabricTests
100 if [ "$INSTALL_COUCHDB" = "true" ]; then
101 echo "Installing CouchDb into $COUCHDB_INSTALL_DIR"
103 if [ -d "$COUCHDB_INSTALL_DIR/couchdb" ]; then
104 rm -rf "$COUCHDB_INSTALL_DIR/old.couchdb"
105 mv "$COUCHDB_INSTALL_DIR/couchdb" "$COUCHDB_INSTALL_DIR/old.couchdb"
108 mkdir
-p $COUCHDB_INSTALL_DIR/couchdb
111 COUCHDB_INSTALL_DIR
=$COUCHDB_INSTALL_DIR/couchdb
112 export COUCHDB_INSTALL_DIR