[Kimchi-devel] [PATCH V5 6/7] add an optional to toggle the sample plugin

Daniel H Barboza danielhb at linux.vnet.ibm.com
Mon Jun 9 11:18:57 UTC 2014


Reviewed-by: Daniel Barboza <danielhb at linux.vnet.ibm.com>

On 06/09/2014 07:09 AM, shaohef at linux.vnet.ibm.com wrote:
> 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-plugins
>
> Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
> ---
>   configure.ac                                   | 17 +++++++++++++++++
>   plugins/sample/Makefile.am                     |  2 +-
>   plugins/sample/{sample.conf => sample.conf.in} |  2 +-
>   3 files changed, 19 insertions(+), 2 deletions(-)
>   rename plugins/sample/{sample.conf => sample.conf.in} (91%)
>
> diff --git a/configure.ac b/configure.ac
> index cc971e8..2594829 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -48,6 +48,22 @@ if test "x$PYFLAKES" = "x"; then
>     AC_MSG_WARN([pyflakes not found])
>   fi
>
> +AC_ARG_ENABLE(
> +    [sample],
> +    [AS_HELP_STRING(
> +        [--enable-sample],
> +        [build sample plugin package @<:@default=no@:>@]
> +    )],
> +    ,
> +    [enable_sample="no"]
> +)
> +
> +# AM_CONDITIONAL([SAMPLE], [test "${enable_sample}" = "yes"])
> +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 +78,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
>       ui/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 91%
> rename from plugins/sample/sample.conf
> rename to plugins/sample/sample.conf.in
> index 78a9f4e..f890983 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"
>




More information about the Kimchi-devel mailing list