You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2013/10/07 18:20:25 UTC

[19/47] git commit: updated refs/heads/1.5.x to 797537c

custom Makefile for my-first-couchdb-plugin


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

Branch: refs/heads/1.5.x
Commit: 839beb049de7815efe48aefe51aa57fb5e491dfb
Parents: 6b48a9a
Author: Jan Lehnardt <ja...@apache.org>
Authored: Fri Oct 4 15:02:04 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Fri Oct 4 15:02:04 2013 +0200

----------------------------------------------------------------------
 configure.ac                              |  1 +
 src/Makefile.am                           | 13 ++-------
 src/my-first-couchdb-plugin/Makefile.am   | 21 ++++++++++++++
 src/my-first-couchdb-plugin/Makefile.dist | 38 ++++++++++++++++++++++++++
 4 files changed, 62 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/839beb04/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 321c651..09c34dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -737,6 +737,7 @@ AC_CONFIG_FILES([src/couch_mrview/Makefile])
 AC_CONFIG_FILES([src/couch_plugins/Makefile])
 AC_CONFIG_FILES([src/couch_replicator/Makefile])
 AC_CONFIG_FILES([src/couchjs-node/Makefile])
+AC_CONFIG_FILES([src/my-first-couchdb-plugin/Makefile])
 AC_CONFIG_FILES([src/couchdb/couch.app.tpl])
 AC_CONFIG_FILES([src/couchdb/Makefile])
 AC_CONFIG_FILES([src/couchdb/priv/Makefile])

http://git-wip-us.apache.org/repos/asf/couchdb/blob/839beb04/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index d306cd5..13e73bf 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -23,14 +23,5 @@ SUBDIRS = \
     ibrowse \
     mochiweb \
     snappy \
-    couchjs-node
-
-EXTRA_DIST = \
-  my-first-couchdb-plugin/.gitignore \
-  my-first-couchdb-plugin/Makefile.dist \
-  my-first-couchdb-plugin/Makefile.am \
-  my-first-couchdb-plugin/priv/default.d/my_first_couchdb_plugin.ini \
-  my-first-couchdb-plugin/README.md \
-  my-first-couchdb-plugin/src/my_first_couchdb_plugin.app.src \
-  my-first-couchdb-plugin/src/my_first_couchdb_plugin.erl \
-  my-first-couchdb-plugin/test/my_first_couchdb_plugin_tests.erl
+    couchjs-node \
+    my-first-couchdb-plugin

http://git-wip-us.apache.org/repos/asf/couchdb/blob/839beb04/src/my-first-couchdb-plugin/Makefile.am
----------------------------------------------------------------------
diff --git a/src/my-first-couchdb-plugin/Makefile.am b/src/my-first-couchdb-plugin/Makefile.am
new file mode 100644
index 0000000..cb3b70f
--- /dev/null
+++ b/src/my-first-couchdb-plugin/Makefile.am
@@ -0,0 +1,21 @@
+## 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.
+
+EXTRA_DIST =
+  .gitignore \
+  Makefile.dist \
+  Makefile.am \
+  priv/default.d/my_first_couchdb_plugin.ini \
+  README.md \
+  src/my_first_couchdb_plugin.app.src \
+  src/my_first_couchdb_plugin.erl \
+  test/my_first_couchdb_plugin_tests.erl

http://git-wip-us.apache.org/repos/asf/couchdb/blob/839beb04/src/my-first-couchdb-plugin/Makefile.dist
----------------------------------------------------------------------
diff --git a/src/my-first-couchdb-plugin/Makefile.dist b/src/my-first-couchdb-plugin/Makefile.dist
new file mode 100644
index 0000000..7806bd7
--- /dev/null
+++ b/src/my-first-couchdb-plugin/Makefile.dist
@@ -0,0 +1,38 @@
+## 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.
+
+# Customize here
+NAME=my_first_couchdb_plugin
+VERSION=1.0.0
+# Stop customizing here
+
+ERL=$(shell couch-config --erl-bin)
+ERLANG_VERSION=$(shell couch-config --erlang-version)
+COUCHDB_VERSION=$(shell couch-config --couch-version | sed 's/\+.*//')
+PLUGIN_DIRS=ebin priv
+PLUGIN_VERSION_SLUG=$(NAME)-$(VERSION)-$(ERLANG_VERSION)-$(COUCHDB_VERSION)
+PLUGIN_DIST=$(PLUGIN_VERSION_SLUG)
+
+all: compile
+
+compile:
+	ERL_LIBS=$(shell couch-config --erl-libs-dir):$(ERL_LIBS) rebar compile
+
+dev:
+	@ERL_LIBS=$(shell pwd) couchdb -i -a priv/default.d/*.ini
+
+plugin: compile
+	@mkdir -p $(PLUGIN_DIRS)
+	@mkdir -p $(PLUGIN_DIST)
+	@cp -r $(PLUGIN_DIRS) $(PLUGIN_DIST)
+	@tar czf $(PLUGIN_VERSION_SLUG).tar.gz $(PLUGIN_DIST)
+	@$(ERL) -eval 'File = "$(PLUGIN_VERSION_SLUG).tar.gz", {ok, Data} = file:read_file(File),io:format("~s: ~s~n", [File, base64:encode(crypto:sha(Data))]),halt()' -noshell