summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2015-04-06 22:20:32 +0200
committerJan Lehnardt <jan@apache.org>2015-06-24 23:06:48 +0200
commit53bfa44f2c0749389e299edddb6a2ab4033fdca8 (patch)
tree910f4ab52269f1b745ded0509ea2b45d0a305102 /configure
parentf80317483b27fcdacc6a022d228b309ee1781b5e (diff)
downloadcouchdb-53bfa44f2c0749389e299edddb6a2ab4033fdca8.tar.gz
add log file option to ./configure, unify naming of configure vars
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure44
1 files changed, 28 insertions, 16 deletions
diff --git a/configure b/configure
index d76eb8a92..c122bf3b8 100755
--- a/configure
+++ b/configure
@@ -11,11 +11,12 @@
# License for the specific language governing permissions and limitations under
# the License.
-PREFIX="/opt/couchdb"
+PREFIX="/usr/local"
PACKAGE_AUTHOR_NAME="The Apache Software Foundation"
COUCHDB_USER=`whoami`
WITH_CURL="false"
+# cd into this script’s directory
rootdir="$(cd "${0%/*}" 2>/dev/null; echo "$PWD")"
basename=`basename $0`
@@ -32,8 +33,9 @@ Options:
-h display a short help message and exit
-u USER set the username to run as (defaults to $COUCHDB_USER)
-p DIRECTORY set the prefix for installation (defaults to $PREFIX)
- -d DIRECTORY specify the data directory (defaults to $PREFIX/var/lib)
- -v DIRECTORY specify the view directory (defaults to $PREFIX/var/lib)
+ -d DIRECTORY specify the data directory (defaults to /var/lib/couchdb)
+ -v DIRECTORY specify the view directory (defaults to /var/lib/couchdb)
+ -l FILE specify the log file (defaults to /var/log/couchdb.log)
-c request that couchjs is linked to cURL (default false)
EOF
@@ -52,7 +54,7 @@ display_error () {
parse_opts () {
set +e
- options=`getopt hu:p:d:v:c $@`
+ options=`getopt hu:p:d:v:l:c $@`
if test ! $? -eq 0; then
display_error
fi
@@ -63,24 +65,32 @@ parse_opts () {
-h) shift; display_help; exit;;
-u) shift; COUCHDB_USER=$1; shift;;
-p) shift; PREFIX=$1; shift;;
- -d) shift; DATA=$1; shift;;
- -v) shift; VIEW=$1; shift;;
+ -d) shift; DATA_DIR=$1; shift;;
+ -v) shift; VIEW_DIR=$1; shift;;
+ -l) shift; LOG_FILE=$1; shift;;
-c) shift; WITH_CURL="true";;
--) shift; break;;
*) display_error "Unknown option: $1" >&2;;
esac
done
- if test ! -n "$DATA"; then
- DATA="$PREFIX/var/lib";
+
+ # defaults
+ if test -z "$DATA_DIR"; then
+ DATA_DIR="/var/lib/couchdb";
+ fi
+ if test -z "$VIEW_DIR"; then
+ VIEW_DIR="/var/lib/couchdb";
fi
- if test ! -n "$VIEW"; then
- VIEW="$PREFIX/var/lib";
+ if test -z "$LOG_FILE"; then
+ LOG_FILE="/var/log/couchdb.log";
fi
}
parse_opts $@
+INSTALL_DIR="$PREFIX/couchdb"
+
echo "==> configuring couchdb in rel/couchdb.config"
cat > rel/couchdb.config << EOF
@@ -99,9 +109,10 @@ cat > rel/couchdb.config << EOF
% The contents of this file are auto-generated by configure
%
{package_author_name, "$PACKAGE_AUTHOR_NAME"}.
-{prefix, "$PREFIX"}.
-{data_dir, "$DATA"}.
-{view_index_dir, "$VIEW"}.
+{prefix, "INSTALLDIR"}.
+{data_dir, "$DATA_DIR"}.
+{view_index_dir, "$VIEW_DIR"}.
+{log_file, "$LOG_FILE"}.
{user, "$COUCHDB_USER"}.
{node_name, "-name couchdb"}.
{cluster_port, 5984}.
@@ -124,9 +135,10 @@ cat > install.mk << EOF
# The contents of this file are auto-generated by configure
#
package_author_name = $PACKAGE_AUTHOR_NAME
-prefix = $PREFIX
-data_dir = $DATA
-view_index_dir = $VIEW
+install_dir = $INSTALL_DIR
+data_dir = $DATA_DIR
+view_index_dir = $VIEW_DIR
+log_file = $LOG_FILE
user = $COUCHDB_USER
EOF