Skip to content

Commit

Permalink
Merge pull request apache#2 from omwok/trunk
Browse files Browse the repository at this point in the history
request to pull some commit
  • Loading branch information
ewhauser committed Jun 6, 2012
2 parents a52ff80 + 8a2a7b5 commit bf6bee8
Show file tree
Hide file tree
Showing 882 changed files with 213,384 additions and 25,427 deletions.
615 changes: 614 additions & 1 deletion CHANGES.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Apache ZooKeeper
Copyright 2009 The Apache Software Foundation
Copyright 2009-2011 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
22 changes: 13 additions & 9 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
For the latest information about ZooKeeper, please visit our website at:

http://hadoop.apache.org/zookeeper/
http://zookeeper.apache.org/

and our wiki, at:

http://wiki.apache.org/hadoop/ZooKeeper
https://cwiki.apache.org/confluence/display/ZOOKEEPER

Full documentation for this release can also be found in docs/index.html

---------------------------
Packaging/release artifacts

The release artifact contains the following jar files:
The release artifact contains the following jar file at the toplevel:

zookeeper-<version>.jar - legacy jar file which contains all classes
and source files. Prior to version 3.3.0 this
Expand All @@ -20,13 +20,17 @@ zookeeper-<version>.jar - legacy jar file which contains all classes
debugging purposes) however is also larger as
a result

zookeeper-<version>-bin.jar - contains only class (*.class) files
zookeeper-<version>-src.jar - contains only src (*.java) files
The release artifact contains the following jar files in "dist-maven" directory:

zookeeper-<version>.jar - bin (binary) jar - contains only class (*.class) files
zookeeper-<version>-sources.jar - contains only src (*.java) files
zookeeper-<version>-javadoc.jar - contains only javadoc files

The bin/src/javadoc jars were added specifically to support Maven/Ivy which have the
ability to pull these down automatically as part of your build process. The content
of the legacy jar and the bin+src jar are the same.
These bin/src/javadoc jars were added specifically to support Maven/Ivy which have
the ability to pull these down automatically as part of your build process.
The content of the legacy jar and the bin+sources jar are the same.

As of version 3.3.0 bin/src/javadoc jars are deployed to the Apache Maven repository.
As of version 3.3.0 bin/sources/javadoc jars contained in dist-maven directory
are deployed to the Apache Maven repository after the release has been accepted
by Apache:
http://people.apache.org/repo/m2-ibiblio-rsync-repository/
65 changes: 65 additions & 0 deletions README_packaging.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
README file for Packaging Notes

Requirement
-----------

gcc, cppunit and python-setuptools are required to build
C and python bindings.

On RHEL machine:

yum install cppunit
yum install python-setuptools

On Ubuntu:

apt-get --install cppunit
apt-get --install python-setuptools

Package build command
---------------------

Command to build Debian package: ant deb
Command to build RPM Package: ant rpm

rpm and deb packages are generated and placed in:

