Timothy St. Clair 5e2bd06
diff --git a/3rdparty/Makefile.am b/3rdparty/Makefile.am
Timothy St. Clair 5e2bd06
index 7cf0c88..6df5526 100644
Timothy St. Clair 5e2bd06
--- a/3rdparty/Makefile.am
Timothy St. Clair 5e2bd06
+++ b/3rdparty/Makefile.am
Timothy St. Clair 5e2bd06
@@ -94,10 +94,6 @@ if WITH_BUNDLED_ZOOKEEPER
Timothy St. Clair 5e2bd06
 	  $(MAKE) $(AM_MAKEFLAGS)
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 5e2bd06
   ALL_LOCAL += $(ZOOKEEPER)/src/c/libzookeeper_mt.la
Timothy St. Clair 5e2bd06
-else
Timothy St. Clair 5e2bd06
-  # No matter what, we need to extract ZooKeeper so that we can run
Timothy St. Clair 5e2bd06
-  # 'make check' (some of our tests need the ZooKeeper JAR).
Timothy St. Clair 5e2bd06
-  ALL_LOCAL += $(ZOOKEEPER)-stamp
Timothy St. Clair 5e2bd06
 endif
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 5e2bd06
 all-local: $(ALL_LOCAL)
Timothy St. Clair 5e2bd06
diff --git a/configure.ac b/configure.ac
Timothy St. Clair 189ce66
index 86d448c..75e494c 100644
Timothy St. Clair 5e2bd06
--- a/configure.ac
Timothy St. Clair 5e2bd06
+++ b/configure.ac
Timothy St. Clair 189ce66
@@ -19,6 +19,12 @@
Timothy St. Clair 189ce66
 
Timothy St. Clair 189ce66
 AC_PREREQ([2.61])
Timothy St. Clair 37ac802
 AC_INIT([mesos], [0.23.0])
Timothy St. Clair 189ce66
+MAJOR_VER=0
Timothy St. Clair 37ac802
+MINOR_VER=23
Timothy St. Clair 37ac802
+PATCH_VER=0
Timothy St. Clair 189ce66
+AC_SUBST(MAJOR_VER)
Timothy St. Clair 189ce66
+AC_SUBST(MINOR_VER)
Timothy St. Clair 189ce66
+AC_SUBST(PATCH_VER)
Timothy St. Clair 189ce66
 
Timothy St. Clair 189ce66
 # Have autoconf setup some variables related to the system.
Timothy St. Clair 189ce66
 AC_CANONICAL_HOST
Timothy St. Clair 189ce66
@@ -216,6 +222,8 @@ AC_ARG_VAR([MAVEN_HOME], [looks for mvn at MAVEN_HOME/bin/mvn])
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 5e2bd06
 AC_ARG_VAR([PROTOBUF_JAR], [full path to protobuf jar on prefixed builds])
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 5e2bd06
+AC_ARG_VAR([ZOOKEEPER_JAR], [full path to zookeeper jar on prefixed builds])
Timothy St. Clair 5e2bd06
+
Timothy St. Clair 5e2bd06
 AC_ARG_VAR([PYTHON], [which Python interpreter to use])
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 5e2bd06
 AC_MSG_NOTICE([Setting up build environment for ${target_cpu} ${target_os}])
Timothy St. Clair 189ce66
@@ -284,8 +296,18 @@ fi
Timothy St. Clair 5e2bd06
 if test -n "`echo $with_zookeeper`"; then
Timothy St. Clair 5e2bd06
   CPPFLAGS="$CPPFLAGS -I${with_zookeeper}/include/zookeeper"
Timothy St. Clair 5e2bd06
   LDFLAGS="$LDFLAGS -L${with_zookeeper}/lib"
Timothy St. Clair 5e2bd06
+  if test -z "`echo ZOOKEEPER_JAR`"; then
Timothy St. Clair 5e2bd06
+    ZOOKEEPER_JAR="${with_zookeeper}/zookeeper.jar"
Timothy St. Clair 5e2bd06
+  fi
Timothy St. Clair 5e2bd06
 elif test "x$enable_bundled" = "xno"; then
Timothy St. Clair 5e2bd06
   CPPFLAGS="$CPPFLAGS -I/usr/include/zookeeper"
Timothy St. Clair 5e2bd06
+  if test -z "`echo ZOOKEEPER_JAR`"; then
Timothy St. Clair 5e2bd06
+    ZOOKEEPER_JAR="/usr/share/java/zookeeper/zookeeper.jar"
Timothy St. Clair 5e2bd06
+  fi
Timothy St. Clair 5e2bd06
+else
Timothy St. Clair 5e2bd06
+  if test -z "`echo ZOOKEEPER_JAR`"; then
Timothy St. Clair 5e2bd06
+    ZOOKEEPER_JAR="3rdparty/zookeeper-3.4.5/zookeeper-3.4.5.jar"
Timothy St. Clair 5e2bd06
+  fi
Timothy St. Clair 5e2bd06
 fi
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 189ce66
@@ -400,6 +422,7 @@ fi
Timothy St. Clair 5e2bd06
 AM_CONDITIONAL([WITH_BUNDLED_ZOOKEEPER],
Timothy St. Clair 5e2bd06
                [test "x$with_bundled_zookeeper" = "xyes"])
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 5e2bd06
+AC_SUBST([ZOOKEEPER_JAR])
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 5e2bd06
 # Check if user has asked us to use a preinstalled protobuf, or if
