public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-cluster/zookeeper-bin/files/, sys-cluster/zookeeper-bin/
@ 2016-09-26 12:15 Patrick Lauer
  0 siblings, 0 replies; only message in thread
From: Patrick Lauer @ 2016-09-26 12:15 UTC (permalink / raw
  To: gentoo-commits

commit:     bb99eceeb46b154b21dfb82c5e5d8fb6b0de9c4c
Author:     Patrick Lauer <patrick <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 26 12:05:42 2016 +0000
Commit:     Patrick Lauer <patrick <AT> gentoo <DOT> org>
CommitDate: Mon Sep 26 12:14:49 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bb99ecee

sys-cluster/zookeeper-bin: Initial import.

Based on ebuilds by Ultrabug, with modifications tested in the adjust overlay.

Package-Manager: portage-2.3.0

 sys-cluster/zookeeper-bin/Manifest                 |  1 +
 sys-cluster/zookeeper-bin/files/log4j.properties   | 58 ++++++++++++++
 sys-cluster/zookeeper-bin/files/zookeeper.confd    | 18 +++++
 sys-cluster/zookeeper-bin/files/zookeeper.initd    | 15 ++++
 sys-cluster/zookeeper-bin/metadata.xml             | 12 +++
 .../zookeeper-bin/zookeeper-bin-3.4.9.ebuild       | 91 ++++++++++++++++++++++
 6 files changed, 195 insertions(+)

diff --git a/sys-cluster/zookeeper-bin/Manifest b/sys-cluster/zookeeper-bin/Manifest
new file mode 100644
index 00000000..4e4a436
--- /dev/null
+++ b/sys-cluster/zookeeper-bin/Manifest
@@ -0,0 +1 @@
+DIST zookeeper-3.4.9.tar.gz 22724574 SHA256 e7f340412a61c7934b5143faef8d13529b29242ebfba2eba48169f4a8392f535 SHA512 4f3e003c6ce5e3338f642f7deaa0fd2cfd1b30591d3ed4fe880492dded6c4bf01d30483e28f3a38b43bb6d2696ff4d819fc9577733224cec07e236437e88a657 WHIRLPOOL 9e879b335156adf5fcb46e1ddb5e76a061338862cdd14b4cd85dffac4a3343ff21d84ac24b31b232b52426d756bc17734448591cbd13b556c59664b42a8a298a

diff --git a/sys-cluster/zookeeper-bin/files/log4j.properties b/sys-cluster/zookeeper-bin/files/log4j.properties
new file mode 100644
index 00000000..c462993
--- /dev/null
+++ b/sys-cluster/zookeeper-bin/files/log4j.properties
@@ -0,0 +1,58 @@
+# Define some default values that can be overridden by system properties
+zookeeper.root.logger=INFO, CONSOLE
+zookeeper.console.threshold=INFO
+zookeeper.log.dir=/var/log/zookeeper/
+zookeeper.log.file=zookeeper.log
+zookeeper.log.threshold=DEBUG
+zookeeper.tracelog.dir=/var/log/zookeeper/
+zookeeper.tracelog.file=zookeeper_trace.log
+
+#
+# ZooKeeper Logging Configuration
+#
+
+# Format is "<default threshold> (, <appender>)+
+
+# DEFAULT: console appender only
+#log4j.rootLogger=${zookeeper.root.logger}
+
+# Example with rolling log file
+log4j.rootLogger=CONSOLE, ROLLINGFILE
+
+# Example with rolling log file and tracing
+#log4j.rootLogger=TRACE, CONSOLE, ROLLINGFILE, TRACEFILE
+
+#
+# Log INFO level and above messages to the console
+#
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Threshold=${zookeeper.console.threshold}
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n
+
+#
+# Add ROLLINGFILE to rootLogger to get log file output
+#    Log DEBUG level and above messages to a log file
+log4j.appender.ROLLINGFILE=org.apache.log4j.RollingFileAppender
+log4j.appender.ROLLINGFILE.Threshold=${zookeeper.log.threshold}
+log4j.appender.ROLLINGFILE.File=${zookeeper.log.dir}/${zookeeper.log.file}
+
+# Max log file size of 256MB
+log4j.appender.ROLLINGFILE.MaxFileSize=256MB
+# uncomment the next line to limit number of backup files
+log4j.appender.ROLLINGFILE.MaxBackupIndex=10
+
+log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n
+
+
+#
+# Add TRACEFILE to rootLogger to get log file output
+#    Log DEBUG level and above messages to a log file
+log4j.appender.TRACEFILE=org.apache.log4j.FileAppender
+log4j.appender.TRACEFILE.Threshold=TRACE
+log4j.appender.TRACEFILE.File=${zookeeper.tracelog.dir}/${zookeeper.tracelog.file}
+
+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

diff --git a/sys-cluster/zookeeper-bin/files/zookeeper.confd b/sys-cluster/zookeeper-bin/files/zookeeper.confd
new file mode 100644
index 00000000..c6c6f0a
--- /dev/null
+++ b/sys-cluster/zookeeper-bin/files/zookeeper.confd
@@ -0,0 +1,18 @@
+# JVM options
+JVM_OPTS=""
+
+# zookeeper files
+MAIN="org.apache.zookeeper.server.quorum.QuorumPeerMain"
+CONFIG="/opt/zookeeper-bin/conf/zoo.cfg"
+
+# build the classpath
+INSTALL_DIR=/opt/zookeeper-bin
+CLASSPATH="${INSTALL_DIR}/conf:${CLASSPATH}"
+
+for i in ${INSTALL_DIR}/zookeeper-*.jar; do
+	CLASSPATH="${i}:${CLASSPATH}"
+done
+
+for i in ${INSTALL_DIR}/lib/*.jar; do
+	CLASSPATH="${i}:${CLASSPATH}"
+done

diff --git a/sys-cluster/zookeeper-bin/files/zookeeper.initd b/sys-cluster/zookeeper-bin/files/zookeeper.initd
new file mode 100644
index 00000000..a760ce7
--- /dev/null
+++ b/sys-cluster/zookeeper-bin/files/zookeeper.initd
@@ -0,0 +1,15 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+name="zookeeper"
+command="/usr/bin/java"
+command_args="${JVM_OPTS} -cp ${CLASSPATH} ${MAIN} ${CONFIG}"
+command_background="true"
+start_stop_daemon_args="--user zookeeper --group zookeeper"
+pidfile="/var/run/zookeeper.pid"
+
+depend() {
+	need net
+}

diff --git a/sys-cluster/zookeeper-bin/metadata.xml b/sys-cluster/zookeeper-bin/metadata.xml
new file mode 100644
index 00000000..56c47e9
--- /dev/null
+++ b/sys-cluster/zookeeper-bin/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person">
+    <email>patrick@gentoo.org</email>
+    <name>Patrick Lauer</name>
+  </maintainer>
+  <maintainer type="project">
+    <email>cluster@gentoo.org</email>
+    <name>Gentoo Cluster Project</name>
+  </maintainer>
+</pkgmetadata>

diff --git a/sys-cluster/zookeeper-bin/zookeeper-bin-3.4.9.ebuild b/sys-cluster/zookeeper-bin/zookeeper-bin-3.4.9.ebuild
new file mode 100644
index 00000000..6c481e5
--- /dev/null
+++ b/sys-cluster/zookeeper-bin/zookeeper-bin-3.4.9.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1 eutils java-utils-2 user
+
+MY_P="zookeeper"
+MY_PN=${MY_P}-${PV}
+
+DESCRIPTION="A high-performance coordination service for distributed applications."
+HOMEPAGE="http://zookeeper.apache.org/"
+SRC_URI="mirror://apache/${MY_P}/${MY_PN}/${MY_PN}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+RESTRICT="mirror binchecks"
+IUSE=""
+
+DEPEND=""
+RDEPEND=">=virtual/jre-1.7"
+
+S=${WORKDIR}/${MY_PN}
+
+INSTALL_DIR=/opt/${PN}
+export CONFIG_PROTECT="${CONFIG_PROTECT} ${INSTALL_DIR}/conf"
+
+pkg_setup() {
+	enewgroup zookeeper
+	enewuser zookeeper -1 /bin/sh /var/lib/zookeeper zookeeper
+}
+
+src_prepare() {
+	# python
+	sed -e "s|src/c/zookeeper.c|zookeeper.c|g" \
+		-e "s|../../../|${S}|g" \
+		-i contrib/zkpython/src/python/setup.py || die
+}
+
+src_configure() {
+	cd "${S}"/src/c || die
+	econf
+}
+
+src_compile() {
+	cd "${S}"/src/c || die
+	emake
+}
+
+src_install() {
+	local DATA_DIR=/var/lib/${MY_P}
+
+	# python
+	cd "${S}"/contrib/zkpython/ || die
+	mv src/python/setup.py .
+	mv src/c/* .
+	python_foreach_impl distutils-r1_src_install
+	cd "${S}" || die
+
+	# cleanup sources
+	rm -rf src/ || die
+	rm bin/*.cmd || die
+
+	keepdir "${DATA_DIR}"
+	sed "s:^dataDir=.*:dataDir=${DATA_DIR}:" conf/zoo_sample.cfg > conf/zoo.cfg || die "sed failed"
+	cp "${FILESDIR}"/log4j.properties conf/ || die "cp log4j conf failed"
+
+	dodir "${INSTALL_DIR}"
+	cp -a "${S}"/* "${D}${INSTALL_DIR}" || die "install failed"
+
+	# data dir perms
+	fowners zookeeper:zookeeper "${DATA_DIR}"
+
+	# log dir
+	keepdir /var/log/zookeeper
+	fowners zookeeper:zookeeper /var/log/zookeeper
+
+	# init script
+	newinitd "${FILESDIR}"/zookeeper.initd zookeeper
+	newconfd "${FILESDIR}"/zookeeper.confd zookeeper
+
+	# env file
+	cat > 99"${PN}" <<-EOF
+		PATH=${INSTALL_DIR}/bin
+		CONFIG_PROTECT=${INSTALL_DIR}/conf
+	EOF
+	doenvd 99"${PN}" || die "doenvd failed"
+}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-09-26 12:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-26 12:15 [gentoo-commits] repo/gentoo:master commit in: sys-cluster/zookeeper-bin/files/, sys-cluster/zookeeper-bin/ Patrick Lauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox