From b79276f637b999e5f914855d1539f7e5d8691ccd Mon Sep 17 00:00:00 2001 From: Teerapatr K <97140774+teerapatrk@users.noreply.github.com> Date: Tue, 20 Jun 2023 15:21:00 +0200 Subject: [PATCH] sys-cluster/zookeeper-bin: Backward release 3.4.13 (#829) --- sys-cluster/zookeeper-bin/Manifest | 1 + .../zookeeper-bin/files/log4j.properties | 58 ++++++++++++++++ .../zookeeper-bin/files/zookeeper.confd | 18 +++++ .../zookeeper-bin/files/zookeeper.initd | 14 ++++ sys-cluster/zookeeper-bin/metadata.xml | 12 ++++ .../zookeeper-bin-3.4.13-r1.ebuild | 69 +++++++++++++++++++ 6 files changed, 172 insertions(+) create mode 100644 sys-cluster/zookeeper-bin/Manifest create mode 100644 sys-cluster/zookeeper-bin/files/log4j.properties create mode 100644 sys-cluster/zookeeper-bin/files/zookeeper.confd create mode 100644 sys-cluster/zookeeper-bin/files/zookeeper.initd create mode 100644 sys-cluster/zookeeper-bin/metadata.xml create mode 100644 sys-cluster/zookeeper-bin/zookeeper-bin-3.4.13-r1.ebuild diff --git a/sys-cluster/zookeeper-bin/Manifest b/sys-cluster/zookeeper-bin/Manifest new file mode 100644 index 00000000..bc25b58e --- /dev/null +++ b/sys-cluster/zookeeper-bin/Manifest @@ -0,0 +1 @@ +DIST zookeeper-3.4.13.tar.gz 37191810 BLAKE2B 994eecf982a19bbf3ae648c5d140746f5836f0f5d8921ed005ebccdedf0098591005b9038eb75fc660b48ae12b09b8db9dd68d3ac3b4ac9f847de214996e1efd SHA512 3481bd19945d80848f81d9dc2896a682ae8b62269b8164ffbae532e55aa4219961403e0208c8e72cf784605eae436d70ddae2b26e0deba0f1f84c74188c32c0a diff --git a/sys-cluster/zookeeper-bin/files/log4j.properties b/sys-cluster/zookeeper-bin/files/log4j.properties new file mode 100644 index 00000000..c462993d --- /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: 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..c6c6f0a6 --- /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..ba66c216 --- /dev/null +++ b/sys-cluster/zookeeper-bin/files/zookeeper.initd @@ -0,0 +1,14 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +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..84864403 --- /dev/null +++ b/sys-cluster/zookeeper-bin/metadata.xml @@ -0,0 +1,12 @@ + + + + + patrick@gentoo.org + Patrick Lauer + + + cluster@gentoo.org + Gentoo Cluster Project + + diff --git a/sys-cluster/zookeeper-bin/zookeeper-bin-3.4.13-r1.ebuild b/sys-cluster/zookeeper-bin/zookeeper-bin-3.4.13-r1.ebuild new file mode 100644 index 00000000..4ce2c076 --- /dev/null +++ b/sys-cluster/zookeeper-bin/zookeeper-bin-3.4.13-r1.ebuild @@ -0,0 +1,69 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit java-utils-2 + +MY_PN="zookeeper" +MY_P="${MY_PN}-${PV}" + +DESCRIPTION="A high-performance coordination service for distributed applications" +HOMEPAGE="https://zookeeper.apache.org/" +SRC_URI="https://archive.apache.org/dist/${MY_PN}/${MY_P}/${MY_P}.tar.gz" +S="${WORKDIR}/${MY_P}" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~x86" +RESTRICT="mirror binchecks" + +BDEPEND=" + acct-group/zookeeper + acct-user/zookeeper +" +RDEPEND=" + ${BDEPEND} + >=virtual/jre-1.7 +" + +INSTALL_DIR=/opt/"${PN}" +export CONFIG_PROTECT="${CONFIG_PROTECT} ${INSTALL_DIR}/conf" + +src_prepare() { + default + rm "${S}"/docs/images/instruction_arrow.png || die + rm "${S}"/docs/skin/images/instruction_arrow.png || die +} + +src_install() { + local DATA_DIR=/var/lib/"${MY_P}" + + # cleanup sources + rm bin/*.cmd || die + + keepdir "${DATA_DIR}" + sed "s:^dataDir=.*:dataDir=${DATA_DIR}:" conf/zoo_sample.cfg > conf/zoo.cfg || die + cp "${FILESDIR}"/log4j.properties conf/ || die + + dodir "${INSTALL_DIR}" + cp -a "${S}"/* "${ED}${INSTALL_DIR}" || die + + # 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}" +}