Timothy St. Clair 5e2bd06
 # they asked us to ignore all bundled libraries while compiling and
Timothy St. Clair 5e2bd06
diff --git a/src/Makefile.am b/src/Makefile.am
Timothy St. Clair 189ce66
index b821a3b..17fac25 100644
Timothy St. Clair 5e2bd06
--- a/src/Makefile.am
Timothy St. Clair 5e2bd06
+++ b/src/Makefile.am
Timothy St. Clair 5e2bd06
@@ -27,8 +27,6 @@ include ../3rdparty/libprocess/3rdparty/versions.am
Timothy St. Clair 5e2bd06
 # them include $(top_builddir) as appropriate.
Timothy St. Clair 5e2bd06
 DISTRIBUTE = 3rdparty/distribute-$(DISTRIBUTE_VERSION)
Timothy St. Clair 5e2bd06
 LEVELDB = 3rdparty/leveldb
Timothy St. Clair 5e2bd06
-ZOOKEEPER = 3rdparty/zookeeper-$(ZOOKEEPER_VERSION)/src/c
Timothy St. Clair 5e2bd06
-ZOOKEEPER_JAR = 3rdparty/zookeeper-$(ZOOKEEPER_VERSION)/zookeeper-$(ZOOKEEPER_VERSION).jar
Timothy St. Clair 5e2bd06
 LIBPROCESS = 3rdparty/libprocess
Timothy St. Clair 5e2bd06
 STOUT = $(LIBPROCESS)/3rdparty/stout
Timothy St. Clair 5e2bd06
 BOOST = $(LIBPROCESS)/3rdparty/boost-$(BOOST_VERSION)
Timothy St. Clair 5e2bd06
@@ -38,6 +36,10 @@ GTEST = $(GMOCK)/gtest
Timothy St. Clair 5e2bd06
 PROTOBUF = $(LIBPROCESS)/3rdparty/protobuf-$(PROTOBUF_VERSION)
Timothy St. Clair 5e2bd06
 PICOJSON = $(LIBPROCESS)/3rdparty/picojson-$(PICOJSON_VERSION)
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 5e2bd06
+if WITH_BUNDLED_ZOOKEEPER
Timothy St. Clair 5e2bd06
+  ZOOKEEPER = 3rdparty/zookeeper-$(ZOOKEEPER_VERSION)/src/c
Timothy St. Clair 5e2bd06
+endif
Timothy St. Clair 5e2bd06
+
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 189ce66
 # Unfortunatley, 'pkglibexecdir' and 'pkgsysconfdir' are not set
Timothy St. Clair 5e2bd06
 # before automake 1.11, so we need to set them manually (until we in
Timothy St. Clair 189ce66
@@ -564,7 +566,7 @@ lib_LTLIBRARIES += libmesos.la
Timothy St. Clair 189ce66
 # Include as part of the distribution.
Timothy St. Clair 189ce66
 libmesos_la_SOURCES = $(MESOS_PROTO) $(CONTAINERIZER_PROTO) $(SCHEDULER_PROTO)
Timothy St. Clair 189ce66
 
Timothy St. Clair 189ce66
-libmesos_la_LDFLAGS = -release $(PACKAGE_VERSION)
Timothy St. Clair 189ce66
+libmesos_la_LDFLAGS = -version-info $(MINOR_VER):$(MAJOR_VER):0
Timothy St. Clair 189ce66
 
Timothy St. Clair 189ce66
 # Since we just include the convenience library (and no sources), we
Timothy St. Clair 189ce66
 # need to tell libtool to build this as a C++ library.
Timothy St. Clair 189ce66
@@ -909,7 +911,7 @@ $(EXAMPLES_JAR): $(EXAMPLES_SOURCE)
Timothy St. Clair 5e2bd06
 	@echo "Building examples.jar ..."
Timothy St. Clair 5e2bd06
 	$(MKDIR_P) examples/java
Timothy St. Clair 5e2bd06
 	$(JAVA_HOME)/bin/javac -source 1.6 -target 1.6			\
Timothy St. Clair 5e2bd06
-          -cp ../$(ZOOKEEPER_JAR):@PROTOBUF_JAR@:$(MESOS_JAR):$(srcdir)/examples/java	\
Timothy St. Clair 5e2bd06
+          -cp @ZOOKEEPER_JAR@:@PROTOBUF_JAR@:$(MESOS_JAR):$(srcdir)/examples/java	\
Timothy St. Clair 5e2bd06
           -sourcepath $(srcdir)/examples/java -d examples/java	        \
