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