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: Wed, 30 Dec 2020 09:17:09
Message-Id: 1609319814.9b26b0048fd7a4801540e9c6f5041051aac6928e.fordfrog@gentoo
1 commit: 9b26b0048fd7a4801540e9c6f5041051aac6928e
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 30 09:16:54 2020 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 30 09:16:54 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9b26b004
7
8 net-analyzer/zabbix: bump to 5.2.3
9
10 Package-Manager: Portage-3.0.12, 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.3.ebuild | 346 ++++++++++++++++++++++++++++++++
15 2 files changed, 347 insertions(+)
16
17 diff --git a/net-analyzer/zabbix/Manifest b/net-analyzer/zabbix/Manifest
18 index 543c190339e..8da020be552 100644
19 --- a/net-analyzer/zabbix/Manifest
20 +++ b/net-analyzer/zabbix/Manifest
21 @@ -5,3 +5,4 @@ DIST zabbix-5.0.5.tar.gz 19153153 BLAKE2B 6f78e690b5a8325739148802a8933d6b1e45a7
22 DIST zabbix-5.0.6.tar.gz 19359566 BLAKE2B 375fcbed08be46c1f17c7979763dcdfb8a51a25c2523037a1992dbb7ceb798a665f5d01e97e2e6ef023d5170e3e71df933e0fc41d27fd905ba190497d6bcd28d SHA512 c136536eab3c0e3527e8db8528656776de8849554e0a85a1644000e51c66b09044b176985de1c6d1dcc1d4ec03fc2456111c4df8d896ca276eeed2744cdd48be
23 DIST zabbix-5.2.1.tar.gz 19579218 BLAKE2B 32f8955af5e15dd72f660a2fe1153c8c3d582d9470a87def756516db53a512605fcb67263317ef5980d597d1124324dc15c404e31aa96201105fbd5821549bb8 SHA512 deb69250a91abe24c7988011bfaa369cc13639636b37668ec12e310d92813288adc8e3a2ea7a2a51b0f54d7e6f594277778bb37a481b8f9c3dbb02e528a0cfa0
24 DIST zabbix-5.2.2.tar.gz 19745101 BLAKE2B 651184d4645ff4cfac1317326bd846b4707d8556a30c64dd0b5ac923fb2bb4439b120a4c2bf43c1f73b57a919d5f3bfba28e3d9efde6a3f48587c5b7d0b1d7db SHA512 7bb79111ff809a90a5911d7f94f86eddec3a3fa4f91fdfbf013178442de81d22dc13359679570b8d62fe41b664c764c42cbe98936fd195521951aab507933d9b
25 +DIST zabbix-5.2.3.tar.gz 19791383 BLAKE2B ad0c2306f05d1d664068d9dbc6983c79e1e4d13e605a4683076da51968d2ca2dd6330ca16ad5e24fcabca95565ff1c3e4246ce7352f23a32d419ba207869f8c2 SHA512 207d522ab728bb89f6aaf793af94848469210fb257ead34b93e0f7ba7b2a22b4cce65d516dfbb549a36ae873fe6b6d3486c47f11efff8950d3c81570c673ff9e
26
27 diff --git a/net-analyzer/zabbix/zabbix-5.2.3.ebuild b/net-analyzer/zabbix/zabbix-5.2.3.ebuild
28 new file mode 100644
29 index 00000000000..8f6e9556236
30 --- /dev/null
31 +++ b/net-analyzer/zabbix/zabbix-5.2.3.ebuild
32 @@ -0,0 +1,346 @@
33 +# Copyright 1999-2020 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 +}