You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2014/02/03 13:59:50 UTC

[11/27] couchdb commit: updated refs/heads/1843-feature-bigcouch to 465d1ad

Build with rebar


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/f84eb4fc
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/f84eb4fc
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/f84eb4fc

Branch: refs/heads/1843-feature-bigcouch
Commit: f84eb4fc50ef8e6d26508bbc55c5dbd270f9d408
Parents: 938fc01
Author: Robert Newson <rn...@apache.org>
Authored: Wed Dec 18 14:04:59 2013 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Mon Feb 3 12:53:55 2014 +0000

----------------------------------------------------------------------
 .gitignore                                      | 149 +---
 Makefile                                        |  50 ++
 Makefile.am                                     | 172 ----
 bin/Makefile.am                                 | 154 ----
 bootstrap                                       | 151 ----
 configure                                       |  82 ++
 configure.ac                                    | 789 -----------------
 etc/Makefile.am                                 | 117 ---
 etc/couchdb/Makefile.am                         |  93 --
 etc/default/Makefile.am                         |  13 -
 etc/init/Makefile.am                            |  13 -
 etc/launchd/Makefile.am                         |  13 -
 etc/logrotate.d/Makefile.am                     |  13 -
 etc/windows/Makefile.am                         |  13 -
 rebar.config                                    |  38 +
 rel/files/README                                |   4 +
 rel/files/sys.config                            |   1 +
 rel/files/vm.args                               |   0
 rel/overlay/bin/couchdb                         |  28 +
 rel/overlay/etc/default.ini                     | 122 +++
 rel/overlay/etc/local.ini                       |   1 +
 rel/overlay/etc/vm.args                         |  23 +
 rel/reltool.config                              |  70 ++
 share/Makefile.am                               | 219 -----
 share/doc/Makefile.am                           |  14 -
 share/doc/build/Makefile.am                     | 354 --------
 src/Makefile.am                                 |  30 -
 src/chttpd/.gitignore                           |   1 -
 src/chttpd/Makefile.am                          |  56 --
 src/chttpd/README.md                            |  16 -
 src/chttpd/src/chttpd.app.src                   |   2 +-
 src/chttpd/src/chttpd_view.erl                  |  71 +-
 src/config/.gitignore                           |   5 -
 src/config/Makefile.am                          |  44 -
 src/config/src/config.app.src                   |   2 +-
 src/couch/Makefile.am                           | 204 -----
 src/couch/priv/Makefile.am                      | 159 ----
 src/couch/priv/stat_descriptions.cfg            |  50 ++
 src/couch/priv/stat_descriptions.cfg.in         |  50 --
 src/couch/rebar.config                          |  11 +
 src/couch/src/couch.app.src                     |  22 +
 src/couch/src/couch.app.tpl.in                  |  26 -
 src/couch_index/Makefile.am                     |  38 -
 src/couch_index/src/couch_index.app.src         |   2 +-
 src/couch_mrview/Makefile.am                    |  72 --
 src/couch_mrview/include/couch_mrview.hrl       |   2 +
 src/couch_mrview/src/couch_mrview.app.src       |   2 +-
 src/couch_replicator/.gitignore                 |   4 -
 src/couch_replicator/Makefile.am                |  76 --
 .../src/couch_replicator.app.src                |   2 +-
 src/ddoc_cache/.gitignore                       |   1 -
 src/ddoc_cache/Makefile.am                      |  42 -
 src/ddoc_cache/src/ddoc_cache.app.src           |   2 +-
 src/ejson/Makefile.am                           |  91 --
 src/ejson/src/ejson.app.in                      |   9 -
 src/ejson/src/ejson.app.src                     |   9 +
 src/ets_lru/.gitignore                          |   5 -
 src/ets_lru/Makefile.am                         |  34 -
 src/ets_lru/src/ets_lru.app.src                 |   2 +-
 src/fabric/.gitignore                           |   4 -
 src/fabric/Makefile.am                          |  77 --
 src/fabric/src/fabric.app.src                   |   2 +-
 src/fabric/src/fabric_rpc.erl                   |  17 +-
 src/fabric/src/fabric_view.erl                  |  13 +-
 src/fabric/src/fabric_view_reduce.erl           |   7 +-
 src/ibrowse/Makefile.am                         |  51 --
 src/ibrowse/src/ibrowse.app.in                  |   7 -
 src/ibrowse/src/ibrowse.app.src                 |   7 +
 src/mem3/.gitignore                             |   4 -
 src/mem3/Makefile.am                            |  60 --
 src/mem3/src/mem3.app.src                       |   2 +-
 src/mochiweb/Makefile.am                        | 113 ---
 src/mochiweb/src/mochiweb.app.in                |  32 -
 src/mochiweb/src/mochiweb.app.src               |   3 +-
 src/oauth/Makefile.am                           |  41 -
 src/oauth/src/oauth.app.in                      |  20 -
 src/oauth/src/oauth.app.src                     |  20 +
 src/rebar/.gitignore                            |  12 -
 src/rebar/.travis.yml                           |   8 -
 src/rebar/CONTRIBUTING.md                       |  94 ---
 src/rebar/LICENSE                               | 178 ----
 src/rebar/Makefile                              |  44 -
 src/rebar/NOTES.org                             |  28 -
 src/rebar/README.md                             |  79 --
 src/rebar/THANKS                                | 122 ---
 src/rebar/bootstrap                             | 118 ---
 src/rebar/bootstrap.bat                         |   2 -
 src/rebar/dialyzer_reference                    |   3 -
 src/rebar/ebin/rebar.app                        |  93 --
 src/rebar/include/rebar.hrl                     |  14 -
 src/rebar/inttest/bug_5_rt.erl                  |  29 -
 src/rebar/inttest/ct1/ct1_rt.erl                |  28 -
 src/rebar/inttest/ct1/rebar.config              |   1 -
 src/rebar/inttest/ct1/test_SUITE.erl            |  11 -
 src/rebar/inttest/ct2/ct2_rt.erl                |  26 -
 src/rebar/inttest/ct2/foo.test.spec             |   1 -
 src/rebar/inttest/ct2/foo_SUITE.erl             |  10 -
 src/rebar/inttest/depplugins/depplugins_rt.erl  |  50 --
 src/rebar/inttest/depplugins/rebar.config       |   1 -
 .../depplugins/rebar_dependsonplugin.config     |   2 -
 src/rebar/inttest/depplugins/testplugin_mod.erl |   6 -
 src/rebar/inttest/rgen1/reltool.config          |  31 -
 src/rebar/inttest/rgen1/retest.config           |   1 -
 src/rebar/inttest/rgen1/rgen1_rt.erl            |  18 -
 src/rebar/inttest/rgen1/test.config             |   1 -
 src/rebar/inttest/rgen1/vars.config             |   1 -
 src/rebar/inttest/t_custom_config/custom.config |   4 -
 .../inttest/t_custom_config/custom_config.erl   |   6 -
 .../t_custom_config/t_custom_config_rt.erl      |  39 -
 src/rebar/inttest/tdeps1/a.erl                  |   8 -
 src/rebar/inttest/tdeps1/a.rebar.config         |   1 -
 src/rebar/inttest/tdeps1/b.hrl                  |   1 -
 src/rebar/inttest/tdeps1/b.rebar.config         |   1 -
 src/rebar/inttest/tdeps1/c.hrl                  |   1 -
 src/rebar/inttest/tdeps1/tdeps1_rt.erl          |  59 --
 src/rebar/inttest/tdeps2/a.erl                  |   3 -
 src/rebar/inttest/tdeps2/a.rebar.config         |   1 -
 src/rebar/inttest/tdeps2/b.hrl                  |   1 -
 src/rebar/inttest/tdeps2/b.rebar.config         |   1 -
 src/rebar/inttest/tdeps2/c.hrl                  |   1 -
 src/rebar/inttest/tdeps2/root.rebar.config      |   2 -
 src/rebar/inttest/tdeps2/tdeps2_rt.erl          |  65 --
 src/rebar/inttest/tdeps3/a.erl                  |   3 -
 src/rebar/inttest/tdeps3/a.rebar.config         |   4 -
 src/rebar/inttest/tdeps3/b.hrl                  |   1 -
 src/rebar/inttest/tdeps3/b.rebar.config         |   5 -
 src/rebar/inttest/tdeps3/c.hrl                  |   1 -
 src/rebar/inttest/tdeps3/c.rebar.config         |   1 -
 src/rebar/inttest/tdeps3/d.hrl                  |   1 -
 src/rebar/inttest/tdeps3/d.rebar.config         |   1 -
 src/rebar/inttest/tdeps3/e.hrl                  |   1 -
 src/rebar/inttest/tdeps3/f.hrl                  |   1 -
 src/rebar/inttest/tdeps3/root.rebar.config      |   1 -
 src/rebar/inttest/tdeps3/tdeps3_rt.erl          |  89 --
 src/rebar/inttest/tdeps_update/a.erl            |   3 -
 src/rebar/inttest/tdeps_update/a.rebar.config   |   1 -
 src/rebar/inttest/tdeps_update/a2.rebar.config  |   1 -
 src/rebar/inttest/tdeps_update/a3.rebar.config  |   1 -
 src/rebar/inttest/tdeps_update/a4.rebar.config  |   4 -
 src/rebar/inttest/tdeps_update/b.hrl            |   1 -
 src/rebar/inttest/tdeps_update/b.rebar.config   |   1 -
 src/rebar/inttest/tdeps_update/b2.rebar.config  |   1 -
 src/rebar/inttest/tdeps_update/b3.rebar.config  |   1 -
 src/rebar/inttest/tdeps_update/b4.rebar.config  |   1 -
 src/rebar/inttest/tdeps_update/c.hrl            |   1 -
 src/rebar/inttest/tdeps_update/c.rebar.config   |   1 -
 src/rebar/inttest/tdeps_update/c2.hrl           |   1 -
 src/rebar/inttest/tdeps_update/c2.rebar.config  |   4 -
 src/rebar/inttest/tdeps_update/c3.rebar.config  |   4 -
 src/rebar/inttest/tdeps_update/d.hrl            |   1 -
 .../inttest/tdeps_update/root.rebar.config      |   1 -
 .../inttest/tdeps_update/tdeps_update_rt.erl    | 147 ----
 src/rebar/inttest/thooks/fish.erl               |   5 -
 src/rebar/inttest/thooks/rebar.config           |   7 -
 src/rebar/inttest/thooks/thooks_rt.erl          |  40 -
 src/rebar/inttest/tplugins/bad.config           |   2 -
 src/rebar/inttest/tplugins/bad_plugin.erl       |   7 -
 src/rebar/inttest/tplugins/fish.erl             |   5 -
 src/rebar/inttest/tplugins/rebar.config         |   1 -
 src/rebar/inttest/tplugins/test_plugin.erl      |   8 -
 src/rebar/inttest/tplugins/tplugins_rt.erl      |  40 -
 src/rebar/priv/shell-completion/bash/rebar      |  85 --
 src/rebar/priv/shell-completion/zsh/_rebar      |  83 --
 src/rebar/priv/templates/basicnif.c             |  59 --
 src/rebar/priv/templates/basicnif.erl           |  42 -
 src/rebar/priv/templates/basicnif.template      |   3 -
 src/rebar/priv/templates/ctsuite.erl            | 167 ----
 src/rebar/priv/templates/ctsuite.template       |   2 -
 src/rebar/priv/templates/simpleapp.app.src      |  12 -
 src/rebar/priv/templates/simpleapp.template     |   4 -
 src/rebar/priv/templates/simpleapp_app.erl      |  16 -
 src/rebar/priv/templates/simpleapp_sup.erl      |  27 -
 src/rebar/priv/templates/simplefsm.erl          |  57 --
 src/rebar/priv/templates/simplefsm.template     |   2 -
 src/rebar/priv/templates/simplemod.erl          |   6 -
 src/rebar/priv/templates/simplemod.template     |   3 -
 src/rebar/priv/templates/simplemod_tests.erl    |   3 -
 src/rebar/priv/templates/simplenode.erl.script  |  44 -
 .../simplenode.install_upgrade.escript          |  44 -
 src/rebar/priv/templates/simplenode.nodetool    | 182 ----
 .../priv/templates/simplenode.reltool.config    |  44 -
 src/rebar/priv/templates/simplenode.runner      | 348 --------
 src/rebar/priv/templates/simplenode.sys.config  |  11 -
 src/rebar/priv/templates/simplenode.template    |  13 -
 src/rebar/priv/templates/simplenode.vm.args     |  19 -
 .../templates/simplenode.windows.runner.cmd     | 103 ---
 .../templates/simplenode.windows.start_erl.cmd  |  40 -
 src/rebar/priv/templates/simplesrv.erl          |  50 --
 src/rebar/priv/templates/simplesrv.template     |   2 -
 src/rebar/rebar.config                          |  21 -
 src/rebar/rebar.config.sample                   | 236 ------
 src/rebar/rebar.config.script                   |  20 -
 src/rebar/src/getopt.erl                        | 842 -------------------
 src/rebar/src/mustache.erl                      | 228 -----
 src/rebar/src/rebar.erl                         | 501 -----------
 src/rebar/src/rebar_abnfc_compiler.erl          | 123 ---
 src/rebar/src/rebar_app_utils.erl               | 208 -----
 src/rebar/src/rebar_appups.erl                  | 210 -----
 src/rebar/src/rebar_asn1_compiler.erl           | 100 ---
 src/rebar/src/rebar_base_compiler.erl           | 260 ------
 src/rebar/src/rebar_cleaner.erl                 |  56 --
 src/rebar/src/rebar_config.erl                  | 249 ------
 src/rebar/src/rebar_core.erl                    | 608 -------------
 src/rebar/src/rebar_ct.erl                      | 350 --------
 src/rebar/src/rebar_deps.erl                    | 774 -----------------
 src/rebar/src/rebar_dia_compiler.erl            | 106 ---
 src/rebar/src/rebar_edoc.erl                    | 130 ---
 src/rebar/src/rebar_erlc_compiler.erl           | 511 -----------
 src/rebar/src/rebar_erlydtl_compiler.erl        | 265 ------
 src/rebar/src/rebar_escripter.erl               | 197 -----
 src/rebar/src/rebar_eunit.erl                   | 812 ------------------
 src/rebar/src/rebar_file_utils.erl              | 194 -----
 src/rebar/src/rebar_lfe_compiler.erl            |  84 --
 src/rebar/src/rebar_log.erl                     |  83 --
 src/rebar/src/rebar_neotoma_compiler.erl        | 163 ----
 src/rebar/src/rebar_otp_app.erl                 | 220 -----
 src/rebar/src/rebar_port_compiler.erl           | 607 -------------
 src/rebar/src/rebar_protobuffs_compiler.erl     | 153 ----
 src/rebar/src/rebar_qc.erl                      | 187 ----
 src/rebar/src/rebar_rel_utils.erl               | 238 ------
 src/rebar/src/rebar_reltool.erl                 | 408 ---------
 src/rebar/src/rebar_require_vsn.erl             | 121 ---
 src/rebar/src/rebar_shell.erl                   |  56 --
 src/rebar/src/rebar_subdirs.erl                 |  84 --
 src/rebar/src/rebar_templater.erl               | 462 ----------
 src/rebar/src/rebar_upgrade.erl                 | 268 ------
 src/rebar/src/rebar_utils.erl                   | 510 -----------
 src/rebar/src/rebar_xref.erl                    | 287 -------
 src/rebar/test/rebar_eunit_tests.erl            | 434 ----------
 src/rebar/test/rebar_file_utils_tests.erl       | 278 ------
 src/rebar/test/rebar_xref_eunit.erl             | 203 -----
 src/rebar/test/upgrade_project/README.md        |  40 -
 .../apps/dummy/src/dummy.app.src                |   9 -
 .../apps/dummy/src/dummy_app.erl                |   9 -
 .../apps/dummy/src/dummy_server.erl             |  56 --
 .../apps/dummy/src/dummy_sup.erl                |  15 -
 src/rebar/test/upgrade_project/rebar.config     |   4 -
 src/rebar/test/upgrade_project/rel/files/dummy  | 347 --------
 src/rebar/test/upgrade_project/rel/files/erl    |  44 -
 .../test/upgrade_project/rel/files/nodetool     | 182 ----
 .../test/upgrade_project/rel/files/sys.config   |  11 -
 .../test/upgrade_project/rel/files/vm.args      |  19 -
 .../test/upgrade_project/rel/reltool.config     |  27 -
 src/rexi/.gitignore                             |   8 -
 src/rexi/Makefile.am                            |  48 --
 src/rexi/src/rexi.app.src                       |   2 +-
 src/snappy/Makefile.am                          |  40 -
 src/snappy/c_src/Makefile.am                    |  58 --
 src/snappy/src/snappy.app.in                    |  12 -
 src/snappy/src/snappy.app.src                   |  12 +
 src/twig/.gitignore                             |   3 -
 src/twig/Makefile.am                            |  49 --
 test/Makefile.am                                |  15 -
 test/bench/Makefile.am                          |  22 -
 test/etap/Makefile.am                           |  96 ---
 test/javascript/Makefile.am                     |  26 -
 test/view_server/Makefile.am                    |  15 -
 utils/Makefile.am                               |  38 -
 var/Makefile.am                                 |  23 -
 259 files changed, 660 insertions(+), 19811 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 3391f7a..e15b210 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,112 +1,45 @@
