From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BBBA1138334 for ; Wed, 11 Jul 2018 10:27:05 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B2A7BE07D3; Wed, 11 Jul 2018 10:27:04 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6CED6E07D3 for ; Wed, 11 Jul 2018 10:27:04 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 77AA1335CB2 for ; Wed, 11 Jul 2018 10:27:01 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D71C435A for ; Wed, 11 Jul 2018 10:26:59 +0000 (UTC) From: "Tony Vroon" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Tony Vroon" Message-ID: <1531304816.c7cf6fb8f2be88a7efbae4c195759de12ce361a9.chainsaw@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/graylog2/files/, app-admin/graylog2/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-admin/graylog2/files/confd-r2 app-admin/graylog2/files/initd-r2 app-admin/graylog2/graylog2-2.4.5-r1.ebuild X-VCS-Directories: app-admin/graylog2/files/ app-admin/graylog2/ X-VCS-Committer: chainsaw X-VCS-Committer-Name: Tony Vroon X-VCS-Revision: c7cf6fb8f2be88a7efbae4c195759de12ce361a9 X-VCS-Branch: master Date: Wed, 11 Jul 2018 10:26:59 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: ad3e4bda-07d9-471a-9147-b08d34744cbd X-Archives-Hash: 84a27109bbd0fd97a1f07cec89d13024 commit: c7cf6fb8f2be88a7efbae4c195759de12ce361a9 Author: Tomas Mozes gmail com> AuthorDate: Mon Jun 11 06:17:09 2018 +0000 Commit: Tony Vroon gentoo org> CommitDate: Wed Jul 11 10:26:56 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c7cf6fb8 app-admin/graylog2: improve ebuild Package-Manager: Portage-2.3.40, Repoman-2.3.9 Closes: https://github.com/gentoo/gentoo/pull/9170 app-admin/graylog2/files/confd-r2 | 12 ++++ app-admin/graylog2/files/initd-r2 | 31 ++++++++++ app-admin/graylog2/graylog2-2.4.5-r1.ebuild | 87 +++++++++++++++++++++++++++++ 3 files changed, 130 insertions(+) diff --git a/app-admin/graylog2/files/confd-r2 b/app-admin/graylog2/files/confd-r2 new file mode 100644 index 00000000000..97eac6ac77f --- /dev/null +++ b/app-admin/graylog2/files/confd-r2 @@ -0,0 +1,12 @@ +GRAYLOG_CONFIG_FILE="/etc/graylog2/graylog.conf" +GRAYLOG_DATA_DIR="/var/lib/graylog2" +GRAYLOG_GROUP="graylog" +GRAYLOG_INSTALL_DIR="/usr/share/graylog2" +GRAYLOG_LOG_DIR="/var/log/graylog2" +GRAYLOG_OPTIONS="" +GRAYLOG_USER="graylog" + +JAVA_OPTS="-Djava.library.path=$GRAYLOG_INSTALL_DIR/lib/sigar -Xms1g -Xmx1g -XX:NewRatio=1 -server -XX:+ResizeTLAB -XX:+UseConcMarkSweepGC -XX:+CMSConcurrentMTEnabled -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC -XX:-OmitStackTraceInFastThrow" + +# Please adjust according to your bind address +rc_need="net.lo" diff --git a/app-admin/graylog2/files/initd-r2 b/app-admin/graylog2/files/initd-r2 new file mode 100644 index 00000000000..c6177eef41d --- /dev/null +++ b/app-admin/graylog2/files/initd-r2 @@ -0,0 +1,31 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +command="/usr/bin/java" +command_args="${JAVA_OPTS} -jar ${GRAYLOG_INSTALL_DIR}/graylog.jar server -f ${GRAYLOG_CONFIG_FILE} --no-pid-file ${GRAYLOG_OPTIONS}" +command_background="true" +command_user="${GRAYLOG_USER}:${GRAYLOG_GROUP}" +pidfile="/run/${RC_SVCNAME}.pid" + +output_log="${GRAYLOG_LOG_DIR}/graylog.stdout.log" +error_log="${GRAYLOG_LOG_DIR}/graylog.stderr.log" +directory="${GRAYLOG_INSTALL_DIR}" +required_files="${GRAYLOG_CONFIG_FILE}" + +depend() { + use dns +} + +start_pre() { + local d + for d in \ + "${GRAYLOG_DATA_DIR}" \ + "${GRAYLOG_DATA_DIR}/data" \ + "${GRAYLOG_DATA_DIR}/data/contentpacks" \ + "${GRAYLOG_DATA_DIR}/data/journal" \ + "${GRAYLOG_LOG_DIR}"; do + + checkpath -d -o "${GRAYLOG_USER}":"${GRAYLOG_GROUP}" -m750 "${d}" + done +} diff --git a/app-admin/graylog2/graylog2-2.4.5-r1.ebuild b/app-admin/graylog2/graylog2-2.4.5-r1.ebuild new file mode 100644 index 00000000000..91ea75e61cb --- /dev/null +++ b/app-admin/graylog2/graylog2-2.4.5-r1.ebuild @@ -0,0 +1,87 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +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" +RESTRICT="strip" + +RDEPEND="virtual/jdk:1.8" + +DOCS=( + COPYING README.markdown UPGRADING.rst +) + +GRAYLOG_DATA_DIR="/var/lib/graylog2" +GRAYLOG_INSTALL_DIR="/usr/share/graylog2" +QA_PREBUILT="${GRAYLOG_INSTALL_DIR}/lib/sigar/libsigar*" + +S="${WORKDIR}/graylog-${PV}" + +pkg_setup() { + enewgroup graylog + enewuser graylog -1 -1 -1 graylog +} + +src_prepare() { + default + + # Stick to architecture of build host + if ! use amd64; then + rm -r lib/sigar/libsigar-amd64-*.so || die "Failed in removing AMD64 support libraries" + fi + if ! use ppc64; then + rm -r lib/sigar/libsigar-ppc64-*.so || die "Failed in removing PPC64 support libraries" + fi + if ! use x86; then + rm -r lib/sigar/libsigar-x86-*.so || die "Failed in removing X86 support libraries" + fi + # Currently unsupported platforms + # QA warning galore but testing/patches welcome + rm lib/sigar/libsigar-*freebsd*so \ + lib/sigar/libsigar-*solaris*so \ + lib/sigar/libsigar-*hpux*.sl \ + lib/sigar/libsigar-*macosx*.dylib \ + lib/sigar/libsigar-ia64-*.so \ + lib/sigar/libsigar-ppc-*.so \ + lib/sigar/libsigar-s390x*.so \ + lib/sigar/*winnt* || die "Failed in removing unsupported platform libraries" + + # gentoo specific paths + sed -i "s@\(node_id_file = \).*@\1${GRAYLOG_DATA_DIR}/node-id@g; \ + s@\(message_journal_dir = \).*@\1${GRAYLOG_DATA_DIR}/data/journal@g; \ + s@#\(content_packs_dir = \).*@\1${GRAYLOG_DATA_DIR}/data/contentpacks@g" \ + graylog.conf.example || die +} + +src_install() { + default + + insinto /etc/graylog2 + doins graylog.conf.example + + insinto "${GRAYLOG_DATA_DIR}/data/contentpacks" + doins data/contentpacks/grok-patterns.json + + insinto "${GRAYLOG_INSTALL_DIR}" + doins graylog.jar + doins -r lib plugin + + newconfd "${FILESDIR}/confd-r2" graylog2 + newinitd "${FILESDIR}/initd-r2" graylog2 +} + +pkg_postinst() { + ewarn "Graylog does not depend on need.net any more (#439092)." + ewarn + ewarn "Please configure rc_need according to your binding address in:" + ewarn "/etc/conf.d/graylog2" +}