[Kimchi-devel] [PATCH V9 6/9] add an option to toggle the sample plugin

shaohef at linux.vnet.ibm.com shaohef at linux.vnet.ibm.com
Fri Jun 13 10:28:51 UTC 2014


From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>

sample plugin is used to test as a plugin demo.

we disable it by default.

use this command to enable sample plugin
$ ./autogen.sh --enable-sample

Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
---
 configure.ac                                   | 16 ++++++++++++++++
 plugins/sample/Makefile.am                     |  2 +-
 plugins/sample/{sample.conf => sample.conf.in} |  2 +-
 3 files changed, 18 insertions(+), 2 deletions(-)
 rename plugins/sample/{sample.conf => sample.conf.in} (95%)

diff --git a/configure.ac b/configure.ac
index db87060..c7da29b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,6 +48,21 @@ if test "x$PYFLAKES" = "x"; then
   AC_MSG_WARN([pyflakes not found])
 fi
 
+AC_ARG_ENABLE(
+    [sample],
+    [AS_HELP_STRING(
+        [--enable-sample],
+        [enable sample plugin @<:@default=no@:>@]
+    )],
+    ,
+    [enable_sample="no"]
+)
+
+if test "${enable_sample}" = "yes"; then
+AC_SUBST([ENABLE_SAMPLE], [True])
+else
+AC_SUBST([ENABLE_SAMPLE], [False])
+fi
 
 AC_CONFIG_FILES([
     po/Makefile.in
@@ -62,6 +77,7 @@ AC_CONFIG_FILES([
     src/kimchi/model/Makefile
     plugins/Makefile
     plugins/sample/Makefile
+    plugins/sample/sample.conf
     plugins/sample/ui/Makefile
     plugins/sample/ui/config/Makefile
     plugins/sample/ui/js/Makefile
diff --git a/plugins/sample/Makefile.am b/plugins/sample/Makefile.am
index e03a4c0..a229244 100644
--- a/plugins/sample/Makefile.am
+++ b/plugins/sample/Makefile.am
@@ -19,4 +19,4 @@
 
 SUBDIRS = ui
 
-EXTRA_DIST = API.json sample.conf $(wildcard *.py)
+EXTRA_DIST = API.json sample.conf.in $(wildcard *.py)
diff --git a/plugins/sample/sample.conf b/plugins/sample/sample.conf.in
similarity index 95%
rename from plugins/sample/sample.conf
rename to plugins/sample/sample.conf.in
index d4994e5..6e0908b 100644
--- a/plugins/sample/sample.conf
+++ b/plugins/sample/sample.conf.in
@@ -1,5 +1,5 @@
 [kimchi]
-enable = True
+enable = @ENABLE_SAMPLE@
 plugin_class = "Drawings"
 uri = "/plugins/sample"
 
-- 
1.9.3




More information about the Kimchi-devel mailing list