-!.gitignore
-!.mailmap
-*.beam
-*.diff
-*.gz
-*.la
-*.lo
 *.o
-*.orig
-*.rej
-*.stamp
-*.sw*
-*.tpl
-*~
-.*
-INSTALL
-Makefile
-Makefile.in
-THANKS
-acinclude.m4
-aclocal.m4
-apache-couchdb-*
-autom4te.cache
-bin/.deps/
-bin/couch-config
-bin/couch-config_dev
-bin/couchdb
-bin/couchdb.1
-bin/couchjs_dev
-bin/couchpw
-build-aux/config.*
-build-aux/depcomp
-build-aux/install-sh
-build-aux/ltmain.sh
-build-aux/missing
-build-aux/texinfo.tex
-config.h
-config.h.in
-config.log
-config.status
-configure
-couchdb.log
-couchdb.stderr
-couchdb.stdout
-cover/*
+*.so
+*.Tpo
+*.beam
 erl_crash.dump
-etc/couchdb/default.ini
-etc/couchdb/default_dev.ini
-etc/couchdb/local_dev.ini
-etc/init/couchdb
-etc/launchd/org.apache.couchdb.plist
-etc/logrotate.d/couchdb
-libtool
-m4
-share/doc/build/CouchDB.log
-share/doc/build/doctrees
-share/doc/build/html
-share/doc/build/latex
-share/doc/build/texinfo
-share/server/main-coffee.js
-share/server/main.js
-src/couch_mrview/ebin/
-src/couch_replicator/ebin/
-src/couch/.deps/*
-src/couch/.libs/*
-src/couch/ebin/
-src/couch/couch.app
-src/couch/couchjs
-src/couch/edoc-info
-src/couch/erlang.png
-src/couch/priv/.deps/
-src/couch/priv/.libs/
-src/couch/priv/couch_icu_driver.la
-src/couch/priv/couch_icu_driver.*
-src/couch/priv/couchjs
-src/couch/priv/couchjs.1
-src/couch/priv/couchspawnkillable
-src/couch/priv/stat_descriptions.cfg
-src/couch/priv/stat_descriptions.cfg
-src/couch/stylesheet.css
-src/ejson/.deps/
-src/ejson/.libs/
-src/ejson/ebin
-src/ejson/priv
-src/erlang-oauth/oauth.app
-src/erlang-oauth/oauth.app
-src/ibrowse/ebin/
-src/mochiweb/ebin/
-src/oauth/ebin/
-src/snappy/.deps/
-src/snappy/.libs/
-src/snappy/ebin/
-src/snappy/priv/
-src/snappy/c_src/google-snappy/.deps/
-src/snappy/c_src/google-snappy/snappy-stubs-public.h
-src/snappy/c_src/google-snappy/stamp-h2
+wiki/
+
+# building
+src/*/ebin/
+rel/couchdb
+rel/couchdb.config
+rel/overlay.config
+install.mk
+rebar
+deps/
 
+# scons building
+couchjs/.sconf_temp/
+couchjs/.sconsign.dblite
+couchjs/build/
+couchjs/config.log
+*.pyc
+
+# testing
+.eunit
+@abs_top_builddir@/
+src/couch/test/etap/temp*
+.dialyzer_filter
+.dialyzer_out
+*.plt
+
+# dev
+dev/lib
+dev/logs
+rel/dev*
+rel/tmpdata
+rel/logs
+
+# vim
+*.swp
+*~
 
