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 2013/12/19 00:04:47 UTC

[1/3] Build with rebar

Updated Branches:
  refs/heads/1843-feature-bigcouch d68f4defa -> ba152cb21 (forced update)


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/snappy/src/snappy.app.src
----------------------------------------------------------------------
diff --git a/src/snappy/src/snappy.app.src b/src/snappy/src/snappy.app.src
new file mode 100644
index 0000000..9f3f9a3
--- /dev/null
+++ b/src/snappy/src/snappy.app.src
@@ -0,0 +1,12 @@
+{application, snappy,
+ [
+  {description, "snappy compressor/decompressor Erlang NIF wrapper"},
+  {vsn, git},
+  {registered, []},
+  {applications, [
+                  kernel,
+                  stdlib
+                 ]},
+  {env, []},
+  {modules, [snappy]}
+ ]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/twig/.gitignore
----------------------------------------------------------------------
diff --git a/src/twig/.gitignore b/src/twig/.gitignore
deleted file mode 100644
index 6308d7c..0000000
--- a/src/twig/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-ebin
-src/.*.swp
-.project

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/twig/Makefile.am
----------------------------------------------------------------------
diff --git a/src/twig/Makefile.am b/src/twig/Makefile.am
deleted file mode 100644
index 8832ce1..0000000
--- a/src/twig/Makefile.am
+++ /dev/null
@@ -1,49 +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.
-
-twigebindir = $(localerlanglibdir)/twig/ebin
-
-twigebin_DATA = $(compiled_files)
-
-include_files = \
-	twig_int.hrl
-
-source_files = \
-	src/twig.app.src \
-    src/twig.erl \
-	src/twig_app.erl \
-	src/twig_event_handler.erl \
-	src/twig_monitor.erl \
-	src/twig_sup.erl \
-	src/twig_util.erl \
-	src/trunc_io.erl
-
-compiled_files = \
-	ebin/twig.app \
-    ebin/twig.beam \
-	ebin/twig_app.beam \
-	ebin/twig_event_handler.beam \
-	ebin/twig_monitor.beam \
-	ebin/twig_sup.beam \
-	ebin/twig_util.beam \
-	ebin/trunc_io.beam
-
-EXTRA_DIST = $(include_files) $(source_files)
-CLEANFILES = $(compiled_files)
-
-ebin/%.app: src/%.app.src
-	@mkdir -p ebin/
-	sed -e "s|%version%|@version@|g" < $< > $@
-
-ebin/%.beam: src/%.erl
-	@mkdir -p ebin/
-	$(ERLC) -Wall -I$(top_srcdir)/src -o ebin/ $(ERLC_FLAGS) $<

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/test/Makefile.am
----------------------------------------------------------------------
diff --git a/test/Makefile.am b/test/Makefile.am
deleted file mode 100644
index 7c70a5a..0000000
--- a/test/Makefile.am
+++ /dev/null
@@ -1,15 +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 = bench etap javascript view_server
-EXTRA_DIST = random_port.ini
-

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/test/bench/Makefile.am
----------------------------------------------------------------------
diff --git a/test/bench/Makefile.am b/test/bench/Makefile.am
deleted file mode 100644
index ce39c4b..0000000
--- a/test/bench/Makefile.am
+++ /dev/null
@@ -1,22 +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.
-
-EXTRA_DIST = benchbulk.sh bench_marks.js run.tpl
-
-noinst_SCRIPTS = run
-CLEANFILES = run
-
-run: run.tpl
-	sed -e "s|%abs_top_srcdir%|$(abs_top_srcdir)|" \
-		-e "s|%abs_top_builddir%|$(abs_top_builddir)|" \
-	< $< > $@
-	chmod +x $@

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/test/etap/Makefile.am
----------------------------------------------------------------------
diff --git a/test/etap/Makefile.am b/test/etap/Makefile.am
deleted file mode 100644
index c092805..0000000
--- a/test/etap/Makefile.am
+++ /dev/null
@@ -1,96 +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.
-
-noinst_SCRIPTS = run
-noinst_DATA = etap.beam test_util.beam test_web.beam
-
-noinst_PROGRAMS = test_cfg_register
-test_cfg_register_SOURCES = test_cfg_register.c
-test_cfg_register_CFLAGS = -D_BSD_SOURCE
-
-%.beam: %.erl
-	$(ERLC) $<
-
-run: run.tpl
-	sed -e "s|%abs_top_srcdir%|@abs_top_srcdir@|g" \
-	    -e "s|%abs_top_builddir%|@abs_top_builddir@|g" > \
-	$@ < $<
-	chmod +x $@
-
-# @@ wildcards are NOT portable, please replace with clean-local rules
-CLEANFILES = run *.beam
-DISTCLEANFILES = temp.*
-
-EXTRA_DIST = \
-    run.tpl \
-    test_web.erl \
-    001-load.t \
-    002-icu-driver.t \
-    010-file-basics.t \
-    011-file-headers.t \
-    020-btree-basics.t \
-    021-btree-reductions.t \
-    030-doc-from-json.t \
-    031-doc-to-json.t \
-    040-util.t \
-    041-uuid-gen-id.ini \
-    041-uuid-gen-seq.ini \
-    041-uuid-gen-utc.ini \
-    041-uuid-gen.t \
-    042-work-queue.t \
-    050-stream.t \
-    060-kt-merging.t \
-    061-kt-missing-leaves.t \
-    062-kt-remove-leaves.t \
-    063-kt-get-leaves.t \
-    064-kt-counting.t \
-    065-kt-stemming.t \
-    070-couch-db.t \
-    072-cleanup.t \
-    073-changes.t \
-    074-doc-update-conflicts.t \
-    075-auth-cache.t \
-    076-file-compression.t \
-    080-config-get-set.t \
-    081-config-override.1.ini \
-    081-config-override.2.ini \
-    081-config-override.t \
-    082-config-register.t \
-    083-config-no-files.t \
-    090-task-status.t \
-    100-ref-counter.t \
-    120-stats-collect.t \
-    121-stats-aggregates.cfg \
-    121-stats-aggregates.ini \
-    121-stats-aggregates.t \
-    130-attachments-md5.t \
-    140-attachment-comp.t \
-    150-invalid-view-seq.t \
-    160-vhosts.t \
-    170-os-daemons.es \
-    170-os-daemons.t \
-    171-os-daemons-config.es \
-    171-os-daemons-config.t \
-    172-os-daemon-errors.1.sh \
-    172-os-daemon-errors.2.sh \
-    172-os-daemon-errors.3.sh \
-    172-os-daemon-errors.4.sh \
-    172-os-daemon-errors.t \
-    173-os-daemon-cfg-register.t \
-    180-http-proxy.ini \
-    180-http-proxy.t \
-    190-json-stream-parse.t \
-    200-view-group-no-db-leaks.t \
-    201-view-group-shutdown.t \
-    210-os-proc-pool.t \
-    220-compaction-daemon.t \
-    231-cors.t

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/test/javascript/Makefile.am
----------------------------------------------------------------------
diff --git a/test/javascript/Makefile.am b/test/javascript/Makefile.am
deleted file mode 100644
index d7367e0..0000000
--- a/test/javascript/Makefile.am
+++ /dev/null
@@ -1,26 +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.
-
-EXTRA_DIST = \
-	cli_runner.js \
-	couch_http.js \
-	run.tpl
-
-noinst_SCRIPTS = run
-CLEANFILES = run
-
-run: run.tpl
-	sed -e "s|%abs_top_srcdir%|$(abs_top_srcdir)|" \
-		-e "s|%abs_top_builddir%|$(abs_top_builddir)|" \
-		-e "s|%localstaterundir%|$(abs_top_builddir)/tmp/run|g" \
-	< $< > $@
-	chmod +x $@

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/test/view_server/Makefile.am
----------------------------------------------------------------------
diff --git a/test/view_server/Makefile.am b/test/view_server/Makefile.am
deleted file mode 100644
index 11e7feb..0000000
--- a/test/view_server/Makefile.am
+++ /dev/null
@@ -1,15 +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.
-
-EXTRA_DIST = \
-	query_server_spec.rb \
-	run_native_process.es

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/utils/Makefile.am
----------------------------------------------------------------------
diff --git a/utils/Makefile.am b/utils/Makefile.am
deleted file mode 100644
index eb8ec43..0000000
--- a/utils/Makefile.am
+++ /dev/null
@@ -1,38 +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.
-
-noinst_SCRIPTS = run
-
-CLEANFILES = $(noinst_SCRIPTS)
-
-transform = @program_transform_name@
-couchdb_command_name = `echo couchdb | sed '$(transform)'`
-
-run: ../bin/couchdb.tpl
-	sed -e "s|%ERL%|$(ERL)|g" \
-	    -e "s|%ICU_CONFIG%|$(ICU_CONFIG)|g" \
-	    -e "s|%bindir%|$(abs_top_builddir)/bin|g" \
-	    -e "s|%defaultini%|default_dev.ini|g" \
-	    -e "s|%localini%|local_dev.ini|g" \
-	    -e "s|%localerlanglibdir%|$(abs_top_builddir)\/src|g" \
-	    -e "s|%localconfdir%|$(abs_top_builddir)/etc/couchdb|g" \
-	    -e "s|%localstatelogdir%|$(abs_top_builddir)/tmp/log|g" \
-	    -e "s|%localstatelibdir%|$(abs_top_builddir)/tmp/lib|g" \
-	    -e "s|%localstatedir%|$(abs_top_builddir)/tmp|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 $@

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/var/Makefile.am
----------------------------------------------------------------------
diff --git a/var/Makefile.am b/var/Makefile.am
deleted file mode 100644
index 901ab2b..0000000
--- a/var/Makefile.am
+++ /dev/null
@@ -1,23 +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.
-
-install-data-hook:
-	if test ! "$(mkdir_p)" = ""; then \
-	    $(mkdir_p) "$(DESTDIR)$(localstatelibdir)"; \
-	    $(mkdir_p) "$(DESTDIR)$(localstatelogdir)"; \
-	    $(mkdir_p) "$(DESTDIR)$(localstaterundir)"; \
-	else \
-	    echo "WARNING: You may have to create these directories by hand."; \
-	    mkdir -p "$(DESTDIR)$(localstatelibdir)"; \
-	    mkdir -p "$(DESTDIR)$(localstatelogdir)"; \
-	    mkdir -p "$(DESTDIR)$(localstaterundir)"; \
-	fi


[2/3] Build with rebar

Posted by rn...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/share/doc/build/Makefile.am
----------------------------------------------------------------------
diff --git a/share/doc/build/Makefile.am b/share/doc/build/Makefile.am
deleted file mode 100644
index 3db9689..0000000
--- a/share/doc/build/Makefile.am
+++ /dev/null
@@ -1,354 +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)
-
-SPHINXOPTS = \
-    -n -c $(srcdir)/../src \
-    -A local=1 \
-    $(srcdir)/../src
-
-info_file_dist = texinfo/CouchDB.info
-
-info_file_inst = CouchDB
-
-if BUILD_INFO
-info_file_build = $(info_file_dist)
-else
-info_file_build =
-endif
-
-pdf_file_dist = latex/CouchDB.pdf.gz
-
-pdf_file_inst = CouchDB.pdf.gz
-
-if BUILD_PDF
-pdf_file_build = $(pdf_file_dist)
-else
-pdf_file_build =
-endif
-
-# Please keep lists of rst and related generated files sorted
-
-html_files = \
-    html/_images/futon-createdb.png \
-    html/_images/futon-editdoc.png \
-    html/_images/futon-editeddoc.png \
-    html/_images/futon-overview.png \
-    html/_images/futon-replform.png \
-    html/_sources/api/authn.txt \
-    html/_sources/api/configuration.txt \
-    html/_sources/api/database.txt \
-    html/_sources/api/dbmaint.txt \
-    html/_sources/api/design.txt \
-    html/_sources/api/documents.txt \
-    html/_sources/api/local.txt \
-    html/_sources/api/misc.txt \
-    html/_sources/api/reference.txt \
-    html/_sources/api-basics.txt \
-    html/_sources/changelog.txt \
-    html/_sources/changes.txt \
-    html/_sources/commonjs.txt \
-    html/_sources/cors.txt \
-    html/_sources/config_reference.txt \
-    html/_sources/configuring.txt \
-    html/_sources/ddocs.txt \
-    html/_sources/errors.txt \
-    html/_sources/http-proxying.txt \
-    html/_sources/index.txt \
-    html/_sources/intro.txt \
-    html/_sources/json-structure.txt \
-    html/_sources/os-daemons.txt \
-    html/_sources/pretty_urls.txt \
-    html/_sources/query-servers.txt \
-    html/_sources/range.txt \
-    html/_sources/release.txt \
-    html/_sources/replication.txt \
-    html/_sources/ssl.txt \
-    html/_static/ajax-loader.gif \
-    html/_static/basic.css \
-    html/_static/comment-bright.png \
-    html/_static/comment-close.png \
-    html/_static/comment.png \
-    html/_static/default.css \
-    html/_static/doctools.js \
-    html/_static/down-pressed.png \
-    html/_static/down.png \
-    html/_static/favicon.ico \
-    html/_static/file.png \
-    html/_static/jquery.js \
-    html/_static/logo.png \
-    html/_static/minus.png \
-    html/_static/plus.png \
-    html/_static/pygments.css \
-    html/_static/rtd.css \
-    html/_static/searchtools.js \
-    html/_static/sidebar.js \
-    html/_static/underscore.js \
-    html/_static/up-pressed.png \
-    html/_static/up.png \
-    html/_static/websupport.js \
-    html/api/authn.html \
-    html/api/configuration.html \
-    html/api/database.html \
-    html/api/dbmaint.html \
-    html/api/design.html \
-    html/api/documents.html \
-    html/api/local.html \
-    html/api/misc.html \
-    html/api/reference.html \
-    html/api-basics.html \
-    html/changelog.html \
-    html/changes.html \
-    html/commonjs.html \
-    html/cors.html \
-    html/config_reference.html \
-    html/configuring.html \
-    html/ddocs.html \
-    html/errors.html \
-    html/http-proxying.html \
-    html/index.html \
-    html/intro.html \
-    html/json-structure.html \
-    html/os-daemons.html \
-    html/pretty_urls.html \
-    html/query-servers.html \
-    html/range.html \
-    html/release.html \
-    html/replication.html \
-    html/ssl.html \
-    html/objects.inv \
-    html/genindex.html \
-    html/search.html \
-    html/searchindex.js
-
-if BUILD_HTML
-html_files_build = $(html_files)
-else
-html_files_build =
-endif
-
-image_files = \
-    ../images/epub-icon.png \
-    ../images/favicon.ico \
-    ../images/futon-createdb.png \
-    ../images/futon-editdoc.png \
-    ../images/futon-editeddoc.png \
-    ../images/futon-overview.png \
-    ../images/futon-replform.png \
-    ../images/logo.png
-
-src_files = \
-    ../src/api/authn.rst \
-    ../src/api/configuration.rst \
-    ../src/api/database.rst \
-    ../src/api/dbmaint.rst \
-    ../src/api/design.rst \
-    ../src/api/documents.rst \
-    ../src/api/local.rst \
-    ../src/api/misc.rst \
-    ../src/api/reference.rst \
-    ../src/api-basics.rst \
-    ../src/changelog.rst \
-    ../src/changes.rst \
-    ../src/commonjs.rst \
-    ../src/cors.rst \
-    ../src/config_reference.rst \
-    ../src/configuring.rst \
-    ../src/ddocs.rst \
-    ../src/errors.rst \
-    ../src/http-proxying.rst \
-    ../src/index.rst \
-    ../src/intro.rst \
-    ../src/json-structure.rst \
-    ../src/os-daemons.rst \
-    ../src/pretty_urls.rst \
-    ../src/query-servers.rst \
-    ../src/range.rst \
-    ../src/release.rst \
-    ../src/replication.rst \
-    ../src/ssl.rst \
-    ../src/conf.py
-
-src_files_html = \
-    ../static/rtd.css \
-    ../templates/help.html \
-    ../templates/searchbox.html \
-    ../templates/utilities.html
-
-EXTRA_DIST = \
-    $(image_files) \
-    $(src_files) \
-    $(src_files_html) \
-    $(info_file_build) \
-    $(pdf_file_build) \
-    $(html_files_build)
-
-BUILT_SOURCES = \
-    $(info_file_build) \
-    $(pdf_file_build) \
-    $(html_files_build)
-
-$(pdf_file_dist): pdf
-
-$(html_files): html
-
-$(info_file_dist): info.stamp
-	@if test -f $@; then :; else \
-	    rm -f info.stamp; \
-	    $(MAKE_SAFE) $(AM_MAKEFLAGS) info.stamp; \
-	fi
-
-info.stamp: $(image_files) $(src_files)
-	trap "rm -rf info.lock info.stamp" 1 2 13 15; \
-	if mkdir info.lock 2>/dev/null; then \
-	    rm -f info.tmp; \
-	    touch info.tmp; \
-	    $(top_srcdir)/build-aux/sphinx-build \
-	        -b texinfo $(SPHINXOPTS) $(builddir)/texinfo; \
-	    $(MAKE_SAFE) -C texinfo info; \
-	    $(top_srcdir)/build-aux/sphinx-touch $(info_file_dist); \
-	    mv -f info.tmp $@; \
-	    rmdir info.lock; \
-	else \
-	    while test -d info.lock; do \
-	        sleep 1; \
-	    done; \
-	    test -f info.stamp; \
-	fi
-
-$(pdf_file_dist): pdf.stamp
-	@if test -f $@; then :; else \
-	    rm -f pdf.stamp; \
-	    $(MAKE_SAFE) $(AM_MAKEFLAGS) pdf.stamp; \
-	fi
-
-pdf.stamp: $(image_files) $(src_files)
-	trap "rm -rf pdf.lock pdf.stamp" 1 2 13 15; \
-	if mkdir pdf.lock 2>/dev/null; then \
-	    rm -f pdf.tmp; \
-	    touch pdf.tmp; \
-	    $(top_srcdir)/build-aux/sphinx-build \
-	        -b latex $(SPHINXOPTS) $(builddir)/latex; \
-	    $(MAKE_SAFE) -C latex all-pdf; \
-	    $(top_srcdir)/build-aux/sphinx-touch latex/CouchDB.pdf; \
-	    gzip -9 < latex/CouchDB.pdf > $(pdf_file_dist); \
-	    mv -f pdf.tmp $@; \
-	    rmdir pdf.lock; \
-	else \
-	    while test -d pdf.lock; do \
-	        sleep 1; \
-	    done; \
-	    test -f pdf.stamp; \
-	fi
-
-$(html_files): html.stamp
-	@if test -f $@; then :; else \
-	    rm -f html.stamp; \
-	    $(MAKE_SAFE) $(AM_MAKEFLAGS) html.stamp; \
-	fi
-
-html.stamp: $(image_files) $(src_files) $(src_files_html)
-	trap "rm -rf html.lock html.stamp" 1 2 13 15; \
-	if mkdir html.lock 2>/dev/null; then \
-	    rm -f html.tmp; \
-	    touch html.tmp; \
-	    $(top_srcdir)/build-aux/sphinx-build \
-	        -b html $(SPHINXOPTS) $(builddir)/html; \
-	    $(top_srcdir)/build-aux/sphinx-touch $(html_files); \
-	    mv -f html.tmp $@; \
-	    rmdir html.lock; \
-	else \
-	    while test -d html.lock; do \
-	        sleep 1; \
-	    done; \
-	    test -f html.stamp; \
-	fi
-
-pdf-local:
-	$(MAKE) $(AM_MAKEFLAGS) pdf.stamp
-
-html-local:
-	$(MAKE) $(AM_MAKEFLAGS) html.stamp
-
-install-data-local:
-	if test -s $(info_file_dist); then \
-	    $(INSTALL) -d $(DESTDIR)$(infodir); \
-	    $(INSTALL_DATA) \
-	        $(info_file_dist) $(DESTDIR)$(infodir)/$(info_file_inst); \
-	    if test -n "`which install-info`"; then \
-	        install-info \
-	            $(DESTDIR)$(infodir)/$(info_file_inst) \
-	            $(DESTDIR)$(infodir)/dir \
-	        || true; \
-	    fi \
-	fi
-	if test -s $(pdf_file_dist); then \
-	    $(INSTALL) -d $(DESTDIR)$(localdocdir); \
-	    $(INSTALL_DATA) \
-	        $(pdf_file_dist) $(DESTDIR)$(localdocdir)/$(pdf_file_inst); \
-	fi
-	for dist_file in $(html_files); do \
-	    if test -s $$dist_file; then \
-	        inst_file=`echo $$dist_file | sed s,^html,docs,`; \
-	        $(INSTALL) -d `dirname $(DESTDIR)$(localdatadir)/www/$$inst_file`; \
-	        $(INSTALL_DATA) \
-	            $$dist_file $(DESTDIR)$(localdatadir)/www/$$inst_file; \
-	    fi \
-	done
-
-uninstall-local:
-	rm -f $(DESTDIR)$(infodir)/$(info_file_inst)
-	if test -d $(DESTDIR)$(infodir); then \
-	    if test -n "`which install-info`"; then\
-	        install-info \
-	            --delete \
-	            $(DESTDIR)$(infodir)/$(info_file_inst) \
-	            $(DESTDIR)$(infodir)/dir \
-	        || true; \
-	    fi \
-	fi
-	rm -f $(DESTDIR)$(localdocdir)/$(pdf_file_inst)
-	for dist_file in $(html_files); do \
-	    if test -s $$dist_file; then \
-	        inst_file=`echo $$dist_file | sed s,^html,docs,`; \
-	        rm -f $(DESTDIR)$(localdatadir)/www/$$inst_file; \
-	    fi \
-	done
-
-DISTCLEANFILES = \
-    info.stamp \
-    pdf.stamp \
-    html.stamp
-
-distclean-local:
-	rm -fr doctrees
-	rm -fr html
-	rm -fr latex
-	rm -fr texinfo
-
-# We handle exit code manually. Please fix if there is a better way.
-distcheck-hook:
-	if test ! -s $(info_file_dist); then \
-	    $(top_srcdir)/build-aux/dist-error $(info_file_dist); \
-	fi
-	if test ! -s $(pdf_file_dist); then \
-	    $(top_srcdir)/build-aux/dist-error $(pdf_file_dist); \
-	fi
-	exit_code=0; \
-	for file in $(html_files); do \
-	    if test ! -s $$file; then \
-	        exit_code=1; \
-	        $(top_srcdir)/build-aux/dist-error $$file || break; \
-	    fi \
-	done; \
-	exit $$exit_code;

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644
index 2b05fbd..0000000
--- a/src/Makefile.am
+++ /dev/null
@@ -1,30 +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 = \
-    snappy \
-    ejson \
-    ibrowse \
-    mochiweb \
-    oauth \
-    config \
-    couch_index \
-    couch_mrview \
-    couch_replicator \
-    couch \
-	twig \
-	rexi \
-	mem3 \
-	fabric \
-	ets_lru \
-	ddoc_cache \
-	chttpd

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/chttpd/.gitignore
----------------------------------------------------------------------
diff --git a/src/chttpd/.gitignore b/src/chttpd/.gitignore
deleted file mode 100644
index ba4df8d..0000000
--- a/src/chttpd/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-ebin/*
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/chttpd/Makefile.am
----------------------------------------------------------------------
diff --git a/src/chttpd/Makefile.am b/src/chttpd/Makefile.am
deleted file mode 100644
index c785968..0000000
--- a/src/chttpd/Makefile.am
+++ /dev/null
@@ -1,56 +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.
-
-chttpdebindir = $(localerlanglibdir)/chttpd/ebin
-
-chttpdebin_DATA = $(compiled_files)
-
-source_files = \
-	src/chttpd.app.src \
-	src/chttpd.erl \
-	src/chttpd_app.erl \
-	src/chttpd_config_listener.erl \
-	src/chttpd_db.erl \
-	src/chttpd_external.erl \
-	src/chttpd_misc.erl \
-	src/chttpd_rewrite.erl \
-	src/chttpd_show.erl \
-	src/chttpd_sup.erl \
-	src/chttpd_view.erl
-
-compiled_files = \
-	ebin/chttpd.app \
-	ebin/chttpd.beam \
-	ebin/chttpd_app.beam \
-	ebin/chttpd_config_listener.beam \
-	ebin/chttpd_db.beam \
-	ebin/chttpd_external.beam \
-	ebin/chttpd_misc.beam \
-	ebin/chttpd_rewrite.beam \
-	ebin/chttpd_show.beam \
-	ebin/chttpd_sup.beam
-
-# Conflicts in couch_db.hrl prevent us from building these
-# until after we merge the couch application
-#	ebin/chttpd_view.beam
-
-
-EXTRA_DIST = $(source_files)
-CLEANFILES = $(compiled_files)
-
-ebin/%.app: src/%.app.src
-	@mkdir -p ebin/
-	sed -e "s|%version%|@version@|g" < $< > $@
-
-ebin/%.beam: src/%.erl
-	@mkdir -p ebin/
-	$(ERLC) -Wall -I$(top_srcdir)/src -o ebin/ $(ERLC_FLAGS) $<

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/chttpd/README.md
----------------------------------------------------------------------
diff --git a/src/chttpd/README.md b/src/chttpd/README.md
deleted file mode 100644
index 784bedd..0000000
--- a/src/chttpd/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-## chttpd
-
-chttpd is a cluster-aware http layer for [CouchDB][1].  It is used in [BigCouch][2] as the http front-end.
-
-### License
-[Apache 2.0][3]
-
-### Contact
- * [http://cloudant.com][4]
- * [info@cloudant.com][5]
-
-[1]: http://couchdb.apache.org
-[2]: http://github.com/cloudant/bigcouch
-[3]: http://www.apache.org/licenses/LICENSE-2.0.html
-[4]: http://cloudant.com
-[5]: mailto:info@cloudant.com

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/chttpd/src/chttpd.app.src
----------------------------------------------------------------------
diff --git a/src/chttpd/src/chttpd.app.src b/src/chttpd/src/chttpd.app.src
index d841f6c..9ab91c8 100644
--- a/src/chttpd/src/chttpd.app.src
+++ b/src/chttpd/src/chttpd.app.src
@@ -12,7 +12,7 @@
 
  {application, chttpd, [
     {description, "HTTP interface for CouchDB cluster"},
-    {vsn, "%version%"},
+    {vsn, git},
     {modules, [
         chttpd,
         chttpd_app,

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/chttpd/src/chttpd_view.erl
----------------------------------------------------------------------
diff --git a/src/chttpd/src/chttpd_view.erl b/src/chttpd/src/chttpd_view.erl
index 2c64dda..85b88a3 100644
--- a/src/chttpd/src/chttpd_view.erl
+++ b/src/chttpd/src/chttpd_view.erl
@@ -12,6 +12,7 @@
 
 -module(chttpd_view).
 -include_lib("couch/include/couch_db.hrl").
+-include_lib("couch_mrview/include/couch_mrview.hrl").
 
 -export([handle_view_req/3, handle_temp_view_req/2, get_reduce_type/1,
     parse_view_params/3, view_group_etag/2, view_group_etag/3,
@@ -91,11 +92,11 @@ view_callback({error, Reason}, {_, Resp}) ->
 extract_view_type(_ViewName, [], _IsReduce) ->
     throw({not_found, missing_named_view});
 extract_view_type(ViewName, [View|Rest], IsReduce) ->
-    case lists:member(ViewName, [Name || {Name, _} <- View#view.reduce_funs]) of
+    case lists:member(ViewName, [Name || {Name, _} <- View#mrview.reduce_funs]) of
     true ->
         if IsReduce -> reduce; true -> red_map end;
     false ->
-        case lists:member(ViewName, View#view.map_names) of
+        case lists:member(ViewName, View#mrview.map_names) of
         true -> map;
         false -> extract_view_type(ViewName, Rest, IsReduce)
         end
@@ -153,7 +154,7 @@ parse_view_params(Req, Keys, ViewType) when not is_list(Req) ->
     parse_view_params(QueryParams, Keys, ViewType);
 parse_view_params(QueryParams, Keys, ViewType) ->
     IsMultiGet = (Keys =/= nil),
-    Args = #view_query_args{
+    Args = #mrargs{
         view_type=ViewType,
         multi_get=IsMultiGet,
         keys=Keys
@@ -162,7 +163,7 @@ parse_view_params(QueryParams, Keys, ViewType) ->
         validate_view_query(K, V, Args2)
     end, Args, QueryParams),
 
-    GroupLevel = QueryArgs#view_query_args.group_level,
+    GroupLevel = QueryArgs#mrargs.group_level,
     case {ViewType, GroupLevel, IsMultiGet} of
         {reduce, exact, true} ->
             QueryArgs;
@@ -180,9 +181,9 @@ parse_view_params(QueryParams, Keys, ViewType) ->
 parse_json_view_param({<<"key">>, V}) ->
     [{start_key, V}, {end_key, V}];
 parse_json_view_param({<<"startkey_docid">>, V}) ->
-    [{start_docid, V}];
+    [{start_key_docid, V}];
 parse_json_view_param({<<"endkey_docid">>, V}) ->
-    [{end_docid, V}];
+    [{end_key_docid, V}];
 parse_json_view_param({<<"startkey">>, V}) ->
     [{start_key, V}];
 parse_json_view_param({<<"endkey">>, V}) ->
@@ -224,9 +225,9 @@ parse_view_param("key", Value) ->
     JsonKey = ?JSON_DECODE(Value),
     [{start_key, JsonKey}, {end_key, JsonKey}];
 parse_view_param("startkey_docid", Value) ->
-    [{start_docid, ?l2b(Value)}];
+    [{start_key_docid, ?l2b(Value)}];
 parse_view_param("endkey_docid", Value) ->
-    [{end_docid, ?l2b(Value)}];
+    [{end_key_docid, ?l2b(Value)}];
 parse_view_param("startkey", Value) ->
     [{start_key, ?JSON_DECODE(Value)}];
 parse_view_param("endkey", Value) ->
@@ -273,64 +274,64 @@ parse_view_param(Key, Value) ->
     [{extra, {Key, Value}}].
 
 validate_view_query(start_key, Value, Args) ->
-    case Args#view_query_args.multi_get of
+    case Args#mrargs.multi_get of
         true ->
             Msg = <<"Query parameter `start_key` is "
                     "not compatiible with multi-get">>,
             throw({query_parse_error, Msg});
         _ ->
-            Args#view_query_args{start_key=Value}
+            Args#mrargs{start_key=Value}
     end;
-validate_view_query(start_docid, Value, Args) ->
-    Args#view_query_args{start_docid=Value};
+validate_view_query(start_key_docid, Value, Args) ->
+    Args#mrargs{start_key_docid=Value};
 validate_view_query(end_key, Value, Args) ->
-    case Args#view_query_args.multi_get of
+    case Args#mrargs.multi_get of
         true->
             Msg = <<"Query paramter `end_key` is "
                     "not compatibile with multi-get">>,
             throw({query_parse_error, Msg});
         _ ->
-            Args#view_query_args{end_key=Value}
+            Args#mrargs{end_key=Value}
     end;
-validate_view_query(end_docid, Value, Args) ->
-    Args#view_query_args{end_docid=Value};
+validate_view_query(end_key_docid, Value, Args) ->
+    Args#mrargs{end_key_docid=Value};
 validate_view_query(limit, Value, Args) ->
-    Args#view_query_args{limit=Value};
+    Args#mrargs{limit=Value};
 validate_view_query(list, Value, Args) ->
-    Args#view_query_args{list=Value};
+    Args#mrargs{list=Value};
 validate_view_query(stale, Value, Args) ->
-    Args#view_query_args{stale=Value};
+    Args#mrargs{stale=Value};
 validate_view_query(descending, true, Args) ->
-    case Args#view_query_args.direction of
+    case Args#mrargs.direction of
         rev -> Args; % Already reversed
         fwd ->
-            Args#view_query_args{
+            Args#mrargs{
                 direction = rev,
-                start_docid =
-                    reverse_key_default(Args#view_query_args.start_docid),
-                end_docid =
-                    reverse_key_default(Args#view_query_args.end_docid)
+                start_key_docid =
+                    reverse_key_default(Args#mrargs.start_key_docid),
+                end_key_docid =
+                    reverse_key_default(Args#mrargs.end_key_docid)
             }
     end;
 validate_view_query(descending, false, Args) ->
     Args; % Ignore default condition
 validate_view_query(skip, Value, Args) ->
-    Args#view_query_args{skip=Value};
+    Args#mrargs{skip=Value};
 validate_view_query(group_level, Value, Args) ->
-    case Args#view_query_args.view_type of
+    case Args#mrargs.view_type of
         reduce ->
-            Args#view_query_args{group_level=Value};
+            Args#mrargs{group_level=Value};
         _ ->
             Msg = <<"Invalid URL parameter 'group' or "
                     " 'group_level' for non-reduce view.">>,
             throw({query_parse_error, Msg})
     end;
 validate_view_query(inclusive_end, Value, Args) ->
-    Args#view_query_args{inclusive_end=Value};
+    Args#mrargs{inclusive_end=Value};
 validate_view_query(reduce, false, Args) ->
     Args;
 validate_view_query(reduce, _, Args) ->
-    case Args#view_query_args.view_type of
+    case Args#mrargs.view_type of
         map ->
             Msg = <<"Invalid URL parameter `reduce` for map view.">>,
             throw({query_parse_error, Msg});
@@ -338,29 +339,29 @@ validate_view_query(reduce, _, Args) ->
             Args
     end;
 validate_view_query(include_docs, true, Args) ->
-    case Args#view_query_args.view_type of
+    case Args#mrargs.view_type of
         reduce ->
             Msg = <<"Query paramter `include_docs` "
                     "is invalid for reduce views.">>,
             throw({query_parse_error, Msg});
         _ ->
-            Args#view_query_args{include_docs=true}
+            Args#mrargs{include_docs=true}
     end;
 validate_view_query(include_docs, _Value, Args) ->
     Args;
 validate_view_query(conflicts, true, Args) ->
-    case Args#view_query_args.view_type of
+    case Args#mrargs.view_type of
     reduce ->
         Msg = <<"Query parameter `conflicts` "
                 "is invalid for reduce views.">>,
         throw({query_parse_error, Msg});
     _ ->
-        Args#view_query_args{extra = [conflicts|Args#view_query_args.extra]}
+        Args#mrargs{extra = [conflicts|Args#mrargs.extra]}
     end;
 validate_view_query(conflicts, _Value, Args) ->
     Args;
 validate_view_query(sorted, false, Args) ->
-    Args#view_query_args{sorted=false};
+    Args#mrargs{sorted=false};
 validate_view_query(sorted, _Value, Args) ->
     Args;
 validate_view_query(extra, _Value, Args) ->

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/config/.gitignore
----------------------------------------------------------------------
diff --git a/src/config/.gitignore b/src/config/.gitignore
deleted file mode 100644
index c57e7cf..0000000
--- a/src/config/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-ebin
-deps
-.eunit
-*~
-*.swp

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/config/Makefile.am
----------------------------------------------------------------------
diff --git a/src/config/Makefile.am b/src/config/Makefile.am
deleted file mode 100644
index 86731a2..0000000
--- a/src/config/Makefile.am
+++ /dev/null
@@ -1,44 +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.
-
-configebindir = $(localerlanglibdir)/config/ebin
-
-configebin_DATA = $(compiled_files)
-
-source_files = \
-	src/config.app.src \
-    src/config.erl \
-	src/config_app.erl \
-	src/config_listener.erl \
-	src/config_sup.erl \
-	src/config_util.erl \
-	src/config_writer.erl
-
-compiled_files = \
-	ebin/config.app \
-    ebin/config.beam \
-	ebin/config_app.beam \
-	ebin/config_listener.beam \
-	ebin/config_sup.beam \
-	ebin/config_util.beam \
-	ebin/config_writer.beam
-
-EXTRA_DIST = $(source_files)
-CLEANFILES = $(compiled_files)
-
-ebin/%.app: src/%.app.src
-	@mkdir -p ebin/
-	sed -e "s|%version%|@version@|g" < $< > $@
-
-ebin/%.beam: src/%.erl
-	@mkdir -p ebin/
-	$(ERLC) -Wall -I$(top_srcdir)/src -o ebin/ $(ERLC_FLAGS) $<

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/config/src/config.app.src
----------------------------------------------------------------------
diff --git a/src/config/src/config.app.src b/src/config/src/config.app.src
index 9b0f5f0..6eea351 100644
--- a/src/config/src/config.app.src
+++ b/src/config/src/config.app.src
@@ -12,7 +12,7 @@
 
 {application, config, [
     {description, "INI file configuration system for Apache CouchDB"},
-    {vsn, "%version%"},
+    {vsn, git},
     {modules, [
         config,
         config_app,

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/couch/Makefile.am
----------------------------------------------------------------------
diff --git a/src/couch/Makefile.am b/src/couch/Makefile.am
deleted file mode 100644
index 5f47bcd..0000000
--- a/src/couch/Makefile.am
+++ /dev/null
@@ -1,204 +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 = priv
-
-# devdocdir = $(localdocdir)/developer/couchdb
-couchlibdir = $(localerlanglibdir)/couch-$(version)
-couchincludedir = $(couchlibdir)/include
-couchebindir = $(couchlibdir)/ebin
-
-couchinclude_DATA = include/couch_db.hrl
-couchebin_DATA = $(compiled_files)
-
-# dist_devdoc_DATA = $(doc_base) $(doc_modules)
-
-CLEANFILES = $(compiled_files) $(doc_base)
-
-# CLEANFILES = $(doc_modules) edoc-info
-
-source_files = \
-    src/couch.erl \
-    src/couch_app.erl \
-    src/couch_auth_cache.erl \
-    src/couch_btree.erl \
-    src/couch_changes.erl \
-    src/couch_compaction_daemon.erl \
-    src/couch_compress.erl \
-    src/couch_config.erl \
-    src/couch_config_writer.erl \
-    src/couch_db.erl \
-    src/couch_db_update_notifier.erl \
-    src/couch_db_update_notifier_sup.erl \
-    src/couch_doc.erl \
-    src/couch_drv.erl \
-    src/couch_ejson_compare.erl \
-    src/couch_emsort.erl \
-    src/couch_event_sup.erl \
-    src/couch_external_manager.erl \
-    src/couch_external_server.erl \
-    src/couch_file.erl \
-    src/couch_httpd.erl \
-    src/couch_httpd_db.erl \
-    src/couch_httpd_auth.erl \
-    src/couch_httpd_cors.erl \
-    src/couch_httpd_oauth.erl \
-    src/couch_httpd_external.erl \
-    src/couch_httpd_misc_handlers.erl \
-    src/couch_httpd_proxy.erl \
-    src/couch_httpd_rewrite.erl \
-    src/couch_httpd_stats_handlers.erl \
-    src/couch_httpd_vhost.erl \
-    src/couch_key_tree.erl \
-    src/couch_log.erl \
-	src/couch_lru.erl \
-    src/couch_native_process.erl \
-    src/couch_os_daemons.erl \
-    src/couch_os_process.erl \
-    src/couch_passwords.erl \
-    src/couch_primary_sup.erl \
-	src/couch_proc_manager.erl \
-    src/couch_query_servers.erl \
-    src/couch_secondary_sup.erl \
-    src/couch_server.erl \
-    src/couch_stats_aggregator.erl \
-    src/couch_stats_collector.erl \
-    src/couch_stream.erl \
-    src/couch_sup.erl \
-    src/couch_task_status.erl \
-    src/couch_users_db.erl \
-    src/couch_util.erl \
-    src/couch_uuids.erl \
-    src/couch_db_updater.erl \
-    src/couch_work_queue.erl
-
-EXTRA_DIST = \
-	$(source_files) \
-	include/couch_db.hrl \
-	src/couch_js_functions.hrl
-
-compiled_files = \
-    ebin/couch.app \
-    ebin/couch.beam \
-    ebin/couch_app.beam \
-    ebin/couch_auth_cache.beam \
-    ebin/couch_btree.beam \
-    ebin/couch_changes.beam \
-    ebin/couch_compaction_daemon.beam \
-    ebin/couch_compress.beam \
-    ebin/couch_config.beam \
-    ebin/couch_config_writer.beam \
-    ebin/couch_db.beam \
-    ebin/couch_db_update_notifier.beam \
-    ebin/couch_db_update_notifier_sup.beam \
-    ebin/couch_doc.beam \
-    ebin/couch_drv.beam \
-    ebin/couch_ejson_compare.beam \
-    ebin/couch_emsort.beam \
-    ebin/couch_event_sup.beam \
-    ebin/couch_external_manager.beam \
-    ebin/couch_external_server.beam \
-    ebin/couch_file.beam \
-    ebin/couch_httpd.beam \
-    ebin/couch_httpd_db.beam \
-    ebin/couch_httpd_auth.beam \
-    ebin/couch_httpd_oauth.beam \
-    ebin/couch_httpd_cors.beam \
-    ebin/couch_httpd_proxy.beam \
-    ebin/couch_httpd_external.beam \
-    ebin/couch_httpd_misc_handlers.beam \
-    ebin/couch_httpd_rewrite.beam \
-    ebin/couch_httpd_stats_handlers.beam \
-    ebin/couch_httpd_vhost.beam \
-    ebin/couch_key_tree.beam \
-    ebin/couch_log.beam \
-	ebin/couch_lru.beam \
-    ebin/couch_native_process.beam \
-    ebin/couch_os_daemons.beam \
-    ebin/couch_os_process.beam \
-    ebin/couch_passwords.beam \
-    ebin/couch_primary_sup.beam \
-	ebin/couch_proc_manager.beam \
-    ebin/couch_query_servers.beam \
-    ebin/couch_secondary_sup.beam \
-    ebin/couch_server.beam \
-    ebin/couch_stats_aggregator.beam \
-    ebin/couch_stats_collector.beam \
-    ebin/couch_stream.beam \
-    ebin/couch_sup.beam \
-    ebin/couch_task_status.beam \
-    ebin/couch_users_db.beam \
-    ebin/couch_util.beam \
-    ebin/couch_uuids.beam \
-    ebin/couch_db_updater.beam \
-    ebin/couch_work_queue.beam
-
-# doc_base = \
-#     erlang.png \
-#     index.html \
-#     modules-frame.html \
-#     overview-summary.html \
-#     packages-frame.html \
-#     stylesheet.css
-
-# doc_modules = \
-#     couch_btree.html \
-#     couch_config.html \
-#     couch_config_writer.html \
-#     couch_db.html \
-#     couch_db_update_notifier.html \
-#     couch_db_update_notifier_sup.html \
-#     couch_doc.html \
-#     couch_event_sup.html \
-#     couch_file.html \
-#     couch_httpd.html \
-#     couch_key_tree.html \
-#     couch_log.html \
-#     couch_query_servers.html \
-#     couch_rep.html \
-#     couch_rep_sup.html \
-#     couch_server.html \
-#     couch_stream.html \
-#     couch_util.html
-
-if WINDOWS
-ebin/couch.app: src/couch.app.tpl
-	@mkdir -p ebin/
-	modules=`find ./src -name "*.erl" \! -name ".*" -exec basename {} .erl \; | tr '\n' ',' | sed "s/,$$//"`; \
-	sed -e "s|%package_name%|@package_name@|g" \
-			-e "s|%version%|@version@|g" \
-			-e "s|@modules@|$$modules|g" \
-			-e "s|%localconfdir%|../etc/couchdb|g" \
-			-e "s|@defaultini@|default.ini|g" \
-			-e "s|@localini@|local.ini|g" > \
-	$@ < $<
-else
-ebin/couch.app: src/couch.app.tpl
-	@mkdir -p ebin/
-	modules=`{ find ./src -name "*.erl" \! -name ".*" -exec basename {} .erl \; | tr '\n' ','; echo ''; } | sed "s/,$$//"`; \
-	sed -e "s|%package_name%|@package_name@|g" \
-			-e "s|%version%|@version@|g" \
-			-e "s|@modules@|$$modules|g" \
-			-e "s|%localconfdir%|@localconfdir@|g" \
-			-e "s|@defaultini@|default.ini|g" \
-			-e "s|@localini@|local.ini|g" > \
-	$@ < $<
-endif
-
-# $(dist_devdoc_DATA): edoc-info
-
-# $(ERL) -noshell -run edoc_run files [\"$<\"]
-
-ebin/%.beam: src/%.erl include/couch_db.hrl src/couch_js_functions.hrl
-	@mkdir -p ebin/
-	$(ERLC) -I$(top_srcdir)/src -o ebin/ $(ERLC_FLAGS) ${TEST} $<;
-

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/couch/priv/Makefile.am
----------------------------------------------------------------------
diff --git a/src/couch/priv/Makefile.am b/src/couch/priv/Makefile.am
deleted file mode 100644
index ced9bec..0000000
--- a/src/couch/priv/Makefile.am
+++ /dev/null
@@ -1,159 +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)
-
-couchlibdir = $(localerlanglibdir)/couch-$(version)
-couchprivdir = $(couchlibdir)/priv
-couchprivlibdir = $(couchlibdir)/priv/lib
-man1dir = $(mandir)/man1
-
-man_file = couchjs.1
-
-if BUILD_MAN
-man_file_build = $(man_file)
-else
-man_file_build =
-endif
-
-BUILT_SOURCES = $(man_file_build)
-
-EXTRA_DIST = \
-	spawnkillable/couchspawnkillable.sh \
-	stat_descriptions.cfg.in \
-	couch_ejson_compare/erl_nif_compat.h \
-	couch_js/sm170.c \
-	couch_js/sm180.c \
-	couch_js/sm185.c \
-	$(man_file_build)
-
-CLEANFILES = $(man_file_build) stat_descriptions.cfg
-
-couchprivlib_LTLIBRARIES = couch_icu_driver.la
-if USE_EJSON_COMPARE_NIF
-couchprivlib_LTLIBRARIES += couch_ejson_compare.la
-couch_ejson_compare_la_SOURCES = couch_ejson_compare/couch_ejson_compare.c
-couch_ejson_compare_la_CPPFLAGS = -D_BSD_SOURCE $(ICU_CPPFLAGS) $(ERLANG_FLAGS)
-couch_ejson_compare_la_LDFLAGS = -module -avoid-version
-couch_ejson_compare_la_LIBADD = $(ICU_LIBS)
-if WINDOWS
-couch_ejson_compare_la_LDFLAGS += -no-undefined
-endif
-endif
-couch_icu_driver_la_SOURCES = icu_driver/couch_icu_driver.c
-couch_icu_driver_la_LDFLAGS = -module -avoid-version
-couch_icu_driver_la_CPPFLAGS = $(ICU_CPPFLAGS) $(ERLANG_FLAGS)
-couch_icu_driver_la_LIBADD = $(ICU_LIBS)
-
-if WINDOWS
-couch_icu_driver_la_LDFLAGS += -no-undefined
-couch_icu_driver_so_name = couch_icu_driver.dll
-else
-couch_icu_driver_so_name = couch_icu_driver.so
-endif
-
-$(couch_icu_driver_so_name): couch_icu_driver.la
-	cp .libs/$(couch_icu_driver_so_name) $@
-
-all: $(couch_icu_driver_so_name)
-
-COUCHJS_SRCS = \
-	couch_js/help.h \
-	couch_js/http.c \
-	couch_js/http.h \
-	couch_js/main.c \
-	couch_js/utf8.c \
-	couch_js/utf8.h \
-	couch_js/util.h \
-	couch_js/util.c
-
-locallibbin_PROGRAMS = couchjs
-couchjs_SOURCES = $(COUCHJS_SRCS)
-couchjs_CFLAGS = -g -Wall -Werror -D_BSD_SOURCE $(CURL_CFLAGS) $(JS_CFLAGS)
-couchjs_LDADD = $(CURL_LIBS) $(JS_LIBS)
-
-couchpriv_DATA = stat_descriptions.cfg
-couchpriv_PROGRAMS = couchspawnkillable
-
-# Depend on source files so distributed man pages are not rebuilt for end user.
-
-$(man_file): $(COUCHJS_SRCS)
-	$(MAKE_SAFE) -f Makefile couchjs; \
-	$(top_srcdir)/build-aux/missing --run \
-	    help2man \
-	        --no-info \
-	        --help-option="-h" \
-	        --version-option="-V" \
-	        --name="$(package_name) JavaScript interpreter" \
-	        ./couchjs --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
-
-%.cfg: %.cfg.in
-	cp $< $@
-
-if WINDOWS
-couchspawnkillable_SOURCES = spawnkillable/couchspawnkillable_win.c
-endif
-
-if !WINDOWS
-couchspawnkillable: spawnkillable/couchspawnkillable.sh
-	cp $< $@
-	chmod +x $@
-endif
-
-# libtool and automake have defeated markh.  For each of our executables
-# we end up with 2 copies - one directly in the 'target' folder (eg, 'priv')
-# and another - the correct one - in .libs.  The former doesn't work but is
-# what gets installed for 'couchspawnkillable' - but the correct one for
-# couchjs.exe *does* get copied.  *shrug*  So just clobber it with the
-# correct one as the last step. See bug COUCHDB-439
-install-data-hook:
-	if test -f "$(DESTDIR)$(couchprivlibdir)/couch_icu_driver"; then \
-	    rm -f "$(DESTDIR)$(couchprivlibdir)/couch_icu_driver.so"; \
-	    cd "$(DESTDIR)$(couchprivlibdir)" && \
-	        $(LN_S) couch_icu_driver couch_icu_driver.so; \
-	fi
-	if test -f "$(DESTDIR)$(couchprivlibdir)/couch_ejson_compare_nif"; then \
-	    rm -f "$(DESTDIR)$(couchprivlibdir)/couch_ejson_compare_nif.so"; \
-	    cd "$(DESTDIR)$(couchprivlibdir)" && \
-	        $(LN_S) couch_ejson_compare_nif couch_ejson_compare_nif.so; \
-	fi
-if WINDOWS
-	$(INSTALL) $(ICU_BIN)/icuuc*.dll $(bindir)
-	$(INSTALL) $(ICU_BIN)/icudt*.dll $(bindir)
-	$(INSTALL) $(ICU_BIN)/icuin*.dll $(bindir)
-	$(INSTALL) $(JS_LIB_BINARY) $(bindir)
-	$(INSTALL) .libs/couchspawnkillable.exe \
-		"$(DESTDIR)$(couchprivdir)/couchspawnkillable.exe"
-endif
-
-uninstall-local:
-	rm -f $(DESTDIR)$(man1dir)/$(man_file)
-	if test -f "$(DESTDIR)$(couchprivlibdir)/couch_erl_driver"; then \
-	    rm -f "$(DESTDIR)$(couchprivlibdir)/couch_erl_driver.so"; \
-	fi
-
-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/ba152cb2/src/couch/src/couch.app.src
----------------------------------------------------------------------
diff --git a/src/couch/src/couch.app.src b/src/couch/src/couch.app.src
new file mode 100644
index 0000000..0cc3b54
--- /dev/null
+++ b/src/couch/src/couch.app.src
@@ -0,0 +1,22 @@
+{application, couch, [
+    {description, "Apache CouchDB"},
+    {vsn, git},
+    {registered, [
+        couch_db_update,
+        couch_db_update_notifier_sup,
+        couch_external_manager,
+        couch_httpd,
+        couch_log,
+        couch_primary_services,
+        couch_proc_manager,
+        couch_secondary_services,
+        couch_server,
+        couch_sup,
+        couch_stats_aggregator,
+        couch_stats_collector,
+        couch_task_status
+    ]},
+    {mod, {couch_app, []}},
+    {applications, [kernel, stdlib, crypto, sasl, inets, oauth, ibrowse,
+        mochiweb, ssl, twig, couch_event]}
+]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/couch/src/couch.app.tpl.in
----------------------------------------------------------------------
diff --git a/src/couch/src/couch.app.tpl.in b/src/couch/src/couch.app.tpl.in
deleted file mode 100644
index 9b7536b..0000000
--- a/src/couch/src/couch.app.tpl.in
+++ /dev/null
@@ -1,26 +0,0 @@
-{application, couch, [
-    {description, "@package_name@"},
-    {vsn, "@version@"},
-    {modules, [@modules@]},
-    {registered, [
-        couch_db_update,
-        couch_db_update_notifier_sup,
-        couch_external_manager,
-        couch_httpd,
-        couch_log,
-        couch_primary_services,
-        couch_proc_manager,
-        couch_secondary_services,
-        couch_server,
-        couch_sup,
-        couch_stats_aggregator,
-        couch_stats_collector,
-        couch_task_status
-    ]},
-    {mod, {couch_app, [
-        "%localconfdir%/@defaultini@",
-        "%localconfdir%/@localini@"
-    ]}},
-    {applications, [kernel, stdlib, twig, config]},
-    {included_applications, [crypto, sasl, inets, oauth, ibrowse, mochiweb, os_mon]}
-]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/couch_index/Makefile.am
----------------------------------------------------------------------
diff --git a/src/couch_index/Makefile.am b/src/couch_index/Makefile.am
deleted file mode 100644
index 945623a..0000000
--- a/src/couch_index/Makefile.am
+++ /dev/null
@@ -1,38 +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.
-
-couch_indexlibdir = $(localerlanglibdir)/couch_index-0.1
-couch_indexebindir = $(couch_indexlibdir)/ebin
-
-couch_indexebin_DATA = $(compiled_files)
-
-EXTRA_DIST = $(source_files)
-CLEANFILES = $(compiled_files)
-
-source_files = \
-    src/couch_index.erl \
-    src/couch_index_compactor.erl \
-    src/couch_index_server.erl \
-    src/couch_index_updater.erl \
-	src/couch_index_util.erl
-
-compiled_files = \
-    ebin/couch_index.beam \
-    ebin/couch_index_compactor.beam \
-    ebin/couch_index_server.beam \
-    ebin/couch_index_updater.beam \
-	ebin/couch_index_util.beam
-
-ebin/%.beam: src/%.erl
-	@mkdir -p ebin/
-	$(ERLC) -I$(top_srcdir)/src -o ebin/ $(ERLC_FLAGS) ${TEST} $<;
-

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/couch_index/src/couch_index.app.src
----------------------------------------------------------------------
diff --git a/src/couch_index/src/couch_index.app.src b/src/couch_index/src/couch_index.app.src
index 141ed9d..594589d 100644
--- a/src/couch_index/src/couch_index.app.src
+++ b/src/couch_index/src/couch_index.app.src
@@ -12,7 +12,7 @@
 
 {application, couch_index, [
     {description, "CouchDB Secondary Index Manager"},
-    {vsn, "@version@"},
+    {vsn, git},
     {modules, [
         couch_index,
         couch_index_server

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/couch_mrview/Makefile.am
----------------------------------------------------------------------
diff --git a/src/couch_mrview/Makefile.am b/src/couch_mrview/Makefile.am
deleted file mode 100644
index fa7d83b..0000000
--- a/src/couch_mrview/Makefile.am
+++ /dev/null
@@ -1,72 +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.
-
-couch_mrviewlibdir = $(localerlanglibdir)/couch_mrview-0.1
-couch_mrviewincludedir = $(couch_mrviewlibdir)/include
-couch_mrviewebindir = $(couch_mrviewlibdir)/ebin
-
-couch_mrviewinclude_DATA = $(include_files)
-couch_mrviewebin_DATA = $(compiled_files)
-
-include_files = \
-    include/couch_mrview.hrl
-
-source_files = \
-    src/couch_mrview.app.src \
-    src/couch_mrview.erl \
-    src/couch_mrview_cleanup.erl \
-    src/couch_mrview_compactor.erl \
-    src/couch_mrview_http.erl \
-    src/couch_mrview_index.erl \
-    src/couch_mrview_show.erl \
-    src/couch_mrview_test_util.erl \
-    src/couch_mrview_updater.erl \
-    src/couch_mrview_util.erl
-
-test_files = \
-    test/01-load.t \
-    test/02-map-views.t \
-    test/03-red-views.t \
-    test/04-index-info.t \
-    test/05-collation.t \
-    test/06-all-docs.t \
-	test/07-compact-swap.t
-
-compiled_files = \
-    ebin/couch_mrview.app \
-    ebin/couch_mrview.beam \
-    ebin/couch_mrview_cleanup.beam \
-    ebin/couch_mrview_compactor.beam \
-    ebin/couch_mrview_http.beam \
-    ebin/couch_mrview_index.beam \
-    ebin/couch_mrview_show.beam \
-    ebin/couch_mrview_test_util.beam \
-    ebin/couch_mrview_updater.beam \
-    ebin/couch_mrview_util.beam
-
-EXTRA_DIST = $(include_files) $(source_files) $(test_files)
-CLEANFILES = $(compiled_files)
-
-check:
-if TESTS
-	$(abs_top_builddir)/test/etap/run $(abs_top_srcdir)/src/couch_mrview/test
-endif
-
-ebin/%.app: src/%.app.src
-	@mkdir -p ebin/
-	sed -e "s|%version%|@version@|g" \
-	< $< > $@
-
-ebin/%.beam: src/%.erl $(include_files)
-	@mkdir -p ebin/
-	$(ERLC) -Wall -I$(top_srcdir)/src -o ebin/ $(ERLC_FLAGS) ${TEST} $<;
-

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/couch_mrview/include/couch_mrview.hrl
----------------------------------------------------------------------
diff --git a/src/couch_mrview/include/couch_mrview.hrl b/src/couch_mrview/include/couch_mrview.hrl
index 0d59066..6a0dfd0 100644
--- a/src/couch_mrview/include/couch_mrview.hrl
+++ b/src/couch_mrview/include/couch_mrview.hrl
@@ -70,11 +70,13 @@
     skip = 0,
     group_level = 0,
     stale = false,
+    multi_get = false,
     inclusive_end = true,
     include_docs = false,
     update_seq=false,
     conflicts,
     callback,
     list,
+    sorted = true,
     extra = []
 }).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/couch_mrview/src/couch_mrview.app.src
----------------------------------------------------------------------
diff --git a/src/couch_mrview/src/couch_mrview.app.src b/src/couch_mrview/src/couch_mrview.app.src
index 52898a6..99c52f0 100644
--- a/src/couch_mrview/src/couch_mrview.app.src
+++ b/src/couch_mrview/src/couch_mrview.app.src
@@ -12,7 +12,7 @@
 
 {application, couch_mrview, [
     {description, "CouchDB Map/Reduce Views"},
-    {vsn, "%version%"},
+    {vsn, git},
     {modules, [
         couch_mrview,
         couch_mrview_compactor,

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/couch_replicator/.gitignore
----------------------------------------------------------------------
diff --git a/src/couch_replicator/.gitignore b/src/couch_replicator/.gitignore
deleted file mode 100644
index b3099f5..0000000
--- a/src/couch_replicator/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.beam
-.eunit
-ebin/replicator.app
-.DS_Store
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/couch_replicator/Makefile.am
----------------------------------------------------------------------
diff --git a/src/couch_replicator/Makefile.am b/src/couch_replicator/Makefile.am
deleted file mode 100644
index ea5d117..0000000
--- a/src/couch_replicator/Makefile.am
+++ /dev/null
@@ -1,76 +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.
-
-couch_replicatorlibdir = $(localerlanglibdir)/couch_replicator-0.1
-couch_replicatorincludedir = $(couch_replicatorlibdir)/include
-couch_replicatorebindir = $(couch_replicatorlibdir)/ebin
-
-couch_replicatorinclude_DATA = $(include_files)
-couch_replicatorebin_DATA = $(compiled_files)
-
-include_files = \
-	src/couch_replicator_api_wrap.hrl \
-	src/couch_replicator.hrl \
-	src/couch_replicator_js_functions.hrl
-
-source_files = \
-	src/couch_replicator_api_wrap.erl \
-	src/couch_replicator_httpc_pool.erl \
-	src/couch_replicator_httpc.erl \
-	src/couch_replicator_httpd.erl \
-	src/couch_replicator_job_sup.erl \
-	src/couch_replicator_notifier.erl \
-	src/couch_replicator_manager.erl \
-	src/couch_replicator_utils.erl \
-	src/couch_replicator_worker.erl \
-	src/couch_replicator.app.src \
-	src/couch_replicator.erl
-
-test_files = \
-	test/01-load.t \
-	test/02-httpc-pool.t \
-	test/03-replication-compact.t \
-	test/04-replication-large-atts.t \
-	test/05-replication-many-leaves.t \
-	test/06-doc-missing-stubs.t
-
-compiled_files = \
-	ebin/couch_replicator_api_wrap.beam \
-	ebin/couch_replicator_httpc_pool.beam \
-	ebin/couch_replicator_httpc.beam \
-	ebin/couch_replicator_httpd.beam \
-	ebin/couch_replicator_job_sup.beam \
-	ebin/couch_replicator_notifier.beam \
-	ebin/couch_replicator_manager.beam \
-	ebin/couch_replicator_utils.beam \
-	ebin/couch_replicator_worker.beam \
-	ebin/couch_replicator.app \
-	ebin/couch_replicator.beam
-
-EXTRA_DIST = $(include_files) $(source_files) $(test_files)
-CLEANFILES = $(compiled_files)
-
-check:
-if TESTS
-	$(abs_top_builddir)/test/etap/run $(abs_top_srcdir)/src/couch_replicator/test
-endif
-
-ebin/%.app: src/%.app.src
-	@mkdir -p ebin/
-	sed -e "s|%version%|@version@|g" \
-	< $< > $@
-
-ebin/%.beam: src/%.erl $(include_files)
-	@mkdir -p ebin/
-	$(ERLC) -Wall -I$(top_srcdir)/src -o ebin/ $(ERLC_FLAGS) ${TEST} $<;
-
-

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/couch_replicator/src/couch_replicator.app.src
----------------------------------------------------------------------
diff --git a/src/couch_replicator/src/couch_replicator.app.src b/src/couch_replicator/src/couch_replicator.app.src
index bd6b3e3..2da0d4a 100644
--- a/src/couch_replicator/src/couch_replicator.app.src
+++ b/src/couch_replicator/src/couch_replicator.app.src
@@ -12,7 +12,7 @@
 
 {application, couch_replicator, [
     {description, "CouchDB replicator"},
-    {vsn, "%version%"},
+    {vsn, git},
     {modules, [
         couch_replicator,
         couch_replicator_api_wrap,

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/ddoc_cache/.gitignore
----------------------------------------------------------------------
diff --git a/src/ddoc_cache/.gitignore b/src/ddoc_cache/.gitignore
deleted file mode 100644
index fc83a9a..0000000
--- a/src/ddoc_cache/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-ebin/

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/ddoc_cache/Makefile.am
----------------------------------------------------------------------
diff --git a/src/ddoc_cache/Makefile.am b/src/ddoc_cache/Makefile.am
deleted file mode 100644
index 6936545..0000000
--- a/src/ddoc_cache/Makefile.am
+++ /dev/null
@@ -1,42 +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.
-
-ddoc_cacheebindir = $(localerlanglibdir)/ddoc_cache/ebin
-
-ddoc_cacheebin_DATA = $(compiled_files)
-
-source_files = \
-	src/ddoc_cache.app.src \
-    src/ddoc_cache.erl \
-	src/ddoc_cache_app.erl \
-	src/ddoc_cache_opener.erl \
-	src/ddoc_cache_sup.erl \
-	src/ddoc_cache_util.erl
-
-compiled_files = \
-	ebin/ddoc_cache.app \
-    ebin/ddoc_cache.beam \
-	ebin/ddoc_cache_app.beam \
-	ebin/ddoc_cache_opener.beam \
-	ebin/ddoc_cache_sup.beam \
-	ebin/ddoc_cache_util.beam
-
-EXTRA_DIST = $(source_files)
-CLEANFILES = $(compiled_files)
-
-ebin/%.app: src/%.app.src
-	@mkdir -p ebin/
-	sed -e "s|%version%|@version@|g" < $< > $@
-
-ebin/%.beam: src/%.erl
-	@mkdir -p ebin/
-	$(ERLC) -Wall -I$(top_srcdir)/src -o ebin/ $(ERLC_FLAGS) $<

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/ddoc_cache/src/ddoc_cache.app.src
----------------------------------------------------------------------
diff --git a/src/ddoc_cache/src/ddoc_cache.app.src b/src/ddoc_cache/src/ddoc_cache.app.src
index 78f45de..a183dbd 100644
--- a/src/ddoc_cache/src/ddoc_cache.app.src
+++ b/src/ddoc_cache/src/ddoc_cache.app.src
@@ -12,7 +12,7 @@
 
 {application, ddoc_cache, [
     {description, "Design Document Cache"},
-    {vsn, "%version%"},
+    {vsn, git},
     {modules, [
         ddoc_cache,
         ddoc_cache_app,

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/ejson/Makefile.am
----------------------------------------------------------------------
diff --git a/src/ejson/Makefile.am b/src/ejson/Makefile.am
deleted file mode 100644
index 21136fb..0000000
--- a/src/ejson/Makefile.am
+++ /dev/null
@@ -1,91 +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.
-
-ejsonebindir = $(localerlanglibdir)/ejson-0.1.0/ebin
-ejsonprivdir = $(localerlanglibdir)/ejson-0.1.0/priv
-
-CLEANFILES = \
-    $(ejsonebin_make_generated_file_list) \
-    $(ejsonpriv_make_generated_file_list) \
-    priv/ejson.so
-
-EJSON_C_SRCS = \
-	c_src/ejson.c \
-	c_src/decode.c \
-	c_src/encode.c \
-	c_src/yajl/yajl_alloc.c \
-	c_src/yajl/yajl_buf.c \
-	c_src/yajl/yajl.c \
-	c_src/yajl/yajl_encode.c \
-	c_src/yajl/yajl_gen.c \
-	c_src/yajl/yajl_lex.c \
-	c_src/yajl/yajl_parser.c
-
-EJSON_C_HDRS = \
-    c_src/erl_nif_compat.h \
-    c_src/yajl/yajl_alloc.h \
-    c_src/yajl/yajl_buf.h \
-    c_src/yajl/yajl_bytestack.h \
-    c_src/yajl/yajl_common.h \
-    c_src/yajl/yajl_encode.h \
-    c_src/yajl/yajl_gen.h \
-    c_src/yajl/yajl_lex.h \
-    c_src/yajl/yajl_parse.h \
-    c_src/yajl/yajl_parser.h
-
-ejson_file_collection = \
-    src/ejson.app.in \
-    src/ejson.erl \
-    src/mochijson2.erl \
-    src/mochinum.erl
-
-ejsonebin_make_generated_file_list = \
-    ebin/ejson.app \
-    ebin/ejson.beam \
-    ebin/mochijson2.beam \
-    ebin/mochinum.beam
-
-EXTRA_DIST = \
-	$(EJSON_C_HDRS) \
-	$(ejson_file_collection)
-
-ejsonebin_DATA = \
-    $(ejsonebin_make_generated_file_list)
-
-if USE_OTP_NIFS
-ejsonpriv_LTLIBRARIES = ejson.la
-
-ejson_la_SOURCES = $(EJSON_C_SRCS)
-ejson_la_CFLAGS = $(ERLANG_FLAGS)
-ejson_la_LDFLAGS = -module -avoid-version
-
-if WINDOWS
-ejson_la_LDFLAGS += -no-undefined
-EJSON_SO_NAME = ejson.dll
-else
-EJSON_SO_NAME = ejson.so
-endif
-
-priv/$(EJSON_SO_NAME): ejson.la
-	@mkdir -p ./priv
-	cp .libs/$(EJSON_SO_NAME) $@
-
-all: priv/$(EJSON_SO_NAME)
-endif
-
-ebin/%.app: src/%.app.in
-	@mkdir -p ebin/
-	cp $< $@
-
-ebin/%.beam: src/%.erl
-	@mkdir -p ebin/
-	$(ERLC) $(ERLC_FLAGS) -o ebin/ $<

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/ejson/src/ejson.app.in
----------------------------------------------------------------------
diff --git a/src/ejson/src/ejson.app.in b/src/ejson/src/ejson.app.in
deleted file mode 100644
index c2920e9..0000000
--- a/src/ejson/src/ejson.app.in
+++ /dev/null
@@ -1,9 +0,0 @@
-{application, ejson, [
-    {description, "EJSON - decode and encode JSON into/from Erlang terms"},
-    {vsn, "0.1.0"},
-    {modules, [ejson]},
-    {registered, []},
-    {applications, [kernel, stdlib]},
-    {env, []}
-]}.
-

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/ejson/src/ejson.app.src
----------------------------------------------------------------------
diff --git a/src/ejson/src/ejson.app.src b/src/ejson/src/ejson.app.src
new file mode 100644
index 0000000..7180b81
--- /dev/null
+++ b/src/ejson/src/ejson.app.src
@@ -0,0 +1,9 @@
+{application, ejson, [
+    {description, "EJSON - decode and encode JSON into/from Erlang terms"},
+    {vsn, git},
+    {modules, [ejson]},
+    {registered, []},
+    {applications, [kernel, stdlib]},
+    {env, []}
+]}.
+

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/ets_lru/.gitignore
----------------------------------------------------------------------
diff --git a/src/ets_lru/.gitignore b/src/ets_lru/.gitignore
deleted file mode 100644
index 90bd4cb..0000000
--- a/src/ets_lru/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-erl_crash.dump
-
-.eunit/
-ebin/
-test/*.beam

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/ets_lru/Makefile.am
----------------------------------------------------------------------
diff --git a/src/ets_lru/Makefile.am b/src/ets_lru/Makefile.am
deleted file mode 100644
index 5fd6c7b..0000000
--- a/src/ets_lru/Makefile.am
+++ /dev/null
@@ -1,34 +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.
-
-ets_lruebindir = $(localerlanglibdir)/ets_lru/ebin
-
-ets_lruebin_DATA = $(compiled_files)
-
-source_files = \
-	src/ets_lru.app.src \
-    src/ets_lru.erl
-
-compiled_files = \
-	ebin/ets_lru.app \
-    ebin/ets_lru.beam
-
-EXTRA_DIST = $(source_files)
-CLEANFILES = $(compiled_files)
-
-ebin/%.app: src/%.app.src
-	@mkdir -p ebin/
-	sed -e "s|%version%|@version@|g" < $< > $@
-
-ebin/%.beam: src/%.erl
-	@mkdir -p ebin/
-	$(ERLC) -Wall -I$(top_srcdir)/src -o ebin/ $(ERLC_FLAGS) $<

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/ets_lru/src/ets_lru.app.src
----------------------------------------------------------------------
diff --git a/src/ets_lru/src/ets_lru.app.src b/src/ets_lru/src/ets_lru.app.src
index 603c5d6..2573a0f 100644
--- a/src/ets_lru/src/ets_lru.app.src
+++ b/src/ets_lru/src/ets_lru.app.src
@@ -12,7 +12,7 @@
 
 {application, ets_lru, [
     {description, "ETS Base LRU Cache"},
-    {vsn, "%version%"},
+    {vsn, git},
     {modules, [
         ets_lru
     ]},

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/fabric/.gitignore
----------------------------------------------------------------------
diff --git a/src/fabric/.gitignore b/src/fabric/.gitignore
deleted file mode 100644
index 37bfdb0..0000000
--- a/src/fabric/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.beam
-.eunit
-ebin/fabric.app
-.DS_Store
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/fabric/Makefile.am
----------------------------------------------------------------------
diff --git a/src/fabric/Makefile.am b/src/fabric/Makefile.am
deleted file mode 100644
index 64ca935..0000000
--- a/src/fabric/Makefile.am
+++ /dev/null
@@ -1,77 +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.
-
-fabricebindir = $(localerlanglibdir)/fabric/ebin
-
-fabricebin_DATA = $(compiled_files)
-
-source_files = \
-    src/fabric.app.src \
-    src/fabric.erl \
-    src/fabric_db_create.erl \
-    src/fabric_db_delete.erl \
-    src/fabric_db_doc_count.erl \
-    src/fabric_db_info.erl \
-    src/fabric_db_meta.erl \
-    src/fabric_db_update_listener.erl \
-    src/fabric_dict.erl \
-    src/fabric_doc_attachments.erl \
-    src/fabric_doc_missing_revs.erl \
-    src/fabric_doc_open.erl \
-    src/fabric_doc_open_revs.erl \
-    src/fabric_doc_update.erl \
-    src/fabric_group_info.erl \
-    src/fabric_rpc.erl \
-    src/fabric_util.erl \
-    src/fabric_view.erl \
-    src/fabric_view_all_docs.erl \
-    src/fabric_view_changes.erl \
-    src/fabric_view_map.erl \
-    src/fabric_view_reduce.erl
-
-compiled_files = \
-    ebin/fabric.app \
-    ebin/fabric.beam \
-    ebin/fabric_db_create.beam \
-    ebin/fabric_db_delete.beam \
-    ebin/fabric_db_doc_count.beam \
-    ebin/fabric_db_info.beam \
-    ebin/fabric_db_meta.beam \
-    ebin/fabric_db_update_listener.beam \
-    ebin/fabric_dict.beam \
-    ebin/fabric_doc_attachments.beam \
-    ebin/fabric_doc_missing_revs.beam \
-    ebin/fabric_doc_open.beam \
-    ebin/fabric_doc_open_revs.beam \
-    ebin/fabric_doc_update.beam \
-    ebin/fabric_group_info.beam \
-    ebin/fabric_util.beam
-
-# Conflicts in couch_db.hrl prevent us from building these
-# until after we merge the couch application
-#   ebin/fabric_rpc.beam
-#	ebin/fabric_view.beam
-#	ebin/fabric_view_all_docs.beam
-#	ebin/fabric_view_changes.beam
-#	ebin/fabric_view_map.beam
-#	ebin/fabric_view_reduce.beam
-
-EXTRA_DIST = $(source_files)
-CLEANFILES = $(compiled_files)
-
-ebin/%.app: src/%.app.src
-	@mkdir -p ebin/
-	sed -e "s|%version%|@version@|g" < $< > $@
-
-ebin/%.beam: src/%.erl
-	@mkdir -p ebin/
-	$(ERLC) -Wall -I$(top_srcdir)/src -o ebin/ $(ERLC_FLAGS) $<

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/fabric/src/fabric.app.src
----------------------------------------------------------------------
diff --git a/src/fabric/src/fabric.app.src b/src/fabric/src/fabric.app.src
index a3022e6..5ac86ef 100644
--- a/src/fabric/src/fabric.app.src
+++ b/src/fabric/src/fabric.app.src
@@ -12,7 +12,7 @@
 
 {application, fabric, [
     {description, "Routing and proxying layer for CouchDB cluster"},
-    {vsn, "%version%"},
+    {vsn, git},
     {modules, [
         fabric,
         fabric_db_create,

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/fabric/src/fabric_rpc.erl
----------------------------------------------------------------------
diff --git a/src/fabric/src/fabric_rpc.erl b/src/fabric/src/fabric_rpc.erl
index 4926609..2685cd7 100644
--- a/src/fabric/src/fabric_rpc.erl
+++ b/src/fabric/src/fabric_rpc.erl
@@ -22,6 +22,7 @@
 
 -include_lib("fabric/include/fabric.hrl").
 -include_lib("couch/include/couch_db.hrl").
+-include_lib("couch_mrview/include/couch_mrview.hrl").
 
 -record (view_acc, {
     db,
@@ -38,13 +39,13 @@
 %% rpc endpoints
 %%  call to with_db will supply your M:F with a #db{} and then remaining args
 
-all_docs(DbName, #view_query_args{keys=nil} = QueryArgs) ->
+all_docs(DbName, #mrargs{keys=nil} = QueryArgs) ->
     {ok, Db} = get_or_create_db(DbName, []),
-    #view_query_args{
+    #mrargs{
         start_key = StartKey,
-        start_docid = StartDocId,
+        start_key_docid = StartDocId,
         end_key = EndKey,
-        end_docid = EndDocId,
+        end_key_docid = EndDocId,
         limit = Limit,
         skip = Skip,
         include_docs = IncludeDocs,
@@ -93,7 +94,7 @@ changes(DbName, Options, StartSeq) ->
 
 map_view(DbName, DDoc, ViewName, QueryArgs) ->
     {ok, Db} = get_or_create_db(DbName, []),
-    #view_query_args{
+    #mrargs{
         limit = Limit,
         skip = Skip,
         keys = Keys,
@@ -126,7 +127,7 @@ map_view(DbName, DDoc, ViewName, QueryArgs) ->
         {ok, _, Acc} = couch_view:fold(View, fun view_fold/3, Acc0, Options);
     _ ->
         Acc = lists:foldl(fun(Key, AccIn) ->
-            KeyArgs = QueryArgs#view_query_args{start_key=Key, end_key=Key},
+            KeyArgs = QueryArgs#mrargs{start_key=Key, end_key=Key},
             Options = couch_httpd_view:make_key_options(KeyArgs),
             {_Go, _, Out} = couch_view:fold(View, fun view_fold/3, AccIn,
                 Options),
@@ -141,7 +142,7 @@ reduce_view(DbName, #doc{} = DDoc, ViewName, QueryArgs) ->
 reduce_view(DbName, Group0, ViewName, QueryArgs) ->
     erlang:put(io_priority, {interactive, DbName}),
     {ok, Db} = get_or_create_db(DbName, []),
-    #view_query_args{
+    #mrargs{
         group_level = GroupLevel,
         limit = Limit,
         skip = Skip,
@@ -168,7 +169,7 @@ reduce_view(DbName, Group0, ViewName, QueryArgs) ->
         couch_view:fold_reduce(ReduceView, fun reduce_fold/3, Acc0, Options);
     _ ->
         lists:map(fun(Key) ->
-            KeyArgs = QueryArgs#view_query_args{start_key=Key, end_key=Key},
+            KeyArgs = QueryArgs#mrargs{start_key=Key, end_key=Key},
             Options0 = couch_httpd_view:make_key_options(KeyArgs),
             Options = [{key_group_fun, GroupFun} | Options0],
             couch_view:fold_reduce(ReduceView, fun reduce_fold/3, Acc0, Options)

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/fabric/src/fabric_view.erl
----------------------------------------------------------------------
diff --git a/src/fabric/src/fabric_view.erl b/src/fabric/src/fabric_view.erl
index a42582b..9cb4b03 100644
--- a/src/fabric/src/fabric_view.erl
+++ b/src/fabric/src/fabric_view.erl
@@ -19,6 +19,7 @@
 -include_lib("fabric/include/fabric.hrl").
 -include_lib("mem3/include/mem3.hrl").
 -include_lib("couch/include/couch_db.hrl").
+-include_lib("couch_mrview/include/couch_mrview.hrl").
 
 -spec remove_down_shards(#collector{}, node()) ->
     {ok, #collector{}} | {error, any()}.
@@ -139,7 +140,7 @@ possibly_embed_doc(_State,
     Row;
 possibly_embed_doc(#collector{db_name=DbName, query_args=Args},
               #view_row{key=_Key, id=_Id, value=Value, doc=_Doc}=Row) ->
-    #view_query_args{include_docs=IncludeDocs} = Args,
+    #mrargs{include_docs=IncludeDocs} = Args,
     case IncludeDocs andalso is_tuple(Value) of
     true ->
         {Props} = Value,
@@ -190,7 +191,7 @@ get_next_row(#collector{rows = []}) ->
     throw(complete);
 get_next_row(#collector{reducer = RedSrc} = St) when RedSrc =/= undefined ->
     #collector{
-        query_args = #view_query_args{direction=Dir},
+        query_args = #mrargs{direction=Dir},
         keys = Keys,
         rows = RowDict,
         os_proc = Proc,
@@ -269,9 +270,9 @@ extract_view(Pid, ViewName, [View|Rest], ViewType) ->
     end.
 
 view_names(View, Type) when Type == red_map; Type == reduce ->
-    [Name || {Name, _} <- View#view.reduce_funs];
+    [Name || {Name, _} <- View#mrview.reduce_funs];
 view_names(View, map) ->
-    View#view.map_names.
+    View#mrview.map_names.
 
 index_of(X, List) ->
     index_of(X, List, 1).
@@ -283,10 +284,10 @@ index_of(X, [X|_Rest], I) ->
 index_of(X, [_|Rest], I) ->
     index_of(X, Rest, I+1).
 
-get_shards(DbName, #view_query_args{stale=Stale})
+get_shards(DbName, #mrargs{stale=Stale})
   when Stale == ok orelse Stale == update_after ->
     mem3:ushards(DbName);
-get_shards(DbName, #view_query_args{stale=false}) ->
+get_shards(DbName, #mrargs{stale=false}) ->
     mem3:shards(DbName).
 
 % unit test

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/fabric/src/fabric_view_reduce.erl
----------------------------------------------------------------------
diff --git a/src/fabric/src/fabric_view_reduce.erl b/src/fabric/src/fabric_view_reduce.erl
index 54dcdf5..c922a7f 100644
--- a/src/fabric/src/fabric_view_reduce.erl
+++ b/src/fabric/src/fabric_view_reduce.erl
@@ -17,6 +17,7 @@
 -include_lib("fabric/include/fabric.hrl").
 -include_lib("mem3/include/mem3.hrl").
 -include_lib("couch/include/couch_db.hrl").
+-include_lib("couch_mrview/include/couch_mrview.hrl").
 
 go(DbName, GroupId, View, Args, Callback, Acc0) when is_binary(GroupId) ->
     {ok, DDoc} = fabric:open_doc(DbName, <<"_design/", GroupId/binary>>, []),
@@ -27,13 +28,13 @@ go(DbName, DDoc, VName, Args, Callback, Acc0) ->
     Lang = couch_view_group:get_language(Group),
     Views = couch_view_group:get_views(Group),
     {NthRed, View} = fabric_view:extract_view(nil, VName, Views, reduce),
-    {VName, RedSrc} = lists:nth(NthRed, View#view.reduce_funs),
+    {VName, RedSrc} = lists:nth(NthRed, View#mrview.reduce_funs),
     Workers = lists:map(fun(#shard{name=Name, node=N} = Shard) ->
         Ref = rexi:cast(N, {fabric_rpc, reduce_view, [Name,DDoc,VName,Args]}),
         Shard#shard{ref = Ref}
     end, fabric_view:get_shards(DbName, Args)),
     RexiMon = fabric_util:create_monitors(Workers),
-    #view_query_args{limit = Limit, skip = Skip} = Args,
+    #mrargs{limit = Limit, skip = Skip} = Args,
     OsProc = case os_proc_needed(RedSrc) of
         true -> couch_query_servers:get_os_process(Lang);
         _ -> nil
@@ -43,7 +44,7 @@ go(DbName, DDoc, VName, Args, Callback, Acc0) ->
         query_args = Args,
         callback = Callback,
         counters = fabric_dict:init(Workers, 0),
-        keys = Args#view_query_args.keys,
+        keys = Args#mrargs.keys,
         skip = Skip,
         limit = Limit,
         lang = Lang,

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/ibrowse/Makefile.am
----------------------------------------------------------------------
diff --git a/src/ibrowse/Makefile.am b/src/ibrowse/Makefile.am
deleted file mode 100644
index 533a27f..0000000
--- a/src/ibrowse/Makefile.am
+++ /dev/null
@@ -1,51 +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.
-
-ibrowseebindir = $(localerlanglibdir)/ibrowse-2.2.0/ebin
-
-ibrowse_file_collection = \
-	src/ibrowse.app.in \
-	src/ibrowse.erl \
-	src/ibrowse_app.erl \
-	src/ibrowse_http_client.erl \
-	src/ibrowse_lb.erl \
-	src/ibrowse_lib.erl \
-	src/ibrowse_sup.erl \
-	src/ibrowse_test.erl
-
-ibrowseebin_make_generated_file_list = \
-	ebin/ibrowse.app \
-	ebin/ibrowse.beam \
-	ebin/ibrowse_app.beam \
-	ebin/ibrowse_http_client.beam \
-	ebin/ibrowse_lb.beam \
-	ebin/ibrowse_lib.beam \
-	ebin/ibrowse_sup.beam \
-	ebin/ibrowse_test.beam
-
-ibrowseebin_DATA = \
-    $(ibrowseebin_make_generated_file_list)
-
-EXTRA_DIST =  \
-    $(ibrowse_file_collection) \
-    include/ibrowse.hrl
-
-CLEANFILES = \
-    $(ibrowseebin_make_generated_file_list)
-
-ebin/%.app: src/%.app.in
-	@mkdir -p ebin/
-	cp $< $@
-
-ebin/%.beam: src/%.erl
-	@mkdir -p ebin/
-	$(ERLC) -o ebin/ -I$(top_srcdir)/src $(ERLC_FLAGS) $<

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/ibrowse/src/ibrowse.app.in
----------------------------------------------------------------------
diff --git a/src/ibrowse/src/ibrowse.app.in b/src/ibrowse/src/ibrowse.app.in
deleted file mode 100644
index 1d88084..0000000
--- a/src/ibrowse/src/ibrowse.app.in
+++ /dev/null
@@ -1,7 +0,0 @@
-{application, ibrowse,
-        [{description, "Erlang HTTP client application"},
-         {vsn, "4.0.1"},
-         {registered, [ibrowse_sup, ibrowse]},
-         {applications, [kernel,stdlib]},
-	 {env, []},
-	 {mod, {ibrowse_app, []}}]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/ibrowse/src/ibrowse.app.src
----------------------------------------------------------------------
diff --git a/src/ibrowse/src/ibrowse.app.src b/src/ibrowse/src/ibrowse.app.src
new file mode 100644
index 0000000..f65ba44
--- /dev/null
+++ b/src/ibrowse/src/ibrowse.app.src
@@ -0,0 +1,7 @@
+{application, ibrowse,
+        [{description, "Erlang HTTP client application"},
+         {vsn, git},
+         {registered, [ibrowse_sup, ibrowse]},
+         {applications, [kernel,stdlib]},
+	 {env, []},
+	 {mod, {ibrowse_app, []}}]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/mem3/.gitignore
----------------------------------------------------------------------
diff --git a/src/mem3/.gitignore b/src/mem3/.gitignore
deleted file mode 100644
index e16ee29..0000000
--- a/src/mem3/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-ebin/*.beam
-ebin/*.app
-TEST-*
-.eunit

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/mem3/Makefile.am
----------------------------------------------------------------------
diff --git a/src/mem3/Makefile.am b/src/mem3/Makefile.am
deleted file mode 100644
index cf732ab..0000000
--- a/src/mem3/Makefile.am
+++ /dev/null
@@ -1,60 +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.
-
-mem3ebindir = $(localerlanglibdir)/mem3/ebin
-
-mem3ebin_DATA = $(compiled_files)
-
-source_files = \
-	src/mem3.app.src \
-    src/mem3.erl \
-	src/mem3_app.erl \
-	src/mem3_httpd.erl \
-	src/mem3_nodes.erl \
-	src/mem3_rep.erl \
-	src/mem3_shards.erl \
-	src/mem3_sup.erl \
-	src/mem3_sync.erl \
-	src/mem3_sync_event.erl \
-	src/mem3_sync_nodes.erl \
-	src/mem3_sync_security.erl \
-	src/mem3_util.erl
-
-compiled_files = \
-	ebin/mem3.app \
-    ebin/mem3.beam \
-	ebin/mem3_app.beam \
-	ebin/mem3_httpd.beam \
-	ebin/mem3_shards.beam \
-	ebin/mem3_sup.beam \
-	ebin/mem3_sync.beam \
-	ebin/mem3_sync_event.beam \
-	ebin/mem3_sync_nodes.beam \
-	ebin/mem3_sync_security.beam \
-	ebin/mem3_util.beam
-
-# Conflicts in couch_db.hrl prevent us from building these
-# until after we merge the couch application
-#	ebin/mem3_nodes.beam
-#	ebin/mem3_rep.beam
-
-
-EXTRA_DIST = $(source_files)
-CLEANFILES = $(compiled_files)
-
-ebin/%.app: src/%.app.src
-	@mkdir -p ebin/
-	sed -e "s|%version%|@version@|g" < $< > $@
-
-ebin/%.beam: src/%.erl
-	@mkdir -p ebin/
-	$(ERLC) -Wall -I$(top_srcdir)/src -o ebin/ $(ERLC_FLAGS) $<

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/mem3/src/mem3.app.src
----------------------------------------------------------------------
diff --git a/src/mem3/src/mem3.app.src b/src/mem3/src/mem3.app.src
index 612a7fb..616e4bd 100644
--- a/src/mem3/src/mem3.app.src
+++ b/src/mem3/src/mem3.app.src
@@ -12,7 +12,7 @@
 
 {application, mem3, [
     {description, "CouchDB Cluster Membership"},
-    {vsn, "%version%"},
+    {vsn, git},
     {modules, [
         mem3,
         mem3_app,

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/mochiweb/Makefile.am
----------------------------------------------------------------------
diff --git a/src/mochiweb/Makefile.am b/src/mochiweb/Makefile.am
deleted file mode 100644
index 655f0ab..0000000
--- a/src/mochiweb/Makefile.am
+++ /dev/null
@@ -1,113 +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.
-
-if USE_NATIVE_MOCHIJSON
-MOCHIJSON_ERLC_FLAGS=+native
-endif
-
-mochiwebebindir = $(localerlanglibdir)/mochiweb-1.4.1/ebin
-
-mochiweb_file_collection = \
-	src/mochifmt.erl \
-	src/mochifmt_records.erl \
-	src/mochifmt_std.erl \
-	src/mochiglobal.erl \
-	src/mochihex.erl \
-	src/mochijson.erl \
-	src/mochijson2.erl \
-	src/mochilists.erl \
-	src/mochilogfile2.erl \
-	src/mochinum.erl \
-	src/mochitemp.erl \
-	src/mochiutf8.erl \
-	src/mochiweb.app.in \
-	src/mochiweb.app.src \
-	src/mochiweb.erl \
-	src/mochiweb_acceptor.erl \
-	src/mochiweb_app.erl \
-	src/mochiweb_charref.erl \
-	src/mochiweb_cookies.erl \
-	src/mochiweb_cover.erl \
-	src/mochiweb_echo.erl \
-	src/mochiweb_headers.erl \
-	src/mochiweb_html.erl \
-	src/mochiweb_http.erl \
-	src/mochiweb_io.erl \
-	src/mochiweb_mime.erl \
-	src/mochiweb_multipart.erl \
-	src/mochiweb_request.erl \
-	src/mochiweb_request_tests.erl \
-	src/mochiweb_response.erl \
-	src/mochiweb_skel.erl \
-	src/mochiweb_socket.erl \
-	src/mochiweb_socket_server.erl \
-	src/mochiweb_sup.erl \
-	src/mochiweb_util.erl \
-	src/reloader.erl
-
-mochiwebebin_make_generated_file_list = \
-	ebin/mochifmt.beam \
-	ebin/mochifmt_records.beam \
-	ebin/mochifmt_std.beam \
-	ebin/mochiglobal.beam \
-	ebin/mochihex.beam \
-	ebin/mochijson.beam \
-	ebin/mochijson2.beam \
-	ebin/mochilists.beam \
-	ebin/mochilogfile2.beam \
-	ebin/mochinum.beam \
-	ebin/mochitemp.beam \
-	ebin/mochiutf8.beam \
-	ebin/mochiweb.app \
-	ebin/mochiweb.beam \
-	ebin/mochiweb_acceptor.beam \
-	ebin/mochiweb_app.beam \
-	ebin/mochiweb_charref.beam \
-	ebin/mochiweb_cookies.beam \
-	ebin/mochiweb_cover.beam \
-	ebin/mochiweb_echo.beam \
-	ebin/mochiweb_headers.beam \
-	ebin/mochiweb_html.beam \
-	ebin/mochiweb_http.beam \
-	ebin/mochiweb_io.beam \
-	ebin/mochiweb_mime.beam \
-	ebin/mochiweb_multipart.beam \
-	ebin/mochiweb_request.beam \
-	ebin/mochiweb_response.beam \
-	ebin/mochiweb_skel.beam \
-	ebin/mochiweb_socket.beam \
-	ebin/mochiweb_socket_server.beam \
-	ebin/mochiweb_sup.beam \
-	ebin/mochiweb_util.beam \
-	ebin/reloader.beam
-
-mochiwebebin_DATA = \
-    $(mochiwebebin_make_generated_file_list)
-
-EXTRA_DIST =  \
-    $(mochiweb_file_collection) \
-    src/internal.hrl
-
-CLEANFILES = \
-    $(mochiwebebin_make_generated_file_list)
-
-ebin/%.app: src/%.app.in
-	@mkdir -p ebin/
-	cp $< $@
-
-ebin/mochijson2.beam: src/mochijson2.erl
-	@mkdir -p ebin/
-	$(ERLC) -o ebin/ $(ERLC_FLAGS) $(MOCHIJSON_ERLC_FLAGS) $<
-
-ebin/%.beam: src/%.erl
-	@mkdir -p ebin/
-	$(ERLC) -o ebin/ $(ERLC_FLAGS) $<

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/mochiweb/src/mochiweb.app.in
----------------------------------------------------------------------
diff --git a/src/mochiweb/src/mochiweb.app.in b/src/mochiweb/src/mochiweb.app.in
deleted file mode 100644
index 6a4a314..0000000
--- a/src/mochiweb/src/mochiweb.app.in
+++ /dev/null
@@ -1,32 +0,0 @@
-{application, mochiweb,
- [{description, "MochiMedia Web Server"},
-  {vsn, "1.4.1"},
-  {modules, [
-        mochihex,
-        mochijson,
-        mochijson2,
-        mochinum,
-        mochiweb,
-        mochiweb_app,
-        mochiweb_charref,
-        mochiweb_cookies,
-        mochiweb_echo,
-        mochiweb_headers,
-        mochiweb_html,
-        mochiweb_http,
-        mochiweb_multipart,
-        mochiweb_request,
-        mochiweb_response,
-        mochiweb_skel,
-        mochiweb_socket_server,
-        mochiweb_sup,
-        mochiweb_util,
-        reloader,
-        mochifmt,
-        mochifmt_std,
-        mochifmt_records
-	    ]},
-  {registered, []},
-  {mod, {mochiweb_app, []}},
-  {env, []},
-  {applications, [kernel, stdlib]}]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/mochiweb/src/mochiweb.app.src
----------------------------------------------------------------------
diff --git a/src/mochiweb/src/mochiweb.app.src b/src/mochiweb/src/mochiweb.app.src
index 37a21fb..c240102 100644
--- a/src/mochiweb/src/mochiweb.app.src
+++ b/src/mochiweb/src/mochiweb.app.src
@@ -1,7 +1,6 @@
-%% This is generated from src/mochiweb.app.src
 {application, mochiweb,
  [{description, "MochiMedia Web Server"},
-  {vsn, "1.4.1"},
+  {vsn, git},
   {modules, []},
   {registered, []},
   {mod, {mochiweb_app, []}},

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/oauth/Makefile.am
----------------------------------------------------------------------
diff --git a/src/oauth/Makefile.am b/src/oauth/Makefile.am
deleted file mode 100644
index 1636d98..0000000
--- a/src/oauth/Makefile.am
+++ /dev/null
@@ -1,41 +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.
-
-oauthebindir = $(localerlanglibdir)/oauth/ebin
-
-oauth_file_collection = \
-	src/oauth.app.in \
-    src/oauth.erl
-
-# Removed oauth_rsa_sha1.beam until we require R12B5 or
-# we add a ./configure option to enable it.
-
-oauthebin_make_generated_file_list = \
-	ebin/oauth.app \
-    ebin/oauth.beam
-
-oauthebin_DATA = \
-	$(oauthebin_make_generated_file_list)
-
-EXTRA_DIST = \
-	$(oauth_file_collection)
-
-CLEANFILES = \
-    $(oauthebin_make_generated_file_list)
-
-ebin/%.app: src/%.app.in
-	@mkdir -p ebin/
-	cp $< $@
-
-ebin/%.beam: src/%.erl
-	@mkdir -p ebin/
-	$(ERLC) -o ebin/ $(ERLC_FLAGS) $<

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/oauth/src/oauth.app.in
----------------------------------------------------------------------
diff --git a/src/oauth/src/oauth.app.in b/src/oauth/src/oauth.app.in
deleted file mode 100644
index a8ec17c..0000000
--- a/src/oauth/src/oauth.app.in
+++ /dev/null
@@ -1,20 +0,0 @@
-{application, oauth, [
-  {description, "Erlang OAuth implementation"},
-  {vsn, "7d85d3ef"},
-  {modules, [
-    oauth,
-    oauth_hmac_sha1,
-    oauth_http,
-    oauth_plaintext,
-    oauth_rsa_sha1,
-    oauth_unix,
-    oauth_uri
-  ]},
-  {registered, []},
-  {applications, [
-    kernel,
-    stdlib,
-    crypto,
-    inets
-  ]}
-]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/oauth/src/oauth.app.src
----------------------------------------------------------------------
diff --git a/src/oauth/src/oauth.app.src b/src/oauth/src/oauth.app.src
new file mode 100644
index 0000000..a8ec17c
--- /dev/null
+++ b/src/oauth/src/oauth.app.src
@@ -0,0 +1,20 @@
+{application, oauth, [
+  {description, "Erlang OAuth implementation"},
+  {vsn, "7d85d3ef"},
+  {modules, [
+    oauth,
+    oauth_hmac_sha1,
+    oauth_http,
+    oauth_plaintext,
+    oauth_rsa_sha1,
+    oauth_unix,
+    oauth_uri
+  ]},
+  {registered, []},
+  {applications, [
+    kernel,
+    stdlib,
+    crypto,
+    inets
+  ]}
+]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/rexi/.gitignore
----------------------------------------------------------------------
diff --git a/src/rexi/.gitignore b/src/rexi/.gitignore
deleted file mode 100644
index 4f2f040..0000000
--- a/src/rexi/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# building
-ebin
-.eunit
-logs
-*.spec
-deps
-*.beam
-

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/rexi/Makefile.am
----------------------------------------------------------------------
diff --git a/src/rexi/Makefile.am b/src/rexi/Makefile.am
deleted file mode 100644
index e658627..0000000
--- a/src/rexi/Makefile.am
+++ /dev/null
@@ -1,48 +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.
-
-rexiebindir = $(localerlanglibdir)/rexi/ebin
-
-rexiebin_DATA = $(compiled_files)
-
-source_files = \
-	src/rexi.app.src \
-    src/rexi.erl \
-	src/rexi_app.erl \
-	src/rexi_gov_manager.erl \
-	src/rexi_governor.erl \
-	src/rexi_monitor.erl \
-	src/rexi_server.erl \
-	src/rexi_sup.erl \
-	src/rexi_utils.erl
-
-compiled_files = \
-	ebin/rexi.app \
-    ebin/rexi.beam \
-	ebin/rexi_app.beam \
-	ebin/rexi_gov_manager.beam \
-	ebin/rexi_governor.beam \
-	ebin/rexi_monitor.beam \
-	ebin/rexi_server.beam \
-	ebin/rexi_sup.beam \
-	ebin/rexi_utils.beam
-
-EXTRA_DIST = $(source_files)
-CLEANFILES = $(compiled_files)
-
-ebin/%.app: src/%.app.src
-	@mkdir -p ebin/
-	sed -e "s|%version%|@version@|g" < $< > $@
-
-ebin/%.beam: src/%.erl
-	@mkdir -p ebin/
-	$(ERLC) -Wall -I$(top_srcdir)/src -o ebin/ $(ERLC_FLAGS) $<

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/rexi/src/rexi.app.src
----------------------------------------------------------------------
diff --git a/src/rexi/src/rexi.app.src b/src/rexi/src/rexi.app.src
index c9af9d0..0691edd 100644
--- a/src/rexi/src/rexi.app.src
+++ b/src/rexi/src/rexi.app.src
@@ -12,7 +12,7 @@
 
 {application, rexi, [
     {description, "Lightweight RPC server"},
-    {vsn, "%version%"},
+    {vsn, git},
     {modules, [
         rexi,
         rexi_app,

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/snappy/Makefile.am
----------------------------------------------------------------------
diff --git a/src/snappy/Makefile.am b/src/snappy/Makefile.am
deleted file mode 100644
index baa4f68..0000000
--- a/src/snappy/Makefile.am
+++ /dev/null
@@ -1,40 +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 = c_src
-
-snappyebindir = $(localerlanglibdir)/snappy-1.0.5/ebin
-
-snappy_file_collection = \
-    src/snappy.app.in \
-    src/snappy.erl
-
-snappyebin_make_generated_file_list = \
-    ebin/snappy.app \
-    ebin/snappy.beam
-
-snappyebin_DATA = \
-	$(snappyebin_make_generated_file_list)
-
-EXTRA_DIST = \
-    $(snappy_file_collection)
-
-CLEANFILES = \
-    $(snappyebin_make_generated_file_list)
-
-ebin/%.app: src/%.app.in
-	@mkdir -p ebin/
-	cp $< $@
-
-ebin/%.beam: src/%.erl
-	@mkdir -p ebin/
-	$(ERLC) -o ebin/ $(ERLC_FLAGS) $<

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/snappy/c_src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/snappy/c_src/Makefile.am b/src/snappy/c_src/Makefile.am
deleted file mode 100644
index 3a5d6cd..0000000
--- a/src/snappy/c_src/Makefile.am
+++ /dev/null
@@ -1,58 +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.
-
-snappyprivdir = $(localerlanglibdir)/snappy-1.0.5/priv
-
-snappy_cxx_srcs = \
-	snappy_nif.cc \
-	google-snappy/snappy.cc \
-	google-snappy/snappy-sinksource.cc \
-	google-snappy/snappy-stubs-internal.cc
-
-snappy_cxx_hdrs = \
-	erl_nif_compat.h \
-	google-snappy/snappy.h \
-	google-snappy/snappy-internal.h \
-	google-snappy/snappy-sinksource.h \
-	google-snappy/snappy-stubs-internal.h \
-	google-snappy/snappy-stubs-public.h.in
-
-EXTRA_DIST = \
-    google-snappy/AUTHORS \
-    google-snappy/COPYING \
-	$(snappy_cxx_hdrs)
-
-CLEANFILES = \
-	../priv/snappy_nif.so
-
-if USE_OTP_NIFS
-snappypriv_LTLIBRARIES = snappy_nif.la
-snappy_nif_la_SOURCES = $(snappy_cxx_srcs)
-snappy_nif_la_CXXFLAGS = $(ERLANG_FLAGS)
-snappy_nif_la_LDFLAGS = -module -avoid-version
-
-if WINDOWS
-snappy_nif_la_LDFLAGS += -no-undefined
-snappy_nif_la_CXXFLAGS += -EHsc -Ox
-SNAPPY_SO_NAME = snappy_nif.dll
-else
-SNAPPY_SO_NAME = snappy_nif.so
-endif
-
-
-# This is purely to enable ./utils/run
-../priv/$(SNAPPY_SO_NAME): snappy_nif.la
-	@mkdir -p ../priv
-	cp .libs/$(SNAPPY_SO_NAME) $@
-
-all: ../priv/$(SNAPPY_SO_NAME)
-endif

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/src/snappy/src/snappy.app.in
----------------------------------------------------------------------
diff --git a/src/snappy/src/snappy.app.in b/src/snappy/src/snappy.app.in
deleted file mode 100644
index 25d37b5..0000000
--- a/src/snappy/src/snappy.app.in
+++ /dev/null
@@ -1,12 +0,0 @@
-{application, snappy,
- [
-  {description, "snappy compressor/decompressor Erlang NIF wrapper"},
-  {vsn, "1.0.5"},
-  {registered, []},
-  {applications, [
-                  kernel,
-                  stdlib
-                 ]},
-  {env, []},
-  {modules, [snappy]}
- ]}.


[3/3] git commit: updated refs/heads/1843-feature-bigcouch to ba152cb

Posted by rn...@apache.org.
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/ba152cb2
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/ba152cb2
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/ba152cb2

Branch: refs/heads/1843-feature-bigcouch
Commit: ba152cb2153e892c0d8eec7f6fbeecf3dcaff10a
Parents: 938fc01
Author: Robert Newson <rn...@apache.org>
Authored: Wed Dec 18 14:04:59 2013 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Dec 18 23:04:18 2013 +0000

----------------------------------------------------------------------
 .gitignore                                      | 149 +---
 Makefile                                        |  54 ++
 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                                    |  36 +
 rel/overlay/bin/couchdb                         |  28 +
 rel/overlay/etc/default.ini                     | 123 +++
 rel/overlay/etc/local.ini                       |   1 +
 rel/overlay/etc/vm.args                         |  23 +
 rel/reltool.config                              |  75 ++
 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/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/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 -
 87 files changed, 602 insertions(+), 4075 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/.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/ba152cb2/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..faa570c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,54 @@
+# 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: rebar
+	@echo "==> couchjs (compile)"
+#	@cd couchjs && python scons/scons.py $(couchjsflags)
+	@./rebar compile
+
+rebar:
+	@echo "==> building rebar"
+	@cd src/rebar && make && cp rebar ../..
+
+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/ba152cb2/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/ba152cb2/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/ba152cb2/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/ba152cb2/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/ba152cb2/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/ba152cb2/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/ba152cb2/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/ba152cb2/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/ba152cb2/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/ba152cb2/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/ba152cb2/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/ba152cb2/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/ba152cb2/rebar.config
----------------------------------------------------------------------
diff --git a/rebar.config b/rebar.config
new file mode 100644
index 0000000..903e5cd
--- /dev/null
+++ b/rebar.config
@@ -0,0 +1,36 @@
+% 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_index",
+    "src/couch_mrview",
+    "src/couch",
+    "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"
+]}.
+
+{lib_dirs, ["src/"]}.
+
+{erl_opts, [debug_info]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/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/ba152cb2/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..f1584be
--- /dev/null
+++ b/rel/overlay/etc/default.ini
@@ -0,0 +1,123 @@
+[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]
+view_manager={couch_view, start_link, []}
+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/ba152cb2/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/ba152cb2/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/ba152cb2/rel/reltool.config
----------------------------------------------------------------------
diff --git a/rel/reltool.config b/rel/reltool.config
new file mode 100644
index 0000000..ffc03f4
--- /dev/null
+++ b/rel/reltool.config
@@ -0,0 +1,75 @@
+% 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_event,
+        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_event, [{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, "overlay/share"},
+    {copy, "../couchjs/build/couchjs", "bin/couchjs"},
+    {copy, "../couchjs/build/main.js", "share/couchjs/main.js"},
+    {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"}
+]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/share/Makefile.am
----------------------------------------------------------------------
diff --git a/share/Makefile.am b/share/Makefile.am
deleted file mode 100644
index 31373ee..0000000
--- a/share/Makefile.am
+++ /dev/null
@@ -1,219 +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 = doc
-
-JS_FILE = server/main.js
-
-JS_FILE_COMPONENTS = \
-    server/json2.js \
-    server/filter.js \
-    server/mimeparse.js \
-    server/render.js \
-    server/state.js \
-    server/util.js \
-    server/validate.js \
-    server/views.js
-
-JS_FILE_COMPONENTS_LAST = server/loop.js
-
-$(JS_FILE): $(JS_FILE_COMPONENTS) $(JS_FILE_COMPONENTS_LAST)
-	mkdir -p `dirname $(JS_FILE)`
-	echo "// DO NOT EDIT THIS FILE BY HAND" > $@
-	echo >> $@
-	cat $^ >> $@
-
-COFFEE_FILE = server/main-coffee.js
-
-COFFEE_FILE_COMPONENTS_LAST = server/coffee-script.js server/loop.js
-
-$(COFFEE_FILE): $(JS_FILE_COMPONENTS) $(COFFEE_FILE_COMPONENTS_LAST)
-	mkdir -p `dirname $(COFFEE_FILE)`
-	echo "// DO NOT EDIT THIS FILE BY HAND" > $@
-	echo >> $@
-	cat $^ >> $@
-
-CLEANFILES = $(JS_FILE) $(COFFEE_FILE)
-
-EXTRA_DIST = $(JS_FILE_COMPONENTS) $(JS_FILE_COMPONENTS_LAST) $(COFFEE_FILE_COMPONENTS_LAST)
-
-nobase_localdata_SCRIPTS = \
-    $(JS_FILE) \
-    $(COFFEE_FILE)
-
-nobase_dist_localdata_DATA = \
-    www/config.html \
-    www/couch_tests.html \
-    www/custom_test.html \
-    www/database.html \
-    www/session.html \
-    www/dialog/_admin_party.html \
-    www/dialog/_change_password.html \
-    www/dialog/_compact_cleanup.html \
-    www/dialog/_create_admin.html \
-    www/dialog/_login.html \
-    www/dialog/_signup.html \
-    www/dialog/_create_database.html \
-    www/dialog/_create_config.html \
-    www/dialog/_delete_database.html \
-    www/dialog/_delete_document.html \
-    www/dialog/_database_security.html \
-    www/dialog/_share_test_reports.html \
-    www/dialog/_save_view_as.html \
-    www/dialog/_upload_attachment.html \
-    www/document.html \
-    www/favicon.ico \
-    www/image/add.png \
-    www/image/apply.gif \
-    www/image/bg.png \
-    www/image/cancel.gif \
-    www/image/compact.png \
-    www/image/delete-mini.png \
-    www/image/delete.png \
-    www/image/grippie.gif \
-    www/image/hgrad.gif \
-    www/image/key.png \
-    www/image/load.png \
-    www/image/logo.png \
-    www/image/order-asc.gif \
-    www/image/order-desc.gif \
-    www/image/path.gif \
-    www/image/progress.gif \
-    www/image/rarrow.png \
-    www/image/run-mini.png \
-    www/image/run.png \
-    www/image/running.png \
-    www/image/save.png \
-    www/image/sidebar-toggle.png \
-    www/image/spinner.gif \
-    www/image/spinner_33.gif \
-    www/image/spinner_6b.gif \
-    www/image/test_failure.gif \
-    www/image/test_success.gif \
-    www/image/thead-key.gif \
-    www/image/thead.gif \
-    www/image/toggle-collapse.gif \
-    www/image/toggle-expand.gif \
-    www/image/twisty.gif \
-    www/index.html \
-    www/replicator.html \
-    www/script/couch.js \
-    www/script/couch_tests.js \
-    www/script/couch_test_runner.js \
-    www/script/futon.browse.js \
-    www/script/futon.format.js \
-    www/script/futon.js \
-    www/script/jquery.couch.js \
-    www/script/jquery.dialog.js \
-    www/script/jquery.editinline.js \
-    www/script/jquery.form.js \
-    www/script/jquery.js \
-    www/script/jquery-ui-1.8.11.custom.min.js \
-    www/script/jquery.resizer.js \
-    www/script/jquery.suggest.js \
-    www/script/json2.js \
-    www/script/jspec/jspec.css \
-    www/script/jspec/jspec.jquery.js \
-    www/script/jspec/jspec.js \
-    www/script/jspec/jspec.xhr.js \
-    www/script/oauth.js \
-    www/script/sha1.js \
-    www/script/base64.js \
-    www/script/test/all_docs.js \
-    www/script/test/attachments.js \
-    www/script/test/attachments_multipart.js \
-    www/script/test/attachment_names.js \
-    www/script/test/attachment_paths.js \
-    www/script/test/attachment_ranges.js \
-    www/script/test/attachment_views.js \
-    www/script/test/auth_cache.js \
-    www/script/test/basics.js \
-    www/script/test/batch_save.js \
-    www/script/test/bulk_docs.js \
-    www/script/test/changes.js \
-    www/script/test/coffee.js \
-    www/script/test/compact.js \
-    www/script/test/config.js \
-    www/script/test/conflicts.js \
-    www/script/test/content_negotiation.js \
-    www/script/test/cookie_auth.js \
-    www/script/test/copy_doc.js \
-    www/script/test/delayed_commits.js \
-    www/script/test/design_docs.js \
-    www/script/test/design_options.js \
-    www/script/test/design_paths.js \
-    www/script/test/erlang_views.js \
-    www/script/test/etags_head.js \
-    www/script/test/etags_views.js \
-    www/script/test/form_submit.js \
-    www/script/test/http.js \
-    www/script/test/invalid_docids.js \
-    www/script/test/jsonp.js \
-    www/script/test/large_docs.js \
-    www/script/test/list_views.js \
-    www/script/test/lorem.txt \
-    www/script/test/lorem_b64.txt \
-    www/script/test/lots_of_docs.js \
-    www/script/test/method_override.js \
-    www/script/test/multiple_rows.js \
-    www/script/test/oauth.js \
-    www/script/test/oauth_users_db.js \
-    www/script/test/proxyauth.js \
-    www/script/test/purge.js \
-    www/script/test/reader_acl.js \
-    www/script/test/recreate_doc.js \
-    www/script/test/reduce.js \
-    www/script/test/reduce_builtin.js \
-    www/script/test/reduce_false.js \
-    www/script/test/reduce_false_temp.js \
-    www/script/test/replication.js \
-    www/script/test/replicator_db.js \
-    www/script/test/replicator_db_security.js \
-    www/script/test/rev_stemming.js \
-    www/script/test/rewrite.js \
-    www/script/test/security_validation.js \
-    www/script/test/show_documents.js \
-    www/script/test/stats.js \
-    www/script/test/update_documents.js \
-    www/script/test/users_db.js \
-    www/script/test/users_db_security.js \
-    www/script/test/utf8.js \
-    www/script/test/uuids.js \
-    www/script/test/view_collation.js \
-    www/script/test/view_collation_raw.js \
-    www/script/test/view_conflicts.js \
-    www/script/test/view_compaction.js \
-    www/script/test/view_errors.js \
-    www/script/test/view_include_docs.js \
-    www/script/test/view_multi_key_all_docs.js \
-    www/script/test/view_multi_key_design.js \
-    www/script/test/view_multi_key_temp.js \
-    www/script/test/view_offsets.js \
-    www/script/test/view_update_seq.js \
-    www/script/test/view_pagination.js \
-    www/script/test/view_sandboxing.js \
-    www/script/test/view_xml.js \
-    www/spec/couch_js_class_methods_spec.js \
-    www/spec/couch_js_instance_methods_1_spec.js \
-    www/spec/couch_js_instance_methods_2_spec.js \
-    www/spec/couch_js_instance_methods_3_spec.js \
-    www/spec/custom_helpers.js \
-    www/spec/jquery_couch_js_class_methods_spec.js \
-    www/spec/jquery_couch_js_instance_methods_1_spec.js \
-    www/spec/jquery_couch_js_instance_methods_2_spec.js \
-    www/spec/jquery_couch_js_instance_methods_3_spec.js \
-    www/spec/run.html \
-    www/status.html \
-    www/style/jquery-ui-1.8.11.custom.css \
-    www/style/layout.css \
-    www/verify_install.html \
-    www/_sidebar.html

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba152cb2/share/doc/Makefile.am
----------------------------------------------------------------------
diff --git a/share/doc/Makefile.am b/share/doc/Makefile.am
deleted file mode 100644
index 34b41a0..0000000
--- a/share/doc/Makefile.am
+++ /dev/null
@@ -1,14 +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 = build
-