Author: cmlenz Date: Fri Mar 28 16:32:19 2008 New Revision: 642432 URL: http://svn.apache.org/viewvc?rev=642432&view=rev Log: Imported trunk. Added: incubator/couchdb/trunk/AUTHORS incubator/couchdb/trunk/BUGS incubator/couchdb/trunk/Makefile.am incubator/couchdb/trunk/NEWS incubator/couchdb/trunk/NOTICE incubator/couchdb/trunk/README incubator/couchdb/trunk/THANKS incubator/couchdb/trunk/acinclude.m4.in incubator/couchdb/trunk/authors.xml incubator/couchdb/trunk/bin/ (with props) incubator/couchdb/trunk/bin/Makefile.am incubator/couchdb/trunk/bin/couchdb.tpl.in incubator/couchdb/trunk/bin/couchjs.tpl.in incubator/couchdb/trunk/bootstrap (with props) incubator/couchdb/trunk/build-contrib/ incubator/couchdb/trunk/build-contrib/ac_check_icu.m4_2007-09-12.gz (with props) incubator/couchdb/trunk/build-contrib/apache_2.txt.gz (with props) incubator/couchdb/trunk/build-contrib/config.guess_2007-09-12.gz (with props) incubator/couchdb/trunk/build-contrib/config.sub_2007-09-12.gz (with props) incubator/couchdb/trunk/configure.ac incubator/couchdb/trunk/etc/ (with props) incubator/couchdb/trunk/etc/Makefile.am incubator/couchdb/trunk/etc/conf/ incubator/couchdb/trunk/etc/conf/mime.types incubator/couchdb/trunk/etc/couch.ini.tpl.in incubator/couchdb/trunk/etc/couch_httpd.conf.tpl.in incubator/couchdb/trunk/etc/default/ (with props) incubator/couchdb/trunk/etc/default/Makefile.am incubator/couchdb/trunk/etc/default/couchdb.tpl.in incubator/couchdb/trunk/etc/init/ (with props) incubator/couchdb/trunk/etc/init/Makefile.am incubator/couchdb/trunk/etc/init/couchdb.tpl.in (with props) incubator/couchdb/trunk/etc/launchd/ (with props) incubator/couchdb/trunk/etc/launchd/Makefile.am incubator/couchdb/trunk/etc/launchd/org.apache.couchdb.plist.tpl.in incubator/couchdb/trunk/etc/logrotate.d/ (with props) incubator/couchdb/trunk/etc/logrotate.d/Makefile.am incubator/couchdb/trunk/etc/logrotate.d/couchdb.tpl.in incubator/couchdb/trunk/share/ (with props) incubator/couchdb/trunk/share/Makefile.am incubator/couchdb/trunk/share/server/ incubator/couchdb/trunk/share/server/main.js incubator/couchdb/trunk/share/www/ incubator/couchdb/trunk/share/www/browse/ incubator/couchdb/trunk/share/www/browse/_create_database.html (with props) incubator/couchdb/trunk/share/www/browse/_create_document.html (with props) incubator/couchdb/trunk/share/www/browse/_delete_database.html (with props) incubator/couchdb/trunk/share/www/browse/_delete_document.html (with props) incubator/couchdb/trunk/share/www/browse/_save_view_as.html (with props) incubator/couchdb/trunk/share/www/browse/database.html (with props) incubator/couchdb/trunk/share/www/browse/document.html (with props) incubator/couchdb/trunk/share/www/browse/index.html (with props) incubator/couchdb/trunk/share/www/couch_tests.html (with props) incubator/couchdb/trunk/share/www/favicon.ico (with props) incubator/couchdb/trunk/share/www/image/ incubator/couchdb/trunk/share/www/image/add.gif (with props) incubator/couchdb/trunk/share/www/image/apply.gif (with props) incubator/couchdb/trunk/share/www/image/bg.png (with props) incubator/couchdb/trunk/share/www/image/cancel.gif (with props) incubator/couchdb/trunk/share/www/image/delete-mini.gif (with props) incubator/couchdb/trunk/share/www/image/delete.gif (with props) incubator/couchdb/trunk/share/www/image/grippie.gif (with props) incubator/couchdb/trunk/share/www/image/hgrad.gif (with props) incubator/couchdb/trunk/share/www/image/load.gif (with props) incubator/couchdb/trunk/share/www/image/logo.png (with props) incubator/couchdb/trunk/share/www/image/order-asc.gif (with props) incubator/couchdb/trunk/share/www/image/order-desc.gif (with props) incubator/couchdb/trunk/share/www/image/path.gif (with props) incubator/couchdb/trunk/share/www/image/run-mini.gif (with props) incubator/couchdb/trunk/share/www/image/run.gif (with props) incubator/couchdb/trunk/share/www/image/running.gif (with props) incubator/couchdb/trunk/share/www/image/save.gif (with props) incubator/couchdb/trunk/share/www/image/spinner.gif (with props) incubator/couchdb/trunk/share/www/image/test_failure.gif (with props) incubator/couchdb/trunk/share/www/image/test_success.gif (with props) incubator/couchdb/trunk/share/www/image/thead-key.gif (with props) incubator/couchdb/trunk/share/www/image/thead.gif (with props) incubator/couchdb/trunk/share/www/image/toggle-collapse.gif (with props) incubator/couchdb/trunk/share/www/image/toggle-expand.gif (with props) incubator/couchdb/trunk/share/www/image/twisty.gif (with props) incubator/couchdb/trunk/share/www/index.html (with props) incubator/couchdb/trunk/share/www/replicator.html (with props) incubator/couchdb/trunk/share/www/script/ incubator/couchdb/trunk/share/www/script/browse.js (with props) incubator/couchdb/trunk/share/www/script/couch.js (with props) incubator/couchdb/trunk/share/www/script/couch_tests.js (with props) incubator/couchdb/trunk/share/www/script/jquery.cookies.js (with props) incubator/couchdb/trunk/share/www/script/jquery.dialog.js (with props) incubator/couchdb/trunk/share/www/script/jquery.js (with props) incubator/couchdb/trunk/share/www/script/jquery.resizer.js (with props) incubator/couchdb/trunk/share/www/script/jquery.suggest.js (with props) incubator/couchdb/trunk/share/www/script/json2.js (with props) incubator/couchdb/trunk/share/www/script/pprint.js (with props) incubator/couchdb/trunk/share/www/script/shell.js (with props) incubator/couchdb/trunk/share/www/shell.html (with props) incubator/couchdb/trunk/share/www/style/ incubator/couchdb/trunk/share/www/style/layout.css (with props) incubator/couchdb/trunk/src/ (with props) incubator/couchdb/trunk/src/Makefile.am incubator/couchdb/trunk/src/couch_inets/ (with props) incubator/couchdb/trunk/src/couch_inets/Makefile.am incubator/couchdb/trunk/src/couch_inets/couch_inets.app incubator/couchdb/trunk/src/couch_inets/ftp.erl incubator/couchdb/trunk/src/couch_inets/ftp_internal.hrl incubator/couchdb/trunk/src/couch_inets/ftp_progress.erl incubator/couchdb/trunk/src/couch_inets/ftp_response.erl incubator/couchdb/trunk/src/couch_inets/ftp_sup.erl incubator/couchdb/trunk/src/couch_inets/http.erl incubator/couchdb/trunk/src/couch_inets/http_base_64.erl incubator/couchdb/trunk/src/couch_inets/http_chunk.erl incubator/couchdb/trunk/src/couch_inets/http_cookie.erl incubator/couchdb/trunk/src/couch_inets/http_internal.hrl incubator/couchdb/trunk/src/couch_inets/http_request.erl incubator/couchdb/trunk/src/couch_inets/http_response.erl incubator/couchdb/trunk/src/couch_inets/http_transport.erl incubator/couchdb/trunk/src/couch_inets/http_uri.erl incubator/couchdb/trunk/src/couch_inets/http_util.erl incubator/couchdb/trunk/src/couch_inets/httpc_handler.erl incubator/couchdb/trunk/src/couch_inets/httpc_internal.hrl incubator/couchdb/trunk/src/couch_inets/httpc_manager.erl incubator/couchdb/trunk/src/couch_inets/httpc_request.erl incubator/couchdb/trunk/src/couch_inets/httpc_response.erl incubator/couchdb/trunk/src/couch_inets/httpc_sup.erl incubator/couchdb/trunk/src/couch_inets/httpd.erl incubator/couchdb/trunk/src/couch_inets/httpd.hrl incubator/couchdb/trunk/src/couch_inets/httpd_acceptor.erl incubator/couchdb/trunk/src/couch_inets/httpd_acceptor_sup.erl incubator/couchdb/trunk/src/couch_inets/httpd_cgi.erl incubator/couchdb/trunk/src/couch_inets/httpd_conf.erl incubator/couchdb/trunk/src/couch_inets/httpd_esi.erl incubator/couchdb/trunk/src/couch_inets/httpd_example.erl incubator/couchdb/trunk/src/couch_inets/httpd_instance_sup.erl incubator/couchdb/trunk/src/couch_inets/httpd_manager.erl incubator/couchdb/trunk/src/couch_inets/httpd_misc_sup.erl incubator/couchdb/trunk/src/couch_inets/httpd_request.erl incubator/couchdb/trunk/src/couch_inets/httpd_request_handler.erl incubator/couchdb/trunk/src/couch_inets/httpd_response.erl incubator/couchdb/trunk/src/couch_inets/httpd_script_env.erl incubator/couchdb/trunk/src/couch_inets/httpd_socket.erl incubator/couchdb/trunk/src/couch_inets/httpd_sup.erl incubator/couchdb/trunk/src/couch_inets/httpd_util.erl incubator/couchdb/trunk/src/couch_inets/inets.erl incubator/couchdb/trunk/src/couch_inets/inets_app.erl incubator/couchdb/trunk/src/couch_inets/inets_internal.hrl incubator/couchdb/trunk/src/couch_inets/inets_sup.erl incubator/couchdb/trunk/src/couch_inets/mod_actions.erl incubator/couchdb/trunk/src/couch_inets/mod_alias.erl incubator/couchdb/trunk/src/couch_inets/mod_auth.erl incubator/couchdb/trunk/src/couch_inets/mod_auth.hrl incubator/couchdb/trunk/src/couch_inets/mod_auth_dets.erl incubator/couchdb/trunk/src/couch_inets/mod_auth_mnesia.erl incubator/couchdb/trunk/src/couch_inets/mod_auth_plain.erl incubator/couchdb/trunk/src/couch_inets/mod_auth_server.erl incubator/couchdb/trunk/src/couch_inets/mod_browser.erl incubator/couchdb/trunk/src/couch_inets/mod_cgi.erl incubator/couchdb/trunk/src/couch_inets/mod_dir.erl incubator/couchdb/trunk/src/couch_inets/mod_disk_log.erl incubator/couchdb/trunk/src/couch_inets/mod_esi.erl incubator/couchdb/trunk/src/couch_inets/mod_get.erl incubator/couchdb/trunk/src/couch_inets/mod_head.erl incubator/couchdb/trunk/src/couch_inets/mod_htaccess.erl incubator/couchdb/trunk/src/couch_inets/mod_include.erl incubator/couchdb/trunk/src/couch_inets/mod_log.erl incubator/couchdb/trunk/src/couch_inets/mod_range.erl incubator/couchdb/trunk/src/couch_inets/mod_responsecontrol.erl incubator/couchdb/trunk/src/couch_inets/mod_security.erl incubator/couchdb/trunk/src/couch_inets/mod_security_server.erl incubator/couchdb/trunk/src/couch_inets/mod_trace.erl incubator/couchdb/trunk/src/couch_inets/tftp.erl incubator/couchdb/trunk/src/couch_inets/tftp.hrl incubator/couchdb/trunk/src/couch_inets/tftp_binary.erl incubator/couchdb/trunk/src/couch_inets/tftp_engine.erl incubator/couchdb/trunk/src/couch_inets/tftp_file.erl incubator/couchdb/trunk/src/couch_inets/tftp_lib.erl incubator/couchdb/trunk/src/couch_inets/tftp_sup.erl incubator/couchdb/trunk/src/couchdb/ (with props) incubator/couchdb/trunk/src/couchdb/Makefile.am incubator/couchdb/trunk/src/couchdb/cjson.erl incubator/couchdb/trunk/src/couchdb/couch.app.tpl.in incubator/couchdb/trunk/src/couchdb/couch_btree.erl incubator/couchdb/trunk/src/couchdb/couch_db.erl incubator/couchdb/trunk/src/couchdb/couch_db.hrl incubator/couchdb/trunk/src/couchdb/couch_db_update_notifier.erl incubator/couchdb/trunk/src/couchdb/couch_doc.erl incubator/couchdb/trunk/src/couchdb/couch_erl_driver.c (with props) incubator/couchdb/trunk/src/couchdb/couch_event_sup.erl incubator/couchdb/trunk/src/couchdb/couch_file.erl incubator/couchdb/trunk/src/couchdb/couch_ft_query.erl incubator/couchdb/trunk/src/couchdb/couch_js.c (with props) incubator/couchdb/trunk/src/couchdb/couch_key_tree.erl incubator/couchdb/trunk/src/couchdb/couch_log.erl incubator/couchdb/trunk/src/couchdb/couch_query_servers.erl incubator/couchdb/trunk/src/couchdb/couch_rep.erl incubator/couchdb/trunk/src/couchdb/couch_server.erl incubator/couchdb/trunk/src/couchdb/couch_server_sup.erl incubator/couchdb/trunk/src/couchdb/couch_stream.erl incubator/couchdb/trunk/src/couchdb/couch_util.erl incubator/couchdb/trunk/src/couchdb/couch_view.erl incubator/couchdb/trunk/src/couchdb/mod_couch.erl incubator/couchdb/trunk/src/fulltext/ incubator/couchdb/trunk/src/fulltext/lucene/ incubator/couchdb/trunk/src/fulltext/lucene/CouchConfig.java incubator/couchdb/trunk/src/fulltext/lucene/CouchDbDirFilter.java incubator/couchdb/trunk/src/fulltext/lucene/LuceneIndexer.java incubator/couchdb/trunk/src/fulltext/lucene/LuceneSearcher.java incubator/couchdb/trunk/src/fulltext/lucene/readme.txt (with props) incubator/couchdb/trunk/var/ (with props) incubator/couchdb/trunk/var/Makefile.am Modified: incubator/couchdb/trunk/ (props changed) Propchange: incubator/couchdb/trunk/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Fri Mar 28 16:32:19 2008 @@ -0,0 +1,20 @@ +COPYING +ChangeLog +INSTALL +Makefile +Makefile.in +acinclude.m4 +aclocal.m4 +autom4te.cache +build-aux +config.h +config.h.in +config.log +config.status +configure +couchdb-*.tar.gz +couchdb-*.zip +libtool +m4 +stamp-h1 +*.gz Added: incubator/couchdb/trunk/AUTHORS URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/AUTHORS?rev=642432&view=auto ============================================================================== --- incubator/couchdb/trunk/AUTHORS (added) +++ incubator/couchdb/trunk/AUTHORS Fri Mar 28 16:32:19 2008 @@ -0,0 +1,25 @@ +Apache CouchDB Authors +====================== + +Project Lead +------------ + +Apache CouchDB was originally developed by Damien Katz +and he remains the project lead. + +Contributers +------------ + +A number of people have contributed directly to Apache CouchDB by writing +documentation or developing software. A list of these people is included below. + + * William Beh + * Jan Lehnardt + * Christopher Lenz + * Dirk Schalge + * Noah Slater + +See Also +-------- + +For a list of other credits see the `THANKS' file. Added: incubator/couchdb/trunk/BUGS URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/BUGS?rev=642432&view=auto ============================================================================== --- incubator/couchdb/trunk/BUGS (added) +++ incubator/couchdb/trunk/BUGS Fri Mar 28 16:32:19 2008 @@ -0,0 +1,12 @@ +Apache CouchDB Bugs +=================== + +Web +--- + +Report bugs via the web at . + +Email +----- + +Report bugs via email to . Added: incubator/couchdb/trunk/Makefile.am URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/Makefile.am?rev=642432&view=auto ============================================================================== --- incubator/couchdb/trunk/Makefile.am (added) +++ incubator/couchdb/trunk/Makefile.am Fri Mar 28 16:32:19 2008 @@ -0,0 +1,60 @@ +## 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. + +datarootdir = @prefix@/share + +SUBDIRS = bin etc src share var + +pkgdoc_DATA = AUTHORS.gz BUGS.gz changelog.gz NEWS.gz README.gz THANKS.gz + +CLEANFILES = $(doc_DATA) + +DISTCLEANFILES = $(pkgdoc_DATA) + +EXTRA_DIST = AUTHORS BUGS ChangeLog NEWS README THANKS + +AUTHORS.gz: $(top_srcdir)/AUTHORS + -gzip -9 < $< > $@ + +BUGS.gz: $(top_srcdir)/BUGS + -gzip -9 < $< > $@ + +changelog.gz: $(top_srcdir)/ChangeLog + -gzip -9 < $< > $@ + +NEWS.gz: $(top_srcdir)/NEWS + -gzip -9 < $< > $@ + +README.gz: $(top_srcdir)/README + -gzip -9 < $< > $@ + +THANKS.gz: $(top_srcdir)/THANKS + -gzip -9 < $< > $@ + +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 COPYING + rm -f ChangeLog + rm -f INSTALL + rm -f acinclude.m4 + rm -f aclocal.m4 + rm -fr build-aux + rm -f config.h.in* + rm -f configure + rm -f configure~ + rm -f couchdb-$(version).tar.gz + rm -f couchdb-$(version).zip + rm -fr m4 + find . -name Makefile.in | grep -v 'src/js/fdlibm' | xargs rm + +.PHONY: local-clean Added: incubator/couchdb/trunk/NEWS URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/NEWS?rev=642432&view=auto ============================================================================== --- incubator/couchdb/trunk/NEWS (added) +++ incubator/couchdb/trunk/NEWS Fri Mar 28 16:32:19 2008 @@ -0,0 +1,75 @@ +Apache CouchDB News +=================== + +Version 0.7.3a1 +-------------- + + * Changed core licensing to the Apache License 2.0. + * Improved handling of ICU shared libraries. + * Apache CouchDB can automatically respawn following a server crash. + * Apache CouchDB no longer refuses to start with a stale PID file. + * System logrotate configuration provided. + * Miscellaneous improvements to the `couchdb' command. + +Version 0.7.2 +------------- + + * Small changes to build process and couchdb command. + * CouchDB's official port is now 5984 TCP/UDP instead of 8888. + +Version 0.7.1 +------------- + + * Small compatibility issue with Firefox 3 fixed. + +Version 0.7.0 +------------- + + * CouchDB has been rewritten to use the GNU build system for portability. + * The built-in database browsing tool has been rewritten to provide a much + nicer interface for interacting directly with CouchDB from your web browser. + * XML and Fabric have been replaced with JSON and JavaScript for data + transport and View definitions. + +Version 0.6.0 +------------- + + * A replication facility is now available. + * CouchPeek can now create, delete and view documents. + * Building from source is easier and less error prone. + +Version 0.5.0 +------------- + + * A built-in CouchPeek utility. + * A full install kit buildable from a single command. + * A new GNU/Linux version is available. An OS X version is coming soon. + +Version 0.4.0 +------------- + + * Non-existant variables are now nil lists. + * Couch error codes and messages are no longer sent in the HTTP fields, + instead they are exclusively returned in the XML body. This is to avoid HTTP + header parsing problems with oddly formed error messages. + * Returned error messages are now logged at the server at the `info' level to + make general debugging easier. + * Fixed a problem where big table builds caused timesout errors. + * Lots of changes in the low level machinery. Most formulas will continue to + function the same. + * Added full compiler support for extended characters in formula source. + * Support for Perl/Ruby like regular expressions. + * Added `total_rows' and `result_start' attributes to tables. + +Version 0.3.0 +------------- + + * CouchDB now fully supports Unicode and locale specific collation via the ICU + library, both in the Fabric engine and computed tables. + * The `in' operator has been added to Fabric. + * The `startdoc' query string variable specifies the starting document to use if + there are multiple rows with identical startkeys. + * The `skip' query string variable specifies the number of rows to skip before + returning results. The `skip' value must be a positive integer. If used with + a `count' variable the skipped rows aren't counted as output. + * Various changes to the output XML format. Added: incubator/couchdb/trunk/NOTICE URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/NOTICE?rev=642432&view=auto ============================================================================== --- incubator/couchdb/trunk/NOTICE (added) +++ incubator/couchdb/trunk/NOTICE Fri Mar 28 16:32:19 2008 @@ -0,0 +1,50 @@ +Apache CouchDB Notice +===================== + +Core Software +------------- + + * Copyright (C) 2008 Damien Katz + * Copyright (C) 2008 Jan Lehnardt + * Copyright (C) 2008 Noah Slater + +Developed at The Apache Software Foundation . + +Supporting Software +------------------- + +m4/ac_check_icu.m4 +~~~~~~~~~~~~~~~~~~ + + * Copyright (C) 2005 Akos Maroy + +share/www/script/jquery.js +~~~~~~~~~~~~~~~~~~~~~~~~~~ + + * Copyright (C) 2008 John Resig + +share/www/script/json2.js +~~~~~~~~~~~~~~~~~~~~~~~~~ + +This file is in the public domain. + +src/couch_inets +~~~~~~~~~~~~~~~ + + * Copyright (C) 1999 Ericsson Utvecklings AB + +src/js +~~~~~~ + + * Copyright (C) 1999 Netscape Communications Corporation + +src/js/editline +~~~~~~~~~~~~~~~ + + * Copyright (C) 1993 Simmule Turner + * Copyright (C) 1993 Rich Salz + +src/js/fdlibm +~~~~~~~~~~~~~ + + * Copyright (C) 1993 by Sun Microsystems, Inc Added: incubator/couchdb/trunk/README URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/README?rev=642432&view=auto ============================================================================== --- incubator/couchdb/trunk/README (added) +++ incubator/couchdb/trunk/README Fri Mar 28 16:32:19 2008 @@ -0,0 +1,343 @@ +Apache CouchDB Readme +===================== + +Documentation +------------- + +Visit the wiki for more documentation. + +Building From Subversion +------------------------ + +Dependencies +~~~~~~~~~~~~ + +To build Apache CouchDB from checkout you need some of the following installed: + + * GNU Automake (>=1.6.3) (required) + * GNU Autoconf (>=2.59) (required) + * GNU Libtool (required) + * svn2cl (optional) + * xsltproc (optional) + * help2man (optional) + +If you are running a Debian GNU/Linux system (or a derivative such as Ubuntu +GNU/Linux) you can install these dependencies using the `apt-get' command: + +-------------------------------------------------------------------------------- +apt-get install automake autoconf libtool subversion-tools help2man +-------------------------------------------------------------------------------- + +If you are running OS X and have MacPorts installed +you can install some of these dependencies by using the `port' command: + +-------------------------------------------------------------------------------- +port install automake autoconf libtool help2man +-------------------------------------------------------------------------------- + +Note: OS X users should already have Automake, Autoconf and Libtool installed. + +Note: MacPorts users will need to install svn2cl by hand. + +Bootstrapping +~~~~~~~~~~~~~ + +Note: You must repeat this step every time you update your Subversion checkout. + +Bootstrap the pristine source by running the following command: + +-------------------------------------------------------------------------------- +./bootstrap +-------------------------------------------------------------------------------- + +You can use the `-C' option to generate a dummy `ChangeLog' file. + +Installation And First Run +-------------------------- + +You will need the following installed: + + * Erlang OTP (required) + * ICU (required) + * Mozilla SpiderMonkey (required) + * GNU Make (required) + * GNU Compiler Collection (required) + +UNIX-like Operating Systems (inc. OS X) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Dependencies +^^^^^^^^^^^^ + +Debian-based (inc. Ubuntu) Systems +++++++++++++++++++++++++++++++++++ + +If you are running a Debian GNU/Linux system (or a derivative such as Ubuntu +GNU/Linux) you can install the dependencies using the `apt-get' command: + +-------------------------------------------------------------------------------- +apt-get install build-essential erlang libicu36 libicu36-dev libmozjs-dev +-------------------------------------------------------------------------------- + +If you get an error regarding the `libicu36' or `libicu36-dev' be sure to check +the version used by your distribution (using `apt-cache search libicu') and +install those packages instead. + +OS X +++++ + +To install GNU Make and the GNU Compiler Collection on OS X you should install +the Xcode Tools metapackage by running the following command: + +-------------------------------------------------------------------------------- +open /Applications/Installers/Xcode\ Tools/XcodeTools.mpkg +-------------------------------------------------------------------------------- + +We recommend that you satisfy the other dependancies by installing MacPorts + and running the following command: + +-------------------------------------------------------------------------------- +port install icu erlang spidermonkey +-------------------------------------------------------------------------------- + +Note: Don't forget to open a new terminal after you have installed MacPorts +as it updates your PATH and you will not be able to run the `port' command +without the effects of this change. + +To update your `locate' database you may want to run the following command: + +-------------------------------------------------------------------------------- +sudo /usr/libexec/locate.updatedb +-------------------------------------------------------------------------------- + +Installing +^^^^^^^^^^ + +Once you have satisfied dependencies you should run the following command: + +-------------------------------------------------------------------------------- +./configure +-------------------------------------------------------------------------------- + +Note: Apache CouchDB is installed into `/usr/local' by default. If you want to +change where Apache CouchDB is installed (or where to find Erlang) be sure to +read the output from running the `./configure --help' command. + +Note: All the examples assume you have installed into `/usr/local'. + +If everything was successful you should see the following message: + +-------------------------------------------------------------------------------- +You have configured Apache CouchDB. Time to relax. +-------------------------------------------------------------------------------- + +Relax. + +To install Apache CouchDB you should then run the following command: + +-------------------------------------------------------------------------------- +make && sudo make install +-------------------------------------------------------------------------------- + +If you do not wish to be prompted to overwrite any existing Apache CouchDB +configuration files you should run the following command: + +-------------------------------------------------------------------------------- +sudo make && yes | sudo make install +-------------------------------------------------------------------------------- + +Note: Use of the `sudo' command is only required if you are installing into a +system owned directory. You do not need to do this if you are installing +elsewhere, such as your home directory. + +More options can be found by reading the `INSTALL' file. + +Security Considerations +^^^^^^^^^^^^^^^^^^^^^^^ + +It is not advisable to run Apache CouchDB as the superuser. We strongly +recommend that you create a specific user to run Apache CouchDB and own the +data/log directories. + +You can use whatever tool your system provides to create a new `couchdb' user. + +On many UNIX-like systems you can run the following command: + +-------------------------------------------------------------------------------- +adduser couchdb +-------------------------------------------------------------------------------- + +OS X provides the standard Accounts option from the System Preferences +application or you can optionally use the Workgroup Manager application which +can be downloaded as part of the Server Admin Tools +. + +You should set the home directory of the `couchdb' user to +`/usr/local/var/lib/couchdb' which is the Apache CouchDB database directory. + +Make sure to change the ownership of the Apache CouchDB data directories by +running the following commands: + +-------------------------------------------------------------------------------- +chown -R couchdb /usr/local/var/lib/couchdb +chown -R couchdb /usr/local/var/log/couchdb +-------------------------------------------------------------------------------- + +Running Manually +^^^^^^^^^^^^^^^^ + +To start the Apache CouchDB server you should run the following command: + +-------------------------------------------------------------------------------- +sudo -u couchdb couchdb +-------------------------------------------------------------------------------- + +This uses the `sudo' command to run the `couchdb' command as the `couchdb' user. + +When Apache CouchDB starts it should eventually display the following message: + +-------------------------------------------------------------------------------- +Apache CouchDB has started. Time to relax. +-------------------------------------------------------------------------------- + +Relax. + +To check that everything has worked point your web browser to + and run the test suite. + +OS X +++++ + +If you get error when running Apache CouchDB that look like the following: + +-------------------------------------------------------------------------------- +dyld: Library not loaded: libicuuc.38.dy +-------------------------------------------------------------------------------- + +You should make sure that your `~/.profile' file contains the following line: + +-------------------------------------------------------------------------------- +export DYLD_LIBRARY_PATH=/opt/local/lib:$DYLD_LIBRARY_PATH +-------------------------------------------------------------------------------- + +This should have been added for you by MacPorts but may be missing. + +Running as a Daemon +^^^^^^^^^^^^^^^^^^^ + +Note: These instructions assume you have created the `couchdb' user. See the +specific system information included below to learn how to reconfigure this. + +Note: If any of these methods report a failure you can run the `couchdb' +command manually to see the error messages it is displaying. + +The `/usr/local/etc/logrotate.d/couchdb' file is provided as a logrotate +configuration that you can use to rotate Apache CouchDB's logs. + +SysV/BSD-style Systems +++++++++++++++++++++++ + +Depending on your system the `couchdb' init script will be installed into a +direcory called `init.d' (for SysV-style systems) or `rc.d' (for BSD-style +systems). These examples use the `[init.d|rc.d]' notation to indicate this. + +You can control the Apache CouchDB daemon by running the following command: + +-------------------------------------------------------------------------------- +/usr/local/etc/[init.d|rc.d]/couchdb [start|stop|restart|force-reload|status] +-------------------------------------------------------------------------------- + +If you wish to configure how the init script works, such as which user to run +Apache CouchDB as, you must edit the `/usr/local/etc/default/couchdb' file as +appropriate. If you are running the init script as a non-superuser you need to +remove the line with the `COUCHDB_USER' setting. + +If you wish the ApacheCouchDB daemon to run as a system service you need to copy +the `/usr/local/etc/[init.d|rc.d]/couchdb' script into your system wide +`/etc/[init.d|rc.d]' directory and update your system configuration as +appropriate. Consult your system documentation for more information. + +If you are running a Debian GNU/Linux system (or a derivative such as Ubuntu +GNU/Linux) you can configure your system using the following command: + +-------------------------------------------------------------------------------- +sudo update-rc.d couchdb defaults +-------------------------------------------------------------------------------- + +OS X +++++ + +You can use the `launchctl' command to control the Apache CouchDB daemon. + +To load the launchd configuration you must run the following command: + +-------------------------------------------------------------------------------- +sudo launchctl load /usr/local/Library/LaunchDaemons/org.apache.couchdb +-------------------------------------------------------------------------------- + +You can stop the Apache CouchDB daemon by running the following command: + +-------------------------------------------------------------------------------- +sudo launchctl unload /usr/local/Library/LaunchDaemons/org.apache.couchdb +-------------------------------------------------------------------------------- + +If you wish to change the launchd configuration, such as which user to run +Apache CouchDB as, you must edit the +`/usr/local/Library/LaunchDaemons/org.apache.couchdb.plist' file as +appropriate. + +If you wish the Apache CouchDB daemon to run as a system service you need to +copy the `/usr/local/Library/LaunchDaemons/org.apache.couchdb.plist' file into +your system wide `/Library/LaunchDaemons' directory. + +Windows +~~~~~~~ + +Windows documentation is incomplete. Please submit suggestions. + +Development and Distribution +---------------------------- + +Reconfiguring the Build System +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If you have edited any of the files used by the build system, such as the +`Makefile.am' files, you will need to reconfigure your source. + +To reconfigure the source run the following command from the root directory: + +-------------------------------------------------------------------------------- +autoreconf && ./confgure +-------------------------------------------------------------------------------- + +Checking In Changes +~~~~~~~~~~~~~~~~~~~ + +If your source directory has been configured or built you will need to clean +the generated files before checking into the repository by running the +following command: + +-------------------------------------------------------------------------------- +make local-clean +-------------------------------------------------------------------------------- + +If everything was successful you should now have a pristine checkout. + +Preparing For Distribution +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To build the source for distribution you should then run the following command: + +-------------------------------------------------------------------------------- +./configure && make distcheck +-------------------------------------------------------------------------------- + +If everything was successful you should see a `zip' file and/or a `tar.gz' file +sitting in the root directory ready for distribution. + +Release Checklist +~~~~~~~~~~~~~~~~~ + + 1. Update this file with important information. + 2. Update the `NEWS' file with change information. + 3. Update the `acinclude.m4' file with version information. Added: incubator/couchdb/trunk/THANKS URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/THANKS?rev=642432&view=auto ============================================================================== --- incubator/couchdb/trunk/THANKS (added) +++ incubator/couchdb/trunk/THANKS Fri Mar 28 16:32:19 2008 @@ -0,0 +1,21 @@ +Apache CouchDB Thanks +===================== + +Credits +------- + +Apache CouchDB was originally developed by Damien Katz +and a number of other contributors. Many people further contributed to Apache +CouchDB by reporting problems, suggesting various improvements or submitting +changes. A list of these people is included below. + + * Benoit Chesneau + * Till Klampaeckel + * Roger Leigh + * Sam Ruby + * Carlos Valiente + +See Also +-------- + +For a list of authors see the `AUTHORS' file. Added: incubator/couchdb/trunk/acinclude.m4.in URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/acinclude.m4.in?rev=642432&view=auto ============================================================================== --- incubator/couchdb/trunk/acinclude.m4.in (added) +++ incubator/couchdb/trunk/acinclude.m4.in Fri Mar 28 16:32:19 2008 @@ -0,0 +1,31 @@ +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. + +m4_define([LOCAL_PACKAGE_AUTHOR_NAME], [Damien Katz]) +m4_define([LOCAL_PACKAGE_AUTHOR_ADDRESS], [damien_katz@yahoo.com]) +m4_define([LOCAL_PACKAGE_IDENTIFIER], [couchdb]) +m4_define([LOCAL_PACKAGE_NAME], [Apache CouchDB]) + +m4_define([LOCAL_VERSION_MAJOR], [0]) +m4_define([LOCAL_VERSION_MINOR], [7]) +m4_define([LOCAL_VERSION_REVISION], [3]) +m4_define([LOCAL_VERSION_STAGE], [a]) +m4_define([LOCAL_VERSION_RELEASE], [%release%]) +m4_define([LOCAL_VERSION_PRIMARY], + [LOCAL_VERSION_MAJOR.LOCAL_VERSION_MINOR.LOCAL_VERSION_REVISION]) +m4_define([LOCAL_VERSION_SECONDARY], + [LOCAL_VERSION_STAGE[]LOCAL_VERSION_RELEASE]) +m4_define([LOCAL_VERSION], + [LOCAL_VERSION_PRIMARY[]LOCAL_VERSION_SECONDARY]) + +m4_define([LOCAL_LIST_ADDRESS], [couchdb@googlegroups.com]) +m4_define([LOCAL_LIST_URI], [http://groups.google.com/group/couchdb]) Added: incubator/couchdb/trunk/authors.xml URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/authors.xml?rev=642432&view=auto ============================================================================== --- incubator/couchdb/trunk/authors.xml (added) +++ incubator/couchdb/trunk/authors.xml Fri Mar 28 16:32:19 2008 @@ -0,0 +1,24 @@ + + + + William Beh <willbeh@gmail.com> + + + Damien Katz <damien_katz@yahoo.com> + + + Jan Lehnardt <janlehnardt@gmail.com> + + + Christopher Lenz <cmlenz@gmx.de> + + + Dirk Schalge <dirk@epd-me.net> + + + Noah Slater <nslater@bytesexual.org> + + + Noah Slater <nslater@bytesexual.org> + + Propchange: incubator/couchdb/trunk/bin/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Fri Mar 28 16:32:19 2008 @@ -0,0 +1,8 @@ +Makefile +Makefile.in +couchdb +couchdb.1 +couchdb.tpl +couchjs +couchjs.1 +couchjs.tpl Added: incubator/couchdb/trunk/bin/Makefile.am URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/bin/Makefile.am?rev=642432&view=auto ============================================================================== --- incubator/couchdb/trunk/bin/Makefile.am (added) +++ incubator/couchdb/trunk/bin/Makefile.am Fri Mar 28 16:32:19 2008 @@ -0,0 +1,79 @@ +## 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. + +datarootdir = @prefix@/share + +bin_SCRIPTS = couchdb couchjs + +if HELP2MAN +dist_man1_MANS = couchdb.1 couchjs.1 +endif + +CLEANFILES = $(bin_SCRIPTS) $(dist_man1_MANS) + +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|%erlangbindir%|@erlangbindir@|g" \ + -e "s|%erlanglibdir%|@erlanglibdir@|g" \ + -e "s|%pkgconfdir%|@pkgconfdir@|g" \ + -e "s|%pkgstatelogdir%|@pkgstatelogdir@|g" \ + -e "s|%pkgstatelibdir%|@pkgstatelibdir@|g" \ + -e "s|%localstatedir%|@localstatedir@|g" \ + -e "s|%list_address%|@list_address@|g" \ + -e "s|%list_uri%|@list_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 $@ + +couchjs: couchjs.tpl + sed -e "s|%libbindir%|@libbindir@|g" \ + -e "s|%list_address%|@list_address@|g" \ + -e "s|%list_uri%|@list_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|%couchjs_command_name%|$(couchjs_command_name)|g" > \ + $@ < $< + chmod +x $@ + +HELP2MAN_OPTION=--no-info --help-option="-h" --version-option="-V" + +# XXX: Because the scripts are made at bulid time for the user we need to +# XXX: depend on the original templates so as not to cause the rebuilding of +# XXX: the man pages. + +couchdb.1: couchdb.tpl.in + touch $@ + if test -x "$(HELP2MAN_EXECUTABLE)"; then \ + $(MAKE) -f Makefile couchdb; \ + $(HELP2MAN_EXECUTABLE) $(HELP2MAN_OPTION) \ + --name="Apache CouchDB database server" ./couchdb --output $@; \ + fi + +couchjs.1: couchjs.tpl.in + touch $@ + if test -x "$(HELP2MAN_EXECUTABLE)"; then \ + $(MAKE) -f Makefile couchjs; \ + $(HELP2MAN_EXECUTABLE) $(HELP2MAN_OPTION) \ + --name="Apache CouchDB JavaScript interpreter" ./couchjs --output $@; \ + fi Added: incubator/couchdb/trunk/bin/couchdb.tpl.in URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/bin/couchdb.tpl.in?rev=642432&view=auto ============================================================================== --- incubator/couchdb/trunk/bin/couchdb.tpl.in (added) +++ incubator/couchdb/trunk/bin/couchdb.tpl.in Fri Mar 28 16:32:19 2008 @@ -0,0 +1,340 @@ +#! /bin/sh -e + +# @configure_input@ + +# 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. + +SCRIPT_OK=0 +SCRIPT_ERROR=1 + +INTERACTIVE_BOOLEAN=false +BACKGROUND_BOOLEAN=false +KILL_BOOLEAN=false +SHUTDOWN_BOOLEAN=false +RECURSED_BOOLEAN=false + +RESPAWN_TIMEOUT=0 + +LIB_DIRECTORY=%pkgstatelibdir% +LOG_DIRECTORY=%pkgstatelogdir% + +INI_FILE=%pkgconfdir%/couch.ini +PID_FILE=%localstatedir%/run/couchdb.pid + +STDOUT_FILE=couchdb.stdout +STDERR_FILE=couchdb.stderr + +HEART_COMMAND="%bindir%/%couchdb_command_name% -k" +HEART_BEAT_TIMEOUT=11 + +basename=$(basename $0) + +display_version () { + # Display version and copyright information. + + cat << EOF +$basename - %package_name% %version% + +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. +EOF + } + +display_help () { + # Display a short description of the script's behaviour. + + cat << EOF +Usage: $basename [OPTION] + +The $basename command runs the %package_name% server. + +The exit status is 0 for success or 1 for failure. + +The \`-s' option will exit 0 for running and 1 for not running. + +Options: + + -h display a short help message and exit + -V display version information and exit + -c FILE set the configuration FILE (defaults to $INI_FILE) + -i use the interactive Erlang shell + -b spawn as a background process + -p FILE set the background PID FILE (defaults to $PID_FILE) + -r SECONDS respawn background process after SECONDS (defaults to no respawn) + -o FILE redirect background stdout to FILE (defaults to $STDOUT_FILE) + -e FILE redirect background stderr to FILE (defaults to $STDERR_FILE) + -s display the status of the background process + -k kill the background process, will respawn if needed + -d shutdown the background process + +Report bugs via the web at <%list_uri%>. + +Report bugs via email to <%list_address%>. +EOF +} + +display_error () { + # Display a short instruction referring users to further documentation. + + if test -n "$1"; then + echo $1 >&2 + fi + echo >&2 + echo "Try \`"$basename" -h' for more information." >&2 + exit $SCRIPT_ERROR +} + +_load_configuration () { + # Load ini configuration and overwrite default variables. + + dbrootdir_ini_value=$(awk -F = "/^DbRootDir=/{print \$2}" < $INI_FILE) + if test -n "$dbrootdir_ini_value"; then + LIB_DIRECTORY=$dbrootdir_ini_value + fi + logfile_ini_value=$(awk -F = "/^LogFile=/{print \$2}" < $INI_FILE) + if test -n "$logfile_ini_value"; then + LOG_DIRECTORY=$(dirname $logfile_ini_value) + fi +} + +_get_pid () { + if test -f $PID_FILE; then + PID=$(cat $PID_FILE) + fi + if test -z "$PID"; then + # Resort to searching for the running process manually. + PID=$(ps auxww | grep erlang | grep -- "couch_server:start()" | \ + grep -v grep | awk "{print \$2}") + fi + echo $PID +} + +check_status () { + # Check the status of the running Apache CouchDB process. + + PID=$(_get_pid) + if test -n "$PID"; then + if kill -0 $PID 2> /dev/null; then + echo "Apache CouchDB is running as process $PID. Time to relax." + return $SCRIPT_OK + else + echo >&2 << EOF +Apache CouchDB is not running but a stale PID file exists: $PID_FILE" +EOF + fi + else + echo "Apache CouchDB is not running." >&2 + fi + return $SCRIPT_ERROR +} + +check_environment () { + # Check the environment for common problems to prevent nasty backtraces. + + message_prefix="Apache CouchDB needs write permission on the" + if test ! -w $LIB_DIRECTORY; then + echo "$message_prefix data directory: $LIB_DIRECTORY" >&2 + exit $SCRIPT_ERROR + fi + if test ! -w $LOG_DIRECTORY; then + echo "$message_prefix log directory: $LOG_DIRECTORY" >&2 + exit $SCRIPT_ERROR + fi + message_prefix="Apache CouchDB needs write permission on data file" + for file in $(find $LIB_DIRECTORY -type f); do + if test ! -w $file; then + echo "$message_prefix: $file" >&2 + exit $SCRIPT_ERROR + fi + done + message_prefix="Apache CouchDB needs write permission on log file" + for file in $(find $LOG_DIRECTORY -type f); do + if test ! -w $file; then + echo "$message_prefix: $file" >&2 + exit $SCRIPT_ERROR + fi + done + if test "$BACKGROUND_BOOLEAN" = "true"; then + touch $PID_FILE 2> /dev/null || true + touch $STDOUT_FILE 2> /dev/null || true + touch $STDERR_FILE 2> /dev/null || true + message_prefix="Apache CouchDB needs write permission on the" + if test ! -w $PID_FILE; then + echo "$message_prefix PID file: $PID_FILE" >&2 + exit $SCRIPT_ERROR + fi + if test ! -w $STDOUT_FILE; then + echo "$message_prefix STDOUT file: $STDOUT_FILE" >&2 + exit $SCRIPT_ERROR + fi + if test ! -w $STDERR_FILE; then + echo "$message_prefix STDERR file: $STDERR_FILE" >&2 + exit $SCRIPT_ERROR + fi + message_prefix="Apache CouchDB needs a regular" + if ! echo 2> /dev/null >> $PID_FILE; then + echo "$message_prefix PID file: $PID_FILE" >&2 + exit $SCRIPT_ERROR + fi + if ! echo 2> /dev/null >> $STDOUT_FILE; then + echo "$message_prefix STDOUT file: $STDOUT_FILE" >&2 + exit $SCRIPT_ERROR + fi + if ! echo 2> /dev/null >> $STDERR_FILE; then + echo "$message_prefix STDERR file: $STDERR_FILE" >&2 + exit $SCRIPT_ERROR + fi + fi +} + +start_couchdb () { + # Start Apache CouchDB with the Erlang interpreter. + + if test ! "$RECURSED_BOOLEAN" = "true"; then + if check_status 2> /dev/null; then + exit $SCRIPT_OK + fi + check_environment + fi + interactive_option="+Bd -noinput" + if test "$INTERACTIVE_BOOLEAN" = "true"; then + interactive_option="" + fi + if test "$BACKGROUND_BOOLEAN" = "true"; then + touch $PID_FILE + interactive_option="+Bd -noinput" + fi + command="`%ICU_CONFIG% --invoke` \ + %ERL% $interactive_option -sasl errlog_type error \ + -pa %erlanglibdir%/couch-%version%/ebin \ + %erlanglibdir%/couch_inets-4.7.5/ebin \ + -eval \"application:load(couch)\" \ + -eval \"couch_server:start(), receive done -> done end.\" \ + -couchini $INI_FILE" + if test "$BACKGROUND_BOOLEAN" = "true" \ + -a "$RECURSED_BOOLEAN" = "false"; then + # Recursively call and detach a duplicate couchdb command. + $0 -c $INI_FILE -b -r $RESPAWN_TIMEOUT -p $PID_FILE \ + -o $STDOUT_FILE -e $STDERR_FILE -R & + echo "Apache CouchDB has started. Time to relax." + else + if test "$RECURSED_BOOLEAN" = "true"; then + while true; do + export HEART_COMMAND + export HEART_BEAT_TIMEOUT + $(eval $command -pidfile $PID_FILE -heart \ + > $STDOUT_FILE 2> $STDERR_FILE) || true + PID=$(_get_pid) + if test -n "$PID"; then + if kill -0 $PID 2> /dev/null; then + # Found an existing process, do not respawn. + return $SCRIPT_ERROR + fi + # Stale PID file, we should respawn. + else + # No PID file, do not respawn. + return $SCRIPT_OK + fi + if test "$RESPAWN_TIMEOUT" = "0"; then + # RESPAWN_TIMEOUT is zero, do not respawn. + return $SCRIPT_OK + fi + if test "$RESPAWN_TIMEOUT" != "1"; then + plural_ending="s" + fi + cat << EOF +Apache CouchDB crashed, restarting in $RESPAWN_TIMEOUT second$plural_ending. +EOF + sleep $RESPAWN_TIMEOUT + done + else + eval exec $command + fi + fi +} + +stop_couchdb () { + # Send SIGHUP to the running Apache CouchDB process. + + PID=$(_get_pid) + if test -n "$PID"; then + # Clean up PID file or leave stale for respawn. + if test "$1" = "false"; then + echo > $PID_FILE + fi + if kill -0 $PID 2> /dev/null; then + if kill -1 $PID 2> /dev/null; then + if test "$1" = "false"; then + echo "Apache CouchDB has been shutdown." + else + echo "Apache CouchDB has been killed." + fi + return $SCRIPT_OK + else + echo "Apache CouchDB could not be killed." >&2 + return $SCRIPT_ERROR + fi + if test "$1" = "false"; then + echo "Stale PID file exists but Apache CouchDB is not running." + else + echo "Stale PID file existed but Apache CouchDB is not running." + fi + fi + else + echo "Apache CouchDB is not running." + fi +} + +parse_script_option_list () { + # Parse the script option list and take the appropriate action. + + if ! argument_list=$(getopt hVc:ibp:r:Ro:e:skd $@); then + display_error + fi + eval set -- "$argument_list" + while [ $# -gt 0 ]; do + case "$1" in + -h) shift; display_help; exit $SCRIPT_OK;; + -V) shift; display_version; exit $SCRIPT_OK;; + -c) shift; INI_FILE=$1; shift;; + -i) shift; INTERACTIVE_BOOLEAN=true;; + -b) shift; BACKGROUND_BOOLEAN=true;; + -r) shift; RESPAWN_TIMEOUT=$1; shift;; + -R) shift; RECURSED_BOOLEAN=true;; + -p) shift; PID_FILE=$1; shift;; + -o) shift; STDOUT_FILE=$1; shift;; + -e) shift; STDERR_FILE=$1; shift;; + -s) shift; check_status; exit $SCRIPT_OK;; + -k) shift; KILL_BOOLEAN=true;; + -d) shift; SHUTDOWN_BOOLEAN=true;; + --) shift; break;; + *) display_error "Unknown option: $1" >&2;; + esac + done + _load_configuration + if test "$KILL_BOOLEAN" = "true" -o "$SHUTDOWN_BOOLEAN" = "true"; then + stop_couchdb $KILL_BOOLEAN + else + start_couchdb + fi +} + +parse_script_option_list $@ Added: incubator/couchdb/trunk/bin/couchjs.tpl.in URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/bin/couchjs.tpl.in?rev=642432&view=auto ============================================================================== --- incubator/couchdb/trunk/bin/couchjs.tpl.in (added) +++ incubator/couchdb/trunk/bin/couchjs.tpl.in Fri Mar 28 16:32:19 2008 @@ -0,0 +1,103 @@ +#! /bin/sh -e + +# @configure_input@ + +# 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. + +SCRIPT_OK=0 +SCRIPT_ERROR=1 + +DEFAULT_VERSION=170 + +basename=$(basename $0) + +display_version () { + # Display version and copyright information. + + cat << EOF +$basename - %package_name% %version% + +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. +EOF +} + +display_help () { + # Display a short description of the script's behaviour. + + cat << EOF +Usage: $basename [FILE] + +The $basename command runs the %package_name% JavaScript interpreter. + +The exit status is 0 for success or 1 for failure. + +Options: + + -h display a short help message and exit + -V display version information and exit + +Report bugs via the web at <%list_uri%>. + +Report bugs via email to <%list_address%>. +EOF +} + +display_error () { + # Display a short instruction referring users to further documentation. + + if test -n "$1"; then + echo $1 >&2 + fi + echo >&2 + echo "Try \`"$basename" -h' for more information." >&2 + exit $SCRIPT_ERROR +} + +run_couchjs () { + # Run the JavaScript interpreter shell with options. + + exec %libbindir%/%couchjs_command_name% $@ +} + +parse_script_option_list () { + # Parse the script option list and take the appropriate action. + + if ! argument_list=$(getopt hV $@); then + display_error + fi + eval set -- "$argument_list" + while [ $# -gt 0 ]; do + case "$1" in + -h) shift; display_help; exit $SCRIPT_OK;; + -V) shift; display_version; exit $SCRIPT_OK;; + --) shift; break;; + *) break;; + esac + done + option_list=$(echo $@ | sed 's/--//') + if test -z "$option_list"; then + display_error "You must specify a FILE." + fi + run_couchjs $option_list +} + +parse_script_option_list $@ Added: incubator/couchdb/trunk/bootstrap URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/bootstrap?rev=642432&view=auto ============================================================================== --- incubator/couchdb/trunk/bootstrap (added) +++ incubator/couchdb/trunk/bootstrap Fri Mar 28 16:32:19 2008 @@ -0,0 +1,325 @@ +#! /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. + +# Bootstrap the pristine source ready for distribution. + +SCRIPT_OK=0 +SCRIPT_ERROR=1 + +CHANGELOG_PREDICATE=true + +ACINCLUDE_FILE="acinclude.m4" +ACINCLUDE_IN_FILE="acinclude.m4.in" +AC_CHECK_ICU_COMPRESSED_FILE="build-contrib/ac_check_icu.m4_2007-09-12.gz" +AUTHORS_FILE="authors.xml" +BUILD_AUX_DIRECTORY="build-aux" +CHANGELOG_FILE="ChangeLog" +CONFIG_GUESS_COMPRESSED_FILE="build-contrib/config.guess_2007-09-12.gz" +CONFIG_GUESS_FILE="build-aux/config.guess" +CONFIG_SUB_COMPRESSED_FILE="build-contrib/config.sub_2007-09-12.gz" +CONFIG_SUB_FILE="build-aux/config.sub" +COPYING_FILE="COPYING" +LICENSE_COMPRESSED_FILE="build-contrib/apache_2.txt.gz" +M4_DIRECTORY="m4" +M4_AC_CHECK_ICU_FILE="m4/ac_check_icu.m4" +REPOSITORY_URI="http://couchdb.googlecode.com/svn/trunk/" + +ACLOCAL_EXECUTABLE=$(which aclocal || true) +AUTOCONF_EXECUTABLE=$(which autoconf || true) +AUTOHEADER_EXECUTABLE=$(which autoheader || true) +AUTOMAKE_EXECUTABLE=$(which automake || true) +GLIBTOOLIZE_EXECUTABLE=$(which glibtoolize || true) +LIBTOOLIZE_EXECUTABLE=$(which libtoolize || true) +SVN_EXECUTABLE=$(which svn || true) +SVN2CL_EXECUTABLE=$(which svn2cl || true) + +basename=$(basename $0) + +extract_configuration_variable () { + # Extract variables from the local M4 configuration. + + variable_name=$1 + temporary_file=$(mktemp) + if [ $? -ne 0 ]; then + echo "Error: Unable to create a temporary file." + exit $SCRIPT_ERROR + fi + echo "changequote(\`[', \`]')" > $temporary_file + sed "s/m4_//" < $ACINCLUDE_IN_FILE >> $temporary_file + echo $variable_name >> $temporary_file + m4 $temporary_file | grep -v "^$" + rm -f $temporary_file +} + +display_version () { + # Display version and copyright information. + + package_name=$(extract_configuration_variable LOCAL_PACKAGE_NAME) + version=$(extract_configuration_variable LOCAL_VERSION) + cat << EOF +$basename - $package_name $version + +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. +EOF +} + +display_help () { + # Display a short description of the script's behaviour. + + list_address=$(extract_configuration_variable LOCAL_LIST_ADDRESS) + list_uri=$(extract_configuration_variable LOCAL_LIST_URI) + cat << EOF +Usage: $basename [OPTION]... + +The $basename script bootstraps the pristeen source so that it can be built. + +The exit status is 0 for success or 1 for failure. + +Options: + + -h display a short help message and exit + -v display version information and exit + -C do not generate a ChangeLog from Subversion + +Environment variables: + + REPOSITORY_REVISION manual override for revision information + +Report bugs via the web at <$list_uri>. + +Report bugs via email to <$list_address>. +EOF +} + +display_error () { + # Display a short instruction referring users to further documentation. + + if test -n "$1"; then + echo $1 >&2 + fi + echo >&2 + echo "Try \`"$basename" -h' for more information." >&2 + exit $SCRIPT_ERROR +} + +generate_dummy_changelog () { + # Generate a dummy ChangLog file. + + echo "Warning: Generating a dummy ChangeLog file." + touch $CHANGELOG_FILE +} + +check_svn_environment () { + # Check the Subversion environment for sanity. + + if test -z "$SVN_EXECUTABLE"; then + echo "Warning: Unable to find the svn command." + return $SCRIPT_ERROR + fi + if test -n "$REPOSITORY_REVISION"; then + return + fi + if test -n "$($SVN_EXECUTABLE info . 2> /dev/null)"; then + SVN_CHECKOUT_BOOLEAN="true" + fi > /dev/null + if test "$SVN_CHECKOUT_BOOLEAN" != "true"; then + echo "Warning: Unable to determine checkout information." + fi +} + +generate_changelog () { + # Generate the ChangLog file using the Subversion repository. + + if test "$SVN_CHECKOUT_BOOLEAN" = "true"; then + SVN2CL_COMMAND_ARGUMENT="." + fi + if test -n "$REPOSITORY_REVISION"; then + SVN2CL_COMMAND_ARGUMENT="--revision $REPOSITORY_REVISION:1 $REPOSITORY_URI" + fi + if test -z "$SVN2CL_COMMAND_ARGUMENT"; then + return + fi + if test ! -x "$SVN2CL_EXECUTABLE"; then + echo "Warning: Unable to find the svn2cl command." + generate_dummy_changelog + else + echo "Generating \`"$CHANGELOG_FILE"' (may take a while)" + $SVN2CL_EXECUTABLE --authors=$AUTHORS_FILE $SVN2CL_COMMAND_ARGUMENT + fi +} + +generate_acinclude () { + # Generate the acinclude.m4 file using the Subversion repository. + + release_code=$(sed -e "s/\[//g" -e "s/\]//g" -e "s/(//g" -e "s/)//g" \ + < $ACINCLUDE_IN_FILE | awk "/LOCAL_VERSION_STAGE, /{print \$2}") + repository_boolean=false + if test -n "$REPOSITORY_REVISION" -o "$SVN_CHECKOUT_BOOLEAN" = "true"; then + repository_boolean=true + fi + if test -z "$release_code" -o "$repository_boolean" = "false"; then + sed "s/%release%//" < $ACINCLUDE_IN_FILE > $ACINCLUDE_FILE + else + if test "$SVN_CHECKOUT_BOOLEAN" = "true"; then + revision_number=$($SVN_EXECUTABLE info . | \ + awk "/Revision:/{print \$2}") + fi + if test -n "$REPOSITORY_REVISION"; then + revision_number="$REPOSITORY_REVISION" + fi + sed "s/%release%/$revision_number/" \ + < $ACINCLUDE_IN_FILE > $ACINCLUDE_FILE + fi +} + +process_file_collection () { + # Process files required to complete the bootstrap. + + echo "Installing \`"$COPYING_FILE"'" + gzip --decompress --stdout $LICENSE_COMPRESSED_FILE > $COPYING_FILE + echo "Installing \`"$BUILD_AUX_DIRECTORY"'" + mkdir -p $BUILD_AUX_DIRECTORY + echo "Installing \`"$CONFIG_GUESS_FILE"'" + gzip --decompress --stdout \ + $CONFIG_GUESS_COMPRESSED_FILE > $CONFIG_GUESS_FILE + echo "Installing \`"$CONFIG_SUB_FILE"'" + gzip --decompress --stdout \ + $CONFIG_SUB_COMPRESSED_FILE > $CONFIG_SUB_FILE + echo "Installing \`"$M4_DIRECTORY"'" + mkdir -p $M4_DIRECTORY + echo "Installing \`"$M4_AC_CHECK_ICU_FILE"'" + gzip --decompress --stdout \ + $AC_CHECK_ICU_COMPRESSED_FILE > $M4_AC_CHECK_ICU_FILE +} + +run_aclocal () { + # Run the correct version of aclocal. + + if test -x "$ACLOCAL_EXECUTABLE"; then + echo "Running $ACLOCAL_EXECUTABLE" + $ACLOCAL_EXECUTABLE -I m4 + else + echo "Can't find aclocal" + exit $SCRIPT_ERROR + fi +} + +run_libtoolize () { + # Run the correct version of libtoolize. + + if test -x "$LIBTOOLIZE_EXECUTABLE"; then + echo "Running $LIBTOOLIZE_EXECUTABLE" + $LIBTOOLIZE_EXECUTABLE -f -c + else + if test -x "`which $GLIBTOOLIZE_EXECUTABLE`"; then + echo "Running $GLIBTOOLIZE_EXECUTABLE" + $GLIBTOOLIZE_EXECUTABLE -f -c + else + echo "Can't find libtoolize or glibtoolize" + exit $SCRIPT_ERROR + fi + fi +} + +run_autoheader () { + # Run the correct version of autoheader. + + if test -x "$AUTOHEADER_EXECUTABLE"; then + echo "Running $AUTOHEADER_EXECUTABLE" + $AUTOHEADER_EXECUTABLE -f + else + echo "Can't find autoheader" + exit $SCRIPT_ERROR + fi +} + +run_automake () { + # Run the correct version of automake. + + AUTOMAKE_OPTION_COLLECTION="" + if test -x "$AUTOMAKE_EXECUTABLE"; then + echo "Running $AUTOMAKE_EXECUTABLE" + $AUTOMAKE_EXECUTABLE -f -c -a --gnits + else + echo "Can't find automake" + exit $SCRIPT_ERROR + fi +} + +run_autoconf () { + # Run the correct version of autoconf. + + if test -x "$AUTOCONF_EXECUTABLE"; then + echo "Running $AUTOCONF_EXECUTABLE" + $AUTOCONF_EXECUTABLE -f + else + echo "Can't find autoconf" + exit $SCRIPT_ERROR + fi +} + +run_command_collection () { + # Run commands required to complete the bootstrap. + + run_libtoolize + run_aclocal + run_autoheader + run_automake + run_autoconf + cat << EOF + +You have bootstrapped Apache CouchDB. Time to relax. + +Run \`./configure' to configure the source before you install. +EOF +} + +parse_script_option_list () { + # Parse the script option list and take the appropriate action. + + if ! argument_list=$(getopt vhC $@); then + display_error + fi + eval set -- "$argument_list" + while [ $# -gt 0 ]; do + case "$1" in + -v) shift; display_version; exit $SCRIPT_OK;; + -h) shift; display_help; exit $SCRIPT_OK;; + -C) shift; CHANGELOG_PREDICATE=false;; + --) shift; break;; + *) display_error "Unknown option: $1" >&2;; + esac + done + cd $(dirname $0) + process_file_collection + check_svn_environment || true + if test "$CHANGELOG_PREDICATE" = "true"; then + generate_changelog + else + generate_dummy_changelog + fi + generate_acinclude + run_command_collection +} + +parse_script_option_list $@ Propchange: incubator/couchdb/trunk/bootstrap ------------------------------------------------------------------------------ svn:executable = * Added: incubator/couchdb/trunk/build-contrib/ac_check_icu.m4_2007-09-12.gz URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/build-contrib/ac_check_icu.m4_2007-09-12.gz?rev=642432&view=auto ============================================================================== Binary file - no diff available. Propchange: incubator/couchdb/trunk/build-contrib/ac_check_icu.m4_2007-09-12.gz ------------------------------------------------------------------------------ svn:mime-type = application/x-gzip Added: incubator/couchdb/trunk/build-contrib/apache_2.txt.gz URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/build-contrib/apache_2.txt.gz?rev=642432&view=auto ============================================================================== Binary file - no diff available. Propchange: incubator/couchdb/trunk/build-contrib/apache_2.txt.gz ------------------------------------------------------------------------------ svn:mime-type = application/x-gzip Added: incubator/couchdb/trunk/build-contrib/config.guess_2007-09-12.gz URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/build-contrib/config.guess_2007-09-12.gz?rev=642432&view=auto ============================================================================== Binary file - no diff available. Propchange: incubator/couchdb/trunk/build-contrib/config.guess_2007-09-12.gz ------------------------------------------------------------------------------ svn:mime-type = application/x-gzip Added: incubator/couchdb/trunk/build-contrib/config.sub_2007-09-12.gz URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/build-contrib/config.sub_2007-09-12.gz?rev=642432&view=auto ============================================================================== Binary file - no diff available. Propchange: incubator/couchdb/trunk/build-contrib/config.sub_2007-09-12.gz ------------------------------------------------------------------------------ svn:mime-type = application/x-gzip Added: incubator/couchdb/trunk/configure.ac URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/configure.ac?rev=642432&view=auto ============================================================================== --- incubator/couchdb/trunk/configure.ac (added) +++ incubator/couchdb/trunk/configure.ac Fri Mar 28 16:32:19 2008 @@ -0,0 +1,242 @@ +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. + +m4_include([m4/ac_check_icu.m4]) + +AC_INIT([LOCAL_PACKAGE_NAME], [LOCAL_VERSION], [LOCAL_LIST_ADDRESS], + [LOCAL_PACKAGE_IDENTIFIER]) + +AC_PREREQ([2.59]) + +AC_CONFIG_SRCDIR([ChangeLog]) +AC_CONFIG_AUX_DIR([build-aux]) + +AM_CONFIG_HEADER([config.h]) + +AM_INIT_AUTOMAKE([1.6.3 gnu check-news -Wno-portability]) + +AC_GNU_SOURCE +AC_ENABLE_SHARED +AC_DISABLE_STATIC + +AC_PROG_CC +AC_PROG_LIBTOOL +AC_PROG_LN_S + +AC_MSG_CHECKING([for pthread_create in -lpthread]) + +original_LIBS="$LIBS" +LIBS="-lpthread $original_LIBS" + +AC_TRY_LINK([#include], + [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_ARG_WITH([erlang], [AC_HELP_STRING([--with-erlang=PATH], + [set PATH to the Erlang include directory])], [ + ERLANG_FLAGS="-I$withval" +], [ + 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_ARG_WITH([js-include], [AC_HELP_STRING([--with-js-include=PATH], + [set PATH to the SpiderMonkey include directory])], [ + JS_INCLUDE_FLAGS="-I$withval" +], [ + JS_INCLUDE_FLAGS="-I/usr/include/js" + JS_INCLUDE_FLAGS="$JS_INCLUDE_FLAGS -I/usr/include/mozjs" + JS_INCLUDE_FLAGS="$JS_INCLUDE_FLAGS -I/usr/local/include/js" + JS_INCLUDE_FLAGS="$JS_INCLUDE_FLAGS -I/opt/local/include/js" +]) + +AC_ARG_WITH([js-lib], [AC_HELP_STRING([--with-js-lib=PATH], + [set PATH to the SpiderMonkey library directory])], + [JS_LIB_FLAGS="-L$withval"], []) + +# XP_UNIX required for jsapi.h and has been tested to work on Linux and Darwin. +LIB_FLAGS="-L/usr/local/lib -L/opt/local/lib $JS_LIB_FLAGS" +LIBS="$LIB_FLAGS $LIBS" +FLAGS="$LIB_FLAGS $ERLANG_FLAGS $JS_INCLUDE_FLAGS -DXP_UNIX $FLAGS" +CPPFLAGS="$FLAGS $CPPFLAGS" +LDFLAGS="$FLAGS $LDFLAGS" + +AC_CHECK_LIB([js], [JS_NewContext], [], [ + AC_CHECK_LIB([mozjs], [JS_NewContext], [], [ + AC_MSG_ERROR([Could not find the js library. + +Is the Mozilla SpiderMonkey library installed?])])]) + +AC_CHECK_HEADER([jsapi.h], [], [ + AC_MSG_ERROR([Could not find the jsapi header. + +Are Mozilla SpiderMonkey headers installed?])]) + +AC_CHECK_ICU([3]) + +ICU_LOCAL_CFLAGS=`$ICU_CONFIG --cppflags-searchpath` +ICU_LOCAL_LDFLAGS=`$ICU_CONFIG --ldflags-searchpath` + +AC_SUBST(ICU_CONFIG) +AC_SUBST(ICU_LOCAL_CFLAGS) +AC_SUBST(ICU_LOCAL_LDFLAGS) + +AC_PATH_PROG([ERL], [erl]) + +if test x${ERL} = x; then + AC_MSG_ERROR([Could not find the `erl' executable. Is Erlang installed?]) +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 + +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 +path to the Erlang include directory.])]) + +AC_PATH_PROG([HELP2MAN_EXECUTABLE], [help2man]) +if test x${HELP2MAN_EXECUTABLE} = x; then + AC_MSG_WARN([You will be unable to regenerate any man pages.]) +fi + +use_init=yes +use_launchd=yes + +AC_ARG_ENABLE([init], [AC_HELP_STRING([--disable-init], + [don't install init script where applicable])], [ + use_init=$enableval +], []) + +AC_ARG_ENABLE([launchd], [AC_HELP_STRING([--disable-launchd], + [don't install launchd configuration where applicable])], [ + use_launchd=$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_ARG_VAR([ERL_EXECUTABLE], [path to the `erl' executable]) +AC_ARG_VAR([ERLC_EXECUTABLE], [path to the `erlc' executable]) +AC_ARG_VAR([HELP2MAN_EXECUTABLE], [path to the `help2man' program]) + +if test -n "$HELP2MAN_EXECUTABLE"; then + help2man_enabled=true +else + if test -f "$srcdir/bin/couchdb.1" -a -f "$srcdir/bin/couchjs.1"; then + help2man_enabled=true + else + help2man_enabled=false + fi +fi + +AM_CONDITIONAL([INIT], [test x${init_enabled} = xtrue]) +AM_CONDITIONAL([LAUNCHD], [test x${launchd_enabled} = xtrue]) +AM_CONDITIONAL([HELP2MAN], [test x${help2man_enabled} = xtrue]) + +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_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([list_address], ["LOCAL_LIST_ADDRESS"]) +AC_SUBST([list_uri], ["LOCAL_LIST_URI"]) + +AC_SUBST([pkgconfdir], [${sysconfdir}/${PACKAGE_TARNAME}]) +AC_SUBST([pkgdatadir], [${datadir}/${PACKAGE_TARNAME}]) +AC_SUBST([pkgdocdir], [${datadir}/doc/${PACKAGE_TARNAME}]) +AC_SUBST([pkglibdir], [${libdir}/${PACKAGE_TARNAME}]) +AC_SUBST([pkgstatelibdir], [${localstatedir}/lib/${PACKAGE_TARNAME}]) +AC_SUBST([pkgstatelogdir], [${localstatedir}/log/${PACKAGE_TARNAME}]) +AC_SUBST([libbindir], [${pkglibdir}/bin]) +AC_SUBST([erlangbindir], [${pkglibdir}/erlang/bin]) +AC_SUBST([erlanglibdir], [${pkglibdir}/erlang/lib]) + +AC_REVISION([LOCAL_VERSION]) + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([bin/couchjs.tpl]) +AC_CONFIG_FILES([bin/couchdb.tpl]) +AC_CONFIG_FILES([bin/Makefile]) +AC_CONFIG_FILES([etc/couch_httpd.conf.tpl]) +AC_CONFIG_FILES([etc/couch.ini.tpl]) +AC_CONFIG_FILES([etc/default/couchdb.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/Makefile]) +AC_CONFIG_FILES([share/Makefile]) +AC_CONFIG_FILES([src/couch_inets/Makefile]) +AC_CONFIG_FILES([src/couchdb/couch.app.tpl]) +AC_CONFIG_FILES([src/couchdb/Makefile]) +AC_CONFIG_FILES([src/Makefile]) +AC_CONFIG_FILES([var/Makefile]) + +AC_OUTPUT + +echo +echo "You have configured Apache CouchDB. Time to relax." +echo +echo "Run \`make && make install' to install." Propchange: incubator/couchdb/trunk/etc/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Fri Mar 28 16:32:19 2008 @@ -0,0 +1,8 @@ +Makefile +Makefile.in +couch.ini +couch.ini.dist +couch.ini.tpl +couch_httpd.conf +couch_httpd.conf.dist +couch_httpd.conf.tpl Added: incubator/couchdb/trunk/etc/Makefile.am URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/etc/Makefile.am?rev=642432&view=auto ============================================================================== --- incubator/couchdb/trunk/etc/Makefile.am (added) +++ incubator/couchdb/trunk/etc/Makefile.am Fri Mar 28 16:32:19 2008 @@ -0,0 +1,128 @@ +## 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. + +datarootdir = @prefix@/share + +couchprivlibdir = $(erlanglibdir)/couch-$(version)/priv/lib + +SUBDIRS = default init launchd logrotate.d + +default_sysconf_data = logrotate.d/couchdb.dist + +pkgconf_DATA = couch.ini.dist couch_httpd.conf.dist + +nobase_dist_pkgconf_DATA = conf/mime.types + +if INIT +init_sysconf_data = default/couchdb.dist +init_DATA = init/couchdb.dist +endif + +if LAUNCHD +launchd_DATA = launchd/org.apache.couchdb.plist.dist +endif + +nobase_sysconf_DATA = $(default_sysconf_data) $(init_sysconf_data) + +CLEANFILES = $(init_DATA) $(nobase_sysconf_DATA) $(launchd_DATA) $(pkgconf_DATA) + +transform = @program_transform_name@ +couchdb_command_name = `echo couchdb | sed '$(transform)'` +couchjs_command_name = `echo couchjs | sed '$(transform)'` + +couch.ini.dist: couch.ini.tpl + sed -e "s|%bindir%|@bindir@|g" \ + -e "s|%pkgconfdir%|@pkgconfdir@|g" \ + -e "s|%pkgdatadir%|@pkgdatadir@|g" \ + -e "s|%pkgstatelibdir%|@pkgstatelibdir@|g" \ + -e "s|%pkgstatelogdir%|@pkgstatelogdir@|g" \ + -e "s|%couchprivlibdir%|$(couchprivlibdir)|g" \ + -e "s|%couchjs_command_name%|$(couchjs_command_name)|g" \ + < $< > $@ + +couch_httpd.conf.dist: couch_httpd.conf.tpl + sed -e "s|%pkgconfdir%|@pkgconfdir@|g" \ + -e "s|%pkgdatadir%|@pkgdatadir@|g" \ + -e "s|%pkgstatelogdir%|@pkgstatelogdir@|g" \ + < $< > $@ + +default/couchdb.dist: default/couchdb.tpl + if test "$(mkdir_p)"; then \ + $(mkdir_p) default; \ + else \ + if test ! -d default; then \ + mkdir default; \ + fi \ + fi + sed -e "s|%configure_input%|$@. Generated from $< by configure.|" \ + -e "s|%pkgconfdir%|@pkgconfdir@|g" \ + -e "s|%sysconfdir%|@sysconfdir@|" \ + -e "s|%localstatedir%|@localstatedir@|" \ + < $< > $@ + +init/couchdb.dist: 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|%erlangbindir%|@erlangbindir@|" \ + -e "s|%couchdb_command_name%|$(couchdb_command_name)|" \ + < $< > $@ + +logrotate.d/couchdb.dist: logrotate.d/couchdb.tpl + sed -e "s|%pkgstatelogdir%|@pkgstatelogdir@|g" < $< > $@ + +launchd/org.apache.couchdb.plist.dist: 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)|" \ + < $< > $@ + +install-data-hook: + if test $(init_DATA); then \ + chmod 755 "$(DESTDIR)$(initdir)/couchdb"; \ + mv -i "$(DESTDIR)$(sysconfdir)/default/couchdb.dist" \ + "$(DESTDIR)$(sysconfdir)/default/couchdb"; \ + mv -i "$(DESTDIR)$(initdir)/couchdb.dist" \ + "$(DESTDIR)$(initdir)/couchdb"; \ + fi + if test $(launchd_DATA); then \ + mv -i "$(DESTDIR)$(launchddir)/org.apache.couchdb.plist.dist" \ + "$(DESTDIR)$(launchddir)/org.apache.couchdb.plist"; \ + fi + mv -i "$(DESTDIR)/$(sysconfdir)/logrotate.d/couchdb.dist" \ + "$(DESTDIR)/$(sysconfdir)/logrotate.d/couchdb" + mv -i "$(DESTDIR)/$(pkgconfdir)/couch.ini.dist" \ + "$(DESTDIR)/$(pkgconfdir)/couch.ini" + mv -i "$(DESTDIR)/$(pkgconfdir)/couch_httpd.conf.dist" \ + "$(DESTDIR)/$(pkgconfdir)/couch_httpd.conf" + +uninstall-hook: + rm -f $(DESTDIR)$(initdir)/couchdb + rm -f $(DESTDIR)$(launchddir)/org.apache.couchdb.plist + rm -f $(DESTDIR)$(sysconfdir)/default/couchdb + rm -f $(DESTDIR)$(sysconfdir)/logrotate.d/couchdb + rm -f $(DESTDIR)/$(pkgconfdir)/couch.ini + rm -f $(DESTDIR)/$(pkgconfdir)/couch_httpd.conf