-stamp-h1
-test/.deps/
-test/bench/run
-test/etap/.deps/
-test/etap/run
-test/etap/run
-test/etap/temp.*
-test/etap/test_cfg_register
-test/etap/test_util.erl
-test/javascript/run
-test/javascript/run_js_tests.sh
-test/local.ini
-tmp
-utils/run
+# eclipse
+.project
+/.pydevproject

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b90d957
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,50 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+all:  compile
+
+compile:
+	@echo "==> couchjs (compile)"
+#	@cd couchjs && python scons/scons.py $(couchjsflags)
+	@rebar compile
+
+clean:
+	@echo "==> couchjs (clean)"
+#	@cd couchjs && python scons/scons.py --clean
+	@rebar clean
+
+dist: compile
+	@rm -rf rel/couchdb
+	@rebar generate
+
+distclean: clean
+	@rm -rf rel/couchdb
+
+dev: compile
+	@rm -rf rel/dev1 rel/dev2 rel/dev3
+	@echo "==> Building development node #1 (ports 15984/15986)"
+	@rebar generate target_dir=dev1 overlay_vars=dev1.config
+	@echo "==> Building development node #2 (ports 25984/25986)"
+	@rebar generate target_dir=dev2 overlay_vars=dev2.config
+	@echo "==> Building development node #3 (ports 35984/35986)"
+	@rebar generate target_dir=dev3 overlay_vars=dev3.config
+	@echo "\n\
+Development nodes are built, and can be started using ./rel/dev[123]/bin/couchdb.\n\
+Once the nodes are started, they must be joined together by editing the local\n\
+nodes DB. For example, executing\n\
+\n\
+    curl localhost:15986/nodes/dev2@127.0.0.1 -X PUT -d '{}'\n\
+    curl localhost:15986/nodes/dev3@127.0.0.1 -X PUT -d '{}'\n\
+\n\
+will cause node 1 to immediately connect to nodes 2 and 3 and form a cluster.\n\
+The content of the nodes database is continuously replicated throughout the\n\
+cluster, so this is a one-time operation.\n"

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/Makefile.am
----------------------------------------------------------------------
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index 1b71e83..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,172 +0,0 @@
-## Licensed under the Apache License, Version 2.0 (the "License"); you may not
-## use this file except in compliance with the License. You may obtain a copy of
-## the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-## License for the specific language governing permissions and limitations under
-## the License.
-
-SUBDIRS = bin etc src share test var utils
-
-ACLOCAL_AMFLAGS = -I m4
-
-localdoc_DATA = \
-    AUTHORS.gz \
-    BUGS.gz \
-    CHANGES.gz \
-    DEVELOPERS.gz \
-    INSTALL.gz \
-    INSTALL.Unix.gz \
-    INSTALL.Windows.gz \
-    LICENSE.gz \
-    NEWS.gz \
-    NOTICE.gz \
-    README.gz \
-    THANKS.gz
-
-DISTCLEANFILES = $(localdoc_DATA)
-
-EXTRA_DIST = \
-    AUTHORS \
-    BUGS \
-    CHANGES \
-    DEVELOPERS \
-    INSTALL \
-    INSTALL.Unix \
-    INSTALL.Windows \
-    LICENSE \
-    NEWS \
-    NOTICE \
-    README \
-    THANKS \
-    build-aux/sphinx-build \
-    build-aux/sphinx-touch \
-    license.skip
-
-AUTHORS.gz: AUTHORS
-	gzip -9 < $< > $@
-
-BUGS.gz: BUGS
-	gzip -9 < $< > $@
-
-CHANGES.gz: CHANGES
-	gzip -9 < $< > $@
-
-DEVELOPERS.gz: DEVELOPERS
-	gzip -9 < $< > $@
-
-INSTALL.gz: INSTALL
-	gzip -9 < $< > $@
-
-INSTALL.Unix.gz: INSTALL.Unix
-	gzip -9 < $< > $@
-
-INSTALL.Windows.gz: INSTALL.Windows
-	gzip -9 < $< > $@
-
-LICENSE.gz: LICENSE
-	gzip -9 < $< > $@
-
-NEWS.gz: NEWS
-	gzip -9 < $< > $@
-
-NOTICE.gz: NOTICE
-	gzip -9 < $< > $@
-
-README.gz: README
-	gzip -9 < $< > $@
-
-THANKS.gz: THANKS
-	gzip -9 < $< > $@
-
-check: dev check-js
-if TESTS
-	$(top_builddir)/test/etap/run $(top_srcdir)/test/etap
-endif
-
-check-js: dev
-if TESTS
-if USE_CURL
-	MAKE=$(MAKE) $(top_builddir)/test/javascript/run
-endif
-endif
-
-check-etap: dev
-if TESTS
-	$(top_builddir)/test/etap/run $(top_srcdir)/test/etap
-endif
-
-cover: dev
-if TESTS
-	rm -f cover/*.coverdata
-	COVER=1 COVER_BIN=./src/couch/ebin $(top_builddir)/test/etap/run
-	SRC=./src/couch/src \
-	    $(ERL) -noshell \
-	    -pa src/etap \
-	    -eval 'etap_report:create()' \
-	    -s init stop > /dev/null 2>&1
-endif
-
-dev: all
-if TESTS
-	@echo "This command is intended for developers to use;"
-	@echo "it creates development ini files as well as a"
-	@echo "$(top_builddir)/tmp structure for development runtime files."
-	@echo "Use ./utils/run to launch CouchDB from the source tree."
-	mkdir -p $(top_builddir)/etc/couchdb/default.d
-	mkdir -p $(top_builddir)/etc/couchdb/local.d
-	mkdir -p $(top_builddir)/tmp/lib
-	mkdir -p $(top_builddir)/tmp/log
-	mkdir -p $(top_builddir)/tmp/run/couchdb
-endif
-
-install-data-hook:
-	@echo
-	@echo "You have installed Apache CouchDB, time to relax."
-
-distclean-local:
-	rm -fr $(top_builddir)/etc/couchdb/default.d
-	rm -fr $(top_builddir)/etc/couchdb/local.d
-	rm -fr $(top_builddir)/tmp
-	rm -f  $(top_builddir)/couchdb.stdout
-	rm -f  $(top_builddir)/couchdb.stderr
-
-.PHONY: local-clean
-local-clean: maintainer-clean
-	@echo "This command is intended for maintainers to use;"
-	@echo "it deletes files that may need special tools to rebuild."
-	rm -f $(top_srcdir)/INSTALL
-	rm -f $(top_srcdir)/acinclude.m4
-	rm -f $(top_srcdir)/aclocal.m4
-	rm -f $(top_srcdir)/config.h.in
-	rm -f $(top_srcdir)/configure
-	rm -f $(top_srcdir)/test/etap/temp.*
-	rm -f $(top_srcdir)/*.tar.gz
-	rm -f $(top_srcdir)/*.tar.gz.*
-	find $(top_srcdir) -name Makefile.in -exec rm -f {} \;
-
-dist-hook:
-	find $(top_srcdir) -type f -name "._*" -exec rm -f {} \;
-	find $(top_builddir) -type f -name "._*" -exec rm -f {} \;
-
-distcheck-hook:
-	$(MAKE) -C bin distcheck-hook
-	$(MAKE) -C src/couch/priv distcheck-hook
-	$(MAKE) -C share/doc/build distcheck-hook
-	grep -rL 'http://www.apache.org/licenses/LICENSE-2.0' * \
-            | grep --include= -vEf license.skip; \
-        test "$$?" -eq 1
-
-.PHONY: distsign
-distsign: distcheck check
-	gpg --armor --detach-sig $(GPG_ARGS) \
-	    < $(top_srcdir)/$(distdir).tar.gz \
-	    > $(top_srcdir)/$(distdir).tar.gz.asc
-	md5sum $(top_srcdir)/$(distdir).tar.gz \
-	    > $(top_srcdir)/$(distdir).tar.gz.md5
-	sha1sum $(top_srcdir)/$(distdir).tar.gz \
-	    > $(top_srcdir)/$(distdir).tar.gz.sha

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/bin/Makefile.am
----------------------------------------------------------------------
diff --git a/bin/Makefile.am b/bin/Makefile.am
deleted file mode 100644
index 95471ea..0000000
--- a/bin/Makefile.am
+++ /dev/null
@@ -1,154 +0,0 @@
-## Licensed under the Apache License, Version 2.0 (the "License"); you may not
-## use this file except in compliance with the License. You may obtain a copy of
-## the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-## License for the specific language governing permissions and limitations under
-## the License.
-
-MAKE_SAFE = $(MAKE)
-
-if WINDOWS
-bin_SCRIPTS = couchdb.bat
-else
-bin_SCRIPTS = couchdb couch-config
-endif
-
-man1dir = $(mandir)/man1
-
-noinst_SCRIPTS = couchjs_dev couch-config_dev
-
-man_file = couchdb.1
-
-if BUILD_MAN
-man_file_build = $(man_file)
-else
-man_file_build =
-endif
-
-BUILT_SOURCES = $(man_file_build)
-
-EXTRA_DIST = $(man_file_build)
-
-CLEANFILES = $(bin_SCRIPTS) $(man_file_build) $(noinst_SCRIPTS)
-
-transform = @program_transform_name@
-couchdb_command_name = `echo couchdb | sed '$(transform)'`
-couchjs_command_name = `echo couchjs | sed '$(transform)'`
-
-couchdb: couchdb.tpl
-	sed -e "s|%ERL%|$(ERL)|g" \
-	    -e "s|%ICU_CONFIG%|$(ICU_CONFIG)|g" \
-	    -e "s|%bindir%|@bindir@|g" \
-	    -e "s|%localerlanglibdir%|@localerlanglibdir@|g" \
-	    -e "s|%defaultini%|default.ini|g" \
-	    -e "s|%localini%|local.ini|g" \
-	    -e "s|%localconfdir%|@localconfdir@|g" \
-	    -e "s|%localstatelogdir%|@localstatelogdir@|g" \
-	    -e "s|%localstatelibdir%|@localstatelibdir@|g" \
-	    -e "s|%localstatedir%|@localstatedir@|g" \
-	    -e "s|%bug_uri%|@bug_uri@|g" \
-	    -e "s|%package_author_address%|@package_author_address@|g" \
-	    -e "s|%package_author_name%|@package_author_name@|g" \
-	    -e "s|%package_name%|@package_name@|g" \
-	    -e "s|%version%|@version@|g" \
-	    -e "s|%couchdb_command_name%|$(couchdb_command_name)|g" > \
-	$@ < $<
-	chmod +x $@
-
-if !WINDOWS
-install-exec-hook:
-	$(LN_S) -f "$(locallibbindir)/$(couchjs_command_name)" \
-		"$(DESTDIR)$(bindir)/$(couchjs_command_name)"
-endif
-
-couchjs_dev:
-	$(LN_S) -f "$(abs_top_builddir)/src/couch/priv/couchjs" "$@"
-
-couchdb.bat: couchdb.bat.tpl
-	sed -e "s|%ICU_CONFIG%|$(ICU_CONFIG)|g" \
-	    -e "s|%version%|@version@|g" \
-	$< > $@
-
-couch-config: couch-config.tpl
-	sed -e "s|%ERL%|$(ERL)|g" \
-	    -e "s|%bindir%|@bindir@|g" \
-	    -e "s|%localerlanglibdir%|@localerlanglibdir@|g" \
-	    -e "s|%localconfdir%|@localconfdir@|g" \
-	    -e "s|%localdatadir%|$(localdatadir)|g" \
-	    -e "s|%localbuilddatadir%|$(localdatadir)|g" \
-	    -e "s|%localstatelogdir%|@localstatelogdir@|g" \
-	    -e "s|%localstatelibdir%|@localstatelibdir@|g" \
-	    -e "s|%localstatedir%|@localstatedir@|g" \
-	    -e "s|%localstaterundir%|@localstaterundir@|g" \
-	    -e "s|%couchlibdir%|@localerlanglibdir@/couch-%version%|g"\
-	    -e "s|%couchincludedir%|@localerlanglibdir@/include|g"\
-	    -e "s|%couchebindir%|@localerlanglibdir@/ebin|g"\
-	    -e "s|%couchprivlibdir%|@localerlanglibdir@/couch-%version%/priv/lib|g"\
-	    -e "s|%bug_uri%|@bug_uri@|g" \
-	    -e "s|%package_author_address%|@package_author_address@|g" \
-	    -e "s|%package_author_name%|@package_author_name@|g" \
-	    -e "s|%package_name%|@package_name@|g" \
-	    -e "s|%version%|@version@|g" \
-	    -e "s|%couchdb_command_name%|$(couchdb_command_name)|g" > \
-	$@ < $<
-	chmod +x $@
-
-couch-config_dev: couch-config.tpl
-	sed -e "s|%ERL%|$(ERL)|g" \
-	    -e "s|%bindir%|$(abs_top_builddir)/bin|g" \
-	    -e "s|%localerlanglibdir%|$(abs_top_builddir)\/src\/couchdb|g" \
-	    -e "s|%couchlibdir%|$(abs_top_builddir)\/src\/couchdb|g"\
-	    -e "s|%couchincludedir%|$(abs_top_builddir)\/src\/couchdb|g"\
-	    -e "s|%couchebindir%|$(abs_top_builddir)\/src\/couchdb|g"\
-	    -e "s|%couchprivlibdir%|$(abs_top_builddir)/src/couchdb/priv/.libs|g"\
-	    -e "s|%localdatadir%|$(abs_top_srcdir)/share|g" \
-	    -e "s|%localbuilddatadir%|$(abs_top_builddir)/share|g" \
-	    -e "s|%localstatelibdir%|$(abs_top_builddir)/tmp/lib|g" \
-	    -e "s|%localstatelogdir%|$(abs_top_builddir)/tmp/log|g" \
-	    -e "s|%localstatedir%|$(abs_top_builddir)/tmp|g" \
-	    -e "s|%localstaterundir%|$(abs_top_builddir)/tmp/run|g" \
-	    -e "s|%bug_uri%|@bug_uri@|g" \
-	    -e "s|%package_author_address%|@package_author_address@|g" \
-	    -e "s|%package_author_name%|@package_author_name@|g" \
-	    -e "s|%package_name%|@package_name@|g" \
-	    -e "s|%version%|@version@|g" \
-	    -e "s|%couchdb_command_name%|$(abs_top_builddir)/utils/run|g" > \
-	$@ < $<
-	chmod +x $@
-
-# Depend on source files so distributed man pages are not rebuilt for end user.
-
-$(man_file): couchdb.tpl.in
-	$(MAKE_SAFE) -f Makefile couchdb; \
-	$(top_srcdir)/build-aux/missing --run \
-	    help2man \
-	        --no-info \
-	        --help-option="-h" \
-	        --version-option="-V" \
-	        --name="$(package_name) database server" \
-	        ./couchdb --output $@
-
-install-data-local:
-	if test -s $(man_file); then \
-	    if test `cat $(man_file) | wc -l` -gt 1; then \
-	        $(INSTALL) -d $(DESTDIR)$(man1dir); \
-	        $(INSTALL_DATA) $(man_file) $(DESTDIR)$(man1dir)/$(man_file); \
-	    fi \
-	fi
-
-uninstall-local:
-	rm -f $(DESTDIR)$(man1dir)/$(man_file)
-
-distcheck-hook:
-	if test ! -s $(man_file); then \
-	    $(top_srcdir)/build-aux/dist-error $(man_file); \
-	else \
-	    if test ! `cat $(man_file) | wc -l` -gt 1; then \
-	        $(top_srcdir)/build-aux/dist-error $(man_file); \
-	    fi \
-	fi

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/bootstrap
----------------------------------------------------------------------
diff --git a/bootstrap b/bootstrap
deleted file mode 100755
index 021275b..0000000
--- a/bootstrap
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/bin/sh -e
-
-# Licensed under the Apache License, Version 2.0 (the "License"); you may not
-# use this file except in compliance with the License. You may obtain a copy of
-# the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations under
-# the License.
-
-cd `dirname $0`
-
-get () {
-    variable_name=$1
-    echo "changequote(\`[', \`]')" > acinclude.m4.tmp
-    sed -e "s/m4_//" < acinclude.m4.in >> acinclude.m4.tmp
-    echo $variable_name >> acinclude.m4.tmp
-    if test -x "`which gm4 2> /dev/null || true`"; then
-        gm4 acinclude.m4.tmp | grep -v "^$" || true
-    else
-        if test -x "`which m4 2> /dev/null || true`"; then
-            m4 acinclude.m4.tmp | grep -v "^$" || true
-        else
-            echo unknown
-        fi
-    fi
-    rm -f acinclude.m4.tmp
-}
-
-if test -z "$REVISION"; then
-    if test -e .git; then
-        REVISION=`git describe --always`-git
-    fi
-fi
-
-if test -z "`get LOCAL_VERSION_STAGE`" -o -z "$REVISION"; then
-    sed "s/%release%//" < acinclude.m4.in > acinclude.m4
-else
-    sed "s/%release%/$REVISION/" < acinclude.m4.in > acinclude.m4
-fi
-
-if test -e .git; then
-    OS=`uname -s`
-    case "$OS" in
-    Linux|CYGWIN*) # GNU sed
-        SED_ERE_FLAG=-r
-    ;;
-    *) # BSD sed
-        SED_ERE_FLAG=-E
-    ;;
-    esac
-
-    sed -e "/^#.*/d" THANKS.in > THANKS
-    CONTRIB_EMAIL_SED_COMMAND="s/^[[:blank:]]{5}[[:digit:]]+[[:blank:]]/ * /"
-    git shortlog -se 6c976bd..HEAD \
-        | grep -v @apache.org \
-        | sed $SED_ERE_FLAG -e "$CONTRIB_EMAIL_SED_COMMAND" >> THANKS
-    echo "" >> THANKS # simplest portable newline
-    echo "For a list of authors see the \`AUTHORS\` file." >> THANKS
-fi
-
-find_program() {
-  set +e
-  for f in "$@"
-  do
-    file=`which ${f} 2>/dev/null | grep -v '^no '`
-    if test -n "x${file}" -a -x "${file}"
-    then
-      echo ${file}
-      set -e
-      exit 0
-    fi
-  done
-
-  echo "Unable to find any variant: $@" 1>&2
-  echo 1>&2
-  echo "Have you installed a version of this package?" 1>&2
-  set -e
-  exit 1
-}
-
-LIBTOOLIZE=`find_program glibtoolize libtoolize`
-ACLOCAL=`find_program aclocal-1.11 aclocal-1.10 aclocal-1.9 aclocal`
-AUTOHEADER=`find_program autoheader`
-AUTOMAKE=`find_program automake-1.11 automake-1.10 automake-1.9 automake`
-AUTOCONF=`find_program autoconf`
-
-get_aclocal_dir_list () {
-    aclocal_dir=`$ACLOCAL --print-ac-dir`
-    echo $aclocal_dir
-    aclocal_dirlist="$aclocal_dir/dirlist"
-    if test -e $aclocal_dirlist; then
-        cat $aclocal_dirlist | while read dir; do
-            if test -d "$dir"; then
-                echo $dir
-            fi
-        done
-    fi
-}
-
-aclocal_dir_list=`get_aclocal_dir_list`
-
-if test -z "`find $aclocal_dir_list -name ax_check_icu.m4`"; then
-    echo "Unable to find the \`ax_check_icu.m4' file."
-    echo
-    echo "Have you installed GNU Autoconf Archive?"
-    exit 1
-fi
-
-if test -z "`find $aclocal_dir_list -name ax_lib_curl.m4`"; then
-    echo "Unable to find the \`ax_check_icu.m4' file."
-    echo
-    echo "Have you installed GNU Autoconf Archive?"
-    exit 1
-fi
-
-if test -z "`find $aclocal_dir_list -name pkg.m4`"; then
-    echo "Unable to find the \`pkg.m4' file."
-    echo
-    echo "Have you installed pkg-config?"
-    exit 1
-fi
-
-
-mkdir -p build-aux
-mkdir -p m4
-
-${LIBTOOLIZE} -f -c --automake
-${ACLOCAL} -I m4 -Wall
-${AUTOHEADER} -f
-${AUTOMAKE} -f -a -Wall
-${AUTOCONF} -f -Wall
-
-rm -f INSTALL
-
-ln -f -s "`dirname \`readlink build-aux/missing\``/INSTALL"
-
-if test ! -s INSTALL; then
-	echo "Broken INSTALL file."
-	exit 1
-fi
-
-cat << EOF
-You have bootstrapped Apache CouchDB, time to relax.
-
-Run \`./configure' to configure the source before you install.
-EOF
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/configure
----------------------------------------------------------------------
diff --git a/configure b/configure
new file mode 100755
index 0000000..4e59ca6
--- /dev/null
+++ b/configure
@@ -0,0 +1,82 @@
+#!/bin/sh
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+PREFIX="/opt/couchdb"
+COUCHDB_USER=`whoami`
+ABSPATH="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"
+if test ! -n "$DIRPATH"; then DIRPATH=`dirname "$ABSPATH"`; fi
+
+while [ $# -gt 0 ]
+do
+  case $1
+  in
+    -p)
+      PREFIX=$2
+      shift 2
+    ;;
+    -t)
+      TEMPLATE=$2
+      shift 2
+    ;;
+    -d)
+      DATA=$2
+      shift 2
+    ;;
+    -v)
+      VIEW=$2
+      shift 2
+    ;;
+    -u)
+      COUCHDB_USER=$2
+      shift 2
+    ;;
+    *)
+      echo "usage: $0 [-p {prefix} -t {template} -d {data_dir} -v {view_dir} -u {user}]"
+      exit
+    ;;
+  esac
+done
+
+if test ! -n "$DATA"; then DATA="$PREFIX/var/lib"; fi
+if test ! -n "$VIEW"; then VIEW="$PREFIX/var/lib"; fi
+
+echo "==> configuring couchdb in rel/couchdb.config"
+cat > rel/couchdb.config << EOF
+{prefix, "$PREFIX"}.
+{data_dir, "$DATA"}.
+{view_dir, "$VIEW"}.
+{user, "$COUCHDB_USER"}.
+{node_name, "-name couchdb"}.
+{cluster_port, 5984}.
+{backend_port, 5986}.
+EOF
+
+cat > install.mk << EOF
+# The contents of this file are auto-generated by configure
+prefix = $PREFIX
+data_dir = $DATA
+view_dir = $VIEW
+user = $COUCHDB_USER
+EOF
+
+# finally, a few config files for local development nodes
+for i in 1 2 3; do
+cat > rel/dev$i.config << EOF
+{prefix, "$DIRPATH/rel/dev$i"}.
+{data_dir, "$DIRPATH/rel/tmpdata/dev$i"}.
+{view_dir, "$DIRPATH/rel/tmpdata/dev$i"}.
+{node_name, "-name dev$i@127.0.0.1"}.
+{cluster_port, `expr 10000 \* $i + 5984`}.
+{backend_port, `expr 10000 \* $i + 5986`}.
+EOF
+done

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index 4a8edf6..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,789 +0,0 @@
-dnl Licensed under the Apache License, Version 2.0 (the "License"); you may not
-dnl use this file except in compliance with the License.  dnl You may obtain a
-dnl copy of the License at
-dnl
-dnl   http://www.apache.org/licenses/LICENSE-2.0
-dnl
-dnl Unless required by applicable law or agreed to in writing, software
-dnl distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-dnl WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-dnl License for the specific language governing permissions and limitations
-dnl under the License.
-
-AC_INIT(
-    [LOCAL_PACKAGE_NAME],
-    [LOCAL_VERSION],
-    [LOCAL_BUG_URI],
-    [LOCAL_PACKAGE_TARNAME])
-
-AC_PREREQ([2.68])
-
-AC_CONFIG_SRCDIR([CHANGES])
-AC_CONFIG_AUX_DIR([build-aux])
-AC_CONFIG_MACRO_DIR([m4])
-
-AC_CONFIG_HEADERS([config.h])
-AC_CONFIG_HEADERS([src/snappy/c_src/google-snappy/config.h])
-
-AM_INIT_AUTOMAKE([1.6.3 foreign])
-
-AC_USE_SYSTEM_EXTENSIONS
-AC_ENABLE_SHARED
-AC_DISABLE_STATIC
-
-AC_PROG_CC
-LT_INIT([win32-dll])
-LT_INIT
-AC_PROG_LN_S
-
-PKG_PROG_PKG_CONFIG
-
-dnl Config for google snappy
-m4_define([snappy_major], [1])
-m4_define([snappy_minor], [0])
-m4_define([snappy_patchlevel], [3])
-
-AC_PROG_CXX
-AC_LANG([C++])
-AC_C_BIGENDIAN
-AC_CHECK_HEADERS([stdint.h stddef.h sys/mman.h sys/resource.h])
-AC_CHECK_FUNC([mmap])
-
-AC_MSG_CHECKING([if the compiler supports __builtin_expect])
-
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
-    return __builtin_expect(1, 1) ? 1 : 0
-]])],[
-    snappy_have_builtin_expect=yes
-    AC_MSG_RESULT([yes])
-],[
-    snappy_have_builtin_expect=no
-    AC_MSG_RESULT([no])
-])
-
-if test x$snappy_have_builtin_expect = xyes ; then
-    AC_DEFINE([HAVE_BUILTIN_EXPECT], [1],
-        [Define to 1 if the compiler supports __builtin_expect.])
-fi
-
-AC_MSG_CHECKING([if the compiler supports __builtin_ctzll])
-
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
-    return (__builtin_ctzll(0x100000000LL) == 32) ? 1 : 0
-]])],[
-    snappy_have_builtin_ctz=yes
-    AC_MSG_RESULT([yes])
-],[
-    snappy_have_builtin_ctz=no
-    AC_MSG_RESULT([no])
-])
-
-if test x$snappy_have_builtin_ctz = xyes ; then
-    AC_DEFINE([HAVE_BUILTIN_CTZ], [1],
-        [Define to 1 if the compiler supports __builtin_ctz and friends.])
-fi
-
-if test "$ac_cv_header_stdint_h" = "yes"; then
-    AC_SUBST([ac_cv_have_stdint_h], [1])
-else
-    AC_SUBST([ac_cv_have_stdint_h], [0])
-fi
-if test "$ac_cv_header_stddef_h" = "yes"; then
-    AC_SUBST([ac_cv_have_stddef_h], [1])
-else
-    AC_SUBST([ac_cv_have_stddef_h], [0])
-fi
-
-SNAPPY_MAJOR="snappy_major"
-SNAPPY_MINOR="snappy_minor"
-SNAPPY_PATCHLEVEL="snappy_patchlevel"
-
-AC_SUBST([SNAPPY_MAJOR])
-AC_SUBST([SNAPPY_MINOR])
-AC_SUBST([SNAPPY_PATCHLEVEL])
-
-AC_MSG_CHECKING([for pthread_create in -lpthread])
-
-original_LIBS="$LIBS"
-LIBS="-lpthread $original_LIBS"
-
-AC_LINK_IFELSE([
-    AC_LANG_PROGRAM(
-        [[#include<pthread.h>]],
-        [[pthread_create((void *)0, (void *)0, (void *)0, (void *)0)]])],
-        [pthread=yes],
-        [pthread=no])
-
-if test x${pthread} = xyes; then
-    AC_MSG_RESULT([yes])
-else
-    LIBS="$original_LIBS"
-    AC_MSG_RESULT([no])
-fi
-
-AC_PATH_PROG([ERL], [erl])
-
-AS_IF([test x${ERL} = x], [
-    AC_MSG_ERROR([Could not find the `erl' executable. Is Erlang installed?])
-])
-
-AC_ARG_WITH([erlang], 
-    [AS_HELP_STRING([--with-erlang=PATH],
-        [set PATH to the Erlang include directory])
-], [
-    ERLANG_FLAGS="-I$withval"
-], [
-    realerl=`readlink -f $ERL 2>/dev/null`
-    AS_IF([test $? -eq 0], [
-        erlbase=`dirname $realerl`
-        erlbase=`dirname $erlbase`
-        ERLANG_FLAGS="-I${erlbase}/usr/include"
-    ], [
-        # Failed to figure out where erl is installed..
-        # try to add some default directories to search
-        ERLANG_FLAGS="-I${libdir}/erlang/usr/include"
-        ERLANG_FLAGS="$ERLANG_FLAGS -I/usr/lib/erlang/usr/include"
-        ERLANG_FLAGS="$ERLANG_FLAGS -I/usr/local/lib/erlang/usr/include"
-        ERLANG_FLAGS="$ERLANG_FLAGS -I/opt/local/lib/erlang/usr/include"
-    ])
-])
-
-AC_SUBST(ERLANG_FLAGS)
-
-PKG_CHECK_MODULES([JS], [mozjs185], [
-    JS_LIB_DIR="$(${PKG_CONFIG} --variable=libdir mozjs185)"
-], [
-    PKG_CHECK_MODULES([JS], [mozilla-js >= 1.7], [
-        JS_LIB_DIR="$(${PKG_CONFIG} --variable=sdkdir mozilla-js)/lib"
-    ], [
-        JS_LIB_DIR="${libdir}"
-        JS_CFLAGS="-I/usr/include"
-        JS_CFLAGS="$JS_CFLAGS -I/usr/include/js"
-        JS_CFLAGS="$JS_CFLAGS -I/usr/include/mozjs"
-        JS_CFLAGS="$JS_CFLAGS -I/usr/local/include/js"
-        JS_CFLAGS="$JS_CFLAGS -I/opt/local/include/js"
-    ])
-])
-
-AC_ARG_WITH([js-include],
-    [AS_HELP_STRING([--with-js-include=PATH],
-        [set PATH to the SpiderMonkey include directory])
-], [
-    JS_INCLUDE="$withval"
-    JS_CFLAGS="-I$JS_INCLUDE"
-], [])
-
-AC_ARG_WITH([js-lib],
-    [AS_HELP_STRING([--with-js-lib=PATH],
-        [set PATH to the SpiderMonkey library directory])
-], [
-    JS_LIB_DIR=$withval
-    JS_LIBS="-L$withval"
-], [])
-
-use_js_trunk=no
-
-AC_ARG_ENABLE([js-trunk],
-    [AS_HELP_STRING([--enable-js-trunk],
-        [allow use of SpiderMonkey versions newer than js185-1.0.0])
-], [
-    use_js_trunk=$enableval
-], [])
-
-AC_ARG_VAR([ERLC_FLAGS], [general flags to prepend to ERLC_FLAGS])
-AC_ARG_VAR([FLAGS], [general flags to prepend to LDFLAGS and CPPFLAGS])
-
-AS_CASE([$(uname -s)], [CYGWIN*], [] , [*], [
-    CPPFLAGS="$CPPFLAGS -I/opt/local/include"
-    CPPFLAGS="$CPPFLAGS -I/opt/local/include/js"
-    CPPFLAGS="$CPPFLAGS -I/usr/local/include"
-    CPPFLAGS="$CPPFLAGS -I/usr/local/include/js"
-    CPPFLAGS="$CPPFLAGS -I/usr/include"
-    CPPFLAGS="$CPPFLAGS -I/usr/include/js"
-    LDFLAGS="$LDFLAGS -L/opt/local/lib"
-    LDFLAGS="$LDFLAGS -L/usr/local/lib"
-])
-
-CPPFLAGS="$CPPFLAGS $FLAGS"
-LDFLAGS="$LDFLAGS $FLAGS"
-
-# The erlang cc.sh/ld.sh scripts will convert a -O option
-# into the same optimization flags erlang itself uses.
-CFLAGS="-O2 $CFLAGS"
-
-LIBS="$LIBS $LDFLAGS"
-
-AS_CASE([$(uname -s)], [CYGWIN*], [
-    JS_CFLAGS="-DXP_WIN $JS_CFLAGS"
-    IS_WINDOWS="TRUE"
-], [*], [
-    # XP_UNIX required for jsapi.h, tested on Linux and Darwin.
-    JS_CFLAGS="-DXP_UNIX $JS_CFLAGS"
-])
-
-AM_CONDITIONAL([WINDOWS], [test x$IS_WINDOWS = xTRUE])
-
-OLD_LIBS="$LIBS"
-LIBS="$JS_LIBS $LIBS"
-
-OLD_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$JS_CFLAGS $CPPFLAGS"
-
-AC_CHECK_HEADER([jsapi.h], [], [
-    AC_CHECK_HEADER([js/jsapi.h], [
-        CPPFLAGS="$CPPFLAGS -I$JS_INCLUDE/js"
-    ], [
-        AC_MSG_ERROR([Could not find the jsapi header.
-
-Are the Mozilla SpiderMonkey headers installed?])
-    ])
-])
-
-AC_CHECK_LIB([mozjs185], [JS_NewContext], [JS_LIB_BASE=mozjs185], [
-    AC_CHECK_LIB([mozjs185-1.0], [JS_NewContext], [JS_LIB_BASE=mozjs185-1.0], [
-        AC_CHECK_LIB([mozjs], [JS_NewContext], [JS_LIB_BASE=mozjs], [
-            AC_CHECK_LIB([js], [JS_NewContext], [JS_LIB_BASE=js], [
-                AC_CHECK_LIB([js3250], [JS_NewContext], [JS_LIB_BASE=js3250], [
-                    AC_CHECK_LIB([js32], [JS_NewContext], [JS_LIB_BASE=js32], [
-                        AC_MSG_ERROR([Could not find the js library.
-
-Is the Mozilla SpiderMonkey library installed?])
-                    ])
-                ])
-            ])
-        ])
-    ])
-])
-
-# Figure out what version of SpiderMonkey to use
-
-AC_CHECK_LIB([$JS_LIB_BASE], [JS_NewCompartmentAndGlobalObject],
-    # Prevent people from accidentally using SpiderMonkey's that are too new
-    if test "$use_js_trunk" = "no"; then
-        AC_CHECK_DECL([JSOPTION_ANONFUNFIX], [], [
-            AC_MSG_ERROR([Your SpiderMonkey library is too new.
-
-Versions of SpiderMonkey after the js185-1.0.0 release remove the optional
-enforcement of preventing anonymous functions in a statement context. This
-will most likely break your existing JavaScript code as well as render all
-example code invalid.
-
-If you wish to ignore this error pass --enable-js-trunk to ./configure.])
-        ], [
-            [#include <jsapi.h>]
-        ])
-    fi
-    AC_DEFINE([SM185], [1], [Use SpiderMonkey 1.8.5])
-)
-
-AC_CHECK_LIB([$JS_LIB_BASE], [JS_ThrowStopIteration],
-    AC_DEFINE([SM180], [1],
-        [Use SpiderMonkey 1.8.0])
-)
-
-AC_CHECK_LIB([$JS_LIB_BASE], [JS_GetStringCharsAndLength],
-    AC_DEFINE([HAVE_JS_GET_STRING_CHARS_AND_LENGTH], [1],
-        [Use newer JS_GetCharsAndLength function.])
-)
-
-# Else, hope that 1.7.0 works
-
-# Deal with JSScript to JSObject to JSScript switcheroo
-
-AC_CHECK_TYPE([JSScript*],
-    [AC_DEFINE([JSSCRIPT_TYPE], [JSScript*], [Use JSObject* for scripts])],
-    [AC_DEFINE([JSSCRIPT_TYPE], [JSObject*], [Use JSScript* for scripts])],
-    [[#include <jsapi.h>]]
-)
-
-AC_DEFINE([COUCHJS_NAME], ["couchjs"], ["CouchJS executable name."])
-
-if test x${IS_WINDOWS} = xTRUE; then
-    AC_DEFINE([COUCHJS_NAME], ["couchjs.exe"], ["CouchJS executable name."])
-    if test -f "$JS_LIB_DIR/$JS_LIB_BASE.dll"; then
-        # seamonkey 1.7- build layout on Windows
-        JS_LIB_BINARY="$JS_LIB_DIR/$JS_LIB_BASE.dll"
-    else
-        # seamonkey 1.8+ build layout on Windows
-        if test -f "$JS_LIB_DIR/../bin/$JS_LIB_BASE.dll"; then
-            JS_LIB_BINARY="$JS_LIB_DIR/../bin/$JS_LIB_BASE.dll"
-        else
-        AC_MSG_ERROR([Could not find $JS_LIB_BASE.dll.])
-        fi
-    fi
-    AC_SUBST(JS_LIB_BINARY)
-    # On windows we need to know the path to the openssl binaries.
-    AC_ARG_WITH([openssl-bin-dir],
-        [AS_HELP_STRING([--with-openssl-bin-dir=PATH],
-            [path to the open ssl binaries for distribution on Windows])
-    ], [
-        openssl_bin_dir=`cygpath -m "$withval"`
-        AC_SUBST(openssl_bin_dir)
-    ], [])
-    # Windows uses Inno setup - look for its compiler.
-    AC_PATH_PROG([INNO_COMPILER_EXECUTABLE], [iscc])
-    if test x${INNO_COMPILER_EXECUTABLE} = x; then
-        AC_MSG_WARN([You will be unable to build the Windows installer.])
-    fi
-    # We need the msvc redistributables for this platform too
-    # (in theory we could just install the assembly locally - but
-    # there are at least 4 directories with binaries, meaning 4 copies;
-    # so using the redist .exe means it ends up installed globally...)
-    AC_ARG_WITH([msvc-redist-dir],
-        [AS_HELP_STRING([--with-msvc-redist-dir=PATH],
-            [path to the msvc redistributables for the Windows platform])
-    ], [
-        msvc_redist_dir=`cygpath -m "$withval"`
-        msvc_redist_name="vcredist_x86.exe"
-        AC_SUBST(msvc_redist_dir)
-        AC_SUBST(msvc_redist_name)
-    ], [])
-    if test ! -f ${msvc_redist_dir}/${msvc_redist_name}; then
-        AC_MSG_WARN([Installer may fail due to missing MSVC redistributable.])
-    fi
-fi
-
-JS_LIBS="-l$JS_LIB_BASE -lm $JS_LIBS"
-
-AC_SUBST(JS_LIBS)
-
-LIBS="$OLD_LIBS"
-CPPFLAGS="$OLD_CPPFLAGS"
-
-AC_ARG_WITH([win32-icu-binaries],
-    [AS_HELP_STRING([--with-win32-icu-binaries=PATH],
-        [set PATH to the Win32 native ICU binaries directory])
-], [
-    ICU_CPPFLAGS="-I$withval/include"
-    ICU_LIBS="-L$withval/lib -licuuc -licudt -licuin"
-    ICU_BIN=$withval/bin
-], [
-    AX_CHECK_ICU([3.4.1])
-    ICU_BIN=
-])
-
-AC_SUBST(ICU_CFLAGS)
-AC_SUBST(ICU_CPPFLAGS)
-AC_SUBST(ICU_LIBS)
-AC_SUBST(ICU_BIN)
-
-use_curl=yes
-
-AC_ARG_WITH([win32-curl],
-    [AS_HELP_STRING([--with-win32-curl=PATH],
-        [set PATH to the Win32 native curl directory])
-], [
-    # default build on windows is a static lib, and that's what we want too
-    CURL_CFLAGS="-I$withval/include -DCURL_STATICLIB"
-    CURL_LIBS="-L$withval/lib -llibcurl -lWs2_32 -lkernel32 -luser32 -ladvapi32 -lWldap32"
-    # OpenSSL libraries may be pulled in via libcurl if it was built with SSL
-    # these are libeay32 ssleay32 instead of crypto ssl on unix
-], [
-    AX_LIB_CURL([7.18.0],[
-        AC_DEFINE([HAVE_CURL], [1], ["Provide HTTP support to couchjs"])
-    ],[
-        AC_MSG_WARN([You will be unable to run some JavaScript unit tests.])
-        use_curl=no
-        CURL_LIBS=
-    ])
-])
-
-AC_SUBST(CURL_CFLAGS)
-AC_SUBST(CURL_LIBS)
-
-case "$(uname -s)" in
-  Linux)
-    LIBS="$LIBS -lcrypt"
-    CPPFLAGS="-D_XOPEN_SOURCE $CPPFLAGS"
-    ;;
-  FreeBSD)
-    LIBS="$LIBS -lcrypt"
-    ;;
-  OpenBSD)
-    LIBS="$LIBS -lcrypto"
-  ;;
-esac
-
-
-erlang_version_error="The installed Erlang version is less than 5.7.4 (R13B04)."
-
-version="`${ERL} -version 2>&1 | ${SED} 's/[[^0-9]]/ /g'`"
-
-if test `echo $version | ${AWK} "{print \\$1}"` -lt 5; then
-    AC_MSG_ERROR([$erlang_version_error])
-fi
-
-if test `echo $version | ${AWK} "{print \\$2}"` -lt 7; then
-    AC_MSG_ERROR([$erlang_version_error])
-fi
-
-if test `echo $version | ${AWK} "{print \\$2}"` -eq 7; then
-    if test `echo $version | ${AWK} "{print \\$3}"` -lt 4; then
-        AC_MSG_ERROR([$erlang_version_error])
-    fi
-fi
-
-otp_release="`\
-    ${ERL} -noshell \
-    -eval 'io:put_chars(erlang:system_info(otp_release)).' \
-    -s erlang halt`"
-
-AC_SUBST(otp_release)
-
-AM_CONDITIONAL([USE_OTP_NIFS], [test x$otp_release \> xR13B03])
-AM_CONDITIONAL([USE_EJSON_COMPARE_NIF], [test x$otp_release \> xR14B03])
-
-has_crypto=`\
-    ${ERL} -eval "\
-        case application:load(crypto) of ok -> ok; _ -> exit(no_crypto) end. \
-    " -noshell -s init stop`
-
-if test -n "$has_crypto"; then
-    AC_MSG_ERROR([Could not find the Erlang crypto library.
-    
-Has Erlang been compiled with OpenSSL support?])
-fi
-
-AC_PATH_PROG([ERLC], [erlc])
-
-if test x${ERLC} = x; then
-    AC_MSG_ERROR([Could not find the `erlc' executable.
-    
-Is Erlang installed?])
-fi
-
-OLD_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$ERLANG_FLAGS $CPPFLAGS"
-
-AC_CHECK_HEADER([erl_driver.h], [], [
-    AC_MSG_ERROR([Could not find the `erl_driver.h' header.
-
-Are the Erlang headers installed?
-
-Use the `--with-erlang' option to specify the Erlang include directory.])
-])
-
-CPPFLAGS="$OLD_CPPFLAGS"
-
-use_init=yes
-use_launchd=yes
-native_mochijson_enabled=no
-tests_enabled=yes
-docs_enabled=yes
-strictness_enabled=no
-
-AC_ARG_ENABLE([init], 
-    [AS_HELP_STRING([--disable-init],
-        [don't install init script where applicable])
-], [
-    use_init=$enableval
-], [])
-
-AC_ARG_ENABLE([launchd], 
-    [AS_HELP_STRING([--disable-launchd],
-        [don't install launchd configuration where applicable])
-], [
-    use_launchd=$enableval
-], [])
-
-AC_ARG_ENABLE([native-mochijson], 
-    [AS_HELP_STRING([--enable-native-mochijson],
-        [compile mochijson to native code (EXPERIMENTAL)])
-], [
-    native_mochijson_enabled=$enableval
-], [])
-
-AC_ARG_ENABLE([tests], 
-    [AS_HELP_STRING([--disable-tests],
-        [skip tests during build])
-], [
-    tests_enabled=$enableval
-], [])
-
-AC_ARG_ENABLE([docs], 
-    [AS_HELP_STRING([--disable-docs],
-        [skip docs during build])
-], [
-    docs_enabled=$enableval
-], [])
-
-AC_ARG_ENABLE([strictness],
-    [AS_HELP_STRING([--enable-strictness],
-        [exit when optional checks fail])
-], [
-    strictness_enabled=$enableval
-], [])
-
-init_enabled=false
-launchd_enabled=false
-
-if test "$use_init" = "yes"; then
-   AC_MSG_CHECKING(location of init directory)
-   if test -d /etc/rc.d; then
-       init_enabled=true
-       AC_SUBST([initdir], ['${sysconfdir}/rc.d'])
-       AC_MSG_RESULT(${initdir})
-   else
-       if test -d /etc/init.d; then
-           init_enabled=true
-           AC_SUBST([initdir], ['${sysconfdir}/init.d'])
-           AC_MSG_RESULT(${initdir})
-       else
-           AC_MSG_RESULT(not found)
-       fi
-    fi
-fi
-
-if test "$use_launchd" = "yes"; then
-    AC_MSG_CHECKING(location of launchd directory)
-    if test -d /Library/LaunchDaemons; then
-        init_enabled=false
-        launchd_enabled=true
-        AC_SUBST([launchddir], ['${prefix}/Library/LaunchDaemons'])
-        AC_MSG_RESULT(${launchddir})
-    else
-        AC_MSG_RESULT(not found)
-    fi
-fi
-
-AC_CHECK_PROG([HAS_HELP2MAN], [help2man], [yes])
-
-if test x${HAS_HELP2MAN} = x; then
-    if test x${strictness_enabled} = xyes; then
-        AC_MSG_ERROR([Could not find the `help2man' executable.])
-    else
-        AC_MSG_WARN([You will be unable to regenerate man pages.])
-    fi
-fi
-
-AC_CHECK_PROG([HAS_PDFLATEX], [pdflatex], [yes])
-
-if test x${HAS_PDFLATEX} = x; then
-    if test x${strictness_enabled} = xyes; then
-        AC_MSG_ERROR([Could not find the `pdflatex' executable.
-    
-Is LaTeX installed?])
-    else
-        AC_MSG_WARN([You will be unable to regenerate PDF documentation.])
-    fi
-fi
-
-AC_CHECK_PROG([HAS_MAKEINFO], [makeinfo], [yes])
-
-if test x${HAS_MAKEINFO} = x; then
-    if test x${strictness_enabled} = xyes; then
-        AC_MSG_ERROR([Could not find the `makeinfo' executable.
-    
-Is GNU Texinfo installed?])
-    else
-        AC_MSG_WARN([You will be unable to regenerate info documentation.])
-    fi
-fi
-
-AC_CHECK_PROG([HAS_INSTALLINFO], [install-info], [yes])
-
-if test x${HAS_INSTALLINFO} = x; then
-    if test x${strictness_enabled} = xyes; then
-        AC_MSG_ERROR([Could not find the `install-info' executable.
-    
-Is GNU Texinfo installed?])
-    else
-        AC_MSG_WARN([You will be unable to install info documentation.])
-    fi
-fi
-
-AC_CHECK_PROG([HAS_SPHINX_BUILD], [sphinx-build], [yes])
-
-if test x${HAS_SPHINX_BUILD} = x; then
-    if test x${strictness_enabled} = xyes; then
-        AC_MSG_ERROR([Could not find the `sphinx-build' executable.])
-    else
-        AC_MSG_WARN([You will be unable to regenerate documentation.])
-    fi
-fi
-
-if test x${docs_enabled} = xyes; then
-    if test x${HAS_HELP2MAN} = xyes; then
-        build_man=yes
-    fi
-    if test x${HAS_SPHINX_BUILD} = xyes; then
-        build_html=yes
-        if test x${HAS_MAKEINFO} = xyes; then
-            build_info=yes
-        fi    
-        if test x${HAS_PDFLATEX} = xyes; then
-            build_pdf=yes
-        fi
-    fi
-fi
-
-if test x${strictness_enabled} = xyes; then
-    AX_PYTHON_MODULE([pygments], [fatal])
-else
-    AX_PYTHON_MODULE([pygments])
-fi
-
-AC_MSG_CHECKING(pygments version >= 1.5)
-
-python 2> /dev/null << EOF
-import sys
-import pygments
-
-if float(pygments.__version__) >= 1.5:
-    sys.exit(0)
-else:
-    sys.exit(1)
-EOF
-
-if test $? -eq 0; then
-    AC_MSG_RESULT(yes)
-else
-    AC_MSG_RESULT(no)
-    if test x${strictness_enabled} = xyes; then
-        AC_MSG_ERROR([Your copy of pygments is out of date.], 1)
-    else
-        AC_MSG_WARN([Syntax highlighting may not work.])
-    fi
-fi
-
-AC_ARG_VAR([ERL], [path to the `erl' executable])
-AC_ARG_VAR([ERLC], [path to the `erlc' executable])
-
-AM_CONDITIONAL([INIT], [test x${init_enabled} = xtrue])
-AM_CONDITIONAL([LAUNCHD], [test x${launchd_enabled} = xtrue])
-AM_CONDITIONAL([USE_NATIVE_MOCHIJSON], [test x${native_mochijson_enabled} = xyes])
-AM_CONDITIONAL([USE_CURL], [test x${use_curl} = xyes])
-
-AM_CONDITIONAL([BUILD_MAN], [test x${build_man} = xyes])
-AM_CONDITIONAL([BUILD_INFO], [test x${build_info} = xyes])
-AM_CONDITIONAL([BUILD_PDF], [test x${build_pdf} = xyes])
-AM_CONDITIONAL([BUILD_HTML], [test x${build_html} = xyes])
-
-AM_CONDITIONAL([TESTS], [test x${tests_enabled} = xyes])
-AM_CONDITIONAL([STRICTNESS], [test x${strictness_enabled} = xyes])
-
-AC_SUBST([package_author_name], ["LOCAL_PACKAGE_AUTHOR_NAME"])
-AC_SUBST([package_author_address], ["LOCAL_PACKAGE_AUTHOR_ADDRESS"])
-AC_SUBST([package_identifier], ["LOCAL_PACKAGE_IDENTIFIER"])
-AC_SUBST([package_tarname], ["LOCAL_PACKAGE_TARNAME"])
-AC_SUBST([package_name], ["LOCAL_PACKAGE_NAME"])
-
-AC_SUBST([version], ["LOCAL_VERSION"])
-AC_SUBST([version_major], ["LOCAL_VERSION_MAJOR"])
-AC_SUBST([version_minor], ["LOCAL_VERSION_MINOR"])
-AC_SUBST([version_revision], ["LOCAL_VERSION_REVISION"])
-AC_SUBST([version_stage], ["LOCAL_VERSION_STAGE"])
-AC_SUBST([version_release], ["LOCAL_VERSION_RELEASE"])
-
-AC_SUBST([bug_uri], ["LOCAL_BUG_URI"])
-
-AC_SUBST([localconfdir], [${sysconfdir}/${package_identifier}])
-AC_SUBST([localdatadir], [${datadir}/${package_identifier}])
-AC_SUBST([localdocdir], [${datadir}/doc/${package_identifier}])
-AC_SUBST([locallibdir], [${libdir}/${package_identifier}])
-AC_SUBST([localstatelibdir], [${localstatedir}/lib/${package_identifier}])
-AC_SUBST([localstatelogdir], [${localstatedir}/log/${package_identifier}])
-AC_SUBST([localstaterundir], [${localstatedir}/run/${package_identifier}])
-
-# On Windows we install directly into our erlang distribution.
-if test x${IS_WINDOWS} = xTRUE; then
-    AC_SUBST([locallibbindir], [${prefix}/bin])
-    AC_SUBST([localerlanglibdir], [${libdir}])
-else
-    AC_SUBST([locallibbindir], [${locallibdir}/bin])
-    AC_SUBST([localerlanglibdir], [${locallibdir}/erlang/lib])
-fi
-
-# fix for older autotools that don't define "abs_top_YYY" by default
-AC_SUBST(abs_top_srcdir)
-AC_SUBST(abs_top_builddir)
-
-AC_REVISION([LOCAL_VERSION])
-
-AC_CONFIG_FILES([Makefile])
-AC_CONFIG_FILES([bin/couch-config.tpl])
-AC_CONFIG_FILES([bin/couchdb.tpl])
-AC_CONFIG_FILES([bin/couchdb.bat.tpl])
-AC_CONFIG_FILES([bin/Makefile])
-AC_CONFIG_FILES([etc/couchdb/Makefile])
-AC_CONFIG_FILES([etc/couchdb/default.ini.tpl])
-AC_CONFIG_FILES([etc/default/Makefile])
-AC_CONFIG_FILES([etc/init/couchdb.tpl])
-AC_CONFIG_FILES([etc/init/Makefile])
-AC_CONFIG_FILES([etc/launchd/org.apache.couchdb.plist.tpl])
-AC_CONFIG_FILES([etc/launchd/Makefile])
-AC_CONFIG_FILES([etc/logrotate.d/couchdb.tpl])
-AC_CONFIG_FILES([etc/logrotate.d/Makefile])
-AC_CONFIG_FILES([etc/windows/Makefile])
-AC_CONFIG_FILES([etc/Makefile])
-AC_CONFIG_FILES([share/Makefile])
-AC_CONFIG_FILES([share/doc/Makefile])
-AC_CONFIG_FILES([share/doc/build/Makefile])
-AC_CONFIG_FILES([src/Makefile])
-AC_CONFIG_FILES([src/chttpd/Makefile])
-AC_CONFIG_FILES([src/config/Makefile])
-AC_CONFIG_FILES([src/couch_index/Makefile])
-AC_CONFIG_FILES([src/couch_mrview/Makefile])
-AC_CONFIG_FILES([src/couch_replicator/Makefile])
-AC_CONFIG_FILES([src/couch/src/couch.app.tpl])
-AC_CONFIG_FILES([src/couch/Makefile])
-AC_CONFIG_FILES([src/couch/priv/Makefile])
-AC_CONFIG_FILES([src/mem3/Makefile])
-AC_CONFIG_FILES([src/fabric/Makefile])
-AC_CONFIG_FILES([src/ets_lru/Makefile])
-AC_CONFIG_FILES([src/ddoc_cache/Makefile])
-AC_CONFIG_FILES([src/oauth/Makefile])
-AC_CONFIG_FILES([src/ibrowse/Makefile])
-AC_CONFIG_FILES([src/mochiweb/Makefile])
-AC_CONFIG_FILES([src/rexi/Makefile])
-AC_CONFIG_FILES([src/snappy/Makefile])
-AC_CONFIG_FILES([src/snappy/c_src/Makefile])
-AC_CONFIG_FILES([src/snappy/c_src/google-snappy/snappy-stubs-public.h])
-AC_CONFIG_FILES([src/twig/Makefile])
-AC_CONFIG_FILES([src/ejson/Makefile])
-AC_CONFIG_FILES([test/Makefile])
-AC_CONFIG_FILES([test/bench/Makefile])
-AC_CONFIG_FILES([test/etap/Makefile])
-AC_CONFIG_FILES([test/etap/test_util.erl])
-AC_CONFIG_FILES([test/javascript/Makefile])
-AC_CONFIG_FILES([test/view_server/Makefile])
-AC_CONFIG_FILES([utils/Makefile])
-AC_CONFIG_FILES([var/Makefile])
-
-AC_OUTPUT
-
-# Windows Erlang build tools wrap Microsoft's linker and compiler just enough
-# to be able to build Erlang/OTP successfully, but not enough for full
-# compatibility with GNU AutoTools. The MS VC compiler and linker are
-# hidden from autotools in Erlang's cc.sh and ld.sh wrappers. GNU autoconf
-# identifies this dastardly mix as a unix variant, and libtool kindly
-# passes incorrect flags and names through to the MS linker. The simplest fix
-# is to modify libtool via sed to remove those options.
-#
-# As this is only done once at first configure, and subsequent config or source
-# changes may trigger a silent reversion to the non-functioning original.
-#
-# Changes are;
-#
-# 1. replace LIB$name with $name in libname_spec (e.g. libicu -> icu) to ensure
-#    correct windows versions of .lib and .dlls are found or generated.
-# 2. remove incompatible \w-link\w from archive_cmds
-# 3. remove GNU-style directives to be passed through to the linker
-# 4. swap GNU-style shared library flags with MS -dll variant
-#
-# This obscene hackery is tracked under COUCHDB-440 and COUCHDB-1197.
-
-if test x${IS_WINDOWS} = xTRUE; then
-    mv libtool libtool.dist
-    /bin/sed -E -e 's,^libname_spec="lib,libname_spec=",' \
-        -e 's,( -link ), ,' \
-        -e 's,-Xlinker --out-implib -Xlinker \\\$lib,,' \
-        -e 's,(-shared -nostdlib), -dll ,' \
-        < libtool.dist > libtool
-    # probably would chmod +x if we weren't on windows...
-fi
-
-echo
-echo "You have configured Apache CouchDB, time to relax."
-echo
-echo "Run \`make && sudo make install' to install."

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/etc/Makefile.am
----------------------------------------------------------------------
diff --git a/etc/Makefile.am b/etc/Makefile.am
deleted file mode 100644
index 148f701..0000000
--- a/etc/Makefile.am
+++ /dev/null
@@ -1,117 +0,0 @@
-## Licensed under the Apache License, Version 2.0 (the "License"); you may not
-## use this file except in compliance with the License. You may obtain a copy of
-## the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-## License for the specific language governing permissions and limitations under
-## the License.
-
-SUBDIRS = couchdb default init launchd logrotate.d windows
-
-default_sysconf_data = logrotate.d/couchdb
-
-if INIT
-init_sysconf_data = default/couchdb
-init_DATA = init/couchdb
-endif
-
-if LAUNCHD
-launchd_DATA = launchd/org.apache.couchdb.plist
-endif
-
-nobase_sysconf_DATA = $(default_sysconf_data) $(init_sysconf_data)
-
-EXTRA_DIST = \
-    default/couchdb \
-    windows/couchdb.iss.tpl \
-    windows/README.txt.tpl
-
-if WINDOWS
-EXTRA_DIST += \
-    windows/setup-couchdb-@version@.exe.md5 \
-    windows/setup-couchdb-@version@.exe.sha
-endif
-
-CLEANFILES = $(init_DATA) $(default_sysconf_data) $(launchd_DATA)
-
-transform = @program_transform_name@
-couchdb_command_name = `echo couchdb | sed '$(transform)'`
-
-init/couchdb: init/couchdb.tpl
-	if test "$(mkdir_p)"; then \
-	    $(mkdir_p) init; \
-	else \
-	    if test ! -d init; then \
-	        mkdir init; \
-	    fi \
-	fi
-	sed -e "s|%configure_input%|$@. Generated from $< by configure.|" \
-	    -e "s|%bindir%|$(bindir)|" \
-	    -e "s|%sysconfdir%|$(sysconfdir)|" \
-	    -e "s|%localstaterundir%|$(localstaterundir)|" \
-	    -e "s|%couchdb_command_name%|$(couchdb_command_name)|" \
-	< $< > $@
-
-logrotate.d/couchdb: logrotate.d/couchdb.tpl
-	sed -e "s|%localstatelogdir%|@localstatelogdir@|g" < $< > $@
-
-launchd/org.apache.couchdb.plist: launchd/org.apache.couchdb.plist.tpl
-	if test "$(mkdir_p)"; then \
-	    $(mkdir_p) launchd; \
-	else \
-	    if test ! -d launchd; then \
-	        mkdir launchd; \
-	    fi \
-	fi
-	sed -e "s|%configure_input%|$@. Generated from $< by configure.|" \
-	    -e "s|%bindir%|$(bindir)|" \
-	    -e "s|%couchdb_command_name%|$(couchdb_command_name)|" \
-	< $< > $@
-
-if WINDOWS
-
-# README.txt has \n line endings in the repo and must have \r\n
-# when installed as notepad is used to view it.
-# Also: the targets below don't seem to update after an svn-up (which
-# changes the version string in the generated files) so we trick make
-# into always building it with the FORCE pattern...
-windows/README.txt: windows/README.txt.tpl FORCE
-	sed -e "s|%package_name%|@package_name@|g" \
-	    -e "s|%version%|@version@|g" \
-	< $< | unix2dos > $@
-
-windows/couchdb.iss: windows/couchdb.iss.tpl FORCE
-	sed -e "s|%configure_input%|$@. Generated from $< by configure.|" \
-	    -e "s|%package_name%|@package_name@|g" \
-	    -e "s|%locallibbindir%|`cygpath -m @locallibbindir@`|g" \
-	    -e "s|%version%|@version@|g" \
-	    -e "s|%erts_version%|`$(ERL) -version 2>&1 | $(SED) 's/[^0-9\.]//g'`|g" \
-	    -e "s|%openssl_bin_dir%|@openssl_bin_dir@|g" \
-	    -e "s|%msvc_redist_dir%|@msvc_redist_dir@|g" \
-	    -e "s|%msvc_redist_name%|@msvc_redist_name@|g" \
-	< $< > $@
-
-# The installer depends on all files, not just the source .iss file,
-# so we trick make into always building it with the FORCE pattern...
-windows/setup-couchdb-@version@.exe: windows/couchdb.iss windows/README.txt FORCE
-	"$(INNO_COMPILER_EXECUTABLE)" /q $<
-	@echo Windows Installer is at: `cygpath -a -w windows/setup-couchdb-@version@.exe`
-
-windows/setup-couchdb-@version@.exe.md5: windows/setup-couchdb-@version@.exe
-	cd windows && md5sum ./$(<F) > $(@F)
-
-windows/setup-couchdb-@version@.exe.sha: windows/setup-couchdb-@version@.exe
-	cd windows && sha1sum ./$(<F) > $(@F)
-
-FORCE:
-
-endif
-
-install-data-hook:
-	if test -n "$(init_DATA)"; then \
-	    chmod +x "$(DESTDIR)$(initdir)/couchdb"; \
-	fi

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/etc/couchdb/Makefile.am
----------------------------------------------------------------------
diff --git a/etc/couchdb/Makefile.am b/etc/couchdb/Makefile.am
deleted file mode 100644
index 3c15f99..0000000
--- a/etc/couchdb/Makefile.am
+++ /dev/null
@@ -1,93 +0,0 @@
-## Licensed under the Apache License, Version 2.0 (the "License"); you may not
-## use this file except in compliance with the License. You may obtain a copy of
-## the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-## License for the specific language governing permissions and limitations under
-## the License.
-
-couchprivlibdir = $(localerlanglibdir)/couch-$(version)/priv/lib
-devcouchprivlibdir = $(abs_top_builddir)/src/couch/priv/.libs
-
-localconf_DATA = default.ini
-noinst_DATA = default_dev.ini local_dev.ini
-
-EXTRA_DIST = local.ini
-
-CLEANFILES = $(localconf_DATA) $(noinst_DATA)
-
-transform = @program_transform_name@
-couchjs_command_name = `echo couchjs | sed '$(transform)'`
-couchjs_dev_command_name = `echo couchjs_dev | sed '$(transform)'`
-
-if WINDOWS
-default.ini: default.ini.tpl
-	sed -e "s|%bindir%|.|g" \
-	    -e "s|%localconfdir%|$(localconfdir)|g" \
-	    -e "s|%localdatadir%|../share/couchdb|g" \
-	    -e "s|%localbuilddatadir%|../share/couchdb|g" \
-	    -e "s|%localstatelibdir%|../var/lib/couchdb|g" \
-	    -e "s|%localstatelogdir%|../var/log/couchdb|g" \
-	    -e "s|%localstaterundir%|../var/run/couchdb|g" \
-	    -e "s|%couchprivlibdir%|../lib/couch-$(version)/priv/lib|g" \
-	    -e "s|%couchjs_command_name%|couchjs.exe|g" \
-	    -e "s|%package_author_name%|$(package_author_name)|g" \
-	    -e "s|%version%|$(version)|g" \
-	< $< > $@
-else
-default.ini: default.ini.tpl
-	sed -e "s|%bindir%|$(bindir)|g" \
-	    -e "s|%localconfdir%|$(localconfdir)|g" \
-	    -e "s|%localdatadir%|$(localdatadir)|g" \
-	    -e "s|%localbuilddatadir%|$(localdatadir)|g" \
-	    -e "s|%localstatelibdir%|$(localstatelibdir)|g" \
-	    -e "s|%localstatelogdir%|$(localstatelogdir)|g" \
-	    -e "s|%localstaterundir%|$(localstaterundir)|g" \
-	    -e "s|%couchprivlibdir%|$(couchprivlibdir)|g" \
-	    -e "s|%couchjs_command_name%|$(couchjs_command_name)|g" \
-	    -e "s|%package_author_name%|$(package_author_name)|g" \
-	    -e "s|%version%|$(version)|g" \
-	< $< > $@
-endif
-
-default_dev.ini: default.ini.tpl
-	sed -e "s|%bindir%|$(abs_top_builddir)/bin|g" \
-	    -e "s|%localconfdir%|$(abs_top_builddir)/etc/couchdb|g" \
-	    -e "s|%localdatadir%|$(abs_top_srcdir)/share|g" \
-	    -e "s|%localbuilddatadir%|$(abs_top_builddir)/share|g" \
-	    -e "s|%localstatelibdir%|$(abs_top_builddir)/tmp/lib|g" \
-	    -e "s|%localstatelogdir%|$(abs_top_builddir)/tmp/log|g" \
-	    -e "s|%localstaterundir%|$(abs_top_builddir)/tmp/run|g" \
-	    -e "s|%couchprivlibdir%|$(devcouchprivlibdir)|g" \
-	    -e "s|%couchjs_command_name%|$(couchjs_dev_command_name)|g" \
-	    -e "s|%package_author_name%|$(package_author_name)|g" \
-	    -e "s|%version%|$(version)|g" \
-	< $< > $@
-
-# Noah said to not specify local.ini but it borks
-# VPATH builds that make distcheck uses.
-local_dev.ini: local.ini
-	if test ! -f "$@"; then \
-	    cp $< $@; \
-	    chmod +w $@; \
-	fi
-
-install-data-hook:
-	if test ! -f "$(DESTDIR)$(localconfdir)/local.ini"; then \
-	    cp $(srcdir)/local.ini "$(DESTDIR)$(localconfdir)/local.ini"; \
-	fi
-	if test ! "$(mkdir_p)" = ""; then \
-	    $(mkdir_p) "$(DESTDIR)$(localconfdir)/default.d"; \
-	    $(mkdir_p) "$(DESTDIR)$(localconfdir)/local.d"; \
-	else \
-	    echo "WARNING: You may have to create these directories by hand."; \
-	    mkdir -p "$(DESTDIR)$(localconfdir)/default.d"; \
-	    mkdir -p "$(DESTDIR)$(localconfdir)/local.d"; \
-	fi
-
-uninstall-local:
-	rm -f "$(DESTDIR)/$(localconfdir)/local.ini"

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/etc/default/Makefile.am
----------------------------------------------------------------------
diff --git a/etc/default/Makefile.am b/etc/default/Makefile.am
deleted file mode 100644
index 5b4faae..0000000
--- a/etc/default/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-## Licensed under the Apache License, Version 2.0 (the "License"); you may not
-## use this file except in compliance with the License. You may obtain a copy of
-## the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-## License for the specific language governing permissions and limitations under
-## the License.
-
-## This file intentionally left blank.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/etc/init/Makefile.am
----------------------------------------------------------------------
diff --git a/etc/init/Makefile.am b/etc/init/Makefile.am
deleted file mode 100644
index 5b4faae..0000000
--- a/etc/init/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-## Licensed under the Apache License, Version 2.0 (the "License"); you may not
-## use this file except in compliance with the License. You may obtain a copy of
-## the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-## License for the specific language governing permissions and limitations under
-## the License.
-
-## This file intentionally left blank.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/etc/launchd/Makefile.am
----------------------------------------------------------------------
diff --git a/etc/launchd/Makefile.am b/etc/launchd/Makefile.am
deleted file mode 100644
index 5b4faae..0000000
--- a/etc/launchd/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-## Licensed under the Apache License, Version 2.0 (the "License"); you may not
-## use this file except in compliance with the License. You may obtain a copy of
-## the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-## License for the specific language governing permissions and limitations under
-## the License.
-
-## This file intentionally left blank.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/etc/logrotate.d/Makefile.am
----------------------------------------------------------------------
diff --git a/etc/logrotate.d/Makefile.am b/etc/logrotate.d/Makefile.am
deleted file mode 100644
index 5b4faae..0000000
--- a/etc/logrotate.d/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-## Licensed under the Apache License, Version 2.0 (the "License"); you may not
-## use this file except in compliance with the License. You may obtain a copy of
-## the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-## License for the specific language governing permissions and limitations under
-## the License.
-
-## This file intentionally left blank.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/etc/windows/Makefile.am
----------------------------------------------------------------------
diff --git a/etc/windows/Makefile.am b/etc/windows/Makefile.am
deleted file mode 100644
index 5b4faae..0000000
--- a/etc/windows/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-## Licensed under the Apache License, Version 2.0 (the "License"); you may not
-## use this file except in compliance with the License. You may obtain a copy of
-## the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-## License for the specific language governing permissions and limitations under
-## the License.
-
-## This file intentionally left blank.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/rebar.config
----------------------------------------------------------------------
diff --git a/rebar.config b/rebar.config
new file mode 100644
index 0000000..1ae51fd
--- /dev/null
+++ b/rebar.config
@@ -0,0 +1,38 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+{sub_dirs, [
+    "src/ibrowse",
+    "src/config",
+    "src/couch",
+    "src/couch_index",
+    "src/couch_mrview",
+    "src/mem3",
+
+    "src/chttpd",
+    "src/couch_replicator",
+    "src/ddoc_cache",
+    "src/ejson",
+    "src/ets_lru",
+    "src/fabric",
+    "src/mochiweb",
+    "src/oauth",
+    "src/rexi",
+    "src/snappy",
+    "src/twig",
+
+    "rel"
+]}.
+
+{lib_dirs, ["src/"]}.
+
+{erl_opts, [debug_info]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/rel/files/README
----------------------------------------------------------------------
diff --git a/rel/files/README b/rel/files/README
new file mode 100644
index 0000000..5ee9386
--- /dev/null
+++ b/rel/files/README
@@ -0,0 +1,4 @@
+Ignore these files for now.
+
+This is to pacify newer rebar that insists on having a sys.config and
+a vm.args in releases/$VSN/.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/rel/files/sys.config
----------------------------------------------------------------------
diff --git a/rel/files/sys.config b/rel/files/sys.config
new file mode 100644
index 0000000..57afcca
--- /dev/null
+++ b/rel/files/sys.config
@@ -0,0 +1 @@
+[].

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/rel/files/vm.args
----------------------------------------------------------------------
diff --git a/rel/files/vm.args b/rel/files/vm.args
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/rel/overlay/bin/couchdb
----------------------------------------------------------------------
diff --git a/rel/overlay/bin/couchdb b/rel/overlay/bin/couchdb
new file mode 100755
index 0000000..b2dc76b
--- /dev/null
+++ b/rel/overlay/bin/couchdb
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+ERTS_BIN_DIR=$(cd ${0%/*} && pwd)
+
+export ROOTDIR=${ERTS_BIN_DIR%/*}
+
+START_ERL=`cat $ROOTDIR/releases/start_erl.data`
+ERTS_VSN=${START_ERL% *}
+APP_VSN=${START_ERL#* }
+
+export BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin
+export EMU=beam
+export PROGNAME=`echo $0 | sed 's/.*\///'`
+
+exec $BINDIR/erlexec -boot $ROOTDIR/releases/$APP_VSN/couchdb \
+    -args_file $ROOTDIR/etc/vm.args

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/rel/overlay/etc/default.ini
----------------------------------------------------------------------
diff --git a/rel/overlay/etc/default.ini b/rel/overlay/etc/default.ini
new file mode 100644
index 0000000..f10ac33
--- /dev/null
+++ b/rel/overlay/etc/default.ini
@@ -0,0 +1,122 @@
+[couchdb]
+database_dir = {{data_dir}}
+view_index_dir = {{view_dir}}
+max_document_size = 67108864
+os_process_timeout = 5000
+max_dbs_open = 500
+delayed_commits = false
+
+[cluster]
+q=8
+r=2
+w=2
+n=3
+
+[chttpd]
+port = {{cluster_port}}
+backlog = 512
+docroot = {{prefix}}/share/www
+
+[httpd]
+port = {{backend_port}}
+bind_address = 127.0.0.1
+max_connections = 2048
+authentication_handlers = {couch_httpd_oauth, oauth_authentication_handler}, {couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler}
+default_handler = {couch_httpd_db, handle_request}
+secure_rewrites = true
+vhost_global_handlers = _utils, _uuids, _session, _oauth, _users
+allow_jsonp = false
+
+[log]
+file = {{prefix}}/var/log/bigcouch.log
+level = info
+include_sasl = true
+
+[couch_httpd_auth]
+authentication_db = _users
+authentication_redirect = /_utils/session.html
+secret = somethingveryverysecret
+require_valid_user = false
+timeout = 600 ; number of seconds before automatic logout
+auth_cache_size = 50 ; size is number of cache entries
+
+[query_servers]
+javascript = {{prefix}}/bin/couchjs {{prefix}}/share/couchjs/main.js
+
+[query_server_config]
+reduce_limit = true
+
+[daemons]
+external_manager={couch_external_manager, start_link, []}
+query_servers={couch_proc_manager, start_link, []}
+httpd={couch_httpd, start_link, []}
+stats_collector={couch_stats_collector, start, []}
+uuids={couch_uuids, start, []}
+auth_cache={couch_auth_cache, start_link, []}
+
+[httpd_global_handlers]
+/ = {couch_httpd_misc_handlers, handle_welcome_req, <<"Welcome">>}
+favicon.ico = {couch_httpd_misc_handlers, handle_favicon_req, "{{prefix}}/share/www"}
+
+_utils = {couch_httpd_misc_handlers, handle_utils_dir_req, "{{prefix}}/share/www"}
+_all_dbs = {couch_httpd_misc_handlers, handle_all_dbs_req}
+_active_tasks = {couch_httpd_misc_handlers, handle_task_status_req}
+_config = {couch_httpd_misc_handlers, handle_config_req}
+_replicate = {couch_httpd_misc_handlers, handle_replicate_req}
+_uuids = {couch_httpd_misc_handlers, handle_uuids_req}
+_restart = {couch_httpd_misc_handlers, handle_restart_req}
+_stats = {couch_httpd_stats_handlers, handle_stats_req}
+_log = {couch_httpd_misc_handlers, handle_log_req}
+_session = {couch_httpd_auth, handle_session_req}
+_oauth = {couch_httpd_oauth, handle_oauth_req}
+_system = {chttpd_misc, handle_system_req}
+
+[httpd_db_handlers]
+_view_cleanup = {couch_httpd_db, handle_view_cleanup_req}
+_compact = {couch_httpd_db, handle_compact_req}
+_design = {couch_httpd_db, handle_design_req}
+_temp_view = {couch_httpd_view, handle_temp_view_req}
+_changes = {couch_httpd_db, handle_changes_req}
+
+[httpd_design_handlers]
+_view = {couch_httpd_view, handle_view_req}
+_show = {couch_httpd_show, handle_doc_show_req}
+_list = {couch_httpd_show, handle_view_list_req}
+_info = {couch_httpd_db,   handle_design_info_req}
+_rewrite = {couch_httpd_rewrite, handle_rewrite_req}
+_update = {couch_httpd_show, handle_doc_update_req}
+
+[uuids]
+; Known algorithms:
+;   random - 128 bits of random awesome
+;     All awesome, all the time.
+;   sequential - monotonically increasing ids with random increments
+;     First 26 hex characters are random. Last 6 increment in
+;     random amounts until an overflow occurs. On overflow, the
+;     random prefix is regenerated and the process starts over.
+;   utc_random - Time since Jan 1, 1970 UTC with microseconds
+;     First 14 characters are the time in hex. Last 18 are random.
+algorithm = sequential
+
+[stats]
+; rate is in milliseconds
+rate = 1000
+; sample intervals are in seconds
+samples = [0, 60, 300, 900]
+
+[attachments]
+compression_level = 8 ; from 1 (lowest, fastest) to 9 (highest, slowest), 0 to disable compression
+compressible_types = text/*, application/javascript, application/json,  application/xml
+
+[replicator]
+max_http_sessions = 20
+max_http_pipeline_size = 50
+; set to true to validate peer certificates
+verify_ssl_certificates = false
+; file containing a list of peer trusted certificates (PEM format)
+; ssl_trusted_certificates_file = /etc/ssl/certs/ca-certificates.crt
+; maximum peer certificate depth (must be set even if certificate validation is off)
+ssl_certificate_max_depth = 3
+
+[dreyfus]
+name={{clouseau_name}}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/rel/overlay/etc/local.ini
----------------------------------------------------------------------
diff --git a/rel/overlay/etc/local.ini b/rel/overlay/etc/local.ini
new file mode 100644
index 0000000..3146ea2
--- /dev/null
+++ b/rel/overlay/etc/local.ini
@@ -0,0 +1 @@
+; local customizations are stored here

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/rel/overlay/etc/vm.args
----------------------------------------------------------------------
diff --git a/rel/overlay/etc/vm.args b/rel/overlay/etc/vm.args
new file mode 100644
index 0000000..d112f45
--- /dev/null
+++ b/rel/overlay/etc/vm.args
@@ -0,0 +1,23 @@
+# Each node in the system must have a unique name.  A name can be short
+# (specified using -sname) or it can by fully qualified (-name).  There can be
+# no communication between nodes running with the -sname flag and those running 
+# with the -name flag.
+{{node_name}}
+
+# All nodes must share the same magic cookie for distributed Erlang to work.
+# Comment out this line if you synchronized the cookies by other means (using
+# the ~/.erlang.cookie file, for example).
+-setcookie monster
+
+# Tell kernel and SASL not to log anything
+-kernel error_logger silent
+-sasl sasl_error_logger false
+
+# Use kernel poll functionality if supported by emulator
++K true
+
+# Start a pool of asynchronous IO threads
++A 16
+
+# Comment this line out to enable the interactive Erlang shell on startup
++Bd -noinput

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f84eb4fc/rel/reltool.config
----------------------------------------------------------------------
diff --git a/rel/reltool.config b/rel/reltool.config
new file mode 100644
index 0000000..049531c
--- /dev/null
+++ b/rel/reltool.config
@@ -0,0 +1,70 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+{sys, [
+    {lib_dirs, ["../src"]},
+    {rel, "couchdb", "2.0.0a", [
+        chttpd,
+        config,
+        couch,
+        couch_replicator,
+        crypto,
+        ddoc_cache,
+        ets_lru,
+        fabric,
+        ibrowse,
+        inets,
+        kernel,
+        mem3,
+        mochiweb,
+        oauth,
+        rexi,
+        runtime_tools,
+        sasl,
+        snappy,
+        ssl,
+        stdlib,
+        twig,
+        xmerl
+    ]},
+    {rel, "start_clean", "", [kernel, stdlib]},
+    {boot_rel, "couchdb"},
+    {profile, embedded},
+    {excl_sys_filters, ["^bin/.*", "^erts.*/bin/(dialyzer|typer)"]},
+    {excl_archive_filters, [".*"]},
+
+    % It's sufficient to list 'chttpd' here, as reltool will pull in all
+    % dependencies.  But we'll be explicit and list everything actively
+    % developed in this repository.
+    {app, chttpd, [{incl_cond, include}]},
+    {app, config, [{incl_cond, include}]},
+    {app, couch, [{incl_cond, include}]},
+    {app, couch_replicator, [{incl_cond, include}]},
+    {app, ddoc_cache, [{incl_cond, include}]},
+    {app, ets_lru, [{incl_cond, include}]},
+    {app, fabric, [{incl_cond, include}]},
+    {app, mem3, [{incl_cond, include}]},
+    {app, rexi, [{incl_cond, include}]},
+    {app, snappy, [{incl_cond, include}]},
+    {app, twig, [{incl_cond, include}]}
+]}.
+
+{overlay_vars, "couchdb.config"}.
+{overlay, [
+    {mkdir, "var/log"},
+    {copy, "overlay/bin"},
+    {copy, "overlay/etc"},
+    {copy, "files/sys.config", "releases/\{\{rel_vsn\}\}/sys.config"},
+    {copy, "files/vm.args", "releases/\{\{rel_vsn\}\}/vm.args"},
+    {template, "overlay/etc/default.ini", "etc/default.ini"},
+    {template, "overlay/etc/vm.args", "etc/vm.args"}
+]}.