couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beno...@apache.org
Subject svn commit: r1161695 - in /couchdb/trunk: bin/Makefile.am bin/couch-config.tpl.in configure.ac
Date Thu, 25 Aug 2011 18:54:34 GMT
Author: benoitc
Date: Thu Aug 25 18:54:34 2011
New Revision: 1161695

URL: http://svn.apache.org/viewvc?rev=1161695&view=rev
Log:
add couch-config file used to ease the build of plugin. close ticket
#COUCHDB-1012 .

Usage :

    $ ./bin/couch-config
    Usage: couch-config [OPTION]

    The couch-config command runs the Apache CouchDB configuration
helper
    script.

    Options:

      --erl-libs-dir    Erlang library directory
      --config-dir      configuration directory
      --db-dir          database dirrectory
      --view-dir        view index directory
      --static-dir      static asset directory
      --doc-dir         documentation directory
      --log-dir         log directory
      --uri-file        daemon sockets file
      --couch-version   version of Apache CouchDB
      --version         version of couch-config_dev
      --help            Print usage

    If you want to add an option in couch-config or report bugs please
do it
    at <https://issues.apache.org/jira/browse/COUCHDB>.

Added:
    couchdb/trunk/bin/couch-config.tpl.in
Modified:
    couchdb/trunk/bin/Makefile.am
    couchdb/trunk/configure.ac

Modified: couchdb/trunk/bin/Makefile.am
URL: http://svn.apache.org/viewvc/couchdb/trunk/bin/Makefile.am?rev=1161695&r1=1161694&r2=1161695&view=diff
==============================================================================
--- couchdb/trunk/bin/Makefile.am (original)
+++ couchdb/trunk/bin/Makefile.am Thu Aug 25 18:54:34 2011
@@ -13,10 +13,10 @@
 if WINDOWS
 bin_SCRIPTS = couchdb.bat
 else
-bin_SCRIPTS = couchdb couchjs
+bin_SCRIPTS = couchdb couchjs couch-config
 endif
 
-noinst_SCRIPTS = couchjs_dev
+noinst_SCRIPTS = couchjs_dev couch-config_dev
 
 if HELP2MAN
 dist_man1_MANS = couchdb.1 couchjs.1
@@ -75,6 +75,54 @@ couchdb.bat: couchdb.bat.tpl
 	    -e "s|%version%|@version@|g" \
 	$< > $@
 
+couch-config: couch-config.tpl
+	sed -e "s|%ERL%|$(ERL)|g" \
+	    -e "s|%bindir%|@bindir@|g" \
+	    -e "s|%localerlanglibdir%|@localerlanglibdir@|g" \
+	    -e "s|%localconfdir%|@localconfdir@|g" \
+		-e "s|%localdatadir%|$(localdatadir)|g" \
+		-e "s|%localbuilddatadir%|$(localdatadir)|g" \
+	    -e "s|%localstatelogdir%|@localstatelogdir@|g" \
+	    -e "s|%localstatelibdir%|@localstatelibdir@|g" \
+	    -e "s|%localstatedir%|@localstatedir@|g" \
+	    -e "s|%localstaterundir%|@localstaterundir@|g" \
+		-e "s|%couchlibdir%|@localerlanglibdir@/couch-%version%|g"\
+		-e "s|%couchincludedir%|@localerlanglibdir@/include|g"\
+		-e "s|%couchebindir%|@localerlanglibdir@/ebin|g"\
+		-e "s|%couchprivlibdir%|@localerlanglibdir@/couch-%version%/priv/lib|g"\
+	    -e "s|%bug_uri%|@bug_uri@|g" \
+	    -e "s|%package_author_address%|@package_author_address@|g" \
+	    -e "s|%package_author_name%|@package_author_name@|g" \
+	    -e "s|%package_name%|@package_name@|g" \
+	    -e "s|%version%|@version@|g" \
+	    -e "s|%couchdb_command_name%|$(couchdb_command_name)|g" > \
+	$@ < $<
+	chmod +x $@
+
+couch-config_dev: couch-config.tpl
+	sed -e "s|%ERL%|$(ERL)|g" \
+	    -e "s|%bindir%|$(abs_top_builddir)/bin|g" \
+	    -e "s|%localerlanglibdir%|$(abs_top_builddir)\/src\/couchdb|g" \
+		-e "s|%couchlibdir%|$(abs_top_builddir)\/src\/couchdb|g"\
+		-e "s|%couchincludedir%|$(abs_top_builddir)\/src\/couchdb|g"\
+		-e "s|%couchebindir%|$(abs_top_builddir)\/src\/couchdb|g"\
+		-e "s|%couchprivlibdir%|$(abs_top_builddir)/src/couchdb/priv/.libs|g"\
+		-e "s|%localdatadir%|$(abs_top_srcdir)/share|g" \
+		-e "s|%localbuilddatadir%|$(abs_top_builddir)/share|g" \
+	    -e "s|%localstatelibdir%|$(abs_top_builddir)/tmp/lib|g" \
+	    -e "s|%localstatelogdir%|$(abs_top_builddir)/tmp/log|g" \
+		-e "s|%localstatedir%|$(abs_top_builddir)/tmp|g" \
+	    -e "s|%localstaterundir%|$(abs_top_builddir)/tmp/run|g" \
+		-e "s|%bug_uri%|@bug_uri@|g" \
+	    -e "s|%package_author_address%|@package_author_address@|g" \
+	    -e "s|%package_author_name%|@package_author_name@|g" \
+	    -e "s|%package_name%|@package_name@|g" \
+	    -e "s|%version%|@version@|g" \
+	    -e "s|%couchdb_command_name%|$(abs_top_builddir)/utils/run|g" > \
+	$@ < $<
+	chmod +x $@
+
+
 HELP2MAN_OPTION=--no-info --help-option="-h" --version-option="-V"
 
 # XXX: Because the scripts are made at build time for the user we need to