Timothy St. Clair 5e2bd06
           $(srcdir)/examples/java/*.java
Timothy St. Clair 5e2bd06
 	$(JAVA_HOME)/bin/jar cf $@ -C examples/java .
Timothy St. Clair 189ce66
@@ -1160,6 +1162,7 @@ if HAS_JAVA
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 5e2bd06
   mesos_tests_CPPFLAGS += $(JAVA_CPPFLAGS)
Timothy St. Clair 5e2bd06
   mesos_tests_CPPFLAGS += -DZOOKEEPER_VERSION=\"$(ZOOKEEPER_VERSION)\"
Timothy St. Clair 5e2bd06
+  mesos_tests_CPPFLAGS += -DZOOKEEPER_JAR=\"@ZOOKEEPER_JAR@\"
Timothy St. Clair 5e2bd06
   mesos_tests_LDFLAGS = $(AM_LDFLAGS)
Timothy St. Clair 5e2bd06
   mesos_tests_DEPENDENCIES += $(EXAMPLES_JAR)
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 5e2bd06
diff --git a/src/examples/java/test-log.in b/src/examples/java/test-log.in
Timothy St. Clair 5e2bd06
index 4c8547a..7723e73 100644
Timothy St. Clair 5e2bd06
--- a/src/examples/java/test-log.in
Timothy St. Clair 5e2bd06
+++ b/src/examples/java/test-log.in
Timothy St. Clair 5e2bd06
@@ -21,11 +21,10 @@ test ! -e ${PROTOBUF_JAR} && \
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 5e2bd06
 # TODO(vinod): Deduce the zookeeper version.
Timothy St. Clair 5e2bd06
 ZOOKEEPER=${MESOS_BUILD_DIR}/3rdparty/zookeeper-3.4.5
Timothy St. Clair 5e2bd06
-ZOOKEEPER_JAR=${ZOOKEEPER}/zookeeper-3.4.5.jar
Timothy St. Clair 5e2bd06
+ZOOKEEPER_JAR=@ZOOKEEPER_JAR@
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 5e2bd06
 test ! -e ${ZOOKEEPER_JAR} && \
Timothy St. Clair 5e2bd06
-  echo "${RED}Failed to find ${ZOOKEEPER_JAR}${NORMAL}" && \
Timothy St. Clair 5e2bd06
-  exit 1
Timothy St. Clair 5e2bd06
+  echo "${RED}Failed to find ${ZOOKEEPER_JAR}${NORMAL}"
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 5e2bd06
 MESOS_JAR=${MESOS_BUILD_DIR}/src/java/target/mesos-@PACKAGE_VERSION@.jar
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 5e2bd06
diff --git a/src/tests/zookeeper.cpp b/src/tests/zookeeper.cpp
Timothy St. Clair 189ce66
index 08cab86..1e6e315 100644
Timothy St. Clair 5e2bd06
--- a/src/tests/zookeeper.cpp
Timothy St. Clair 5e2bd06
+++ b/src/tests/zookeeper.cpp
Timothy St. Clair 189ce66
@@ -56,16 +56,17 @@ const Duration ZooKeeperTest::NO_TIMEOUT = Seconds(10);
Timothy St. Clair 189ce66
 void ZooKeeperTest::SetUpTestCase()
Timothy St. Clair 189ce66
 {
Timothy St. Clair 189ce66
   if (!Jvm::created()) {
Timothy St. Clair 189ce66
+    string classpath = "-Djava.class.path=" ZOOKEEPER_JAR;
Timothy St. Clair 189ce66
+
Timothy St. Clair 189ce66
+#ifdef BUNDLED
Timothy St. Clair 5e2bd06
     string zkHome =
Timothy St. Clair 5e2bd06
       path::join(flags.build_dir, "/3rdparty/zookeeper-" ZOOKEEPER_VERSION);
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 5e2bd06
-    string classpath = "-Djava.class.path=" +
Timothy St. Clair 5e2bd06
-      path::join(zkHome, "zookeeper-" ZOOKEEPER_VERSION ".jar");
Timothy St. Clair 189ce66
-
Timothy St. Clair 5e2bd06
     // Now add all the libraries in 'lib' too.
Timothy St. Clair 5e2bd06
     Try<list<string> > jars = os::glob(path::join(zkHome, "lib", "*.jar"));
Timothy St. Clair 5e2bd06
 
Timothy St. Clair 189ce66
     CHECK_SOME(jars);
Timothy St. Clair 189ce66
+#endif
Timothy St. Clair 189ce66
 
Timothy St. Clair 5e2bd06
     foreach (const string& jar, jars.get()) {
Timothy St. Clair 5e2bd06
       classpath += ":" + jar;