Since not all modules work on all platforms, perhaps we should install
them but not enable them by default.  In that case the user/packager
can selectively choose which modules to enable?

I'll have to think about this...

Cheers,

Bernard

On Fri, Jun 25, 2010 at 1:26 PM, Bernard Li <bern...@vanhpc.org> wrote:
> Hi all:
>
> The following patch will install the gmond module (including python)
> config files to the sysconfdir as well as the python modules to
> moduledir when `make install` is executed:
>
> Index: gmond/modules/status/Makefile.am
> ===================================================================
> --- gmond/modules/status/Makefile.am    (revision 2302)
> +++ gmond/modules/status/Makefile.am    (working copy)
> @@ -12,3 +12,7 @@
>  endif
>
>  INCLUDES = @APR_INCLUDES@
> +
> +install-data-hook:
> +       mkdir -p $(DESTDIR)$(sysconfdir)/conf.d/ && \
> +         $(INSTALL_DATA) ../conf.d/modgstatus.conf
> $(DESTDIR)$(sysconfdir)/conf.d
> Index: gmond/modules/cpu/Makefile.am
> ===================================================================
> --- gmond/modules/cpu/Makefile.am       (revision 2302)
> +++ gmond/modules/cpu/Makefile.am       (working copy)
> @@ -26,3 +26,7 @@
>  endif
>
>  INCLUDES = @APR_INCLUDES@
> +
> +install-data-hook:
> +       mkdir -p $(DESTDIR)$(sysconfdir)/conf.d && \
> +         $(INSTALL_DATA) ../conf.d/multicpu.conf 
> $(DESTDIR)$(sysconfdir)/conf.d
> Index: gmond/python_modules/network/Makefile.am
> ===================================================================
> --- gmond/python_modules/network/Makefile.am    (revision 2302)
> +++ gmond/python_modules/network/Makefile.am    (working copy)
> @@ -1,2 +1,9 @@
>  pys = tcpconn.py
>  EXTRA_DIST = $(pys)
> +
> +if BUILD_PYTHON
> +install-data-hook:
> +       mkdir -p $(DESTDIR)$(moduledir)/python_modules && \
> +         $(INSTALL_DATA) $(pys) $(DESTDIR)$(moduledir)/python_modules
> +       $(INSTALL_DATA) ../conf.d/tcpconn.pyconf 
> $(DESTDIR)$(sysconfdir)/conf.d
> +endif
> Index: gmond/python_modules/Makefile.am
> ===================================================================
> --- gmond/python_modules/Makefile.am    (revision 2302)
> +++ gmond/python_modules/Makefile.am    (working copy)
> @@ -1,2 +1,8 @@
>  DIST_SUBDIRS = disk example network
>  EXTRA_DIST = ./conf.d/*.pyconf
> +
> +if BUILD_PYTHON
> +PYTHON_SUBDIR = disk example network
> +endif
> +
> +SUBDIRS = $(PYTHON_SUBDIR)
> Index: gmond/python_modules/disk/Makefile.am
> ===================================================================
> --- gmond/python_modules/disk/Makefile.am       (revision 2302)
> +++ gmond/python_modules/disk/Makefile.am       (working copy)
> @@ -1,2 +1,9 @@
>  pys = multidisk.py
>  EXTRA_DIST = $(pys)
> +
> +if BUILD_PYTHON
> +install-data-hook:
> +       mkdir -p $(DESTDIR)$(moduledir)/python_modules && \
> +         $(INSTALL_DATA) $(pys) $(DESTDIR)$(moduledir)/python_modules
> +       $(INSTALL_DATA) ../conf.d/diskusage.pyconf
> $(DESTDIR)$(sysconfdir)/conf.d/diskusage.pyconf.off
> +endif
> Index: gmond/python_modules/example/Makefile.am
> ===================================================================
> --- gmond/python_modules/example/Makefile.am    (revision 2302)
> +++ gmond/python_modules/example/Makefile.am    (working copy)
> @@ -1,2 +1,10 @@
> -pys = example.py
> +pys = example.py spfexample.py
>  EXTRA_DIST = $(pys)
> +
> +if BUILD_PYTHON
> +install-data-hook:
> +       mkdir -p $(DESTDIR)$(moduledir)/python_modules && \
> +         $(INSTALL_DATA) $(pys) $(DESTDIR)$(moduledir)/python_modules
> +       $(INSTALL_DATA) ../conf.d/example.pyconf
> $(DESTDIR)$(sysconfdir)/conf.d/example.pyconf.off
> +       $(INSTALL_DATA) ../conf.d/spfexample.pyconf
> $(DESTDIR)$(sysconfdir)/conf.d/spfexample.pyconf.off
> +endif
>
> Since this is done by the make install target, packagers no longer
> need to manually install these files.
>
> I'd appreciate if someone could eyeball this and let me know if this
> looks fine before I check it in.
>
> Thanks,
>
> Bernard
>

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to