build/zookeeper*.[rpm|deb]
build/contrib/**.[rpm|deb]

Default package file structure layout

/usr/bin - User executable
/usr/sbin - System executable
/usr/libexec - Configuration boot trap script
/usr/lib - Native libraries
/usr/share/doc/zookeeper - Documents
/usr/share/zookeeper - Project files
/usr/share/zookeeper/template/conf - Configuration template files
/etc/zookeeper - Configuration files
/etc/init.d/zookeeper - OS startup script

Source file structure layout
---------------------

src/packages/update-zookeeper-env.sh
- setup environment variables and symlink $PREFIX/etc/zookeeper to
/etc/zookeeper.
- This script is designed to run in post installation, and pre-remove
phase of ZooKeeper package.
- Run update-zookeeper-env.sh -h to get a list of supported parameters.

src/packages/template
- Standard configuration template

src/packages/deb
Meta data for creating Debian package

src/packages/deb/init.d
Daemon start/stop script for Debian flavor of Linux

src/packages/rpm
Meta data for creating RPM package

src/packages/rpm/init.d
Daemon start/stop script for Redhat flavor of Linux
24 changes: 12 additions & 12 deletions bin/zkCleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,27 @@
# relative to the canonical path of this script.
#

# Only follow symlinks if readlink supports it
if readlink -f "$0" > /dev/null 2>&1
then
ZOOBIN=`readlink -f "$0"`
# use POSTIX interface, symlink is followed automatically
ZOOBIN="${BASH_SOURCE-$0}"
ZOOBIN=`dirname ${ZOOBIN}`
ZOOBINDIR=`cd ${ZOOBIN}; pwd`

if [ -e "$ZOOBIN/../libexec/zkEnv.sh" ]; then
. "$ZOOBINDIR"/../libexec/zkEnv.sh
else
ZOOBIN="$0"
. "$ZOOBINDIR"/zkEnv.sh
fi
ZOOBINDIR=`dirname "$ZOOBIN"`

. "$ZOOBINDIR"/zkEnv.sh

ZOODATADIR=$(grep '^dataDir=' "$ZOOCFG" | sed -e 's/.*=//')
ZOODATALOGDIR=$(grep '^dataLogDir=' "$ZOOCFG" | sed -e 's/.*=//')
ZOODATADIR=$(grep "^[[:space:]]*dataDir=" "$ZOOCFG" | sed -e 's/.*=//')
ZOODATALOGDIR=$(grep "^[[:space:]]*dataLogDir=" "$ZOOCFG" | sed -e 's/.*=//')

if [ "x$ZOODATALOGDIR" = "x" ]
then
echo java "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \
$JAVA "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \
-cp "$CLASSPATH" $JVMFLAGS \
org.apache.zookeeper.server.PurgeTxnLog "$ZOODATADIR" $*
else
echo java "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \
$JAVA "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \
-cp "$CLASSPATH" $JVMFLAGS \
org.apache.zookeeper.server.PurgeTxnLog "$ZOODATALOGDIR" "$ZOODATADIR" $*
fi
20 changes: 10 additions & 10 deletions bin/zkCli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
# relative to the canonical path of this script.
#

# Only follow symlinks if readlink supports it
if readlink -f "$0" > /dev/null 2>&1
then
ZOOBIN=`readlink -f "$0"`
# use POSTIX interface, symlink is followed automatically
ZOOBIN="${BASH_SOURCE-$0}"
ZOOBIN=`dirname ${ZOOBIN}`
ZOOBINDIR=`cd ${ZOOBIN}; pwd`

if [ -e "$ZOOBIN/../libexec/zkEnv.sh" ]; then
. "$ZOOBINDIR"/../libexec/zkEnv.sh
else
ZOOBIN="$0"
. "$ZOOBINDIR"/zkEnv.sh
fi
ZOOBINDIR=`dirname "$ZOOBIN"`

. "$ZOOBINDIR"/zkEnv.sh

java "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \
-cp "$CLASSPATH" $JVMFLAGS \
$JAVA "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \
-cp "$CLASSPATH" $CLIENT_JVMFLAGS $JVMFLAGS \
org.apache.zookeeper.ZooKeeperMain $@
44 changes: 31 additions & 13 deletions bin/zkEnv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,21 @@
# 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}/..

if [ "x$ZOOCFGDIR" = "x" ]
then
if [ -d "/etc/zookeeper" ]
then
ZOOCFGDIR="/etc/zookeeper"
else
ZOOCFGDIR="$ZOOBINDIR/../conf"
fi
if [ -e "${ZOOKEEPER_PREFIX}/conf" ]; then
ZOOCFGDIR="$ZOOBINDIR/../conf"
else
ZOOCFGDIR="$ZOOBINDIR/../etc/zookeeper"
fi
fi

if [ -f "${ZOOCFGDIR}/zookeeper-env.sh" ]; then
. "${ZOOCFGDIR}/zookeeper-env.sh"
fi

if [ "x$ZOOCFG" = "x" ]
Expand All @@ -39,7 +46,7 @@ fi

ZOOCFG="$ZOOCFGDIR/$ZOOCFG"

if [ -e "$ZOOCFGDIR/java.env" ]
if [ -f "$ZOOCFGDIR/java.env" ]
then
. "$ZOOCFGDIR/java.env"
fi
Expand All @@ -54,6 +61,12 @@ then
ZOO_LOG4J_PROP="INFO,CONSOLE"
fi

if [ "$JAVA_HOME" != "" ]; then
JAVA="$JAVA_HOME/bin/java"
else
JAVA=java
fi

#add the zoocfg dir to classpath
CLASSPATH="$ZOOCFGDIR:$CLASSPATH"

Expand All @@ -62,14 +75,19 @@ do
CLASSPATH="$i:$CLASSPATH"
done

#make it work in the release
for i in "$ZOOBINDIR"/../lib/*.jar
do
#make it work in the binary package
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
done
LIBPATH="${ZOOBINDIR}"/../lib/*.jar
fi

#make it work in the release
for i in "$ZOOBINDIR"/../zookeeper-*.jar
for i in ${LIBPATH}
do
CLASSPATH="$i:$CLASSPATH"
done
Expand Down
Loading

0 comments on commit bf6bee8

Please sign in to comment.