Skip to content
Newer
Older
100644 209 lines (132 sloc) 6.42 KB
bbee976 @jhs The README
jhs authored
1 Build CouchDB
2 =============
3
4 Build CouchDB is a wrapper or master project which pulls in, from official
5 sources, CouchDB plus all of its dependencies. It is the most straightforward
6 and reliable procedure to build official CouchDB releases from source.
7
8 Build CouchDB builds an isolated, independent server. You do not need
73e1880 @jhs Documentation clarification
jhs authored
9 administrator access to run it. You can run several couches (for example, 0.10,
10 0.11, 1.0 releases) side-by-side.
bbee976 @jhs The README
jhs authored
11
12 ## Supported Platforms
13
14 Build CouchDB is developed and tested on the following operating systems:
15
225311f @jhs Debian 5.0 (Lenny) support
jhs authored
16 * Debian GNU/Linux 5.0 (Lenny)
bbee976 @jhs The README
jhs authored
17 * Ubuntu 10.04 LTS (Lucid Lynx)
2e28569 @jhs Update documentation
jhs authored
18 * Ubuntu 9.10 (Karmic Koala)
0849f75 @jhs Fedora 13 support
jhs authored
19 * Fedora 13
0f98a4f @jhs Note that OSX is supported
jhs authored
20 * Apple OSX
cde3460 @amedeo Minor documentation clarification
amedeo authored
21 * OpenSUSE 11.3
bfe5f7e Added pre-usage library requirements and steps to install dependencie…
Tim Rupp authored
22 * Scientific Linux 5.3
94e9f7a @jhs Initial Solaris support
jhs authored
23 * Solaris 10, OpenSolaris
0909722 @jhs Document that RHEL is fully-supported
jhs authored
24 * Red Hat Enterprise Linux Server release 5.5 (Tikanga)
bbee976 @jhs The README
jhs authored
25
26 The following systems are planned for support in the near future:
27
28 * MS Windows Vista, Windows 7
29
30 ## Requirements
31
d4f6fe1 @jhs Ensure people don't use wrong or invalid packages
jhs authored
32 You need only a few packages provided by the operating system. Copy and paste
33 the commands below.
bbee976 @jhs The README
jhs authored
34
225311f @jhs Debian 5.0 (Lenny) support
jhs authored
35 On **Fedora**:
0849f75 @jhs Fedora 13 support
jhs authored
36
cb73200 @jhs SSL and zlib corrections
jhs authored
37 sudo yum install gcc gcc-c++ libtool libcurl-devel \
0849f75 @jhs Fedora 13 support
jhs authored
38 zlib-devel openssl-devel rubygem-rake
39
0909722 @jhs Document that RHEL is fully-supported
jhs authored
40 On **Red Hat Enterprise Linux**:
41
42 The procedure is the same as Fedora, with the following exceptions:
43
44 * Do not use yum to install rubygem-rake or libcurl-devel.
45 * Use [Ruby Version Manager][rvm] to install the latest release of Ruby v 1.8.7. This installed a version of rake, too.
46 * Download and install the latest release of [cURL][curl] from source.
47
48 [rvm]: http://rvm.beginrescueend.com
49 [curl]: http://curl.haxx.se/docs/install.html
50
51
225311f @jhs Debian 5.0 (Lenny) support
jhs authored
52 On **Debian**, first install `sudo` and add yourself to `/etc/sudoers`.
53
54 su -
55 apt-get install sudo
354b340 @jhs Correct visudo command
jhs authored
56 visudo
225311f @jhs Debian 5.0 (Lenny) support
jhs authored
57
58 On **Ubuntu and Debian**:
59
60 sudo apt-get install make gcc zlib1g-dev libssl-dev libreadline5-dev rake
61
d9032e2 @amedeo OpenSUSE 11.3 support
amedeo authored
62 On **OpenSUSE**:
63
64 sudo zypper install flex lksctp-tools-devel zip \
65 rubygem-rake gcc-c++ make m4 zlib-devel \
66 libopenssl-devel libtool automake libcurl-devel
67
bfe5f7e Added pre-usage library requirements and steps to install dependencie…
Tim Rupp authored
68 On **Scientific Linux**
69
9ce0a80 Removed js yum dependency because tracemonkey compiles with appropria…
Tim Rupp authored
70 sudo yum install --enablerepo=dag gcc gcc-c++ libtool zlib-devel openssl-devel \
b457965 Added formatting to readme file
Tim Rupp authored
71 autoconf213
bfe5f7e Added pre-usage library requirements and steps to install dependencie…
Tim Rupp authored
72
94e9f7a @jhs Initial Solaris support
jhs authored
73 On **Solaris**
74
75 sudo pkg install ss-dev
76 sudo pkg-get install ruby rake
77
7f3ac78 Fixing formatting
Tim Rupp authored
78 You also must install a recent copy of Ruby and libcurl as the ones
79 available in the provided yum repositories are too old to use.
bfe5f7e Added pre-usage library requirements and steps to install dependencie…
Tim Rupp authored
80
7f3ac78 Fixing formatting
Tim Rupp authored
81 It is sufficient to perform a standard three-finger salute to install
82 ruby and libcurl
bfe5f7e Added pre-usage library requirements and steps to install dependencie…
Tim Rupp authored
83
576fea8 Fixing more formatting
Tim Rupp authored
84 ./configure
85 make
86 make install
bfe5f7e Added pre-usage library requirements and steps to install dependencie…
Tim Rupp authored
87
490ef9e @jhs Keep the Linuxes together
jhs authored
88 On **OSX**, install XCode.
89
d9032e2 @amedeo OpenSUSE 11.3 support
amedeo authored
90
bbee976 @jhs The README
jhs authored
91 ## Getting the Code
92
93 You will need the Git tool. Check out the code and pull in the third-party
94 submodules.
95
f6b3c79 @jhs Correct clone URL
jhs authored
96 git clone git://github.com/jhs/build-couchdb
bbee976 @jhs The README
jhs authored
97 cd build-couchdb
af0ac90 @jhs Documentation updates
jhs authored
98 git submodule init
bbee976 @jhs The README
jhs authored
99 git submodule update
100
101 ## How to Build CouchDB
102
2e28569 @jhs Update documentation
jhs authored
103 Just run Rake.
bbee976 @jhs The README
jhs authored
104
2e28569 @jhs Update documentation
jhs authored
105 rake
bbee976 @jhs The README
jhs authored
106
2e28569 @jhs Update documentation
jhs authored
107 CouchDB and all its dependencies will install in the `build/`. To uninstall,
35d9041 @jhs Documentation clarification
jhs authored
108 simply delete that directory.
bbee976 @jhs The README
jhs authored
109
110 ## Usage
111
2e28569 @jhs Update documentation
jhs authored
112 It's CouchDB! Just type `couchdb`. (But remember the path)
bbee976 @jhs The README
jhs authored
113
2e28569 @jhs Update documentation
jhs authored
114 $ build/bin/couchdb
bbee976 @jhs The README
jhs authored
115 Apache CouchDB 0.12.0aa63efb6-git (LogLevel=info) is starting.
116 Apache CouchDB has started. Time to relax.
117 [info] [<0.33.0>] Apache CouchDB has started on http://127.0.0.1:5984/
118
2e28569 @jhs Update documentation
jhs authored
119 You can of course call it by absolute path. If your username is `amit` and you
120 checked out the code in your home directory, you would run:
121
122 /home/amit/build-couchdb/build/bin/couchdb
123
5523fa3 @jhs Clarify the env rake task
jhs authored
124 ## Conveniently Add CouchDB to the PATH
125
126 The `env` task will output a script which will add this CouchDB build to your
127 path. Then you can simply type `couchdb`. To load these settings into your
128 current shell, run:
129
130 eval `rake env --silent`
131
117a8ac @jhs Document the new flexible building and installing features
jhs authored
132 ## Cheat Codes
133
134 Build CouchDB supports some fancy tricks by entering cheat codes to the Rake
135 command.
136
137 ### Build any Git fork or tag of CouchDB
138
139 Add a `git` parameter with the repository URL, then a space, then the branch,
140 tag, or commit hash. (Remember to quote all of thos so Rake sees the space.)
141
142 Want to build [GeoCouch][geocouch]? No problem.
143
144 rake git="git://github.com/vmx/couchdb geocouch"
145
146 ### Install CouchDB somewhere besides `build/`.
147
148 Add a `couchdb_build` parameter to place the final couchdb binaries anywhere.
149 Note, you still need the main `build/` subdirectory because couchdb dependencies
150 such as Erlang and ICU reside there.
151
152 However, `couchdb_build` makes it trivial to install several couchdb versions
153 side-by-side.
154
155 rake git="git://github.com/vmx/couchdb geocouch" couchdb_build=geocouch
156 rake git="git://git.apache.org/couchdb.git trunk" couchdb_build=trunk
157 for tag in 1.0.1 11.0 11.1; do
158 rake git="git://git.apache.org/couchdb.git tags/$tag" couchdb_build=$tag
159 done
160
7a7671f @jhs Explain the manifest option
jhs authored
161 ### Get a manifest of all the components
162
163 To get a better idea of exactly what is going on, add a `manifest` parameter.
164
165 rake manifest=1
166
167 That will produce additional files in `build/manifest` which indicate which
168 package (icu, erlang, spidermonkey, etc) owns which files within `build`. A
169 trick I do a lot is `cat build/manifest/couchdb | xargs rm` to "uninstall" only
170 couchdb so I can try a rebuild.
171
4b34aee @jhs Brevity
jhs authored
172 I have no idea how `manifest` interacts with `couchdb_build` as I have never
173 used them together.
7a7671f @jhs Explain the manifest option
jhs authored
174
117a8ac @jhs Document the new flexible building and installing features
jhs authored
175 [geocouch]: http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-the-future-is-now:2010-05-03:en,CouchDB,Python,Erlang,geo
176
dc2ce23 @jhs A way to keep some Erlang libraries
jhs authored
177 ### Do not strip down Erlang/OTP
178
179 Build CouchDB strips many modules out of the Erlang platform to reduce disk
180 usage. (You can see which ones at the top of `tasks/erlang.rake`.) To indicate
181 that a package should be kept, set the `otp_keep` variable to space-separated
182 library names.
183
184 rake otp_keep="compiler eunit"
185
186 Or, you can keep them all this way:
187
188 rake otp_keep="*"
189
e9f063a @jhs Document how to build CouchDB-deps
jhs authored
190 ### How to build only Erlang, couchjs, and OTP so you can build your own CouchDB elsewhere
191
192 There is a special shortcut task to build everything CouchDB needs (i.e. its dependencies).
193
194 rake couchdb:deps otp_keep="*"
195
196 Be careful not to build the `couchdb` target because after it completes, it will delete Erlang components needed for building (but not running).
197 Next, there is a simple task which outputs a `sh` script used to configure any CouchDB checkout.
198
199 rake --silent environment:configure
200
201 The output will look similar to this:
202
203 export PATH="/Users/jhs/src/build-couchdb/build/bin:$PATH"
204 LDFLAGS='-R/Users/jhs/src/build-couchdb/build/lib -L/Users/jhs/src/build-couchdb/build/lib' CFLAGS='-I/Users/jhs/src/build-couchdb/build/include/js -I/Users/jhs/src/build-couchdb/build/lib/erlang/usr/include' ./configure
205
206 In the CouchDB source, paste the above code after running `./bootstrap`. Next, you can run `make` or `make dev`, or anything.
207
bbee976 @jhs The README
jhs authored
208 vim: tw=80
Something went wrong with that request. Please try again.