Skip to content

Instantly share code, notes, and snippets.

@leobm
Forked from janl/install-geocouch.sh
Created March 21, 2013 09:40
Show Gist options
  • Save leobm/5211837 to your computer and use it in GitHub Desktop.
Save leobm/5211837 to your computer and use it in GitHub Desktop.
#!/bin/sh -x
cd /tmp
if [ ! -d "geocouch" ]; then
git clone https://github.com/couchbase/geocouch.git
fi
cd geocouch
git checkout couchdb1.2.x
COUCH_EBIN="/usr/local/lib/couchdb/erlang/lib/couch-1.2.1/ebin"
COUCH_INCLUDE="/usr/local/lib/couchdb/erlang/lib/couch-1.2.1/include"
COUCH_SCRIPT="/usr/local/share/couchdb/www/script"
export ERL_COMPILER_OPTIONS="[{i, \"$COUCH_INCLUDE\"}]"
make
# install
mkdir -p /usr/local/etc/couchdb/default.d/
cp ebin/* $COUCH_EBIN/
cp etc/couchdb/default.d/geocouch.ini /usr/local/etc/couchdb/default.d/geocouch.ini
cp share/www/script/test/* $COUCH_SCRIPT/test/
HAS_SPATIAL_TESTS=`grep spatial $COUCH_SCRIPT/couch_tests.js`
if [ -z "$HAS_SPATIAL_TESTS" ]; then
echo "\
loadTest(\"spatial.js\"); \
loadTest(\"list_spatial.js\"); \
loadTest(\"etags_spatial.js\"); \
loadTest(\"multiple_spatial_rows.js\"); \
loadTest(\"spatial_compaction.js\"); \
loadTest(\"spatial_design_docs.js\"); \
loadTest(\"spatial_bugfixes.js\"); \
loadTest(\"spatial_offsets.js\"); \
">> $COUCH_SCRIPT/couch_tests.js
fi
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment