Gentoo Archives: gentoo-commits

From: "Miroslav Šulc" <fordfrog@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/zabbix/
Date: Tue, 23 Feb 2021 09:44:16
Message-Id: 1614073447.bda424cded777f600e1812419a3498b1ef1cdb10.fordfrog@gentoo
1 commit: bda424cded777f600e1812419a3498b1ef1cdb10
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 23 09:43:06 2021 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 23 09:44:07 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bda424cd
7
8 net-analyzer/zabbix: bump to 5.2.5
9
10 Package-Manager: Portage-3.0.15, Repoman-3.0.2
11 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
12
13 net-analyzer/zabbix/Manifest | 1 +
14 net-analyzer/zabbix/zabbix-5.2.5.ebuild | 350 ++++++++++++++++++++++++++++++++
15 2 files changed, 351 insertions(+)
16
17 diff --git a/net-analyzer/zabbix/Manifest b/net-analyzer/zabbix/Manifest
18 index 1ed8dd53762..4b48800486f 100644
19 --- a/net-analyzer/zabbix/Manifest
20 +++ b/net-analyzer/zabbix/Manifest
21 @@ -5,3 +5,4 @@ DIST zabbix-5.0.7.tar.gz 19382483 BLAKE2B fa0864ba1ac77659e9a18b0c22cee8be1078fa
22 DIST zabbix-5.0.8.tar.gz 19474050 BLAKE2B 1043efca2f373553728206837949bce5f5ea32328c6289e4028f65e6f1ed76560c1ffbd610eec9855f050d0330bcd3b364a983db896285729f30a693d5ae6c6f SHA512 19601ace704c8a887ffc9b57da8825d8a28a5d064aac3e59480994bee4156db186d37ecf4bee2208bbafc0cb76c0c7f47de964f99953ce78d0187457255d92e9
23 DIST zabbix-5.2.3.tar.gz 19791383 BLAKE2B ad0c2306f05d1d664068d9dbc6983c79e1e4d13e605a4683076da51968d2ca2dd6330ca16ad5e24fcabca95565ff1c3e4246ce7352f23a32d419ba207869f8c2 SHA512 207d522ab728bb89f6aaf793af94848469210fb257ead34b93e0f7ba7b2a22b4cce65d516dfbb549a36ae873fe6b6d3486c47f11efff8950d3c81570c673ff9e
24 DIST zabbix-5.2.4.tar.gz 19916307 BLAKE2B 17d0f5dc1d4a8b79d2a5e741a0fa18ecf584ddfb45afbe816721d0e69bae4b5e11b44fe5031c8a34562c30fd2818f7b4a8bfb1442489be3ec23a27a70e789f56 SHA512 e218de9a8b9445401e769c14a9efd0b3d1b7e9610ce021cdbfc9db159801a4033b8f1c1a808c853bfa3aeb66db8a6dd0cbb5b44fc1421fa0f54c28589d7314b4
25 +DIST zabbix-5.2.5.tar.gz 20039761 BLAKE2B 27510c462947a7dedb16d029799aa1c7b38d68199aae47b4b3e5a757120bd74ddf87c7dade0bf339ff2165111345d79119718ade2fe39fd088971be6dcef2bda SHA512 5014a5a510e9ea4a39aa30bdbe3ee82dc1d0a139f32151bb7739df7442ea707b91446ce1cefb61007b603ccedfb0353c628b043db3e90cfe8fc3d67588f2dfd5
26
27 diff --git a/net-analyzer/zabbix/zabbix-5.2.5.ebuild b/net-analyzer/zabbix/zabbix-5.2.5.ebuild
28 new file mode 100644
29 index 00000000000..37470326b6d
30 --- /dev/null
31 +++ b/net-analyzer/zabbix/zabbix-5.2.5.ebuild
32 @@ -0,0 +1,350 @@
33 +# Copyright 1999-2021 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +# needed to make webapp-config dep optional
39 +WEBAPP_OPTIONAL="yes"
40 +inherit flag-o-matic webapp java-pkg-opt-2 systemd toolchain-funcs
41 +
42 +DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers"
43 +HOMEPAGE="https://www.zabbix.com/"
44 +MY_P=${P/_/}
45 +MY_PV=${PV/_/}
46 +SRC_URI="https://cdn.zabbix.com/${PN}/sources/stable/$(ver_cut 1-2)/${P}.tar.gz"
47 +LICENSE="GPL-2"
48 +SLOT="0/$(ver_cut 1-2)"
49 +WEBAPP_MANUAL_SLOT="yes"
50 +KEYWORDS="~amd64 ~x86"
51 +IUSE="+agent java curl frontend ipv6 ldap libxml2 mysql openipmi oracle +postgres proxy server ssh ssl snmp sqlite odbc static"
52 +REQUIRED_USE="|| ( agent frontend proxy server )
53 + proxy? ( ^^ ( mysql oracle postgres sqlite odbc ) )
54 + server? ( ^^ ( mysql oracle postgres odbc ) )
55 + static? ( !oracle !snmp )"
56 +
57 +COMMON_DEPEND="
58 + curl? ( net-misc/curl )
59 + java? ( >=virtual/jdk-1.8:* )
60 + ldap? (
61 + =dev-libs/cyrus-sasl-2*
62 + net-libs/gnutls
63 + net-nds/openldap
64 + )
65 + libxml2? ( dev-libs/libxml2 )
66 + mysql? ( dev-db/mysql-connector-c )
67 + odbc? ( dev-db/unixODBC )
68 + openipmi? ( sys-libs/openipmi )
69 + oracle? ( dev-db/oracle-instantclient-basic )
70 + postgres? ( dev-db/postgresql:* )
71 + proxy? ( sys-libs/zlib )
72 + server? (
73 + dev-libs/libevent
74 + sys-libs/zlib
75 + )
76 + snmp? ( net-analyzer/net-snmp )
77 + sqlite? ( dev-db/sqlite )
78 + ssh? ( net-libs/libssh2 )
79 + ssl? ( dev-libs/openssl:=[-bindist] )
80 +"
81 +
82 +RDEPEND="${COMMON_DEPEND}
83 + acct-group/zabbix
84 + acct-user/zabbix
85 + java? ( >=virtual/jre-1.8:* )
86 + mysql? ( virtual/mysql )
87 + proxy? ( net-analyzer/fping[suid] )
88 + server? (
89 + app-admin/webapp-config
90 + dev-libs/libevent
91 + dev-libs/libpcre
92 + net-analyzer/fping[suid]
93 + )
94 + frontend? (
95 + app-admin/webapp-config
96 + dev-lang/php:*[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode]
97 + media-libs/gd[png]
98 + virtual/httpd-php:*
99 + mysql? ( dev-lang/php[mysqli] )
100 + odbc? ( dev-lang/php[odbc] )
101 + oracle? ( dev-lang/php[oci8-instant-client] )
102 + postgres? ( dev-lang/php[postgres] )
103 + sqlite? ( dev-lang/php[sqlite] )
104 + )
105 +"
106 +DEPEND="${COMMON_DEPEND}
107 + static? (
108 + curl? ( net-misc/curl[static-libs] )
109 + ldap? (
110 + =dev-libs/cyrus-sasl-2*[static-libs]
111 + net-libs/gnutls[static-libs]
112 + net-nds/openldap[static-libs]
113 + )
114 + libxml2? ( dev-libs/libxml2[static-libs] )
115 + mysql? ( dev-db/mysql-connector-c[static-libs] )
116 + odbc? ( dev-db/unixODBC[static-libs] )
117 + postgres? ( dev-db/postgresql:*[static-libs] )
118 + sqlite? ( dev-db/sqlite[static-libs] )
119 + ssh? ( net-libs/libssh2 )
120 + )
121 +"
122 +BDEPEND="
123 + virtual/pkgconfig
124 +"
125 +
126 +PATCHES=(
127 + "${FILESDIR}/${PN}-4.0.18-modulepathfix.patch"
128 + "${FILESDIR}/${PN}-3.0.30-security-disable-PidFile.patch"
129 +)
130 +
131 +S=${WORKDIR}/${MY_P}
132 +
133 +ZABBIXJAVA_BASE="opt/zabbix_java"
134 +
135 +pkg_setup() {
136 + if use oracle; then
137 + if [ -z "${ORACLE_HOME}" ]; then
138 + eerror
139 + eerror "The environment variable ORACLE_HOME must be set"
140 + eerror "and point to the correct location."
141 + eerror "It looks like you don't have Oracle installed."
142 + eerror
143 + die "Environment variable ORACLE_HOME is not set"
144 + fi
145 + if has_version 'dev-db/oracle-instantclient-basic'; then
146 + ewarn
147 + ewarn "Please ensure you have a full install of the Oracle client."
148 + ewarn "dev-db/oracle-instantclient* is NOT sufficient."
149 + ewarn
150 + fi
151 + fi
152 +
153 + if use frontend; then
154 + webapp_pkg_setup
155 + fi
156 +
157 + java-pkg-opt-2_pkg_setup
158 +}
159 +
160 +src_prepare() {
161 + default
162 +}
163 +
164 +src_configure() {
165 + econf \
166 + $(use_enable agent) \
167 + $(use_enable ipv6) \
168 + $(use_enable java) \
169 + $(use_enable proxy) \
170 + $(use_enable server) \
171 + $(use_enable static) \
172 + $(use_with curl libcurl) \
173 + $(use_with ldap) \
174 + $(use_with libxml2) \
175 + $(use_with mysql) \
176 + $(use_with odbc unixodbc) \
177 + $(use_with openipmi openipmi) \
178 + $(use_with oracle) \
179 + $(use_with postgres postgresql) \
180 + $(use_with snmp net-snmp) \
181 + $(use_with sqlite sqlite3) \
182 + $(use_with ssh ssh2) \
183 + $(use_with ssl openssl)
184 +}
185 +
186 +src_compile() {
187 + if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
188 + emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)"
189 + fi
190 +}
191 +
192 +src_install() {
193 + local dirs=(
194 + /etc/zabbix
195 + /var/lib/zabbix
196 + /var/lib/zabbix/home
197 + /var/lib/zabbix/scripts
198 + /var/lib/zabbix/alertscripts
199 + /var/lib/zabbix/externalscripts
200 + /var/log/zabbix
201 + )
202 +
203 + for dir in "${dirs[@]}"; do
204 + dodir "${dir}"
205 + keepdir "${dir}"
206 + done
207 +
208 + if use server; then
209 + insinto /etc/zabbix
210 + doins "${S}"/conf/zabbix_server.conf
211 + fperms 0640 /etc/zabbix/zabbix_server.conf
212 + fowners root:zabbix /etc/zabbix/zabbix_server.conf
213 +
214 + newinitd "${FILESDIR}"/zabbix-server.init zabbix-server
215 +
216 + dosbin src/zabbix_server/zabbix_server
217 +
218 + insinto /usr/share/zabbix
219 + doins -r "${S}"/database/
220 +
221 + systemd_dounit "${FILESDIR}"/zabbix-server.service
222 + systemd_newtmpfilesd "${FILESDIR}"/zabbix-server.tmpfiles zabbix-server.conf
223 + fi
224 +
225 + if use proxy; then
226 + insinto /etc/zabbix
227 + doins "${S}"/conf/zabbix_proxy.conf
228 + fperms 0640 /etc/zabbix/zabbix_proxy.conf
229 + fowners root:zabbix /etc/zabbix/zabbix_proxy.conf
230 +
231 + newinitd "${FILESDIR}"/zabbix-proxy.init zabbix-proxy
232 +
233 + dosbin src/zabbix_proxy/zabbix_proxy
234 +
235 + insinto /usr/share/zabbix
236 + doins -r "${S}"/database/
237 +
238 + systemd_dounit "${FILESDIR}"/zabbix-proxy.service
239 + systemd_newtmpfilesd "${FILESDIR}"/zabbix-proxy.tmpfiles zabbix-proxy.conf
240 + fi
241 +
242 + if use agent; then
243 + insinto /etc/zabbix
244 + doins "${S}"/conf/zabbix_agentd.conf
245 + fperms 0640 /etc/zabbix/zabbix_agentd.conf
246 + fowners root:zabbix /etc/zabbix/zabbix_agentd.conf
247 +
248 + newinitd "${FILESDIR}"/zabbix-agentd.init zabbix-agentd
249 +
250 + dosbin src/zabbix_agent/zabbix_agentd
251 + dobin \
252 + src/zabbix_sender/zabbix_sender \
253 + src/zabbix_get/zabbix_get
254 +
255 + systemd_dounit "${FILESDIR}"/zabbix-agentd.service
256 + systemd_newtmpfilesd "${FILESDIR}"/zabbix-agentd.tmpfiles zabbix-agentd.conf
257 + fi
258 +
259 + fowners root:zabbix /etc/zabbix
260 + fowners zabbix:zabbix \
261 + /var/lib/zabbix \
262 + /var/lib/zabbix/home \
263 + /var/lib/zabbix/scripts \
264 + /var/lib/zabbix/alertscripts \
265 + /var/lib/zabbix/externalscripts \
266 + /var/log/zabbix
267 + fperms 0750 \
268 + /etc/zabbix \
269 + /var/lib/zabbix \
270 + /var/lib/zabbix/home \
271 + /var/lib/zabbix/scripts \
272 + /var/lib/zabbix/alertscripts \
273 + /var/lib/zabbix/externalscripts \
274 + /var/log/zabbix
275 +
276 + dodoc README INSTALL NEWS ChangeLog \
277 + conf/zabbix_agentd.conf \
278 + conf/zabbix_proxy.conf \
279 + conf/zabbix_agentd/userparameter_examples.conf \
280 + conf/zabbix_agentd/userparameter_mysql.conf \
281 + conf/zabbix_server.conf
282 +
283 + if use frontend; then
284 + webapp_src_preinst
285 + cp -R ui/* "${D}/${MY_HTDOCSDIR}"
286 + webapp_configfile \
287 + "${MY_HTDOCSDIR}"/include/db.inc.php \
288 + "${MY_HTDOCSDIR}"/include/config.inc.php
289 + webapp_src_install
290 + fi
291 +
292 + if use java; then
293 + dodir \
294 + /${ZABBIXJAVA_BASE} \
295 + /${ZABBIXJAVA_BASE}/bin \
296 + /${ZABBIXJAVA_BASE}/lib
297 + keepdir /${ZABBIXJAVA_BASE}
298 + exeinto /${ZABBIXJAVA_BASE}/bin
299 + doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar
300 + exeinto /${ZABBIXJAVA_BASE}/lib
301 + doexe \
302 + src/zabbix_java/lib/logback-classic-0.9.27.jar \
303 + src/zabbix_java/lib/logback-console.xml \
304 + src/zabbix_java/lib/logback-core-0.9.27.jar \
305 + src/zabbix_java/lib/logback.xml \
306 + src/zabbix_java/lib/android-json-4.3_r3.1.jar \
307 + src/zabbix_java/lib/slf4j-api-1.6.1.jar
308 + newinitd "${FILESDIR}"/zabbix-jmx-proxy.init zabbix-jmx-proxy
309 + newconfd "${FILESDIR}"/zabbix-jmx-proxy.conf zabbix-jmx-proxy
310 + fi
311 +}
312 +
313 +pkg_postinst() {
314 + if use server || use proxy ; then
315 + elog
316 + elog "You may need to configure your database for Zabbix"
317 + elog "if you have not already done so."
318 + elog
319 +
320 + zabbix_homedir=$(egethome zabbix)
321 + if [ -n "${zabbix_homedir}" ] && \
322 + [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then
323 + ewarn
324 + ewarn "The user 'zabbix' should have his homedir changed"
325 + ewarn "to /var/lib/zabbix/home if you want to use"
326 + ewarn "custom alert scripts."
327 + ewarn
328 + ewarn "A real homedir might be needed for configfiles"
329 + ewarn "for custom alert scripts."
330 + ewarn
331 + ewarn "To change the homedir use:"
332 + ewarn " usermod -d /var/lib/zabbix/home zabbix"
333 + ewarn
334 + fi
335 + fi
336 +
337 + if use server; then
338 + elog
339 + elog "For distributed monitoring you have to run:"
340 + elog
341 + elog "zabbix_server -n <nodeid>"
342 + elog
343 + elog "This will convert database data for use with Node ID"
344 + elog "and also adds a local node."
345 + elog
346 + fi
347 +
348 + elog "--"
349 + elog
350 + elog "You may need to add these lines to /etc/services:"
351 + elog
352 + elog "zabbix-agent 10050/tcp Zabbix Agent"
353 + elog "zabbix-agent 10050/udp Zabbix Agent"
354 + elog "zabbix-trapper 10051/tcp Zabbix Trapper"
355 + elog "zabbix-trapper 10051/udp Zabbix Trapper"
356 + elog
357 +
358 + if use server || use proxy ; then
359 + # check for fping
360 + fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null)
361 + case "${fping_perms}" in
362 + 4[157][157][157])
363 + ;;
364 + *)
365 + ewarn
366 + ewarn "If you want to use the checks 'icmpping' and 'icmppingsec',"
367 + ewarn "you have to make /usr/sbin/fping setuid root and executable"
368 + ewarn "by everyone. Run the following command to fix it:"
369 + ewarn
370 + ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping"
371 + ewarn
372 + ewarn "Please be aware that this might impose a security risk,"
373 + ewarn "depending on the code quality of fping."
374 + ewarn
375 + ;;
376 + esac
377 + fi
378 +}
379 +
380 +pkg_prerm() {
381 + (use frontend || use server) && webapp_pkg_prerm
382 +}