You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2015/07/22 07:29:24 UTC

[07/50] couchdb commit: updated refs/heads/developer-preview-2.0 to 2a31bca

add log file option to ./configure, unify naming of configure vars


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/53bfa44f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/53bfa44f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/53bfa44f

Branch: refs/heads/developer-preview-2.0
Commit: 53bfa44f2c0749389e299edddb6a2ab4033fdca8
Parents: f803174
Author: Jan Lehnardt <ja...@apache.org>
Authored: Mon Apr 6 22:20:32 2015 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Wed Jun 24 23:06:48 2015 +0200

----------------------------------------------------------------------
 Makefile  | 17 ++++++++++-------
 configure | 44 ++++++++++++++++++++++++++++----------------
 2 files changed, 38 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/53bfa44f/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index cf048f1..3eb7c44 100644
--- a/Makefile
+++ b/Makefile
@@ -40,7 +40,7 @@ clean:
 
 check: javascript eunit
 
-# creates a a full erlang release
+# creates a full erlang release
 dist: all
 	@rm -rf rel/couchdb
 	@rebar generate
@@ -80,18 +80,21 @@ devclean:
 	@rm -rf dev/lib/*/data
 
 -include install.mk
-install: dist
-	@mkdir -p $(prefix)
-	@cp -R rel/couchdb/* $(prefix)
+install:
+	@rm -rf rel/couchdb
+	@rebar generate # make full erlang release
+	@mkdir -p $(install_dir)
+	@cp -R rel/couchdb/* $(install_dir)
 	@mkdir -p $(data_dir)
 	@chown $(user) $(data_dir)
 	@mkdir -p $(view_index_dir)
 	@chown $(user) $(view_index_dir)
-	@touch $(prefix)/var/log/couchdb.log
-	@chown $(user) $(prefix)/var/log/couchdb.log
+	@mkdir `dirname $(log_file)`
+	@touch $(log_file)
+	@chown $(user) $(log_file)
 
 uninstall:
-	@rm -rf $(prefix)
+	@rm -rf $(installdir)
 
 install.mk:
 # ignore install.mk missing if we are running

http://git-wip-us.apache.org/repos/asf/couchdb/blob/53bfa44f/configure
----------------------------------------------------------------------
diff --git a/configure b/configure
index d76eb8a..c122bf3 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