diff options
author | Tony Vroon <chainsaw@gentoo.org> | 2016-11-14 14:21:26 +0000 |
---|---|---|
committer | Tony Vroon <chainsaw@gentoo.org> | 2016-11-14 14:22:23 +0000 |
commit | b3d68487e1569d50014d8c029efd3c6a861783b1 (patch) | |
tree | 564f1e676c391c97a448fd47326610ef08482399 /app-admin | |
parent | dev-ros/mavros: remove old (diff) | |
download | gentoo-b3d68487e1569d50014d8c029efd3c6a861783b1.tar.gz gentoo-b3d68487e1569d50014d8c029efd3c6a861783b1.tar.bz2 gentoo-b3d68487e1569d50014d8c029efd3c6a861783b1.zip |
app-admin/graylog2: New addition. Original ebuild by Guillaume Ceccarelli with some minor changes by me. Reviewed by dwfreed, iamben & K_F in #gentoo-dev.
Diffstat (limited to 'app-admin')
-rw-r--r-- | app-admin/graylog2/Manifest | 1 | ||||
-rw-r--r-- | app-admin/graylog2/files/confd | 7 | ||||
-rw-r--r-- | app-admin/graylog2/files/initd | 55 | ||||
-rw-r--r-- | app-admin/graylog2/graylog2-2.1.2.ebuild | 68 |
4 files changed, 131 insertions, 0 deletions
diff --git a/app-admin/graylog2/Manifest b/app-admin/graylog2/Manifest new file mode 100644 index 000000000000..b55dc5e59304 --- /dev/null +++ b/app-admin/graylog2/Manifest @@ -0,0 +1 @@ +DIST graylog-2.1.2.tgz 94284738 SHA256 5d653467fb18fdd58b261598dc820f90d48e2018e7cd8d9f103003a0070d954b SHA512 df636143ff90b0aedcb6db78e20125c10da2428b6e474e925d6fc011fdc3a0b88414ec914981a71a0e08c4916cb5cd18a8eeda28e01d9edf3b3ae4a8fb0a90dc WHIRLPOOL 1ecdb53b0ea0ad55c76604417366f21e6e2c4fb76e1cd38b93d332e08976380096b340bee6120ed2a40949ac31620e37f4ac46f3794805d0313d74211b48c512 diff --git a/app-admin/graylog2/files/confd b/app-admin/graylog2/files/confd new file mode 100644 index 000000000000..58291368f353 --- /dev/null +++ b/app-admin/graylog2/files/confd @@ -0,0 +1,7 @@ +GRAYLOG_CONFIG_FILE="/etc/graylog2/graylog.conf" +GRAYLOG_GROUP="graylog" +GRAYLOG_LOG_DIR="/var/log/graylog2" +GRAYLOG_USER="graylog" +GRAYLOG_OPTIONS="" +GRAYLOG_PID_FILE="/run/graylog2/graylog.pid" +JAVA_OPTS="-Xms1g -Xmx1g -XX:NewRatio=1 -server -XX:+ResizeTLAB -XX:+UseConcMarkSweepGC -XX:+CMSConcurrentMTEnabled -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC -XX:-OmitStackTraceInFastThrow" diff --git a/app-admin/graylog2/files/initd b/app-admin/graylog2/files/initd new file mode 100644 index 000000000000..1a1f562bcbb3 --- /dev/null +++ b/app-admin/graylog2/files/initd @@ -0,0 +1,55 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +export JAVA_HOME=`java-config --jre-home` + +checkconfig() { + if [ ! -r "${GRAYLOG_CONFIG_FILE}" ]; then + eerror "GRAYLOG_CONFIG_FILE doesn't point to a readable config file" + fi +} + +depend() { + need net +} + +start() { + checkconfig || return 1 + + [ -e `dirname "$GRAYLOG_PID_FILE"` ] || \ + install -d -o${GRAYLOG_USER} -g${GRAYLOG_GROUP} -m750 `dirname "$GRAYLOG_PID_FILE"` + + [ -e "$GRAYLOG_LOG_DIR" ] || \ + install -d -o${GRAYLOG_USER} -g${GRAYLOG_GROUP} -m750 "$GRAYLOG_LOG_DIR" + + CLASSPATH="$(java-config -r)" + CLASSPATH="${CLASSPATH}:$(java-config -d --classpath sigar)" + + ebegin "Starting Graylog" + + start-stop-daemon \ + --start \ + --exec "${JAVA_HOME}/bin/java" \ + --user ${GRAYLOG_USER} \ + --group ${GRAYLOG_GROUP} \ + --env CLASSPATH="${CLASSPATH}" \ + --background \ + --chdir /usr/share/graylog2 \ + --stdout ${GRAYLOG_LOG_DIR}/graylog.stdout.log \ + --stderr ${GRAYLOG_LOG_DIR}/graylog.stderr.log \ + -- ${JAVA_OPTS} -Djava.library.path=`java-config --lib sigar` -classpath "${CLASSPATH}" -jar /usr/share/graylog2/graylog.jar server -f "${GRAYLOG_CONFIG_FILE}" -p "${GRAYLOG_PID_FILE}" ${GRAYLOG_OPTIONS} + + eend $? +} + +stop() { + ebegin "Stopping Graylog" + + start-stop-daemon \ + --stop \ + --pidfile "${GRAYLOG_PID_FILE}" + + eend $? +} diff --git a/app-admin/graylog2/graylog2-2.1.2.ebuild b/app-admin/graylog2/graylog2-2.1.2.ebuild new file mode 100644 index 000000000000..86ac3f8f19ef --- /dev/null +++ b/app-admin/graylog2/graylog2-2.1.2.ebuild @@ -0,0 +1,68 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +inherit user + +DESCRIPTION="Free and open source log management" +HOMEPAGE="https://graylog.org" +SRC_URI="https://packages.graylog2.org/releases/graylog/graylog-${PV}.tgz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~ppc64 ~x86" +IUSE="" + +MY_PN="graylog" +S="${WORKDIR}/${MY_PN}-${PV}" + +QA_PREBUILT="/usr/share/graylog2/lib/sigar/libsigar*" +RESTRICT="strip" + +DEPEND="" +RDEPEND="virtual/jdk:1.8" + +INSTALL_DIR="/usr/share/graylog2" + +pkg_setup() { + enewgroup graylog + enewuser graylog -1 -1 -1 graylog +} + +src_prepare() { + default + # graylogctl is replaced by our own initd + rm -r "${S}/bin" + # Stick to architecture of build host + if ! use amd64; then + rm -r "${S}"/lib/sigar/libsigar-amd64-*.so || die "Failed in removing AMD64 support libraries" + fi + if ! use ppc64; then + rm -r "${S}"/lib/sigar/libsigar-ppc64-*.so || die "Failed in removing PPC64 support libraries" + fi + if ! use x86; then + rm -r "${S}"/lib/sigar/libsigar-x86-*.so || die "Failed in removing X86 support libraries" + fi + # Currently unsupported platforms + # QA warning galore but testing/patches welcome + rm -r "${S}"/lib/sigar/libsigar-ia64-*.so || die "Failed in removing IA64 support libraries" + rm -r "${S}"/lib/sigar/libsigar-ppc-*.so || die "Failed in removing PPC support libraries" + rm -r "${S}"/lib/sigar/libsigar-*-freebsd-*.so || die "Failed in removing FreeBSD support libraries" + rm -r "${S}"/lib/sigar/libsigar-pa-*.sl || die "Failed in removing HPPA support libraries" + rm -r "${S}"/lib/sigar/libsigar-*-solaris.so || die "Failed in removing Solaris support libraries" +} + +src_compile() { + einfo "Nothing to compile; upstream supplies JAR only" +} + +src_install() { + insinto /etc/graylog2 + doins graylog.conf.example + insinto "${INSTALL_DIR}" + doins * + newinitd "${FILESDIR}/initd" graylog2 + newconfd "${FILESDIR}/confd" graylog2 +} |