Permalink
Browse files

ZOOKEEPER-999. Create an package integration project

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1163014 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
phunt committed Aug 29, 2011
1 parent 684b229 commit 02e2ef341dd145ba5d6ab434a5f31c9eb6393579
View
@@ -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
View
@@ -25,16 +25,16 @@
# 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 "^[[:space:]]*dataDir=" "$ZOOCFG" | sed -e 's/.*=//')
ZOODATALOGDIR=$(grep "^[[:space:]]*dataLogDir=" "$ZOOCFG" | sed -e 's/.*=//')
View
@@ -25,16 +25,16 @@
# 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" $CLIENT_JVMFLAGS $JVMFLAGS \
View
@@ -22,9 +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 [ -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" ]
@@ -64,13 +76,13 @@ do
done
#make it work in the release
-for i in "$ZOOBINDIR"/../lib/*.jar
-do
- CLASSPATH="$i:$CLASSPATH"
-done
+if [ -d ${ZOOKEEPER_PREFIX}/share/zookeeper ]; then
+ LIBPATH="${ZOOKEEPER_PREFIX}"/share/zookeeper/*.jar
+else
+ 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
View
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
@@ -42,16 +42,16 @@ else
ZOOMAIN="org.apache.zookeeper.server.quorum.QuorumPeerMain"
fi
-# Only follow symlinks if readlink supports it
-if readlink "$0" > /dev/null 2>&1
-then
- ZOOBIN=`readlink "$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
if [ "x$SERVER_JVMFLAGS" ]
then
Oops, something went wrong.

0 comments on commit 02e2ef3

Please sign in to comment.