Permalink
Browse files

add zookeeper

  • Loading branch information...
1 parent 152d7b7 commit 3b8371f76d7e6371d3463a1fadca870964ff3399 @roowe roowe committed Aug 17, 2012
@@ -0,0 +1 @@
+DIST zookeeper-3.3.6.tar.gz 11833706 RMD160 6f72d4bd19059357468589320026de4a0da687c9 SHA1 ea119527974f202c70e463eab28c7a8eeb68bf57 SHA256 eb311ec0479a9447d075a20350ecfc5cf6a2a6d9842d13b59d7548430ac37521
@@ -0,0 +1,71 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit eutils java-utils-2
+
+MY_PN="${PN/apache-/}"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="ZooKeeper is a high-performance coordination service for
+distributed applications."
+HOMEPAGE="http://hadoop.apache.org/"
+SRC_URI="mirror://apache/${MY_PN}/${MY_P}/${MY_P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+RESTRICT="mirror binchecks"
+IUSE=""
+
+DEPEND=""
+RDEPEND=">=virtual/jre-1.6"
+
+S="${WORKDIR}/${MY_P}"
+INSTALL_DIR=/opt/"${PN}"
+DATA_DIR=/var/db/"${PN}"
+export CONFIG_PROTECT="${CONFIG_PROTECT} ${INSTALL_DIR}/conf"
+
+src_install() {
+ dodir "${DATA_DIR}"
+ sed "s:^dataDir=.*:dataDir=${DATA_DIR}:" conf/zoo_sample.cfg > conf/zoo.cfg || die "sed failed"
+
+ dodir "${INSTALL_DIR}"
+ mv "${S}"/* "${D}${INSTALL_DIR}" || die "install failed"
+
+ # env file
+ cat > 99"${PN}" <<-EOF
+ PATH=${INSTALL_DIR}/bin
+ CONFIG_PROTECT=${INSTALL_DIR}/conf
+ EOF
+ doenvd 99"${PN}" || die "doenvd failed"
+
+ cat > "${PN}" <<-EOF
+ #!/sbin/runscript
+
+ opts="start stop restart"
+
+ start() {
+ ${INSTALL_DIR}/bin/zkServer.sh start > /dev/null
+ }
+
+ stop() {
+ ${INSTALL_DIR}/bin/zkServer.sh stop
+ }
+
+ restart() {
+ ${INSTALL_DIR}/bin/zkServer.sh restart > /dev/null
+ }
+
+ status() {
+ ${INSTALL_DIR}/bin/zkServer.sh status
+ }
+ EOF
+ doinitd "${PN}" || die "doinitd failed"
+}
+
+pkg_postinst() {
+ elog "For info on configuration see http://hadoop.apache.org/${MY_PN}/docs/r${PV}"
+}

0 comments on commit 3b8371f

Please sign in to comment.