Skip to content

Instantly share code, notes, and snippets.

@janl
Last active April 22, 2024 17:19
Show Gist options
  • Save janl/5197524 to your computer and use it in GitHub Desktop.
Save janl/5197524 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."
@gr2m
Copy link

gr2m commented Mar 19, 2013

$ curl https://gist.github.com/janl/5197524/raw/325c867617705a0bb2a976dcd6d8ceb7b0663d36/install-geocouch.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1066    0  1066    0     0    843      0 --:--:--  0:00:01 --:--:--  1480
Cloning into geocouch...
remote: Counting objects: 1667, done.
remote: Compressing objects: 100% (614/614), done.
remote: Total 1667 (delta 975), reused 1598 (delta 924)
Receiving objects: 100% (1667/1667), 724.62 KiB | 411 KiB/s, done.
Resolving deltas: 100% (975/975), done.
Branch couchdb1.2.x set up to track remote branch couchdb1.2.x from origin.
Switched to a new branch 'couchdb1.2.x'
ERL_COMPILER_OPTIONS='[{i,[]},{i,"/usr/local/lib/couchdb/erlang/lib/couch-1.2.1/include"}]' ./rebar compile
==> geocouch (compile)
Compiled src/vtree/vtree_insbench.erl
Compiled src/vtree/vtreestats.erl
Compiled src/vtree/vtreeviz.erl
Compiled src/vtree/run_vtreeviz.erl
Compiled src/vtree/run_vtreestats.erl
Compiled src/geocouch/geocouch_duplicates.erl
Compiled src/geocouch/couch_spatial_updater.erl
Compiled src/vtree/vtree.erl
Compiled src/vtree/vtree_bulk.erl
Compiled src/geocouch/couch_spatial_compactor.erl
Compiled src/geocouch/couch_spatial.erl
Compiled src/geocouch/couch_httpd_spatial_list.erl
Compiled test/gc_test_util.erl
Compiled src/geocouch/couch_httpd_spatial.erl
Compiled src/geocouch/couch_spatial_group.erl
cp: /usr/local/etc/couchdb/default.d/geocouch.ini: No such file or directory
Done.

@gr2m
Copy link

gr2m commented Mar 19, 2013

now:

$ curl https://gist.github.com/janl/5197524/raw/92cddbf7f9df91be84b5a9c2b3fa253bda6fd633/install-geocouch.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1109    0  1109    0     0    979      0 --:--:--  0:00:01 --:--:--  1889
Already on 'couchdb1.2.x'
ERL_COMPILER_OPTIONS='[{i,[]},{i,"/usr/local/lib/couchdb/erlang/lib/couch-1.2.1/include"}]' ./rebar compile
==> geocouch (compile)
Done.

@gr2m
Copy link

gr2m commented Mar 19, 2013

Installation GeoCouch:

$ curl https://gist.github.com/janl/5197524/raw/325c867617705a0bb2a976dcd6d8ceb7b0663d36/install-geocouch.sh | sh

then start any CouchDB (either just $ couchdb) or in a hoodie app, and go to futon and the test suite and scroll all the way down and run one of the spatial tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment