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