summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpigfoot <pigfoot@gmail.com>2015-06-03 13:15:17 +0800
committerpigfoot <pigfoot@gmail.com>2015-06-03 13:15:17 +0800
commit000b8f4a94b6ff4d7c2948c9becd48e0637ae07d (patch)
tree8d48031b308e41bef8266be3df0d776a27c90a88
parent Add bat (git and v0.0.2) (diff)
downloadpigfoot-000b8f4a94b6ff4d7c2948c9becd48e0637ae07d.tar.gz
pigfoot-000b8f4a94b6ff4d7c2948c9becd48e0637ae07d.tar.bz2
pigfoot-000b8f4a94b6ff4d7c2948c9becd48e0637ae07d.zip
Add cassandra-bin (v2.1.5)
-rw-r--r--dev-db/cassandra-bin/Manifest3
-rw-r--r--dev-db/cassandra-bin/cassandra-bin-2.1.5.ebuild78
-rw-r--r--dev-db/cassandra-bin/files/init59
3 files changed, 140 insertions, 0 deletions
diff --git a/dev-db/cassandra-bin/Manifest b/dev-db/cassandra-bin/Manifest
new file mode 100644
index 0000000..f5b9da3
--- /dev/null
+++ b/dev-db/cassandra-bin/Manifest
@@ -0,0 +1,3 @@
+AUX init 1211 SHA256 eaae39d2e0c8cd6d40629d1b88ea653a3883a6feee301dc652d5a34f922f23f7 SHA512 f59bf7db63e43bd89ad8f3fec0da7f145515fe518c73e312c7a02b32afd7a9a2f9cb88315a4e9a1395260a8a95eddaad64dd2c293d1eeb8d5f9afe6d5d51791f WHIRLPOOL c53c7ab58018a81beb2a75b36e624472efb337b81a66918ecf4be8e0e473fa5df51efd4e77596dbed47a6df8619ce48b38d5a974f23d6aa16851fdaa6e0a67c9
+DIST apache-cassandra-2.1.5-bin.tar.gz 24282772 SHA256 2d768e2fba9c576289e26247e2ed0b36fb802e06fa0a141783b765d63daf36ff SHA512 a38cd7fcd5d5fa1ea6c9e9ca8506690a198ee7dfa6605a9780dfd3a66c382a540cd811b793a4f21a3799c215d4c4b5e93a75367b4dcdea21e13b7c25344503b9 WHIRLPOOL f74e3d59eafead0ff8c6a8632ee6d8c074286e24df2b2302783d684aa4432c7b3d70a07b404cfb6cf72a69ceef9e81a0b2592407c589b66d9c63ebb47468b52c
+EBUILD cassandra-bin-2.1.5.ebuild 2604 SHA256 d3878cd590fab5589344df6382ab327d3b3519e9655a60aef504858edad514b8 SHA512 d35900294ba12ccc8be744e01daadf34c0a15592f696be4c7b461c316800e62b19bb3e03a7449b431202cbbf27ea3e69878585ca7de6d63bea0690edc1ad25f8 WHIRLPOOL 390c98330b7a5224afaaf9974f772fa934f0eace93d6ad58c1c9f896e4f425e44954bf19f9d9228e2f948b61f3a7c0f89f5e554f8e21593b59fc7803b703d6d6
diff --git a/dev-db/cassandra-bin/cassandra-bin-2.1.5.ebuild b/dev-db/cassandra-bin/cassandra-bin-2.1.5.ebuild
new file mode 100644
index 0000000..e621606
--- /dev/null
+++ b/dev-db/cassandra-bin/cassandra-bin-2.1.5.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+# stolen from: http://data.gpo.zugaina.org/fw-overlay/dev-db/apache-cassandra-bin/
+
+EAPI=5
+
+inherit eutils java-pkg-2 user versionator
+
+DESCRIPTION="A highly scalable second-generation distributed database"
+HOMEPAGE="http://cassandra.apache.org/"
+SRC_URI="mirror://apache/cassandra/${PV}/apache-cassandra-${PV}-bin.tar.gz"
+S="${WORKDIR}/apache-cassandra-${PV}"
+
+LICENSE="Apache-2.0"
+SLOT="$(get_version_component_range 1-2)"
+KEYWORDS="~x86 ~amd64"
+RDEPEND=">=virtual/jre-1.7"
+
+S="${WORKDIR}/apache-cassandra-${PV}"
+INSTALL_DIR="/opt/cassandra-${SLOT}"
+
+pkg_setup() {
+ enewgroup cassandra || die "Could not create group"
+ enewuser cassandra -1 /bin/bash ${INSTALL_DIR} cassandra
+}
+
+src_prepare() {
+ cd "${S}"
+ find . \( -name \*.bat -or -name \*.exe \) -delete
+ rm bin/stop-server
+}
+
+src_install() {
+ insinto ${INSTALL_DIR}
+
+ sed -e "s|/var/lib/cassandra|/var/lib/cassandra/${SLOT}|g" \
+ -i conf/cassandra.yaml || die
+
+ sed -e "s|cassandra_storagedir=\"\$CASSANDRA_HOME/data\"|cassandra_storagedir=\"/var/lib/cassandra/${SLOT}\"|g" \
+ -i bin/cassandra.in.sh || die
+
+ doins -r bin conf interface lib pylib tools
+
+ for i in bin/* ; do
+ if [[ $i == *.in.sh ]]; then
+ continue
+ fi
+ fperms 755 ${INSTALL_DIR}/${i}
+ make_wrapper "$(basename ${i})-${SLOT}" "${INSTALL_DIR}/${i}"
+ done
+
+ keepdir /var/lib/cassandra/${SLOT}
+ fowners -R cassandra:cassandra ${INSTALL_DIR}
+ fowners -R cassandra:cassandra /var/lib/cassandra
+
+ sed "s/{SLOT}/${SLOT}/g" "${FILESDIR}/init" > "${T}/init" || die
+ newinitd "${T}/init" cassandra-${SLOT}
+
+ echo "CONFIG_PROTECT=\"${INSTALL_DIR}/conf\"" > "${T}/25cassandra-${SLOT}" || die
+ doenvd "${T}/25cassandra-${SLOT}"
+}
+
+pkg_postinst() {
+
+ elog "Cassandra's configuration:"
+ elog " * Run-time: /etc/cassandra/"
+ elog " * Start-up: /etc/conf.d/cassandra"
+
+ elog "Cassandra works best when the commitlog directory and the data directory are on different disks"
+ elog "The default configuration sets them to /var/lib/cassandra/commitlog and /var/lib/cassandra/data respectively"
+ elog "You may wish to change those to different mount points"
+
+ ewarn "You should start/stop cassandra via /etc/init.d/cassandra, as this will properly switch to the cassandra:cassandra user group"
+ ewarn "Starting cassandra via its default 'cassandra' shell command, as root, may cause permission problems later on when started as the cassandra user"
+
+}
diff --git a/dev-db/cassandra-bin/files/init b/dev-db/cassandra-bin/files/init
new file mode 100644
index 0000000..905d603
--- /dev/null
+++ b/dev-db/cassandra-bin/files/init
@@ -0,0 +1,59 @@
+#!/sbin/runscript
+
+NAME=cassandra-{SLOT}
+DESC="Cassandra v{SLOT}"
+PIDFILE=/var/run/$NAME/$NAME.pid
+
+_CASSANDRA_DIR="/opt/${NAME}"
+
+DAEMON=${_CASSANDRA_DIR}/bin/cassandra
+DAEMON_OPTS="-p $PIDFILE"
+USER="cassandra"
+
+. ${_CASSANDRA_DIR}/conf/cassandra-env.sh
+
+start() {
+ ebegin "Starting ${DESC}"
+ [ -e `dirname "$PIDFILE"` ] || \
+ install -d -ocassandra -gcassandra -m750 `dirname $PIDFILE`
+
+ start-stop-daemon \
+ --start \
+ --user $USER \
+ --exec $DAEMON \
+ --quiet \
+ --pidfile $PIDFILE \
+ --test >/dev/null || eend 1
+
+ start-stop-daemon \
+ --start \
+ --user $USER \
+ --exec $DAEMON \
+ --background \
+ --pidfile "$PIDFILE" \
+ -- $DAEMON_OPTS >/dev/null
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${DESC}"
+ start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
+ eend $?
+}
+
+restart() {
+ ebegin "Restarting cassandra"
+ start-stop-daemon \
+ --stop \
+ --quiet \
+ --oknodo \
+ --retry TERM/30/KILL/5 > /dev/null || eend 1
+ start-stop-daemon \
+ --start \
+ --quiet \
+ --pidfile $PIDFILE \
+ --chuid $USER \
+ --exec $DAEMON \
+ -- $DAEMON_OPTS > /dev/null
+ eend $?
+}