WIP update to 3.4.6

This commit is contained in:
Timothy St. Clair 2014-10-15 08:30:46 -05:00
parent 0c3eb8f67f
commit da2547bc7d
9 changed files with 245 additions and 951 deletions

View File

@ -1,152 +0,0 @@
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 {

View File

@ -1,32 +0,0 @@
Index: src/c/src/mt_adaptor.c
===================================================================
--- src/c/src/mt_adaptor.c (revision 1447974)
+++ src/c/src/mt_adaptor.c (working copy)
@@ -484,25 +484,9 @@
int32_t fetch_and_add(volatile int32_t* operand, int incr)
{
#ifndef WIN32
- int32_t result;
- asm __volatile__(
- "lock xaddl %0,%1\n"
- : "=r"(result), "=m"(*(int *)operand)
- : "0"(incr)
- : "memory");
- return result;
+ return __sync_fetch_and_add(operand, incr);
#else
- volatile int32_t result;
- _asm
- {
- mov eax, operand; //eax = v;
- mov ebx, incr; // ebx = i;
- mov ecx, 0x0; // ecx = 0;
- lock xadd dword ptr [eax], ecx;
- lock xadd dword ptr [eax], ebx;
- mov result, ecx; // result = ebx;
- }
- return result;
+ return InterlockedExchangeAdd(operand, incr);
#endif
}

91
zkEnv.sh Executable file
View File

@ -0,0 +1,91 @@
#!/usr/bin/env bash
# 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.
# This script should be sourced into other zookeeper
# scripts to setup the env variables
# We use ZOOCFGDIR if defined,
# otherwise we use /etc/zookeeper
# or the conf directory that is
# a sibling of this script's directory
ZOOBINDIR="${ZOOBINDIR:-/usr/bin}"
ZOOKEEPER_PREFIX="${ZOOBINDIR}/.."
ZOOCFGDIR="/etc/zookeeper"
if [ -f "${ZOOCFGDIR}/zookeeper-env.sh" ]; then
. "${ZOOCFGDIR}/zookeeper-env.sh"
fi
if [ "x$ZOOCFG" = "x" ]
then
ZOOCFG="zoo.cfg"
fi
ZOOCFG="$ZOOCFGDIR/$ZOOCFG"
if [ -f "$ZOOCFGDIR/java.env" ]
then
. "$ZOOCFGDIR/java.env"
fi
if [ "x${ZOO_LOG_DIR}" = "x" ]
then
ZOO_LOG_DIR="."
fi
if [ "x${ZOO_LOG4J_PROP}" = "x" ]
then
ZOO_LOG4J_PROP="INFO,CONSOLE"
fi
if [ "$JAVA_HOME" != "" ]; then
JAVA="$JAVA_HOME/bin/java"
else
JAVA=java
fi
## TSTCLAIR: TODO
#
#add the zoocfg dir to classpath
CLASSPATH="$ZOOCFGDIR:$CLASSPATH"
for i in "$ZOOBINDIR"/../src/java/lib/*.jar
do
CLASSPATH="$i:$CLASSPATH"
done
#make it work in the binary package
#(use array for LIBPATH to account for spaces within wildcard expansion)
if [ -e "${ZOOKEEPER_PREFIX}"/share/zookeeper/zookeeper-*.jar ]; then
LIBPATH=("${ZOOKEEPER_PREFIX}"/share/zookeeper/*.jar)
else
#release tarball format
for i in "$ZOOBINDIR"/../zookeeper-*.jar
do
CLASSPATH="$i:$CLASSPATH"
done
LIBPATH=("${ZOOBINDIR}"/../lib/*.jar)
fi
for i in "${LIBPATH[@]}"
do
CLASSPATH="$i:$CLASSPATH"
done
#echo "CLASSPATH=$CLASSPATH"

View File

@ -1,449 +0,0 @@
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=&lt;base of Findbugs installation&gt;
@@ -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">
- <artifact name="netty" type="jar" conf="default"/>
- </dependency>
+ <!--<dependency org="io.netty" name="netty" conf="default" rev="">
+ <artifact name="netty3-3" 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>

View File

@ -1,133 +0,0 @@
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>

View File

@ -1,26 +0,0 @@
--- a/conf/log4j.properties 2012-09-30 12:53:31.000000000 -0500
+++ b/conf/log4j.properties 2013-06-25 12:28:56.833948571 -0500
@@ -1,10 +1,11 @@
# Define some default values that can be overridden by system properties
-zookeeper.root.logger=INFO, CONSOLE
+zookeeper.root.logger=INFO, SYSTEMD
zookeeper.console.threshold=INFO
-zookeeper.log.dir=.
+zookeeper.systemd.threshold=INFO
+zookeeper.log.dir=/var/log/zookeeper
zookeeper.log.file=zookeeper.log
zookeeper.log.threshold=DEBUG
-zookeeper.tracelog.dir=.
+zookeeper.tracelog.dir=/var/log/zookeeper
zookeeper.tracelog.file=zookeeper_trace.log
#
@@ -56,3 +57,8 @@
log4j.appender.TRACEFILE.layout=org.apache.log4j.PatternLayout
### Notice we are including log4j's NDC here (%x)
log4j.appender.TRACEFILE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L][%x] - %m%n
+
+log4j.appender.SYSTEMD=org.apache.log4j.ConsoleAppender
+log4j.appender.SYSTEMD.Threshold=${zookeeper.systemd.threshold}
+log4j.appender.SYSTEMD.layout=org.apache.log4j.PatternLayout
+log4j.appender.SYSTEMD.layout.ConversionPattern=[myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n

View File

@ -0,0 +1,52 @@
diff --git a/build.xml b/build.xml
index 442d52e..bc1f4a2 100644
--- a/build.xml
+++ b/build.xml
@@ -257,7 +257,7 @@ xmlns:maven="antlib:org.apache.maven.artifact.ant">
<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="/usr/share/java/ivy.jar"/>
</condition>
<tstamp>
@@ -343,9 +343,9 @@ xmlns:maven="antlib:org.apache.maven.artifact.ant">
<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"/>
+ includes="ivy.jar" excludes="ivy.jar"/>
+ <get src="${ivy.url}/ivy.jar"
+ dest="${lib.dir}/ivy.jar" usetimestamp="true"/>
</target>
<target name="ivy-taskdef" unless="ivy.initialized">
diff --git a/src/contrib/build-contrib.xml b/src/contrib/build-contrib.xml
index 0e57d08..708f64f 100644
--- a/src/contrib/build-contrib.xml
+++ b/src/contrib/build-contrib.xml
@@ -103,7 +103,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="/usr/share/java/ivy.jar"/>
</condition>
<antcall target="init-contrib"/>
@@ -219,9 +219,9 @@
<!-- ====================================================== -->
<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"/>
+ includes="ivy.jar" excludes="ivy.jar"/>
+ <get src="${ivy.url}/ivy.jar"
+ dest="${lib.dir}/ivy.jar" usetimestamp="true"/>
</target>
<target name="ivy-init" depends="ivy-download" unless="ivy.initialized">

View File

@ -6,17 +6,12 @@ ConditionPathExists=/etc/zookeeper/log4j.properties
ConditionPathExists=/var/lib/zookeeper/data/myid
[Service]
Type=simple
Type=forking
User=zookeeper
SyslogIdentifier=zookeeper
WorkingDirectory=/var/lib/zookeeper
#UMask=0027
#Environment="CP=/etc/zookeeper:/usr/share/java/slf4j/slf4j-log4j12.jar:/usr/share/java/slf4j/slf4j-api.jar:/usr/share/java/netty.jar:/usr/share/java/log4j.jar:/usr/share/java/jline.jar:/usr/share/java/zookeeper/zookeeper.jar"
#Environment="IPv6=-Djava.net.preferIPv4Stack=false -Djava.net.preferIPv6Addresses=true"
#Environment="JMX=-Dcom.sun.management.jmxremote"
ExecStart=/usr/lib/jvm/jre-1.7.0/bin/java -cp $CP $JMX $IPv6 org.apache.zookeeper.server.quorum.QuorumPeerMain /etc/zookeeper/zoo.cfg
ExecStart=/usr/bin/zkServer.sh
#ExecStop=
[Install]
WantedBy=multi-user.target

View File

@ -1,24 +1,22 @@
%global commit 601207e1151b2691112c431fc3b4130a85ac93b5
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global _hardened_build 1
%global skiptests 1
Name: zookeeper
Version: 3.4.6
Release: 1%{?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: https://github.com/apache/zookeeper/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
Source1: %{name}-ZooInspector-template.pom
Source2: %{name}.service
Source3: zkEnv.sh
Patch1: %{name}-3.4.5-zktreeutil-gcc.patch
Patch2: %{name}-3.4.6-ivy-build.patch
#Patch2: %{name}-3.4.5-log4j.patch
#Patch2: %{name}-3.4.5-build-contrib.patch
#Patch5: %{name}-3.4.5-add-PIE-and-RELRO.patch
#Patch3: {name}-3.4.5-add-PIE-and-RELRO.patch
BuildRequires: autoconf
BuildRequires: automake
@ -43,8 +41,11 @@ BuildRequires: checkstyle
BuildRequires: jline1
BuildRequires: jtoaster
BuildRequires: junit
#BuildRequires: log4j12
BuildRequires: log4j
%if 0%{?fedora} >= 21
BuildRequires: mvn(org.slf4j:slf4j-log4j12)
%else
BuildRequires: mvn(log4j:log4j)
%endif
BuildRequires: json_simple
BuildRequires: mockito
@ -55,37 +56,6 @@ BuildRequires: xml-commons-apis
BuildRequires: systemd
%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: checkstyle
Requires: jline1
Requires: jtoaster
@ -94,56 +64,41 @@ Requires: log4j
Requires: mockito
Requires: netty3
Requires: slf4j
Requires: java
Requires: jpackage-utils
BuildArch: noarch
%description java
This package provides a Java client interface to Zookeeper server.
%description
ZooKeeper is a centralized service for maintaining configuration information,
naming, providing distributed synchronization, and providing group services.
%package devel
Summary: Development files for the %{name} library
Requires: %{name}-lib%{?_isa} = %{version}-%{release}
%description devel
Development files for the ZooKeeper C client library.
%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
%package -n python-%{name}
Summary: Python support for %{name}
Requires: %{name}-lib%{?_isa} = %{version}-%{release}
Provides: zkpython%{?_isa} = %{version}-%{release}
Requires: python2
%description -n python-ZooKeeper
ZooKeeper python binding library
%package server
#Group: System Environment/Daemons
Summary: ZooKeeper server
Requires: %{name}-java = %{version}-%{release}
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Requires(pre): shadow-utils
BuildArch: noarch
%description server
ZooKeeper server
%description -n python-%{name}
The python-%{name} package contains Python bindings for %{name}.
%prep
%setup -q -n %{name}-%{commit}
%patch1 -p0
%patch2 -p1
#%patch3 -p1
#%patch4 -p1
#
#cp -p %{SOURCE1} dist-maven/%{name}-%{version}-ZooInspector.pom
#sed -i "s|@version@|%{version}|" dist-maven/%{name}-%{version}-ZooInspector.pom
#%%patch3 -p1
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
@ -159,50 +114,54 @@ sed -i 's@^dataDir=.*$@dataDir=%{_sharedstatedir}/zookeeper/data\ndataLogDir=%{_
-Djavadoc.link.java=%{_javadocdir}/java \
-Dant.build.javac.source=1.5 \
-Dant.build.javac.target=1.5 \
-Ddist.dir=%{buildroot} \
package-native
package
#Compile zktreeutil
# TODO - determine why it's not part of the default build
pushd src/contrib/zktreeutil
rm -rf autom4te.cache
pushd src/c
autoreconf -if
%configure
%{__make} %{?_smp_mflags}
popd
## TODO: install utilities?
%check
%ant -Divy.mode=local \
test
%if %skiptests
echo "Testing disabled, please enable in mock"
%else
%ant -Divy.mode=local test
%endif
%install
#install the c tools
pushd src/c
%make_install
popd
# install the java dependencies.
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}-tests.jar
install -pm 644 build/contrib/ZooInspector/%{name}-%{version}-ZooInspector.jar %{buildroot}%{_javadir}/%{name}/%{name}-ZooInspector.jar
install -pm 755 bin/zkCleanup.sh %{buildroot}%{_bindir}
install -pm 755 bin/zkCli.sh %{buildroot}%{_bindir}
install -pm 755 bin/zkServer.sh %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_libexecdir}
install -pm 755 %{SOURCE3} %{buildroot}%{_libexecdir}
%if 0%{?fedora} >= 21
mkdir -p %{buildroot}%{_datadir}/maven-metadata
mkdir -p %{buildroot}%{_datadir}/maven-poms/%{name}
%add_maven_depmap %{name}-%{name}.pom %{name}/%{name}.jar
%add_maven_depmap org.apache.zookeeper:zookeeper::tests:%{version} %{name}/%{name}-tests.jar
install -pm 644 %{SOURCE1} %{buildroot}%{_datadir}/maven-poms/%{name}/%{name}-%{name}-ZooInspector.pom
sed -i "s|@version@|%{version}|" %{buildroot}%{_datadir}/maven-poms/%{name}/%{name}-%{name}-ZooInspector.pom
%add_maven_depmap %{name}-%{name}-ZooInspector.pom %{name}/%{name}-ZooInspector.jar
%else
mkdir -p %{buildroot}%{_mavenpomdir}
install -pm 644 build/%{name}-%{version}/dist-maven/%{name}.pom %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}.pom
####################################################
# we will need to do our pom cleanup here.
#%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
#sed -i "s|<version>0.9.94</version>|<version>1.0</version>|" dist-maven/%{name}-%{version}.pom
#sed -i "s|<version>3.2.2.Final</version>|<version>3.6.6.Final</version>|" dist-maven/%{name}-%{version}.pom
#sed -i "s|org.jboss.netty|io.netty|" dist-maven/%{name}-%{version}.pom
#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
####################################################
install -pm 644 build/%{name}-%{version}/dist-maven/%{name}-%{version}.pom %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}.pom
%add_maven_depmap JPP.%{name}-%{name}.pom %{name}/%{name}.jar
%add_maven_depmap org.apache.zookeeper:zookeeper::tests:%{version} %{name}/%{name}-tests.jar
@ -211,26 +170,19 @@ install -pm 644 %{SOURCE1} %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-ZooIn
sed -i "s|@version@|%{version}|" %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-ZooInspector.pom
%add_maven_depmap JPP.%{name}-%{name}-ZooInspector.pom %{name}/%{name}-ZooInspector.jar
%endif
mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -pr build/docs/api/* %{buildroot}%{_javadocdir}/%{name}/
#pushd build/c
#%{__make} install DESTDIR=%{buildroot}
# cleanup
#rm -f docs/html/*.map
#popd
#pushd src/contrib/zktreeutil
#%{__make} install DESTDIR=%{buildroot}
#popd
pushd build/contrib/zkpython
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 {} ';'
find %{buildroot} -name '*.a' -exec rm -f {} ';'
mkdir -p %{buildroot}%{_unitdir}
mkdir -p %{buildroot}%{_sysconfdir}/zookeeper
@ -244,68 +196,45 @@ install -p -m 0640 conf/zoo_sample.cfg %{buildroot}%{_sysconfdir}/zookeeper
touch %{buildroot}%{_sysconfdir}/zookeeper/zoo.cfg
touch %{buildroot}%{_sharedstatedir}/zookeeper/data/myid
# TODO
# bin/zkCleanup.sh
# bin/zkCli.sh
# bin/zkEnv.sh
%post lib -p /sbin/ldconfig
%postun lib -p /sbin/ldconfig
%pre server
%pre
getent group zookeeper >/dev/null || groupadd -r zookeeper
getent passwd zookeeper >/dev/null || \
useradd -r -g zookeeper -d %{_sharedstatedir}/zookeeper -s /sbin/nologin \
-c "ZooKeeper service account" zookeeper
%post server
%systemd_post zookeeper.service
%preun server
%post
%systemd_post zookeeper.service
/sbin/ldconfig
%preun
%systemd_preun zookeeper.service
%postun server
%postun
%systemd_postun_with_restart zookeeper.service
/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
%{_bindir}/zk*.sh
%{_libexecdir}/zkEnv.sh
%{_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
%dir %{_javadir}/%{name}
%{_javadir}/%{name}/%{name}.jar
%{_javadir}/%{name}/%{name}-tests.jar
%{_javadir}/%{name}/%{name}-ZooInspector.jar
%if 0%{?fedora} >= 21
%{_datadir}/maven-poms/%{name}/%{name}-%{name}.pom
%{_datadir}/maven-poms/%{name}/%{name}-%{name}-ZooInspector.pom
%{_datadir}/maven-metadata/%{name}.xml
%else
%{_mavendepmapfragdir}/%{name}
%{_mavenpomdir}/JPP.%{name}-%{name}.pom
%{_mavenpomdir}/JPP.%{name}-%{name}-ZooInspector.pom
%{_mavendepmapfragdir}/%{name}
%doc CHANGES.txt LICENSE.txt NOTICE.txt README.txt
%endif
%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
%files server
%attr(0755,root,root) %dir %{_sysconfdir}/zookeeper
%attr(0644,root,root) %ghost %config(noreplace) %{_sysconfdir}/zookeeper/zoo.cfg
%attr(0644,root,root) %{_sysconfdir}/zookeeper/zoo_sample.cfg
@ -317,8 +246,27 @@ getent passwd zookeeper >/dev/null || \
%attr(0640,zookeeper,zookeeper) %ghost %{_sharedstatedir}/zookeeper/data/myid
%attr(0750,zookeeper,zookeeper) %dir %{_sharedstatedir}/zookeeper/log
%{_unitdir}/zookeeper.service
%doc CHANGES.txt LICENSE.txt NOTICE.txt README.txt
%files devel
%{_includedir}/%{name}/
%{_libdir}/*.so
%doc src/c/LICENSE src/c/NOTICE.txt
%files javadoc
%{_javadocdir}/%{name}
%doc LICENSE.txt NOTICE.txt
%files -n python-%{name}
%{python_sitearch}/ZooKeeper-?.?-py%{python_version}.egg-info
%{python_sitearch}/zookeeper.so
%doc LICENSE.txt NOTICE.txt src/contrib/zkpython/README
%changelog
* Wed Oct 8 2014 Timothy St. Clair <tstclair@redhat.com> - 3.4.6-1
- Update to latest stable series
- Cleanup and overhaul package
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4.5-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild