Initial import (#823122).
This commit is contained in:
parent
ca79821e87
commit
e5b4022dc9
|
@ -0,0 +1 @@
|
|||
/zookeeper-3.4.5.tar.gz
|
|
@ -0,0 +1,152 @@
|
|||
diff --git src/java/test/org/apache/zookeeper/test/SaslAuthFailNotifyTest.java src/java/test/org/apache/zookeeper/test/SaslAuthFailNotifyTest.java
|
||||
new file mode 100644
|
||||
index 0000000..2b00d86
|
||||
--- /dev/null
|
||||
+++ src/java/test/org/apache/zookeeper/test/SaslAuthFailNotifyTest.java
|
||||
@@ -0,0 +1,98 @@
|
||||
+/**
|
||||
+ * Licensed to the Apache Software Foundation (ASF) under one
|
||||
+ * or more contributor license agreements. See the NOTICE file
|
||||
+ * distributed with this work for additional information
|
||||
+ * regarding copyright ownership. The ASF licenses this file
|
||||
+ * to you under the Apache License, Version 2.0 (the
|
||||
+ * "License"); you may not use this file except in compliance
|
||||
+ * with the License. You may obtain a copy of the License at
|
||||
+ *
|
||||
+ * http://www.apache.org/licenses/LICENSE-2.0
|
||||
+ *
|
||||
+ * Unless required by applicable law or agreed to in writing, software
|
||||
+ * distributed under the License is distributed on an "AS IS" BASIS,
|
||||
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
+ * See the License for the specific language governing permissions and
|
||||
+ * limitations under the License.
|
||||
+ */
|
||||
+
|
||||
+package org.apache.zookeeper.test;
|
||||
+
|
||||
+import java.io.File;
|
||||
+import java.io.FileWriter;
|
||||
+import java.io.IOException;
|
||||
+import java.util.concurrent.atomic.AtomicInteger;
|
||||
+
|
||||
+import org.apache.zookeeper.CreateMode;
|
||||
+import org.apache.zookeeper.TestableZooKeeper;
|
||||
+import org.apache.zookeeper.WatchedEvent;
|
||||
+import org.apache.zookeeper.ZooKeeper;
|
||||
+import org.apache.zookeeper.Watcher.Event.KeeperState;
|
||||
+import org.apache.zookeeper.ZooDefs.Ids;
|
||||
+import org.junit.Test;
|
||||
+import org.junit.Assert;
|
||||
+
|
||||
+public class SaslAuthFailNotifyTest extends ClientBase {
|
||||
+ static {
|
||||
+ System.setProperty("zookeeper.authProvider.1","org.apache.zookeeper.server.auth.SASLAuthenticationProvider");
|
||||
+ System.setProperty("zookeeper.allowSaslFailedClients","true");
|
||||
+
|
||||
+ try {
|
||||
+ File tmpDir = createTmpDir();
|
||||
+ File saslConfFile = new File(tmpDir, "jaas.conf");
|
||||
+ FileWriter fwriter = new FileWriter(saslConfFile);
|
||||
+
|
||||
+ fwriter.write("" +
|
||||
+ "Server {\n" +
|
||||
+ " org.apache.zookeeper.server.auth.DigestLoginModule required\n" +
|
||||
+ " user_super=\"test\";\n" +
|
||||
+ "};\n" +
|
||||
+ "Client {\n" +
|
||||
+ " org.apache.zookeeper.server.auth.DigestLoginModule required\n" +
|
||||
+ " username=\"super\"\n" +
|
||||
+ " password=\"test1\";\n" + // NOTE: wrong password ('test' != 'test1') : this is to test SASL authentication failure.
|
||||
+ "};" + "\n");
|
||||
+ fwriter.close();
|
||||
+ System.setProperty("java.security.auth.login.config",saslConfFile.getAbsolutePath());
|
||||
+ }
|
||||
+ catch (IOException e) {
|
||||
+ // could not create tmp directory to hold JAAS conf file.
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private AtomicInteger authFailed = new AtomicInteger(0);
|
||||
+
|
||||
+ @Override
|
||||
+ protected TestableZooKeeper createClient(String hp)
|
||||
+ throws IOException, InterruptedException
|
||||
+ {
|
||||
+ MyWatcher watcher = new MyWatcher();
|
||||
+ return createClient(watcher, hp);
|
||||
+ }
|
||||
+
|
||||
+ private class MyWatcher extends CountdownWatcher {
|
||||
+ @Override
|
||||
+ public synchronized void process(WatchedEvent event) {
|
||||
+ if (event.getState() == KeeperState.AuthFailed) {
|
||||
+ synchronized(authFailed) {
|
||||
+ authFailed.incrementAndGet();
|
||||
+ authFailed.notify();
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ super.process(event);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Test
|
||||
+ public void testBadSaslAuthNotifiesWatch() throws Exception {
|
||||
+ ZooKeeper zk = createClient();
|
||||
+ // wait for authFailed event from client's EventThread.
|
||||
+ synchronized(authFailed) {
|
||||
+ authFailed.wait();
|
||||
+ }
|
||||
+ Assert.assertEquals(authFailed.get(),1);
|
||||
+ zk.close();
|
||||
+ }
|
||||
+}
|
||||
diff --git src/java/test/org/apache/zookeeper/test/SaslAuthFailTest.java src/java/test/org/apache/zookeeper/test/SaslAuthFailTest.java
|
||||
index 1589b1f..33a505e 100644
|
||||
--- src/java/test/org/apache/zookeeper/test/SaslAuthFailTest.java
|
||||
+++ src/java/test/org/apache/zookeeper/test/SaslAuthFailTest.java
|
||||
@@ -59,43 +59,6 @@ public class SaslAuthFailTest extends ClientBase {
|
||||
// could not create tmp directory to hold JAAS conf file.
|
||||
}
|
||||
}
|
||||
-
|
||||
- private AtomicInteger authFailed = new AtomicInteger(0);
|
||||
-
|
||||
- @Override
|
||||
- protected TestableZooKeeper createClient(String hp)
|
||||
- throws IOException, InterruptedException
|
||||
- {
|
||||
- MyWatcher watcher = new MyWatcher();
|
||||
- return createClient(watcher, hp);
|
||||
- }
|
||||
-
|
||||
- private class MyWatcher extends CountdownWatcher {
|
||||
- @Override
|
||||
- public synchronized void process(WatchedEvent event) {
|
||||
- if (event.getState() == KeeperState.AuthFailed) {
|
||||
- synchronized(authFailed) {
|
||||
- authFailed.incrementAndGet();
|
||||
- authFailed.notify();
|
||||
- }
|
||||
- }
|
||||
- else {
|
||||
- super.process(event);
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- @Test
|
||||
- public void testBadSaslAuthNotifiesWatch() throws Exception {
|
||||
- ZooKeeper zk = createClient();
|
||||
- // wait for authFailed event from client's EventThread.
|
||||
- synchronized(authFailed) {
|
||||
- authFailed.wait();
|
||||
- }
|
||||
- Assert.assertEquals(authFailed.get(),1);
|
||||
- zk.close();
|
||||
- }
|
||||
-
|
||||
|
||||
@Test
|
||||
public void testAuthFail() throws Exception {
|
|
@ -0,0 +1,447 @@
|
|||
diff -Nru zookeeper-3.4.4/build.xml zookeeper-3.4.4-gil/build.xml
|
||||
--- zookeeper-3.4.4/build.xml 2012-09-17 10:34:37.000000000 +0200
|
||||
+++ zookeeper-3.4.4-gil/build.xml 2012-10-12 17:51:43.676211458 +0200
|
||||
@@ -36,7 +36,7 @@
|
||||
<property name="src.dir" value="${basedir}/src" />
|
||||
<property name="java.src.dir" value="${src.dir}/java/main" />
|
||||
|
||||
- <property name="lib.dir" value="${src.dir}/java/lib" />
|
||||
+ <property name="lib.dir" value="/usr/share/java" />
|
||||
<property name="lib.dir.includes" value="**/*.jar" />
|
||||
<property name="lib.dir.excludes" value="**/excluded/" />
|
||||
|
||||
@@ -89,46 +89,28 @@
|
||||
<property name="dist.dir" value="${build.dir}/${final.name}"/>
|
||||
<property name="dist.maven.dir" value="${dist.dir}/dist-maven"/>
|
||||
|
||||
- <property name="clover.home" location="${env.CLOVER_HOME}"/>
|
||||
- <property name="clover.jar" location="${clover.home}/lib/clover.jar" />
|
||||
- <property name="clover.db.dir" location="${test.java.build.dir}/clover/db"/>
|
||||
- <property name="clover.report.dir"
|
||||
- location="${test.java.build.dir}/clover/reports"/>
|
||||
-
|
||||
<property name="contrib.dir" value="${src.dir}/contrib"/>
|
||||
<property name="recipes.dir" value="${src.dir}/recipes"/>
|
||||
|
||||
<property name="ivy.version" value="2.2.0"/>
|
||||
<property name="ivy.url"
|
||||
- value="http://repo2.maven.org/maven2/org/apache/ivy/ivy" />
|
||||
- <property name="ivy.home" value="${user.home}/.ant" />
|
||||
- <property name="ivy.lib" value="${build.dir}/lib"/>
|
||||
+ value="file:/usr/share/java/" />
|
||||
+ <property name="ivy.home" value="${basedir}/.ant" />
|
||||
+ <property name="ivy.lib" value="/usr/share/java"/>
|
||||
<property name="ivy.package.lib" value="${build.dir}/package/lib"/>
|
||||
<property name="ivy.test.lib" value="${build.dir}/test/lib"/>
|
||||
<property name="ivy.jdiff.lib" value="${build.dir}/jdiff/lib"/>
|
||||
<property name="ivysettings.xml" value="${basedir}/ivysettings.xml"/>
|
||||
|
||||
- <available property="clover.present"
|
||||
- classname="com.cenqua.clover.CloverInstr"
|
||||
- classpath="${clover.home}/lib/clover.jar"/>
|
||||
-
|
||||
<available file="${c.src.dir}/Makefile" property="Makefile.present"/>
|
||||
|
||||
<!-- check if clover reports should be generated -->
|
||||
- <condition property="clover.enabled">
|
||||
- <and>
|
||||
- <isset property="run.clover"/>
|
||||
- <isset property="clover.present"/>
|
||||
- </and>
|
||||
- </condition>
|
||||
|
||||
|
||||
<property name="test.cobertura.output.format" value="html" />
|
||||
<property name="coveragereport.dir" value="${build.dir}/cobertura" />
|
||||
|
||||
<!-- rats properties -->
|
||||
- <property name="rats_url" value="http://arat.googlecode.com/files/rat-lib-all-0.5.1.jar" />
|
||||
- <property name="rat.reporting.classname" value="rat.Report"/>
|
||||
|
||||
<!-- test patch properties -->
|
||||
<property name="scratch.dir" value="${user.home}/tmp"/>
|
||||
@@ -198,7 +180,6 @@
|
||||
<fileset dir="${ivy.lib}">
|
||||
<include name="**/*.jar" />
|
||||
</fileset>
|
||||
- <pathelement path="${clover.jar}" />
|
||||
</path>
|
||||
|
||||
<path id="test.java.classpath">
|
||||
@@ -225,7 +206,7 @@
|
||||
<mkdir dir="${ivy.package.lib}"/>
|
||||
<mkdir dir="${ivy.test.lib}"/>
|
||||
<condition property="ivy.jar.exists">
|
||||
- <available file="${lib.dir}/ivy-${ivy.version}.jar"/>
|
||||
+ <available file="${lib.dir}/ivy.jar"/>
|
||||
</condition>
|
||||
|
||||
<tstamp>
|
||||
@@ -312,8 +293,8 @@
|
||||
<target name="ivy-download" unless="ivy.jar.exists" depends="init">
|
||||
<delete dir="${lib.dir}"
|
||||
includes="ivy-*.jar" excludes="ivy-${ivy.version}.jar"/>
|
||||
- <get src="${ivy.url}/${ivy.version}/ivy-${ivy.version}.jar"
|
||||
- dest="${lib.dir}/ivy-${ivy.version}.jar" usetimestamp="true"/>
|
||||
+ <get src="${ivy.url}/ivy.jar"
|
||||
+ dest="${lib.dir}/ivy.jar" usetimestamp="true"/>
|
||||
</target>
|
||||
|
||||
<target name="ivy-taskdef" unless="ivy.initialized">
|
||||
@@ -329,32 +310,20 @@
|
||||
|
||||
<target name="ivy-retrieve" depends="init,ivy-init">
|
||||
<ivy:retrieve settingsRef="${ant.project.name}" type="jar" conf="default"
|
||||
- pattern="${ivy.lib}/[artifact]-[revision].[ext]"/>
|
||||
+ pattern="${ivy.lib}/[artifact].[ext]"/>
|
||||
</target>
|
||||
|
||||
<target name="ivy-retrieve-test" depends="init,ivy-init">
|
||||
<ivy:retrieve settingsRef="${ant.project.name}" type="jar" conf="test"
|
||||
- pattern="${ivy.test.lib}/[artifact]-[revision].[ext]"/>
|
||||
+ pattern="${ivy.test.lib}/[artifact].[ext]"/>
|
||||
</target>
|
||||
|
||||
<target name="ivy-retrieve-package" depends="init,ivy-init">
|
||||
<ivy:retrieve settingsRef="${ant.project.name}" conf="package"
|
||||
- pattern="${ivy.package.lib}/[artifact]-[revision].[ext]"/>
|
||||
- </target>
|
||||
-
|
||||
- <target name="ivy-retrieve-jdiff" depends="init,ivy-init">
|
||||
- <mkdir dir="${ivy.jdiff.lib}"/>
|
||||
- <ivy:retrieve settingsRef="${ant.project.name}" type="jar" conf="jdiff"
|
||||
- pattern="${ivy.jdiff.lib}/[artifact]-[revision].[ext]"/>
|
||||
- </target>
|
||||
-
|
||||
- <target name="ivy-retrieve-releaseaudit" depends="init,ivy-init">
|
||||
- <ivy:retrieve settingsRef="${ant.project.name}" type="jar" conf="releaseaudit"
|
||||
- pattern="${ivy.lib}/[artifact]-[revision].[ext]"/>
|
||||
- <ivy:cachepath pathid="releaseaudit-classpath" conf="releaseaudit"/>
|
||||
+ pattern="${ivy.package.lib}/[artifact].[ext]"/>
|
||||
</target>
|
||||
|
||||
- <target name="compile" depends="ivy-retrieve,clover,build-generated">
|
||||
+ <target name="compile" depends="ivy-retrieve">
|
||||
<javac srcdir="${java.src.dir}" destdir="${build.classes}" includeantruntime="false"
|
||||
target="${javac.target}" source="${javac.source}" debug="on">
|
||||
<classpath refid="java.classpath"/>
|
||||
@@ -498,7 +467,6 @@
|
||||
<arg value="--revision" />
|
||||
<classpath>
|
||||
<pathelement path="${build.classes}" />
|
||||
- <pathelement path="${clover.jar}" />
|
||||
</classpath>
|
||||
</java>
|
||||
<exec executable="hostname" outputproperty="host.name"/>
|
||||
@@ -541,7 +509,6 @@
|
||||
<arg value="--revision" />
|
||||
<classpath>
|
||||
<pathelement path="${build.classes}" />
|
||||
- <pathelement path="${clover.jar}" />
|
||||
</classpath>
|
||||
</java>
|
||||
<exec executable="hostname" outputproperty="host.name"/>
|
||||
@@ -634,7 +601,7 @@
|
||||
<!-- -->
|
||||
<!-- ================================================================== -->
|
||||
<target name="package"
|
||||
- depends="jar,bin-jar,src-jar,javadoc-jar,test-jar,api-report,create-cppunit-configure,compile-test"
|
||||
+ depends="jar,bin-jar,src-jar,javadoc-jar,test-jar,create-cppunit-configure,compile-test"
|
||||
description="Build distribution">
|
||||
<mkdir dir="${dist.dir}"/>
|
||||
<mkdir dir="${dist.dir}/lib"/>
|
||||
@@ -733,7 +700,7 @@
|
||||
</target>
|
||||
|
||||
<target name="bin-package"
|
||||
- depends="jar,bin-jar,src-jar,javadoc-jar,test-jar,api-report,create-cppunit-configure,compile-test"
|
||||
+ depends="jar,bin-jar,src-jar,javadoc-jar,test-jar,create-cppunit-configure,compile-test"
|
||||
description="Build binary distribution">
|
||||
<delete dir="${dist.dir}"/>
|
||||
<mkdir dir="${dist.dir}"/>
|
||||
@@ -1094,9 +1061,6 @@
|
||||
<delete dir="${docs.src}/build"/>
|
||||
<delete dir="${src_generated.dir}" />
|
||||
<delete dir="${csrc_generated.dir}" />
|
||||
- <delete file="${lib.dir}/Null.java"/>
|
||||
- <delete file="${lib.dir}/rats.jar" />
|
||||
- <delete file="${jdiff.xml.dir}/${name}_${version}.xml"/>
|
||||
<delete file="${jar.name}" />
|
||||
<delete dir="${distribution}"/>
|
||||
<delete dir="${revision.dir}"/>
|
||||
@@ -1260,7 +1224,6 @@
|
||||
<env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH};${cppunit.lib}"/>
|
||||
<env key="PATH" path="${env.PATH};${c.src.dir};"/>
|
||||
<env key="CALLER" value="ANT"/>
|
||||
- <env key="CLOVER_HOME" value="${clover.home}"/>
|
||||
<env key="base_dir" value="${basedir}"/>
|
||||
<arg line="clean run-check"/>
|
||||
</exec>
|
||||
@@ -1304,50 +1267,6 @@
|
||||
<!-- Run optional third-party tool targets -->
|
||||
<!-- ====================================================== -->
|
||||
|
||||
- <!-- clover code coverage -->
|
||||
- <target name="clover" depends="clover.setup, clover.info"
|
||||
- description="Instrument the Unit tests using Clover. Requires a Clover license and CLOVER_HOME environment variable set appropriately. To use, specify -Drun.clover=true on the command line."/>
|
||||
-
|
||||
- <target name="clover.setup" if="clover.enabled">
|
||||
- <taskdef resource="cloverlib.xml" classpath="${clover.jar}"/>
|
||||
- <mkdir dir="${clover.db.dir}"/>
|
||||
- <clover-setup initString="${clover.db.dir}/zookeeper_coverage.db">
|
||||
- <fileset dir="${java.src.dir}"
|
||||
- includes="org/apache/zookeeper/**/*"
|
||||
- excludes="org/apache/zookeeper/version/**/*"/>
|
||||
- </clover-setup>
|
||||
- </target>
|
||||
-
|
||||
- <target name="clover.info" if="run.clover" unless="clover.present">
|
||||
- <echo>
|
||||
- Clover not found. Code coverage reports disabled.
|
||||
- </echo>
|
||||
- </target>
|
||||
-
|
||||
- <target name="clover.check">
|
||||
- <fail unless="clover.present">
|
||||
- ##################################################################
|
||||
- Clover not found.
|
||||
- Please make sure clover.jar is in ANT_HOME/lib, or made available
|
||||
- to Ant using other mechanisms like -lib or CLASSPATH.
|
||||
- ##################################################################
|
||||
- </fail>
|
||||
- </target>
|
||||
-
|
||||
- <target name="generate-clover-reports" depends="clover.check, clover">
|
||||
- <mkdir dir="${clover.report.dir}"/>
|
||||
- <clover-report>
|
||||
- <current outfile="${clover.report.dir}" title="${final.name}">
|
||||
- <format type="html"/>
|
||||
- </current>
|
||||
- </clover-report>
|
||||
- <clover-report>
|
||||
- <current outfile="${clover.report.dir}/clover.xml" title="${final.name}">
|
||||
- <format type="xml"/>
|
||||
- </current>
|
||||
- </clover-report>
|
||||
- </target>
|
||||
-
|
||||
<!-- Run with 'ant -Dfindbugs.home="path to Findbugs directory" findbugs -->
|
||||
<property name="findbugs.home" value="" />
|
||||
<target name="findbugs" depends="check-for-findbugs, jar" if="findbugs.present">
|
||||
@@ -1356,11 +1275,11 @@
|
||||
<property name="findbugs.report.htmlfile" value="${findbugs.out.dir}/zookeeper-findbugs-report.html" />
|
||||
<property name="findbugs.report.xmlfile" value="${findbugs.out.dir}/zookeeper-findbugs-report.xml" />
|
||||
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
|
||||
- classpath="${findbugs.home}/lib/findbugs-ant.jar" />
|
||||
+ classpath="${ivy.lib}/ant/ant-findbugs.jar" />
|
||||
<mkdir dir="${findbugs.out.dir}" />
|
||||
<findbugs home="${findbugs.home}" output="xml:withMessages" excludeFilter="${findbugs.exclude.file}"
|
||||
outputFile="${findbugs.report.xmlfile}" effort="max" jvmargs="-Xmx512M">
|
||||
- <auxClasspath path="${ivy.lib}/log4j-1.2.15.jar" />
|
||||
+ <auxClasspath path="${ivy.lib}/log4j.jar" />
|
||||
<sourcePath path="${java.src.dir}" />
|
||||
<class location="${build.dir}/${final.name}.jar" />
|
||||
</findbugs>
|
||||
@@ -1369,7 +1288,7 @@
|
||||
</target>
|
||||
|
||||
<target name="check-for-findbugs">
|
||||
- <available property="findbugs.present" file="${findbugs.home}/lib/findbugs.jar" />
|
||||
+ <available property="findbugs.present" file="${ivy.lib}/findbugs.jar" />
|
||||
</target>
|
||||
|
||||
<!-- Code coverage -->
|
||||
@@ -1479,51 +1398,6 @@
|
||||
<!-- ================================================================== -->
|
||||
<!-- Perform audit activities for the release -->
|
||||
<!-- ================================================================== -->
|
||||
- <target name="rats-taskdef" depends="ivy-retrieve-releaseaudit">
|
||||
- <typedef format="xml" resource="org/apache/rat/anttasks/antlib.xml" uri="antlib:org.apache.rat.anttasks"
|
||||
- classpathref="releaseaudit-classpath"/>
|
||||
- </target>
|
||||
-
|
||||
- <target name="releaseaudit" depends="package,rats-taskdef" description="Release Audit activities">
|
||||
- <rat:report xmlns:rat="antlib:org.apache.rat.anttasks">
|
||||
- <fileset dir="${dist.dir}">
|
||||
- <exclude name="**/*.m4"/>
|
||||
- <exclude name="**/*.md5"/>
|
||||
- <exclude name="**/*.pom"/>
|
||||
- <exclude name="**/*.sha1"/>
|
||||
- <exclude name="**/.gitignore"/>
|
||||
- <exclude name="**/Makefile**"/>
|
||||
- <exclude name="**/winconfig.h"/>
|
||||
- <exclude name="**/configure**"/>
|
||||
- <exclude name="**/*Doxyfile"/>
|
||||
- <exclude name="**/*.am"/>
|
||||
- <exclude name="**/compile"/>
|
||||
- <exclude name="**/depcomp"/>
|
||||
- <exclude name="**/install-sh"/>
|
||||
- <exclude name="**/ltmain.sh"/>
|
||||
- <exclude name="**/missing"/>
|
||||
- <exclude name="**/wrappers*.opt"/>
|
||||
- <exclude name="CHANGES.txt"/>
|
||||
- <exclude name="**/VERSION"/>
|
||||
- <exclude name="**/ChangeLog"/>
|
||||
- <exclude name="**/OldChangeLog"/>
|
||||
- <exclude name="**/Changes"/>
|
||||
- <exclude name="**/contrib/zkperl/MANIFEST"/>
|
||||
- <exclude name="**/conf/*"/>
|
||||
- <exclude name="**/docs/"/>
|
||||
- <exclude name="**/lib/jdiff/"/>
|
||||
- <exclude name="src/c/autom4te.cache/**"/>
|
||||
- <exclude name="src/c/config**"/>
|
||||
- <exclude name="src/c/src/hashtable/"/>
|
||||
- <exclude name="src/java/generated/.generated/"/>
|
||||
- <exclude name="src/java/test/checkstyle*.xml"/>
|
||||
- <exclude name="src/java/test/checkstyle*.xsl"/>
|
||||
- <exclude name="src/java/test/config/findbugs*.xml"/>
|
||||
- <exclude name="src/**/*.vcproj"/>
|
||||
- <exclude name="src/**/*.sln"/>
|
||||
- </fileset>
|
||||
- </rat:report>
|
||||
- </target>
|
||||
|
||||
<target name="findbugs.check" depends="check-for-findbugs" unless="findbugs.present">
|
||||
<fail message="'findbugs.home' is not defined. Please pass -Dfindbugs.home=<base of Findbugs installation>
|
||||
@@ -1575,65 +1449,6 @@
|
||||
<!-- this target runs the hudson trunk build -->
|
||||
<target name="hudson-test-trunk" depends="docs,tar,findbugs"/>
|
||||
|
||||
- <target name="api-xml" depends="ivy-retrieve-jdiff, javadoc, write-null">
|
||||
- <javadoc>
|
||||
- <doclet name="jdiff.JDiff"
|
||||
- path="${ivy.jdiff.lib}/jdiff-1.0.9.jar:${ivy.jdiff.lib}/xerces-1.4.4.jar">
|
||||
- <param name="-apidir" value="${jdiff.xml.dir}"/>
|
||||
- <param name="-apiname" value="${name} ${version}"/>
|
||||
- </doclet>
|
||||
- <packageset dir="${java.src.dir}">
|
||||
- <include name="org/apache/zookeeper"/>
|
||||
- <exclude name="org/apache/jute"/>
|
||||
- </packageset>
|
||||
- <classpath>
|
||||
- <pathelement location="${build.classes}"/>
|
||||
- <fileset dir="${lib.dir}">
|
||||
- <include name="**/*.jar" />
|
||||
- <exclude name="**/excluded/" />
|
||||
- </fileset>
|
||||
- <fileset dir="${ivy.lib}">
|
||||
- <include name="**/*.jar" />
|
||||
- </fileset>
|
||||
- </classpath>
|
||||
- </javadoc>
|
||||
- </target>
|
||||
-
|
||||
- <target name="write-null">
|
||||
- <exec executable="touch">
|
||||
- <arg value="${jdiff.home}/Null.java"/>
|
||||
- </exec>
|
||||
- </target>
|
||||
-
|
||||
- <target name="api-report" depends="api-xml">
|
||||
- <mkdir dir="${jdiff.build.dir}"/>
|
||||
- <javadoc sourcepath="${java.src.dir}"
|
||||
- destdir="${jdiff.build.dir}"
|
||||
- excludepackagenames="org.apache.jute"
|
||||
- sourceFiles="${jdiff.home}/Null.java">
|
||||
- <doclet name="jdiff.JDiff"
|
||||
- path="${ivy.jdiff.lib}/jdiff-1.0.9.jar:${ivy.jdiff.lib}/xerces-1.4.4.jar">
|
||||
- <param name="-oldapi" value="${name} ${jdiff.stable}"/>
|
||||
- <param name="-newapi" value="${name} ${version}"/>
|
||||
- <param name="-oldapidir" value="${jdiff.xml.dir}"/>
|
||||
- <param name="-newapidir" value="${jdiff.xml.dir}"/>
|
||||
- <param name="-javadocold" value="${jdiff.stable.javadoc}"/>
|
||||
- <param name="-javadocnew" value="../../api/"/>
|
||||
- <param name="-stats"/>
|
||||
- </doclet>
|
||||
- <classpath>
|
||||
- <pathelement location="${build.classes}"/>
|
||||
- <fileset dir="${lib.dir}">
|
||||
- <include name="**/*.jar" />
|
||||
- <exclude name="**/excluded/" />
|
||||
- </fileset>
|
||||
- <fileset dir="${ivy.lib}">
|
||||
- <include name="**/*.jar" />
|
||||
- </fileset>
|
||||
- </classpath>
|
||||
- </javadoc>
|
||||
- </target>
|
||||
-
|
||||
<condition property="ant-eclipse.jar.exists">
|
||||
<available file="${lib.dir}/ant-eclipse-1.0-jvm1.2.jar"/>
|
||||
</condition>
|
||||
diff -Nru zookeeper-3.4.4/ivysettings.xml zookeeper-3.4.4-gil/ivysettings.xml
|
||||
--- zookeeper-3.4.4/ivysettings.xml 2012-09-17 10:34:37.000000000 +0200
|
||||
+++ zookeeper-3.4.4-gil/ivysettings.xml 2012-10-12 17:02:35.706545077 +0200
|
||||
@@ -18,13 +18,13 @@
|
||||
-->
|
||||
|
||||
<property name="repo.maven.org"
|
||||
- value="http://repo1.maven.org/maven2/" override="false"/>
|
||||
+ value="file:///usr/share/java/" override="false"/>
|
||||
<property name="repo.jboss.org"
|
||||
- value="http://repository.jboss.org/nexus/content/groups/public/" override="false"/>
|
||||
+ value="file:///usr/share/java/" override="false"/>
|
||||
<property name="repo.sun.org"
|
||||
- value="http://download.java.net/maven/2/" override="false"/>
|
||||
+ value="file:///usr/share/java/" override="false"/>
|
||||
<property name="maven2.pattern"
|
||||
- value="[organisation]/[module]/[revision]/[module]-[revision]"/>
|
||||
+ value="[module]"/>
|
||||
<property name="maven2.pattern.ext" value="${maven2.pattern}.[ext]"/>
|
||||
<include url="${ivy.default.conf.dir}/ivyconf-local.xml"/>
|
||||
<settings defaultResolver="default"/>
|
||||
diff -Nru zookeeper-3.4.4/ivy.xml zookeeper-3.4.4-gil/ivy.xml
|
||||
--- zookeeper-3.4.4/ivy.xml 2012-09-17 10:34:37.000000000 +0200
|
||||
+++ zookeeper-3.4.4-gil/ivy.xml 2012-10-12 17:41:46.216338834 +0200
|
||||
@@ -39,36 +39,36 @@
|
||||
</publications>
|
||||
|
||||
<dependencies>
|
||||
- <dependency org="org.slf4j" name="slf4j-api" rev="1.6.1"/>
|
||||
- <dependency org="org.slf4j" name="slf4j-log4j12" rev="1.6.1" transitive="false"/>
|
||||
+ <dependency org="org.slf4j" name="slf4j/api" rev=""/>
|
||||
+ <dependency org="org.slf4j" name="slf4j/log4j12" rev="" transitive="false"/>
|
||||
|
||||
<!-- transitive false turns off dependency checking, log4j deps seem borked -->
|
||||
- <dependency org="log4j" name="log4j" rev="1.2.15" transitive="false" conf="default"/>
|
||||
- <dependency org="jline" name="jline" rev="0.9.94" transitive="false" conf="default"/>
|
||||
+ <dependency org="log4j" name="log4j" rev="" transitive="false" conf="default"/>
|
||||
+ <dependency org="jline" name="jline" rev="" transitive="false" conf="default"/>
|
||||
|
||||
- <dependency org="org.jboss.netty" name="netty" conf="default" rev="3.2.2.Final">
|
||||
+ <dependency org="org.jboss.netty" name="netty" conf="default" rev="">
|
||||
<artifact name="netty" type="jar" conf="default"/>
|
||||
</dependency>
|
||||
|
||||
- <dependency org="org.vafer" name="jdeb" rev="0.8" conf="package->master"/>
|
||||
+ <!--dependency org="org.vafer" name="jdeb" rev="0.8" conf="package->master"/-->
|
||||
|
||||
- <dependency org="junit" name="junit" rev="4.8.1" conf="test->default"/>
|
||||
- <dependency org="org.mockito" name="mockito-all" rev="1.8.2"
|
||||
+ <dependency org="junit" name="junit" rev="" conf="test->default"/>
|
||||
+ <dependency org="org.mockito" name="mockito" rev=""
|
||||
conf="test->default"/>
|
||||
- <dependency org="checkstyle" name="checkstyle" rev="5.0"
|
||||
+ <dependency org="checkstyle" name="checkstyle" rev=""
|
||||
conf="test->default"/>
|
||||
|
||||
- <dependency org="jdiff" name="jdiff" rev="1.0.9"
|
||||
+ <!--dependency org="jdiff" name="jdiff" rev=""
|
||||
conf="jdiff->default"/>
|
||||
- <dependency org="xerces" name="xerces" rev="1.4.4"
|
||||
+ <dependency org="xerces" name="xerces-j2" rev=""
|
||||
conf="jdiff->default"/>
|
||||
|
||||
- <dependency org="org.apache.rat" name="apache-rat-tasks"
|
||||
- rev="0.6" conf="releaseaudit->default"/>
|
||||
+ <dependency org="org.apache.rat" name="apache-rat/apache-rat-tasks"
|
||||
+ rev="" conf="releaseaudit->default"/>
|
||||
<dependency org="commons-lang" name="commons-lang"
|
||||
- rev="2.4" conf="releaseaudit->default"/>
|
||||
+ rev="" conf="releaseaudit->default"/>
|
||||
<dependency org="commons-collections" name="commons-collections"
|
||||
- rev="3.1" conf="releaseaudit->default"/>
|
||||
+ rev="" conf="releaseaudit->default"/-->
|
||||
</dependencies>
|
||||
|
||||
</ivy-module>
|
|
@ -0,0 +1,85 @@
|
|||
diff -Nru zookeeper-3.4.5/contrib/zktreeutil/src/Makefile.am zookeeper-3.4.5-gil/contrib/zktreeutil/src/Makefile.am
|
||||
--- zookeeper-3.4.5/contrib/zktreeutil/src/Makefile.am 2012-09-30 19:53:30.000000000 +0200
|
||||
+++ zookeeper-3.4.5-gil/contrib/zktreeutil/src/Makefile.am 2013-06-11 18:09:15.097330579 +0200
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
AM_CXXFLAGS = -I${ZOOKEEPER_PATH}/include -I${ZOOKEEPER_PATH}/generated \
|
||||
-I$(top_srcdir)/include -I${LOG4CXX_INCLUDE} -I/usr/include \
|
||||
- -I${XML2_INCLUDE}
|
||||
+ -I${XML2_INCLUDE} -fPIE
|
||||
|
||||
bin_PROGRAMS = zktreeutil
|
||||
|
||||
diff -Nru zookeeper-3.4.5/recipes/lock/src/c/Makefile.am zookeeper-3.4.5-gil/recipes/lock/src/c/Makefile.am
|
||||
--- zookeeper-3.4.5/recipes/lock/src/c/Makefile.am 2012-09-30 19:53:31.000000000 +0200
|
||||
+++ zookeeper-3.4.5-gil/recipes/lock/src/c/Makefile.am 2013-06-11 17:10:22.808629998 +0200
|
||||
@@ -17,14 +17,14 @@
|
||||
include $(top_srcdir)/aminclude.am
|
||||
|
||||
AM_CFLAGS = -Wall -fPIC -I${ZOOKEEPER_PATH}/include -I${ZOOKEEPER_PATH}/generated \
|
||||
- -I$(top_srcdir)/include -I/usr/include
|
||||
+ -I$(top_srcdir)/include -I/usr/include -fPIE
|
||||
AM_CPPFLAGS = -Wall -I${ZOOKEEPER_PATH}/include -I${ZOOKEEPER_PATH}/generated\
|
||||
- -I${top_srcdir}/include -I/usr/include
|
||||
+ -I${top_srcdir}/include -I/usr/include -fPIE
|
||||
EXTRA_DIST = LICENSE
|
||||
lib_LTLIBRARIES = libzoolock.la
|
||||
libzoolock_la_SOURCES = src/zoo_lock.c include/zoo_lock.h
|
||||
libzoolock_la_CPPFLAGS = -DDLOPEN_MODULE
|
||||
-libzoolock_la_LDFLAGS = -version-info 0:1:0
|
||||
+libzoolock_la_LDFLAGS = -version-info 0:1:0 -pie -Wl,-z,relro -Wl,-z,now
|
||||
|
||||
#run the tests now
|
||||
|
||||
diff -Nru zookeeper-3.4.5/recipes/queue/src/c/Makefile.am zookeeper-3.4.5-gil/recipes/queue/src/c/Makefile.am
|
||||
--- zookeeper-3.4.5/recipes/queue/src/c/Makefile.am 2012-09-30 19:53:31.000000000 +0200
|
||||
+++ zookeeper-3.4.5-gil/recipes/queue/src/c/Makefile.am 2013-06-11 17:09:50.816288611 +0200
|
||||
@@ -17,14 +17,14 @@
|
||||
include $(top_srcdir)/aminclude.am
|
||||
|
||||
AM_CFLAGS = -Wall -fPIC -I${ZOOKEEPER_PATH}/include -I${ZOOKEEPER_PATH}/generated \
|
||||
- -I$(top_srcdir)/include -I/usr/include
|
||||
+ -I$(top_srcdir)/include -I/usr/include -fPIE
|
||||
AM_CPPFLAGS = -Wall -I${ZOOKEEPER_PATH}/include -I${ZOOKEEPER_PATH}/generated\
|
||||
- -I${top_srcdir}/include -I/usr/include
|
||||
+ -I${top_srcdir}/include -I/usr/include -fPIE
|
||||
EXTRA_DIST = LICENSE
|
||||
lib_LTLIBRARIES = libzooqueue.la
|
||||
libzooqueue_la_SOURCES = src/zoo_queue.c include/zoo_queue.h
|
||||
libzooqueue_la_CPPFLAGS = -DDLOPEN_MODULE
|
||||
-libzooqueue_la_LDFLAGS = -version-info 0:1:0
|
||||
+libzooqueue_la_LDFLAGS = -version-info 0:1:0 -pie -Wl,-z,relro -Wl,-z,now
|
||||
|
||||
#run the tests now
|
||||
|
||||
diff -Nru zookeeper-3.4.5/src/c/Makefile.am zookeeper-3.4.5-gil/src/c/Makefile.am
|
||||
--- zookeeper-3.4.5/src/c/Makefile.am 2012-09-30 19:53:31.000000000 +0200
|
||||
+++ zookeeper-3.4.5-gil/src/c/Makefile.am 2013-06-11 17:02:31.701054099 +0200
|
||||
@@ -1,11 +1,11 @@
|
||||
# need this for Doxygen integration
|
||||
include $(top_srcdir)/aminclude.am
|
||||
|
||||
-AM_CPPFLAGS = -I${srcdir}/include -I${srcdir}/tests -I${srcdir}/generated
|
||||
-AM_CFLAGS = -Wall -Werror
|
||||
-AM_CXXFLAGS = -Wall $(USEIPV6)
|
||||
+AM_CPPFLAGS = -I${srcdir}/include -I${srcdir}/tests -I${srcdir}/generated -fPIE
|
||||
+AM_CFLAGS = -Wall -Werror -fPIE
|
||||
+AM_CXXFLAGS = -Wall $(USEIPV6) -fPIE
|
||||
|
||||
-LIB_LDFLAGS = -no-undefined -version-info 2
|
||||
+LIB_LDFLAGS = -no-undefined -version-info 2 -pie -Wl,-z,relro -Wl,-z,now
|
||||
|
||||
pkginclude_HEADERS = include/zookeeper.h include/zookeeper_version.h include/zookeeper_log.h include/proto.h include/recordio.h generated/zookeeper.jute.h
|
||||
EXTRA_DIST=LICENSE
|
||||
diff -Nru zookeeper-3.4.5/src/contrib/zktreeutil/src/Makefile.am zookeeper-3.4.5-gil/src/contrib/zktreeutil/src/Makefile.am
|
||||
--- zookeeper-3.4.5/src/contrib/zktreeutil/src/Makefile.am 2012-09-30 19:53:32.000000000 +0200
|
||||
+++ zookeeper-3.4.5-gil/src/contrib/zktreeutil/src/Makefile.am 2013-06-11 18:12:03.908634751 +0200
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
AM_CXXFLAGS = -I${ZOOKEEPER_PATH}/include -I${ZOOKEEPER_PATH}/generated \
|
||||
-I$(top_srcdir)/include -I${LOG4CXX_INCLUDE} -I/usr/include \
|
||||
- -I${XML2_INCLUDE}
|
||||
+ -I${XML2_INCLUDE} -fPIE
|
||||
|
||||
bin_PROGRAMS = zktreeutil
|
||||
|
|
@ -0,0 +1,133 @@
|
|||
diff -Nru zookeeper-3.4.5/src/contrib/build-contrib.xml zookeeper-3.4.5-gil/src/contrib/build-contrib.xml
|
||||
--- zookeeper-3.4.5/src/contrib/build-contrib.xml 2012-09-30 19:53:32.000000000 +0200
|
||||
+++ zookeeper-3.4.5-gil/src/contrib/build-contrib.xml 2013-04-27 11:51:59.684011892 +0200
|
||||
@@ -43,9 +43,9 @@
|
||||
|
||||
<property name="ivy.version" value="2.2.0"/>
|
||||
<property name="ivy.url"
|
||||
- value="http://repo2.maven.org/maven2/org/apache/ivy/ivy" />
|
||||
+ value="file:/usr/share/java/" />
|
||||
<property name="ivy.home" value="${user.home}/.ant" />
|
||||
- <property name="ivy.lib" value="${build.dir}/lib"/>
|
||||
+ <property name="ivy.lib" value="/usr/share/java"/>
|
||||
<property name="ivy.test.lib" value="${build.test}/lib"/>
|
||||
<property name="ivysettings.xml" value="${zk.root}/ivysettings.xml"/>
|
||||
|
||||
@@ -70,24 +70,17 @@
|
||||
|
||||
<path id="classpath">
|
||||
<pathelement location="${build.classes}"/>
|
||||
- <!-- allow the user to override (e.g. if there are local versions) -->
|
||||
- <fileset dir="${additional.lib.dir}">
|
||||
- <include name="${additional.lib.dir.includes}" />
|
||||
- <exclude name="${additional.lib.dir.excludes}" />
|
||||
+ <fileset dir="/usr/share/java">
|
||||
+ <include name="jline.jar" />
|
||||
+ <include name="jtoaster.jar" />
|
||||
+ <include name="log4j.jar" />
|
||||
+ <include name="netty.jar" />
|
||||
+ <include name="slf4j/api.jar" />
|
||||
+ <include name="slf4j/log4j12.jar" />
|
||||
+ <include name="xerces-j2.jar" />
|
||||
</fileset>
|
||||
- <fileset refid="lib.jars"/>
|
||||
- <pathelement location="${zk.root}/build/classes"/>
|
||||
- <fileset dir="${ivy.lib}">
|
||||
- <include name="**/*.jar" />
|
||||
- </fileset>
|
||||
- <fileset dir="${ivy.test.lib}">
|
||||
- <include name="**/*.jar" />
|
||||
- </fileset>
|
||||
- <fileset dir="${zk.root}/src/java/lib">
|
||||
- <include name="**/*.jar" />
|
||||
- </fileset>
|
||||
- <fileset dir="${ant.home}/lib">
|
||||
- <include name="ant.jar" />
|
||||
+ <fileset dir="${zk.root}/build">
|
||||
+ <include name="zookeeper-${version}.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
@@ -103,7 +96,7 @@
|
||||
<mkdir dir="${ivy.lib}"/>
|
||||
<mkdir dir="${ivy.test.lib}"/>
|
||||
<condition property="ivy.jar.exists">
|
||||
- <available file="${lib.dir}/ivy-${ivy.version}.jar"/>
|
||||
+ <available file="${lib.dir}/ivy.jar"/>
|
||||
</condition>
|
||||
|
||||
<antcall target="init-contrib"/>
|
||||
@@ -133,7 +126,7 @@
|
||||
<target name="jar" depends="compile" unless="skip.contrib">
|
||||
<echo message="contrib: ${name}"/>
|
||||
<jar
|
||||
- jarfile="${build.dir}/zookeeper-${version}-${name}.jar"
|
||||
+ jarfile="${build.dir}/zookeeper-${name}.jar"
|
||||
basedir="${build.classes}"
|
||||
/>
|
||||
</target>
|
||||
@@ -233,15 +226,9 @@
|
||||
</target>
|
||||
|
||||
<target name="ivy-retrieve" depends="init,ivy-init">
|
||||
- <ivy:retrieve settingsRef="${ant.project.name}" type="jar" conf="default"
|
||||
- pattern="${ivy.lib}/[artifact]-[revision].[ext]"/>
|
||||
- <ivy:retrieve settingsRef="${ant.project.name}" type="bundle" conf="default"
|
||||
- pattern="${ivy.lib}/[artifact]-[revision].[ext]"/>
|
||||
</target>
|
||||
|
||||
<target name="ivy-retrieve-test" depends="init,ivy-init">
|
||||
- <ivy:retrieve settingsRef="${ant.project.name}" type="jar" conf="test"
|
||||
- pattern="${ivy.test.lib}/[artifact]-[revision].[ext]"/>
|
||||
</target>
|
||||
|
||||
|
||||
diff -Nru zookeeper-3.4.5/src/contrib/zooinspector/build.xml zookeeper-3.4.5-gil/src/contrib/zooinspector/build.xml
|
||||
--- zookeeper-3.4.5/src/contrib/zooinspector/build.xml 2012-09-30 19:53:32.000000000 +0200
|
||||
+++ zookeeper-3.4.5-gil/src/contrib/zooinspector/build.xml 2013-04-27 11:42:13.257105341 +0200
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
|
||||
<target name="setjarname">
|
||||
- <property name="jarname" value="${build.dir}/zookeeper-${version}-${name}.jar" />
|
||||
+ <property name="jarname" value="${build.dir}/zookeeper-${name}-${version}.jar" />
|
||||
</target>
|
||||
|
||||
<target name="init" depends="checkMainCompiled, zookeeperbuildcontrib.init">
|
||||
@@ -37,11 +37,11 @@
|
||||
<fileset dir="${basedir}/config" />
|
||||
</copy>
|
||||
<copy todir="${build.dir}/lib">
|
||||
- <fileset file="${basedir}/lib/jtoaster-1.0.4.jar" />
|
||||
+ <!--fileset file="${basedir}/lib/jtoaster-1.0.4.jar" /-->
|
||||
<fileset file="${basedir}/lib/log4j.properties" />
|
||||
</copy>
|
||||
<copy todir="${build.dir}/lib">
|
||||
- <fileset file="../../../build/zookeeper-3.3.0.jar" />
|
||||
+ <fileset file="../../../build/zookeeper-${version}.jar" />
|
||||
</copy>
|
||||
<copy todir="${build.dir}">
|
||||
<fileset dir="${basedir}" includes="*.*" excludes="build.xml,ivy.xml" />
|
||||
@@ -55,7 +55,6 @@
|
||||
<jar jarfile="${jarname}">
|
||||
<manifest>
|
||||
<attribute name="Main-Class" value="org.apache.zookeeper.inspector.ZooInspector" />
|
||||
- <attribute name="Class-Path" value="lib/log4j-1.2.15.jar lib/TableLayout-20050920.jar lib/zookeeper-3.3.0.jar lib/jToaster-1.0.4.jar lib" />
|
||||
<attribute name="Built-By" value="${user.name}" />
|
||||
<attribute name="Built-At" value="${build.time}" />
|
||||
<attribute name="Built-On" value="${host.name}" />
|
||||
@@ -140,12 +139,12 @@
|
||||
<copy todir="${dist.dir}/contrib/${name}/config">
|
||||
<fileset dir="${basedir}/config" />
|
||||
</copy>
|
||||
- <copy todir="${dist.dir}/contrib/${name}/lib">
|
||||
+ <!--copy todir="${dist.dir}/contrib/${name}/lib">
|
||||
<fileset file="${basedir}/lib/jtoaster-1.0.4.jar" />
|
||||
</copy>
|
||||
<copy todir="${dist.dir}/contrib/${name}/lib">
|
||||
<fileset file="../../../build/zookeeper-3.3.0.jar" />
|
||||
- </copy>
|
||||
+ </copy-->
|
||||
</target>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,27 @@
|
|||
--- bin/zkServer.sh 2012-09-30 19:53:31.000000000 +0200
|
||||
+++ bin/zkServer.sh-gil 2013-04-27 11:27:59.972764863 +0200
|
||||
@@ -69,15 +69,6 @@
|
||||
ZOOCFG="$2"
|
||||
fi
|
||||
|
||||
-if $cygwin
|
||||
-then
|
||||
- ZOOCFG=`cygpath -wp "$ZOOCFG"`
|
||||
- # cygwin has a "kill" in the shell itself, gets confused
|
||||
- KILL=/bin/kill
|
||||
-else
|
||||
- KILL=kill
|
||||
-fi
|
||||
-
|
||||
echo "Using config: $ZOOCFG" >&2
|
||||
|
||||
if [ -z $ZOOPIDFILE ]; then
|
||||
@@ -140,7 +131,7 @@
|
||||
then
|
||||
echo "no zookeeper to stop (could not find file $ZOOPIDFILE)"
|
||||
else
|
||||
- $KILL -9 $(cat "$ZOOPIDFILE")
|
||||
+ kill -9 $(cat "$ZOOPIDFILE")
|
||||
rm "$ZOOPIDFILE"
|
||||
echo STOPPED
|
||||
fi
|
|
@ -0,0 +1,10 @@
|
|||
--- src/contrib/zktreeutil/src/ZkAdaptor.h 2012-09-30 19:53:32.000000000 +0200
|
||||
+++ src/contrib/zktreeutil/src/ZkAdaptor.h-gil 2013-04-04 03:37:46.731950855 +0200
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
+#include <unistd.h>
|
||||
|
||||
extern "C" {
|
||||
#include "zookeeper.h"
|
|
@ -0,0 +1,48 @@
|
|||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.apache.zookeeper</groupId>
|
||||
<artifactId>zookeeper-ZooInspector</artifactId>
|
||||
<version>@version@</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.zookeeper</groupId>
|
||||
<artifactId>zookeeper</artifactId>
|
||||
<version>@version@</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>any</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>any</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>any</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.netty</groupId>
|
||||
<artifactId>netty</artifactId>
|
||||
<version>any</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jline</groupId>
|
||||
<artifactId>jline</artifactId>
|
||||
<version>any</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.nitido</groupId>
|
||||
<artifactId>jtoaster</artifactId>
|
||||
<version>any</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<version>any</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,48 @@
|
|||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.apache.zookeeper</groupId>
|
||||
<artifactId>zookeeper-test</artifactId>
|
||||
<version>@version@</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.zookeeper</groupId>
|
||||
<artifactId>zookeeper</artifactId>
|
||||
<version>@version@</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>any</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>any</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>any</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.netty</groupId>
|
||||
<artifactId>netty</artifactId>
|
||||
<version>any</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>any</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>any</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.puppycrawl.tools</groupId>
|
||||
<artifactId>checkstyle</artifactId>
|
||||
<version>any</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,14 @@
|
|||
[Unit]
|
||||
Description=Zookeeper
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=JAVA_HOME=/usr/lib/jvm/jre-1.7.0
|
||||
Environment=ZOO_LOG_DIR=/home/zookeeper
|
||||
WorkingDirectory=/home/zookeeper/zookeeper-3.4.5
|
||||
User=zookeeper
|
||||
ExecStart=/home/zookeeper/zookeeper-3.4.5/bin/zkServer.sh start-foreground
|
||||
SyslogIdentifier=zookeeper
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.service
|
|
@ -0,0 +1,337 @@
|
|||
%global _hardened_build 1
|
||||
Name: zookeeper
|
||||
Version: 3.4.5
|
||||
Release: 5%{?dist}
|
||||
Summary: A high-performance coordination service for distributed applications
|
||||
Group: Development/Libraries
|
||||
License: ASL 2.0 and BSD
|
||||
URL: http://zookeeper.apache.org/
|
||||
Source0: http://www.apache.org/dist/%{name}/stable/%{name}-%{version}.tar.gz
|
||||
Source1: %{name}-test-template.pom
|
||||
Source2: %{name}-ZooInspector-template.pom
|
||||
Source3: %{name}.service
|
||||
# remove non free clover references
|
||||
# configure ivy to use system libraries
|
||||
# disable rat-lib and jdiff support
|
||||
Patch0: %{name}-3.4.4-build.patch
|
||||
# https://issues.apache.org/jira/browse/ZOOKEEPER-1557
|
||||
Patch1: https://issues.apache.org/jira/secure/attachment/12548109/ZOOKEEPER-1557.patch
|
||||
Patch2: %{name}-3.4.5-zktreeutil-gcc.patch
|
||||
Patch3: %{name}-3.4.5-disable-cygwin-detection.patch
|
||||
Patch4: %{name}-3.4.5-build-contrib.patch
|
||||
Patch5: %{name}-3.4.5-add-PIE-and-RELRO.patch
|
||||
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: boost-devel
|
||||
BuildRequires: cppunit-devel
|
||||
BuildRequires: dos2unix
|
||||
BuildRequires: doxygen
|
||||
BuildRequires: graphviz
|
||||
BuildRequires: java-devel
|
||||
BuildRequires: java-javadoc
|
||||
BuildRequires: jpackage-utils
|
||||
BuildRequires: libtool
|
||||
BuildRequires: libxml2-devel
|
||||
BuildRequires: log4cxx-devel
|
||||
BuildRequires: python-devel
|
||||
|
||||
BuildRequires: ant
|
||||
BuildRequires: ant-junit
|
||||
BuildRequires: apache-ivy
|
||||
BuildRequires: checkstyle
|
||||
BuildRequires: jline
|
||||
BuildRequires: jtoaster
|
||||
BuildRequires: junit
|
||||
BuildRequires: log4j
|
||||
BuildRequires: mockito
|
||||
BuildRequires: netty
|
||||
BuildRequires: slf4j
|
||||
BuildRequires: xerces-j2
|
||||
BuildRequires: xml-commons-apis
|
||||
|
||||
# BuildRequires: rat-lib
|
||||
# BuildRequires: apache-rat-tasks
|
||||
# BuildRequires: apache-commons-collections
|
||||
# BuildRequires: apache-commons-lang
|
||||
# BuildRequires: jdiff
|
||||
|
||||
%description
|
||||
ZooKeeper is a centralized service for maintaining configuration information,
|
||||
naming, providing distributed synchronization, and providing group services.
|
||||
|
||||
%package lib
|
||||
Summary: Zookeeper C client library
|
||||
Group: System Environment/Libraries
|
||||
|
||||
%description lib
|
||||
ZooKeeper C client library for communicating with ZooKeeper Server.
|
||||
|
||||
%package lib-devel
|
||||
Summary: Development files for the %{name} library
|
||||
Group: Development/Libraries
|
||||
Requires: %{name}-lib%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description lib-devel
|
||||
Development files for the ZooKeeper C client library.
|
||||
|
||||
%package lib-doc
|
||||
Summary: Documentation for the %{name} library
|
||||
Group: Documentation
|
||||
BuildArch: noarch
|
||||
|
||||
%description lib-doc
|
||||
Documentation for the ZooKeeper C client library.
|
||||
|
||||
%package java
|
||||
Group: Development/Libraries
|
||||
Summary: Zookeeper Java client library
|
||||
# Requires: felix-framework
|
||||
# Requires: felix-osgi-compendium
|
||||
Requires: checkstyle
|
||||
Requires: jline
|
||||
Requires: jtoaster
|
||||
Requires: junit
|
||||
Requires: log4j
|
||||
Requires: mockito
|
||||
Requires: netty
|
||||
Requires: slf4j
|
||||
|
||||
Requires: java
|
||||
Requires: jpackage-utils
|
||||
BuildArch: noarch
|
||||
|
||||
%description java
|
||||
This package provides a Java client interface to Zookeeper server.
|
||||
|
||||
%package javadoc
|
||||
Group: Documentation
|
||||
Summary: Javadoc for %{name}
|
||||
BuildArch: noarch
|
||||
|
||||
%description javadoc
|
||||
This package contains javadoc for %{name}.
|
||||
|
||||
%package -n python-ZooKeeper
|
||||
Group: Development/Libraries
|
||||
Summary: ZooKeeper python binding library
|
||||
Requires: %{name}-lib%{?_isa} = %{version}-%{release}
|
||||
Provides: zkpython%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description -n python-ZooKeeper
|
||||
ZooKeeper python binding library
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
find -name "*.jar" -delete
|
||||
find -name "*.class" -delete
|
||||
find -name "*.cmd" -delete
|
||||
find -name "*.so*" -delete
|
||||
find -name "*.dll" -delete
|
||||
|
||||
%patch0 -p1
|
||||
%patch1 -p0
|
||||
%pom_remove_dep org.vafer:jdeb dist-maven/%{name}-%{version}.pom
|
||||
# jdiff task deps
|
||||
%pom_remove_dep jdiff:jdiff dist-maven/%{name}-%{version}.pom
|
||||
%pom_remove_dep xerces:xerces dist-maven/%{name}-%{version}.pom
|
||||
# rat-lib task deps
|
||||
%pom_remove_dep org.apache.rat:apache-rat-tasks dist-maven/%{name}-%{version}.pom
|
||||
%pom_remove_dep commons-collections:commons-collections dist-maven/%{name}-%{version}.pom
|
||||
%pom_remove_dep commons-lang:commons-lang dist-maven/%{name}-%{version}.pom
|
||||
|
||||
%patch2 -p0
|
||||
%patch3 -p0
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
|
||||
sed -i "s|<packaging>pom</packaging>|<packaging>jar</packaging>|" dist-maven/%{name}-%{version}.pom
|
||||
sed -i "s|<groupId>checkstyle</groupId>|<groupId>com.puppycrawl.tools</groupId>|" dist-maven/%{name}-%{version}.pom
|
||||
sed -i "s|<artifactId>mockito-all</artifactId>|<artifactId>mockito-core</artifactId>|" dist-maven/%{name}-%{version}.pom
|
||||
|
||||
cp -p %{SOURCE1} dist-maven/%{name}-%{version}-test.pom
|
||||
cp -p %{SOURCE2} dist-maven/%{name}-%{version}-ZooInspector.pom
|
||||
sed -i "s|@version@|%{version}|" dist-maven/%{name}-%{version}-test.pom dist-maven/%{name}-%{version}-ZooInspector.pom
|
||||
|
||||
iconv -f iso8859-1 -t utf-8 src/c/ChangeLog > src/c/ChangeLog.conv && mv -f src/c/ChangeLog.conv src/c/ChangeLog
|
||||
sed -i 's/\r//' src/c/ChangeLog
|
||||
|
||||
# fix build problem on f18
|
||||
sed -i 's|<exec executable="hostname" outputproperty="host.name"/>|<!--exec executable="hostname" outputproperty="host.name"/-->|' build.xml
|
||||
sed -i 's|<attribute name="Built-On" value="${host.name}" />|<attribute name="Built-On" value="${user.name}" />|' build.xml
|
||||
|
||||
%build
|
||||
|
||||
# ensure that source and target are 1.5
|
||||
%ant -Dtarget.jdk=1.5 \
|
||||
-Djavadoc.link.java=%{_javadocdir}/java \
|
||||
-Dant.build.javac.source=1.5 \
|
||||
-Dant.build.javac.target=1.5 \
|
||||
build-generated jar test-jar javadoc javadoc-dev
|
||||
|
||||
(
|
||||
cd src/contrib
|
||||
%ant -Dversion=%{version} \
|
||||
-Dcontribfilesetincludes="zooinspector/build.xml" \
|
||||
-Dant.build.javac.source=1.5 \
|
||||
-Dant.build.javac.target=1.5 \
|
||||
-Dtarget.jdk=1.5 \
|
||||
-DlastRevision=-1 \
|
||||
-Divy.jar.exists=true \
|
||||
-Divy.initialized=true \
|
||||
-Ddest.dir=../../build/zookeeper
|
||||
)
|
||||
|
||||
pushd src/c
|
||||
rm -rf autom4te.cache
|
||||
autoreconf -fis
|
||||
|
||||
%configure --disable-static --disable-rpath --with-syncapi
|
||||
# Remove rpath
|
||||
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
|
||||
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
|
||||
%{__make} %{?_smp_mflags}
|
||||
make doxygen-doc
|
||||
popd
|
||||
|
||||
# Compile zktreeutil
|
||||
pushd src/contrib/zktreeutil
|
||||
rm -rf autom4te.cache
|
||||
autoreconf -if
|
||||
%configure
|
||||
%{__make} %{?_smp_mflags}
|
||||
popd
|
||||
|
||||
%if 0
|
||||
%check
|
||||
# Execute multi-threaded test suite
|
||||
mkdir -p build/lib
|
||||
for jar in jline log4j xerces-j2 xml-commons-apis; do \
|
||||
ln -sf %{_javadir}/$jar.jar build/lib/$jar.jar; \
|
||||
done
|
||||
pushd src/c
|
||||
%{__make} %{?_smp_mflags} zktest-mt
|
||||
./zktest-mt
|
||||
popd
|
||||
%ifarch i386
|
||||
# Run core Java test suite against zookeeper
|
||||
ant -Dversion=%{version} -DlastRevision=-1 test-core-java
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%install
|
||||
|
||||
mkdir -p %{buildroot}%{_javadir}/%{name}
|
||||
install -pm 644 build/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}/%{name}.jar
|
||||
install -pm 644 build/%{name}-%{version}-test.jar %{buildroot}%{_javadir}/%{name}/%{name}-test.jar
|
||||
install -pm 644 build/contrib/ZooInspector/%{name}-ZooInspector-%{version}.jar %{buildroot}%{_javadir}/%{name}/%{name}-ZooInspector.jar
|
||||
|
||||
mkdir -p %{buildroot}%{_mavenpomdir}
|
||||
install -pm 644 dist-maven/%{name}-%{version}.pom %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}.pom
|
||||
%add_maven_depmap JPP.%{name}-%{name}.pom %{name}/%{name}.jar
|
||||
install -pm 644 dist-maven/%{name}-%{version}-test.pom %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-test.pom
|
||||
%add_maven_depmap JPP.%{name}-%{name}-test.pom %{name}/%{name}-test.jar
|
||||
install -pm 644 dist-maven/%{name}-%{version}-ZooInspector.pom %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-ZooInspector.pom
|
||||
%add_maven_depmap JPP.%{name}-%{name}-ZooInspector.pom %{name}/%{name}-ZooInspector.jar
|
||||
|
||||
mkdir -p %{buildroot}%{_javadocdir}/%{name}/dev
|
||||
cp -pr build/docs/api/* %{buildroot}%{_javadocdir}/%{name}/
|
||||
cp -pr build/docs/dev-api/* %{buildroot}%{_javadocdir}/%{name}/dev/
|
||||
|
||||
pushd src/c
|
||||
%{__make} install DESTDIR=%{buildroot}
|
||||
# cleanup
|
||||
rm -f docs/html/*.map
|
||||
popd
|
||||
|
||||
pushd src/contrib/zktreeutil
|
||||
%{__make} install DESTDIR=%{buildroot}
|
||||
popd
|
||||
|
||||
pushd src/contrib/zkpython
|
||||
%{__python} src/python/setup.py build --build-base=$PWD/build \
|
||||
install --root=%{buildroot} ;\
|
||||
chmod 0755 %{buildroot}%{python_sitearch}/zookeeper.so
|
||||
popd
|
||||
|
||||
find %{buildroot} -name '*.la' -exec rm -f {} ';'
|
||||
|
||||
# TODO
|
||||
# bin/zkCleanup.sh
|
||||
# bin/zkCli.sh
|
||||
# bin/zkEnv.sh
|
||||
# bin/zkServer.sh
|
||||
|
||||
%post lib -p /sbin/ldconfig
|
||||
%postun lib -p /sbin/ldconfig
|
||||
|
||||
%files
|
||||
%{_bindir}/cli_mt
|
||||
%{_bindir}/cli_st
|
||||
%{_bindir}/load_gen
|
||||
%{_bindir}/zktreeutil
|
||||
%doc src/c/ChangeLog src/c/LICENSE src/c/NOTICE.txt src/c/README src/contrib/zktreeutil/README.txt
|
||||
|
||||
%files lib
|
||||
%{_libdir}/lib*.so.*
|
||||
%doc src/c/LICENSE src/c/NOTICE.txt
|
||||
|
||||
%files lib-devel
|
||||
%dir %{_includedir}/%{name}
|
||||
%{_includedir}/%{name}/*.h
|
||||
%{_libdir}/*.so
|
||||
%doc src/c/LICENSE src/c/NOTICE.txt
|
||||
|
||||
%files lib-doc
|
||||
%doc src/c/LICENSE src/c/NOTICE.txt src/c/docs/html/*
|
||||
|
||||
%files java
|
||||
%{_javadir}/%{name}/%{name}.jar
|
||||
%{_javadir}/%{name}/%{name}-test.jar
|
||||
%{_javadir}/%{name}/%{name}-ZooInspector.jar
|
||||
%{_mavenpomdir}/JPP.%{name}-%{name}.pom
|
||||
%{_mavenpomdir}/JPP.%{name}-%{name}-test.pom
|
||||
%{_mavenpomdir}/JPP.%{name}-%{name}-ZooInspector.pom
|
||||
%{_mavendepmapfragdir}/%{name}
|
||||
%doc CHANGES.txt LICENSE.txt NOTICE.txt README.txt
|
||||
|
||||
%files javadoc
|
||||
%{_javadocdir}/%{name}
|
||||
%doc LICENSE.txt NOTICE.txt
|
||||
|
||||
%files -n python-ZooKeeper
|
||||
%{python_sitearch}/ZooKeeper-?.?-py%{python_version}.egg-info
|
||||
%{python_sitearch}/zookeeper.so
|
||||
%doc LICENSE.txt NOTICE.txt src/contrib/zkpython/README
|
||||
|
||||
%changelog
|
||||
* Tue Jun 11 2013 gil cattaneo <puntogil@libero.it> 3.4.5-5
|
||||
- fixed zookeeper.so non-standard-executable-perm thanks to Björn Esser
|
||||
|
||||
* Tue Jun 11 2013 gil cattaneo <puntogil@libero.it> 3.4.5-4
|
||||
- enabled hardened-builds
|
||||
- fixed fully versioned dependency in subpackages (lib-devel and python)
|
||||
- fixed License tag
|
||||
- moved large documentation in lib-doc subpackage
|
||||
|
||||
* Sat Apr 27 2013 gil cattaneo <puntogil@libero.it> 3.4.5-3
|
||||
- built ZooInspector
|
||||
- added additional poms files
|
||||
|
||||
* Tue Apr 23 2013 gil cattaneo <puntogil@libero.it> 3.4.5-2
|
||||
- building/packaging of the zookeeper-test.jar thanks to Robert Rati
|
||||
|
||||
* Sun Dec 02 2012 gil cattaneo <puntogil@libero.it> 3.4.5-1
|
||||
- update to 3.4.5
|
||||
|
||||
* Tue Oct 30 2012 gil cattaneo <puntogil@libero.it> 3.4.4-3
|
||||
- fix missing hostname
|
||||
|
||||
* Fri Oct 12 2012 gil cattaneo <puntogil@libero.it> 3.4.4-2
|
||||
- add ant-junit as BR
|
||||
|
||||
* Fri Oct 12 2012 gil cattaneo <puntogil@libero.it> 3.4.4-1
|
||||
- update to 3.4.4
|
||||
|
||||
* Fri May 18 2012 gil cattaneo <puntogil@libero.it> 3.4.3-1
|
||||
- initial rpm
|
Loading…
Reference in New Issue