[collectd] [PATCH 1/5] Moved contrib/PerlLib/ to bindings/perl/.

Sebastian Harl sh at tokkee.org
Mon Oct 1 00:08:43 CEST 2007


Added bindings/Makefile.am and bindings/perl/Collectd/Makefile.PL,
bindings/perl/Makefile.PL to integrate the Perl modules into the build
system and the official distribution.

Signed-off-by: Sebastian Harl <sh at tokkee.org>
---
 Makefile.am                                        |    2 +-
 bindings/Makefile.am                               |   18 +++++++++
 {contrib/PerlLib => bindings/perl}/Collectd.pm     |    0 
 bindings/perl/Collectd/Makefile.PL                 |    9 +++++
 .../PerlLib => bindings/perl}/Collectd/Unixsock.pm |    0 
 bindings/perl/Makefile.PL                          |    9 +++++
 configure.in                                       |   37 ++++++++++++++++++-
 7 files changed, 72 insertions(+), 3 deletions(-)
 create mode 100644 bindings/Makefile.am
 rename {contrib/PerlLib => bindings/perl}/Collectd.pm (100%)
 create mode 100644 bindings/perl/Collectd/Makefile.PL
 rename {contrib/PerlLib => bindings/perl}/Collectd/Unixsock.pm (100%)
 create mode 100644 bindings/perl/Makefile.PL

diff --git a/Makefile.am b/Makefile.am
index 34c36cc..dfef7dd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = libltdl src
+SUBDIRS = libltdl src bindings
 
 INCLUDES = $(LTDLINCL)
 
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
new file mode 100644
index 0000000..37e31ea
--- /dev/null
+++ b/bindings/Makefile.am
@@ -0,0 +1,18 @@
+EXTRA_DIST = perl/Collectd.pm perl/Makefile.PL perl/Collectd/Makefile.PL perl/Collectd/Unixsock.pm
+
+all-local: @PERL_BINDINGS@
+
+install-exec-local:
+	[ ! -f perl/Makefile ] || $(MAKE) -C perl install
+
+clean-local:
+	[ ! -f perl/Makefile ] || $(MAKE) -C perl realclean
+
+perl: perl/Makefile
+	$(MAKE) -C perl
+
+perl/Makefile: perl/Makefile.PL perl/Collectd/Makefile.PL
+	cd perl && @PERL@ Makefile.PL PREFIX=$(prefix) @PERL_BINDINGS_OPTIONS@
+
+.PHONY: perl
+
diff --git a/contrib/PerlLib/Collectd.pm b/bindings/perl/Collectd.pm
similarity index 100%
rename from contrib/PerlLib/Collectd.pm
rename to bindings/perl/Collectd.pm
diff --git a/bindings/perl/Collectd/Makefile.PL b/bindings/perl/Collectd/Makefile.PL
new file mode 100644
index 0000000..be0ec91
--- /dev/null
+++ b/bindings/perl/Collectd/Makefile.PL
@@ -0,0 +1,9 @@
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+	'NAME'		=> 'Collectd::Unixsock',
+	'VERSION'	=> '4.1.2',
+	'AUTHOR'	=> 'Florian Forster <octo at verplant.org>',
+);
+
+# vim: set sw=4 ts=4 tw=78 noexpandtab :
diff --git a/contrib/PerlLib/Collectd/Unixsock.pm b/bindings/perl/Collectd/Unixsock.pm
similarity index 100%
rename from contrib/PerlLib/Collectd/Unixsock.pm
rename to bindings/perl/Collectd/Unixsock.pm
diff --git a/bindings/perl/Makefile.PL b/bindings/perl/Makefile.PL
new file mode 100644
index 0000000..fab2dae
--- /dev/null
+++ b/bindings/perl/Makefile.PL
@@ -0,0 +1,9 @@
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+	'NAME'		=> 'Collectd',
+	'VERSION'	=> '4.1.2',
+	'AUTHOR'	=> 'Sebastian Harl <sh at tokkee.org>',
+);
+
+# vim: set sw=4 ts=4 tw=78 noexpandtab :
diff --git a/configure.in b/configure.in
index 54d38d5..f67186e 100644
--- a/configure.in
+++ b/configure.in
@@ -1145,6 +1145,9 @@ AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to l
 [
 	with_libperl="yes"
 ])
+
+AC_SUBST(PERL, "$perl_interpreter")
+
 if test "x$with_libperl" = "xyes"
 then
   SAVE_CFLAGS=$CFLAGS
@@ -1817,7 +1820,29 @@ AC_PLUGIN([vserver],     [$plugin_vserver],    [Linux VServer statistics])
 AC_PLUGIN([wireless],    [$plugin_wireless],   [Wireless statistics])
 AC_PLUGIN([xmms],        [$with_libxmms],      [XMMS statistics])
 
-AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile)
+dnl Perl bindings
+AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
+[
+	if test "x$withval" != "xno" && test "x$withval" != "xyes"
+	then
+		PERL_BINDINGS_OPTIONS="$withval"
+		with_perl_bindings="yes"
+	fi
+],
+[
+	PERL_BINDINGS_OPTIONS=""
+	with_perl_bindings="yes"
+])
+if test "x$with_perl_bindings" = "xyes"
+then
+	PERL_BINDINGS="perl"
+else
+	PERL_BINDINGS=""
+fi
+AC_SUBST(PERL_BINDINGS)
+AC_SUBST(PERL_BINDINGS_OPTIONS)
+
+AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile bindings/Makefile)
 
 if test "x$with_liboping" = "xyes" -a "x$with_own_liboping" = "xyes"
 then
@@ -1826,11 +1851,16 @@ fi
 
 if test "x$with_libperl" = "xyes"
 then
-	with_libperl="yes (version `perl -MConfig -e 'print $Config{version};'`)"
+	with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
 else
 	enable_perl="no (needs libperl)"
 fi
 
+if test "x$with_perl_bindings" = "xyes" -a "x$PERL_BINDINGS_OPTIONS" != "x"
+then
+	with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
+fi
+
 cat <<EOF;
 
 Configuration:
@@ -1858,6 +1888,9 @@ Configuration:
     daemon mode . . . . $enable_daemon
     debug . . . . . . . $enable_debug
 
+  Bindings:
+    perl  . . . . . . . $with_perl_bindings
+
   Modules:
     apache  . . . . . . $enable_apache
     apcups  . . . . . . $enable_apcups
-- 
1.5.2.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20071001/863b9491/attachment.pgp 


More information about the collectd mailing list