Skip to content

Commit

Permalink
initial release.
Browse files Browse the repository at this point in the history
add rcouch & rcouch_embed templates.
  • Loading branch information
benoitc committed Dec 6, 2011
0 parents commit 16a4260
Show file tree
Hide file tree
Showing 26 changed files with 1,423 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
@@ -0,0 +1,9 @@
*.o
*.so
*.Tpo
*.beam
*.swp
*.swo
.DS_Store
erl_crash.dump

14 changes: 14 additions & 0 deletions LICENSE
@@ -0,0 +1,14 @@
2011 (c) Benoît Chesneau <benoitc@e-engura.org>

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.

10 changes: 10 additions & 0 deletions NOTICE
@@ -0,0 +1,10 @@
rcouch_template
---------------

2011 (c) Benoît Chesneau <benoitc@e-engura.org>

rcouch_template is released under the Apache 2 license. See the LICENSE file for
the complete license.

rcouch is released under the Apache 2 license. See the LICENSE file for
the complete license.
53 changes: 53 additions & 0 deletions README.md
@@ -0,0 +1,53 @@
# Rebar templates for generating custom couchdb releases

This project provide rebar templates that allows you to create your own
CouchDB releases or embed CouchDB applications based on the rebared
version of Apache CouchDB provided by the [refuge
project](http://refuge.io).

Platforms supported are Linux, FreeBSD 8.0x and sup, MacOSX 10.6/10.7
with Erlang R13B04/R14x, Windows is coming. Tested on i386, amd64 and
Arm platforms.

##Installation:

Install [rebar](https://github.com/basho/rebar). You can do that via
homebrew:

$ brew update
$ brew install rebar

*Note:*make sure to use latest rebar version/

Drop these templates in ~/.rebar/templates.


##Create a custom CouchDB release

To create a custom release of CouchDB with your own plugins, use the
**rcouch** templatefor trunk or **rcouch11** for 1.1.x branch:

$ mkdir myapp
$ rebar create template=rcouch appid=myapp


Then a full custom release has been installed. To use it:


$ make rel
$ ./rel/myapp/bin/myapp

You can now start to customize your release by adding your plugins to
rebar config and editing rel/reltool.config.

##Embed CouchDB in your application

To start an Erlang OTP application that embed CouchDB, use the
**rebar_embed** template for trunk or **rcouch11_embed** for 1.1.x
branch:

$ mkdir myapp
$ rebar create template=rcouch_embed appid=myapp

It create a custom app in apps/myapp/src that you can edit. Then use it
like above.
24 changes: 24 additions & 0 deletions rcouch.Makefile
@@ -0,0 +1,24 @@
DESTDIR?=
DISTDIR= rel/archive

.PHONY: rel deps

all: deps compile

compile:
@rebar compile

deps:
@rebar get-deps

clean:
@rebar clean

distclean: clean relclean
@rebar delete-deps

rel: relclean deps
@rebar compile generate

relclean:
@rm -rf rel/rcouch
40 changes: 40 additions & 0 deletions rcouch.gitignore
@@ -0,0 +1,40 @@
*.beam
*.gz
*.tpl
*.o
*.lo
*.la
*.m4
*.in
*~
*.orig
*.rej
erl_crash.dump
configure
autom4te.cache
build-aux
*.diff
.DS_Store
*.dSYM
*.sw*
*.gz

# relase
rel/{{appid}}
dev

# couch
apps/couch/couchjs

apps/couch/c_src/obj/*.so
apps/couch/priv/*.so
apps/couch/priv/couchspawnkillable
apps/couch/libs
apps/couch/share/server/main.js
apps/couch/share/server/main-coffee.js

# other
deps
ebin
distdir
package/osxbuild
42 changes: 42 additions & 0 deletions rcouch.md
@@ -0,0 +1,42 @@
rcouch
------

rcouch is a static distribution of couchdb using rebar. It is an
extraction of the refuge code to ease the distribution of couchdb.

Based on the couchdb code it is tagged from time to time for stability
purpose. At some point some supported branch may appear.

RCouch differs from refuge by only focusing on Apache CouchDB. It won't
contain any of the refuge features like P2P nodes handling, ... .
Internally we are using it to test couchdb and as an example on how to
embed couchdb in your own applications.

## Features:

- Apache CouchDB based
- Geocouch integrated
- rebar
- relocatable
- Fully opensource. All the sources are on refuge GIT repository
(http://github.com/refuge) under Apache License 2.

## Requirements

- OS supported: Linux, OSX, BSDs (windows support is coming)
- Erlang R14
- Curl
- ICU (if not built statically)

## Installation

Installation is pretty simple. Just run the command line:

$ make rel

and it will generate a couch folder in rel/couch. This release is
fully relocatable, so you can put it where you want on your system.


To create package for your system run `make package` . For now we build
packages for OSX, Debian, Redhat & Solaris.
28 changes: 28 additions & 0 deletions rcouch.rebar.config
@@ -0,0 +1,28 @@
%%-*- mode: erlang -*-

{deps, [

%% apache couchdb core
{couch, ".*", {git, "git://github.com/refuge/couch.git",
{branch, "master"}}},

%% couch index manager
{couch_index, ".*", {git, "git://github.com/refuge/couch_index.git",
{branch, "master"}}},

%% couch map/reduce indexer
{couch_mrview, ".*", {git, "git://github.com/refuge/couch_mrview.git",
{branch, "master"}}},

%% couch replicator
{couch_replicator, ".*", {git, "git://github.com/refuge/couch_replicator.git",
{branch, "master"}}},

%% spatial indexer
{geocouch, ".*", {git, "git://github.com/refuge/geocouch.git",
{branch, master}}}
]}.

{sub_dirs, ["rel"]}.

{require_otp_vsn, "R14B0[234]"}.
28 changes: 28 additions & 0 deletions rcouch.rebar_embed.config
@@ -0,0 +1,28 @@
%%-*- mode: erlang -*-

{deps, [

%% apache couchdb core
{couch, ".*", {git, "git://github.com/refuge/couch.git",
{branch, "master"}}},

%% couch index manager
{couch_index, ".*", {git, "git://github.com/refuge/couch_index.git",
{branch, "master"}}},

%% couch map/reduce indexer
{couch_mrview, ".*", {git, "git://github.com/refuge/couch_mrview.git",
{branch, "master"}}},

%% couch replicator
{couch_replicator, ".*", {git, "git://github.com/refuge/couch_replicator.git",
{branch, "master"}}},

%% spatial indexer
{geocouch, ".*", {git, "git://github.com/refuge/geocouch.git",
{branch, master}}}
]}.

{sub_dirs, ["rel", "apps/{{appid}}"]}.

{require_otp_vsn, "R14B0[234]"}.
27 changes: 27 additions & 0 deletions rcouch.rel/files/app.config
@@ -0,0 +1,27 @@
%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et

[

{couch, [
{config_dir, "{{platform_etc_dir}}"}
]},

%% os_mon config
{os_mon, [
{start_memsup, false},
{start_cpu_sup, false},
{disk_space_check_interval, 1},
{disk_almost_full_thresold, 1}
]},

%% SASL config
{sasl, [
{sasl_error_logger, {file, "{{sasl_error_log}}"}},
{errlog_type, error},
{error_logger_mf_dir, "{{sasl_log_dir}}"}, % Log directory
{error_logger_mf_maxbytes, 10485760}, % 10 MB max file size
{error_logger_mf_maxfiles, 5} % 5 files max
]}
].

0 comments on commit 16a4260

Please sign in to comment.