Gentoo Archives: gentoo-commits

From: Tony Vroon <chainsaw@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/graylog2/files/, app-admin/graylog2/
Date: Wed, 11 Jul 2018 10:27:05
Message-Id: 1531304816.c7cf6fb8f2be88a7efbae4c195759de12ce361a9.chainsaw@gentoo
1 commit: c7cf6fb8f2be88a7efbae4c195759de12ce361a9
2 Author: Tomas Mozes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Mon Jun 11 06:17:09 2018 +0000
4 Commit: Tony Vroon <chainsaw <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 11 10:26:56 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c7cf6fb8
7
8 app-admin/graylog2: improve ebuild
9
10 Package-Manager: Portage-2.3.40, Repoman-2.3.9
11 Closes: https://github.com/gentoo/gentoo/pull/9170
12
13 app-admin/graylog2/files/confd-r2 | 12 ++++
14 app-admin/graylog2/files/initd-r2 | 31 ++++++++++
15 app-admin/graylog2/graylog2-2.4.5-r1.ebuild | 87 +++++++++++++++++++++++++++++
16 3 files changed, 130 insertions(+)
17
18 diff --git a/app-admin/graylog2/files/confd-r2 b/app-admin/graylog2/files/confd-r2
19 new file mode 100644
20 index 00000000000..97eac6ac77f
21 --- /dev/null
22 +++ b/app-admin/graylog2/files/confd-r2
23 @@ -0,0 +1,12 @@
24 +GRAYLOG_CONFIG_FILE="/etc/graylog2/graylog.conf"
25 +GRAYLOG_DATA_DIR="/var/lib/graylog2"
26 +GRAYLOG_GROUP="graylog"
27 +GRAYLOG_INSTALL_DIR="/usr/share/graylog2"
28 +GRAYLOG_LOG_DIR="/var/log/graylog2"
29 +GRAYLOG_OPTIONS=""
30 +GRAYLOG_USER="graylog"
31 +
32 +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"
33 +
34 +# Please adjust according to your bind address
35 +rc_need="net.lo"
36
37 diff --git a/app-admin/graylog2/files/initd-r2 b/app-admin/graylog2/files/initd-r2
38 new file mode 100644
39 index 00000000000..c6177eef41d
40 --- /dev/null
41 +++ b/app-admin/graylog2/files/initd-r2
42 @@ -0,0 +1,31 @@
43 +#!/sbin/openrc-run
44 +# Copyright 1999-2018 Gentoo Foundation
45 +# Distributed under the terms of the GNU General Public License v2
46 +
47 +command="/usr/bin/java"
48 +command_args="${JAVA_OPTS} -jar ${GRAYLOG_INSTALL_DIR}/graylog.jar server -f ${GRAYLOG_CONFIG_FILE} --no-pid-file ${GRAYLOG_OPTIONS}"
49 +command_background="true"
50 +command_user="${GRAYLOG_USER}:${GRAYLOG_GROUP}"
51 +pidfile="/run/${RC_SVCNAME}.pid"
52 +
53 +output_log="${GRAYLOG_LOG_DIR}/graylog.stdout.log"
54 +error_log="${GRAYLOG_LOG_DIR}/graylog.stderr.log"
55 +directory="${GRAYLOG_INSTALL_DIR}"
56 +required_files="${GRAYLOG_CONFIG_FILE}"
57 +
58 +depend() {
59 + use dns
60 +}
61 +
62 +start_pre() {
63 + local d
64 + for d in \
65 + "${GRAYLOG_DATA_DIR}" \
66 + "${GRAYLOG_DATA_DIR}/data" \
67 + "${GRAYLOG_DATA_DIR}/data/contentpacks" \
68 + "${GRAYLOG_DATA_DIR}/data/journal" \
69 + "${GRAYLOG_LOG_DIR}"; do
70 +
71 + checkpath -d -o "${GRAYLOG_USER}":"${GRAYLOG_GROUP}" -m750 "${d}"
72 + done
73 +}
74
75 diff --git a/app-admin/graylog2/graylog2-2.4.5-r1.ebuild b/app-admin/graylog2/graylog2-2.4.5-r1.ebuild
76 new file mode 100644
77 index 00000000000..91ea75e61cb
78 --- /dev/null
79 +++ b/app-admin/graylog2/graylog2-2.4.5-r1.ebuild
80 @@ -0,0 +1,87 @@
81 +# Copyright 1999-2018 Gentoo Foundation
82 +# Distributed under the terms of the GNU General Public License v2
83 +
84 +EAPI=6
85 +
86 +inherit user
87 +
88 +DESCRIPTION="Free and open source log management"
89 +HOMEPAGE="https://graylog.org"
90 +SRC_URI="https://packages.graylog2.org/releases/graylog/graylog-${PV}.tgz"
91 +
92 +LICENSE="GPL-3"
93 +SLOT="0"
94 +KEYWORDS="~amd64 ~ppc64 ~x86"
95 +RESTRICT="strip"
96 +
97 +RDEPEND="virtual/jdk:1.8"
98 +
99 +DOCS=(
100 + COPYING README.markdown UPGRADING.rst
101 +)
102 +
103 +GRAYLOG_DATA_DIR="/var/lib/graylog2"
104 +GRAYLOG_INSTALL_DIR="/usr/share/graylog2"
105 +QA_PREBUILT="${GRAYLOG_INSTALL_DIR}/lib/sigar/libsigar*"
106 +
107 +S="${WORKDIR}/graylog-${PV}"
108 +
109 +pkg_setup() {
110 + enewgroup graylog
111 + enewuser graylog -1 -1 -1 graylog
112 +}
113 +
114 +src_prepare() {
115 + default
116 +
117 + # Stick to architecture of build host
118 + if ! use amd64; then
119 + rm -r lib/sigar/libsigar-amd64-*.so || die "Failed in removing AMD64 support libraries"
120 + fi
121 + if ! use ppc64; then
122 + rm -r lib/sigar/libsigar-ppc64-*.so || die "Failed in removing PPC64 support libraries"
123 + fi
124 + if ! use x86; then
125 + rm -r lib/sigar/libsigar-x86-*.so || die "Failed in removing X86 support libraries"
126 + fi
127 + # Currently unsupported platforms
128 + # QA warning galore but testing/patches welcome
129 + rm lib/sigar/libsigar-*freebsd*so \
130 + lib/sigar/libsigar-*solaris*so \
131 + lib/sigar/libsigar-*hpux*.sl \
132 + lib/sigar/libsigar-*macosx*.dylib \
133 + lib/sigar/libsigar-ia64-*.so \
134 + lib/sigar/libsigar-ppc-*.so \
135 + lib/sigar/libsigar-s390x*.so \
136 + lib/sigar/*winnt* || die "Failed in removing unsupported platform libraries"
137 +
138 + # gentoo specific paths
139 + sed -i "s@\(node_id_file = \).*@\1${GRAYLOG_DATA_DIR}/node-id@g; \
140 + s@\(message_journal_dir = \).*@\1${GRAYLOG_DATA_DIR}/data/journal@g; \
141 + s@#\(content_packs_dir = \).*@\1${GRAYLOG_DATA_DIR}/data/contentpacks@g" \
142 + graylog.conf.example || die
143 +}
144 +
145 +src_install() {
146 + default
147 +
148 + insinto /etc/graylog2
149 + doins graylog.conf.example
150 +
151 + insinto "${GRAYLOG_DATA_DIR}/data/contentpacks"
152 + doins data/contentpacks/grok-patterns.json
153 +
154 + insinto "${GRAYLOG_INSTALL_DIR}"
155 + doins graylog.jar
156 + doins -r lib plugin
157 +
158 + newconfd "${FILESDIR}/confd-r2" graylog2
159 + newinitd "${FILESDIR}/initd-r2" graylog2
160 +}
161 +
162 +pkg_postinst() {
163 + ewarn "Graylog does not depend on need.net any more (#439092)."
164 + ewarn
165 + ewarn "Please configure rc_need according to your binding address in:"
166 + ewarn "/etc/conf.d/graylog2"
167 +}