You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by ma...@apache.org on 2011/08/15 03:40:56 UTC

svn commit: r1157698 - in /zookeeper/trunk: CHANGES.txt src/contrib/zkperl/Changes src/contrib/zkperl/Makefile.PL src/contrib/zkperl/README src/contrib/zkperl/ZooKeeper.pm src/contrib/zkperl/ZooKeeper.xs src/contrib/zkperl/build/check_zk_version.c

Author: mahadev
Date: Mon Aug 15 01:40:56 2011
New Revision: 1157698

URL: http://svn.apache.org/viewvc?rev=1157698&view=rev
Log:
ZOOKEEPER-1034. perl bindings should automatically find the zookeeper c-client headers (nicholas harteau via mahadev)

Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/src/contrib/zkperl/Changes
    zookeeper/trunk/src/contrib/zkperl/Makefile.PL
    zookeeper/trunk/src/contrib/zkperl/README
    zookeeper/trunk/src/contrib/zkperl/ZooKeeper.pm
    zookeeper/trunk/src/contrib/zkperl/ZooKeeper.xs
    zookeeper/trunk/src/contrib/zkperl/build/check_zk_version.c

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1157698&r1=1157697&r2=1157698&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Mon Aug 15 01:40:56 2011
@@ -387,6 +387,9 @@ IMPROVEMENTS:
   ZOOKEEPER-1104. CLONE - In QuorumTest, use the same "for ( .. try { break }
   catch { } )" pattern in testFollowersStartAfterLeaders as in testSessionMove. 
   (Eugene Koontz via mahadev)
+ 
+  ZOOKEEPER-1034. perl bindings should automatically find the zookeeper
+  c-client headers (nicholas harteau via mahadev)
 
 NEW FEATURES:
   ZOOKEEPER-729. Java client API to recursively delete a subtree.

Modified: zookeeper/trunk/src/contrib/zkperl/Changes
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/zkperl/Changes?rev=1157698&r1=1157697&r2=1157698&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/zkperl/Changes (original)
+++ zookeeper/trunk/src/contrib/zkperl/Changes Mon Aug 15 01:40:56 2011
@@ -59,3 +59,7 @@ Revision history
 0.35  Jul 15, 2009
         - support multiple include and library locations
 
+0.36  Mar 27, 2011
+        - Fix zookeeper version check, but only warn since we haven't been enforcing it in a while
+        - Look for zookeeper includes in some sane places by default
+

Modified: zookeeper/trunk/src/contrib/zkperl/Makefile.PL
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/zkperl/Makefile.PL?rev=1157698&r1=1157697&r2=1157698&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/zkperl/Makefile.PL (original)
+++ zookeeper/trunk/src/contrib/zkperl/Makefile.PL Mon Aug 15 01:40:56 2011
@@ -22,6 +22,9 @@ use Config;
 use ExtUtils::MakeMaker;
 use Getopt::Long;
 
+my $ZOO_MAJOR_VERSION = 3;
+my $ZOO_REQUIRED_VERSION = qr{^$ZOO_MAJOR_VERSION\.\d+.\d+$}ismx;
+
 my @zk_inc_paths;
 my @zk_lib_paths;
 
@@ -39,8 +42,7 @@ $zk_lib_paths .= ' ' unless ($zk_lib_pat
 my $cc = $Config{'cc'};
 my $check_file = 'build/check_zk_version';
 
-my $check_out =
-    qx($cc -c $zk_inc_paths -I. -c $check_file.c -o $check_file.o 2>&1);
+my $check_out = qx($cc $zk_inc_paths $zk_lib_paths -I. -o $check_file $check_file.c 2>&1);
 
 if ($?) {
     if ($check_out =~ /zookeeper_version\.h/) {
@@ -52,6 +54,15 @@ if ($?) {
     }
 }
 
+chomp(my $zk_ver = qx($check_file));
+
+if ($? >> 8 != 0) {
+  die "Couldn't check zookeeper version: $zk_ver: $r";
+}
+elsif ($zk_ver !~ $ZOO_REQUIRED_VERSION) {
+  warn "Net::ZooKeeper requires ZooKeeper 3.x, found $zk_ver!";
+}
+
 WriteMakefile(
     'INC'          => "$zk_inc_paths-I.",
     'LIBS'         => [ "$zk_lib_paths-lzookeeper_mt" ],

Modified: zookeeper/trunk/src/contrib/zkperl/README
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/zkperl/README?rev=1157698&r1=1157697&r2=1157698&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/zkperl/README (original)
+++ zookeeper/trunk/src/contrib/zkperl/README Mon Aug 15 01:40:56 2011
@@ -10,15 +10,21 @@ http://hadoop.apache.org/zookeeper/
 
 INSTALLATION
 
-To install this module type the following:
+To install this module type the following, first install the
+zookeeper C client, then:
 
-    perl Makefile.PL \
-        --zookeeper-include=/path/to/zookeeper/client/include \
-        --zookeeper-lib=/path/to/zookeeper/client/lib
+    perl Makefile.PL
     make
     ZK_TEST_HOSTS=host:port,... make test
     make install
 
+If the C headers and library are installed in non-standard
+locations, specify them as arguments to Makefile.PL:
+    
+    perl Makefile.PL \
+        --zookeeper-include=/path/to/zookeeper/client/include \
+        --zookeeper-lib=/path/to/zookeeper/client/lib
+
 The path supplied to the --zookeeper-include option should
 identify the directory that contains the zookeeper.h and other
 ZooKeeper C include files.

Modified: zookeeper/trunk/src/contrib/zkperl/ZooKeeper.pm
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/zkperl/ZooKeeper.pm?rev=1157698&r1=1157697&r2=1157698&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/zkperl/ZooKeeper.pm (original)
+++ zookeeper/trunk/src/contrib/zkperl/ZooKeeper.pm Mon Aug 15 01:40:56 2011
@@ -26,7 +26,7 @@ package Net::ZooKeeper;
 require Exporter;
 require XSLoader;
 
-our $VERSION = '0.35';
+our $VERSION = '0.36';
 
 our @ISA = qw(Exporter);
 

Modified: zookeeper/trunk/src/contrib/zkperl/ZooKeeper.xs
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/zkperl/ZooKeeper.xs?rev=1157698&r1=1157697&r2=1157698&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/zkperl/ZooKeeper.xs (original)
+++ zookeeper/trunk/src/contrib/zkperl/ZooKeeper.xs Mon Aug 15 01:40:56 2011
@@ -28,7 +28,7 @@
 #include <limits.h>                     /* CHAR_BIT */
 #include <sys/time.h>                   /* gettimeofday() */
 
-#include "zookeeper.h"
+#include <zookeeper/zookeeper.h>
 
 #include "build/check_zk_version.h"
 

Modified: zookeeper/trunk/src/contrib/zkperl/build/check_zk_version.c
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/zkperl/build/check_zk_version.c?rev=1157698&r1=1157697&r2=1157698&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/zkperl/build/check_zk_version.c (original)
+++ zookeeper/trunk/src/contrib/zkperl/build/check_zk_version.c Mon Aug 15 01:40:56 2011
@@ -17,9 +17,13 @@
  * limitations under the License.
  */
 
-#include "zookeeper_version.h"
+#include <stdio.h>
+#include <zookeeper/zookeeper_version.h>
 
 #include "check_zk_version.h"
 
-int main() {}
+int main() {
+  printf("%d.%d.%d\n", ZOO_MAJOR_VERSION, ZOO_MINOR_VERSION, ZOO_PATCH_VERSION);
+  return 0;
+}