Added: couchdb/trunk/bin/couch-config.tpl.in
URL: http://svn.apache.org/viewvc/couchdb/trunk/bin/couch-config.tpl.in?rev=1161695&view=auto
==============================================================================
--- couchdb/trunk/bin/couch-config.tpl.in (added)
+++ couchdb/trunk/bin/couch-config.tpl.in Thu Aug 25 18:54:34 2011
@@ -0,0 +1,130 @@
+#! /bin/sh -e
+
+# 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.
+
+basename=`basename "$0"`
+
+staticdir="%localbuilddatadir%"
+erlanglibdir="%localerlanglibdir%"
+couchversion="%version%"
+dbdir="%localstatelibdir%"
+viewdir="%localstatelibdir%"
+confdir="%localconfdir%"
+urifile="%localstaterundir%/couch.uri"
+logdir="%localstatelogdir%"
+
+version () {
+    cat << EOF
+$basename - %package_name% configuration helper %version%
+
+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.
+
+EOF
+}
+
+usage()
+{
+    cat << EOF
+Usage: $basename [OPTION]
+
+The $basename command runs the %package_name% configuration helper
+script.
+
+Options:
+
+  --erl-libs-dir    Erlang library directory
+  --config-dir      configuration directory
+  --db-dir          database dirrectory
+  --view-dir        view index directory
+  --static-dir      static asset directory
+  --doc-dir         documentation directory
+  --log-dir         log directory
+  --uri-file        daemon sockets file 
+  --couch-version   version of Apache CouchDB
+  --version         version of $basename
+  --help            Print usage
+
+If you want to add an option in couch-config or report bugs please do it
+at <%bug_uri%>.
+EOF
+}
+  
+
+if [ $# -lt 1 ]; then
+    usage
+    exit 1
+fi
+
+
+while [ $# -gt 0 ];
+do
+    arg="$1"
+    var=`echo $arg | sed -e 's/^[^=]*=//'`
+    
+    case "$arg" in
+        --erl-libs-dir)
+            echo $erlanglibdir
+            ;;
+        --config-dir)
+            echo $confdir
+            ;;
+        --db-dir)
+            echo $dbdir
+            ;;
+        --view-dir)
+            echo $viewdir
+            ;;
+        --static-dir)
+            echo $staticdir
+            ;;
+        --doc-dir)
+            echo $staticdir
+            ;;
+        --log-dir)
+            echo $logdir
+            ;;
+        --uri-file)
+            echo $urifile
+            ;;
+        --couch-version)
+            echo $couchversion
+            ;;
+        --version)
+            version
+            exit 0
+            ;;
+        --help)
+            usage
+            exit 0
+            ;;
+        *|-*)
+	        echo $basename: ERROR Unknown Option $arg 1>&2
+            echo 1>&2
+            usage 1>&2
+            echo "### $basename: Exitting." 1>&2
+            exit 1;
+            ;;
+    esac
+    shift
+done
+
+exit 0

Modified: couchdb/trunk/configure.ac
URL: http://svn.apache.org/viewvc/couchdb/trunk/configure.ac?rev=1161695&r1=1161694&r2=1161695&view=diff
==============================================================================
--- couchdb/trunk/configure.ac (original)
+++ couchdb/trunk/configure.ac Thu Aug 25 18:54:34 2011
@@ -523,6 +523,7 @@ AC_SUBST(abs_top_builddir)
 AC_REVISION([LOCAL_VERSION])
 
 AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([bin/couch-config.tpl])
 AC_CONFIG_FILES([bin/couchjs.tpl])
 AC_CONFIG_FILES([bin/couchdb.tpl])
 AC_CONFIG_FILES([bin/couchdb.bat.tpl])



Mime
View raw message