Github user janl commented on the pull request:
https://github.com/apache/couchdb/pull/302#issuecomment-113581523
In addition, I wrote up a few notes to make myself understand the whole
thing, maybe it helps others, too:
# CouchDB 2.0 build script
## make install
`make install` moves the built CouchDB binaries as well as configuration,
log and various other files into their final file system locations.
There are default locations for all files, and various ways to customise
the location of each class of files.
These classes of files are being installed (with their default location)
- The CouchDB start script (couchdb) and the couchjs binary
(/usr/local/bin/â¦)
- Erlang binary release (/usr/local/lib/couchdb/â¦)
- Configuration files (/usr/local/etc/couchdb/â¦)
- Static support files, like Fauxton and the documentation
(/usr/local/share/couchdb/â¦)
- Log files (/var/log/couchdb/â¦)
Here is an overview of the paths:
- /usr/local/bin/â¦
- /usr/local/lib/couchdb/â¦
- /usr/local/etc/couchdb/â¦
- /usr/local/share/couchdb/â¦
- /var/log/couchdb/â¦
There are two modifiers for most of these `$prefix` and `DESTDIR`.
### $prefix
`$prefix` defaults to `/usr/local`. You might notice above where it is
applied. It is set by `./configure -p $prefix` before `make install`.
For example, with `./configure -p /opt/local`, the paths look like this:
- /opt/local/bin/â¦
- /opt/local/lib/couchdb/â¦
- /opt/local/etc/couchdb/â¦
- /opt/local/share/couchdb/â¦
- /var/log/couchdb/â¦
### DESTDIR
`DESTDIR` is for package managers to build and test packages outside of the
main operating system paths. It is set as an environment variable before `make
install` as in `DESTDIR=/path/to/somewhere make install`. It applies to *all*
file paths.
For example, with `DESTDIR=/home/anne/ make install`, the paths look like
this:
- /home/anne/usr/local/bin/â¦
- /home/anne/usr/local/lib/couchdb/â¦
- /home/anne/usr/local/etc/couchdb/â¦
- /home/anne/usr/local/share/couchdb/â¦
- /home/anne/var/log/couchdb/â¦
### Other Customisations
Finally, all file class paths are configurable independently, so that (at
least) we can be installed into a standard Linux file system tree:
- /usr/bin/â¦
- /etc/couchdb/â¦
- /usr/lib/couchdb/â¦
- /usr/share/couchdb/â¦
- /var/log/couchdb/â¦
Examples:
`./configure --sysconfdir=/opt/etc`:
- /opt/etc/couchdb/â¦
`./configure --bindir=/my/bindir`:
- /my/bindir/{couchdb,couchjs}
`./configure --libdir=/home/couchdb`
- /home/couchdb/couchdb/â¦
`./configure --logdir`
## CouchDB Paths
The above path settings and customisation options are purely for the
benefit of default installations from source and custom installations via
package managers.
CouchDB itself cares less about where things are, but it needs to be told,
at least, about the location of a few things. These are:
- Where it is installed: {prefix, "$INSTALL_DIR"}.
- Where database are stored: {data_dir, "$DATA_DIR"}.
- Where view indexes are stored: {view_index_dir, "$VIEW_DIR"}.
- Where the log file is stored: {log_file, "$LOG_FILE"}.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---