Skip to content

Instantly share code, notes, and snippets.

@renanyoy
Forked from janl/install-geocouch.sh
Created October 24, 2016 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renanyoy/5142edb2a1b32a601629dc44ebd0a66f to your computer and use it in GitHub Desktop.
Save renanyoy/5142edb2a1b32a601629dc44ebd0a66f 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