Gentoo Archives: gentoo-commits

From: Patrick Lauer <patrick@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/zabbix/
Date: Sun, 02 Sep 2018 12:29:26
Message-Id: 1535891342.bfbaf7f797d1fe14df8dd92649155268cc7ea52b.patrick@gentoo
1 commit: bfbaf7f797d1fe14df8dd92649155268cc7ea52b
2 Author: Patrick Lauer <patrick <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 2 12:29:02 2018 +0000
4 Commit: Patrick Lauer <patrick <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 2 12:29:02 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bfbaf7f7
7
8 net-analyzer/zabbix: Bump
9
10 Package-Manager: Portage-2.3.48, Repoman-2.3.10
11
12 net-analyzer/zabbix/Manifest | 2 +
13 net-analyzer/zabbix/zabbix-3.0.21.ebuild | 331 +++++++++++++++++++++++++++++++
14 net-analyzer/zabbix/zabbix-3.4.13.ebuild | 329 ++++++++++++++++++++++++++++++
15 3 files changed, 662 insertions(+)
16
17 diff --git a/net-analyzer/zabbix/Manifest b/net-analyzer/zabbix/Manifest
18 index 41727d75471..257f4a975a9 100644
19 --- a/net-analyzer/zabbix/Manifest
20 +++ b/net-analyzer/zabbix/Manifest
21 @@ -3,7 +3,9 @@ DIST zabbix-2.2.21.tar.gz 15489747 BLAKE2B e00fe140977f0ce995497954a15ff647c813c
22 DIST zabbix-2.2.23.tar.gz 15504361 BLAKE2B c0eec293a92564607ed56c570aca30385481cf028fdee2bb51fbb29b40d7a1908a6065a6ee21c019ed6fb9eee294bc8fb58414669ae8e16e50f614a0650e2dbd SHA512 178e193f83dbaaa8aa0a0b87dd621acf7aa24e0d84d0010532b419139ed02e3cf892e4e772362bb855efb5966a64b9da8d3512eb91e759835039dc8c3529ea56
23 DIST zabbix-3.0.19.tar.gz 15642128 BLAKE2B b9b84f21371db1eb8efdfb547e2b4a9216e9fb3c76fe54420ab1c76bad5cbf4537f6f0aca720748d39fb2ebf0447c3f82bf9e0d276f9fa4c9e91bc70e8b67f22 SHA512 30239db9236f536325f0ad3a8ea08abd8c460caf60dfd80b881cc9532d2f65d6154e8911be89d141539f7eeced359809405cf1b655eafdab1b940c314c8d3132
24 DIST zabbix-3.0.20.tar.gz 15653766 BLAKE2B 4c36611e6fa26f9f5a8e3201eea0f08f3c2945542284be0a823751ad39f51deffc450e1994bc685c6179d7e72bd3dd58e0071071cd02446d6d733cddf8d7f916 SHA512 06832600f31f13781b42083a56b8bca18f6a2034b6641b6809e338e374fa08dabbae6c9d54ee711b3dd2ac5017203fea3e0cbf7f70a1a1da60dda43c7e1af00c
25 +DIST zabbix-3.0.21.tar.gz 15658030 BLAKE2B 8a943f015ba137c7a161439a31d09bf023bd02bf6ad420c8b02f316adedccf3b23df3775ecea7b27c5b4c893e881f2689cab1c28a4e6c1fe5b79ec08d5d86f43 SHA512 bffe02dac6f009ba8929e0d9ba222ae4bb9da05550f9eaff034fe444ee1c866bd231bb8aa814b7dedc01a5338171b40d461567a7bf619bfccfc523362db579a1
26 DIST zabbix-3.2.11.tar.gz 16099820 BLAKE2B 7038679ecc9ae1b6684d65b3dd0019865e587c82e5a3ffe55610c057f8516ebe34978101065ac31628e6fd54077877c447d64cb1d169e0ad7402e727c7e65d76 SHA512 a14e0af4b183c8deb524c8965700c2988c0c131844f7fbc748aa8d1703b9dad73c2cf6d77663799fbd455adf58fdd1ce8dc5fd6404a9269c1a42160ad0e33e6e
27 DIST zabbix-3.4.10.tar.gz 17300622 BLAKE2B 1b4c275d271ae4d4607400cb6e5f955ba624bf19cd116728e7a71a1b4adc0fbbde8cf91e6b0a71c5d48bf5c38b2ebe0db79f00ba3a42cc4213a0e310d56d5e29 SHA512 25e85cbe7a93a088fa0132ed6f3f75ad1aadedb839d745be38e180f0f9b858e32045b9d057b10cab4d3a8aa770b22b631aa0894fe5f1c3ca4ca62a000934bf94
28 DIST zabbix-3.4.11.tar.gz 17517171 BLAKE2B 72f7d1cad3e8cb7972cb9c3698d35f70c45de1244c14a87f403a0c2c9b1825d679fa32e54dc4b2aae80a24acb7723ce489e0d409fb027c1afc8bb4eccecf9867 SHA512 1360e1de02fbbda30539e0f1dbe9d4aee57bc693f597db011cdefe7e7c4acaa6e3452813ee29e0e614794336e7fc9210ff3458f3761fcec90db66fb4a2275373
29 DIST zabbix-3.4.12.tar.gz 17509251 BLAKE2B 158c7b3061059cc54a5988296404ed6670ca872fa8fa55f8de9708871ee03f163d0365420e23ef5df89a0a85e2f23d607952cf4fc02c974037555534ca164f08 SHA512 6707ff5a15d2c139775b4b5de32ceb4982c90aa4023af310ab9cb849895387984d32f59b7dc9fbaff8f317a630238437e4651ab8272b4535fb5fc3d88750e3ef
30 +DIST zabbix-3.4.13.tar.gz 17507365 BLAKE2B a5d1fa1a48df2ad66b844c2c85038a088ea5f7e3e67c2c3ab5f5d1ad695b3a31664d317e6a1cbf64d1f6a211304f50e5c38f5d973d4607f2caa202e1184420cf SHA512 4edcf6d9df0f100c639efa6bc18e67ed59819e719a2226593fd81212d4c2e46a19cb50501cca005246b4c01c4082a18e21c9049a99ac9df263180a3c24fa52f0
31
32 diff --git a/net-analyzer/zabbix/zabbix-3.0.21.ebuild b/net-analyzer/zabbix/zabbix-3.0.21.ebuild
33 new file mode 100644
34 index 00000000000..c3575d4f121
35 --- /dev/null
36 +++ b/net-analyzer/zabbix/zabbix-3.0.21.ebuild
37 @@ -0,0 +1,331 @@
38 +# Copyright 1999-2018 Gentoo Foundation
39 +# Distributed under the terms of the GNU General Public License v2
40 +
41 +EAPI="6"
42 +
43 +# needed to make webapp-config dep optional
44 +WEBAPP_OPTIONAL="yes"
45 +inherit flag-o-matic webapp java-pkg-opt-2 user systemd toolchain-funcs
46 +
47 +DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers"
48 +HOMEPAGE="https://www.zabbix.com/"
49 +MY_P=${P/_/}
50 +MY_PV=${PV/_/}
51 +SRC_URI="https://prdownloads.sourceforge.net/zabbix/${MY_P}.tar.gz"
52 +LICENSE="GPL-2"
53 +SLOT="0"
54 +WEBAPP_MANUAL_SLOT="yes"
55 +KEYWORDS="~amd64 ~x86"
56 +IUSE="+agent java curl frontend ipv6 xmpp ldap libxml2 mysql openipmi oracle postgres proxy server ssh ssl snmp sqlite odbc static"
57 +REQUIRED_USE="|| ( agent frontend proxy server )
58 + proxy? ( ^^ ( mysql oracle postgres sqlite odbc ) )
59 + server? ( ^^ ( mysql oracle postgres sqlite odbc ) )
60 + static? ( !oracle !snmp )"
61 +
62 +COMMON_DEPEND="snmp? ( net-analyzer/net-snmp )
63 + ldap? (
64 + net-nds/openldap
65 + =dev-libs/cyrus-sasl-2*
66 + net-libs/gnutls
67 + )
68 + mysql? ( >=virtual/mysql-5.0.3 )
69 + sqlite? ( >=dev-db/sqlite-3.3.5 )
70 + postgres? ( dev-db/postgresql:* )
71 + oracle? ( >=dev-db/oracle-instantclient-basic-10.0.0.0 )
72 + xmpp? ( dev-libs/iksemel )
73 + libxml2? ( dev-libs/libxml2 )
74 + curl? ( net-misc/curl )
75 + openipmi? ( sys-libs/openipmi )
76 + ssh? ( net-libs/libssh2 )
77 + java? ( virtual/jdk:* )
78 + odbc? ( dev-db/unixODBC )
79 + ssl? ( dev-libs/openssl:=[-bindist] )"
80 +
81 +RDEPEND="${COMMON_DEPEND}
82 + proxy? ( net-analyzer/fping )
83 + server? ( net-analyzer/fping
84 + app-admin/webapp-config )
85 + java? (
86 + >=virtual/jre-1.4
87 + dev-java/slf4j-api
88 + )
89 + frontend? (
90 + >=dev-lang/php-5.3.0[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode]
91 + || ( dev-lang/php[apache2] dev-lang/php[cgi] dev-lang/php[fpm] )
92 + mysql? ( dev-lang/php[mysqli] )
93 + odbc? ( dev-lang/php[odbc] )
94 + oracle? ( dev-lang/php[oci8-instant-client] )
95 + postgres? ( dev-lang/php[postgres] )
96 + sqlite? ( dev-lang/php[sqlite] )
97 + media-libs/gd[png]
98 + app-admin/webapp-config )"
99 +DEPEND="${COMMON_DEPEND}
100 + static? (
101 + ldap? (
102 + net-nds/openldap[static-libs]
103 + =dev-libs/cyrus-sasl-2*[static-libs]
104 + net-libs/gnutls[static-libs]
105 + )
106 + mysql? ( >=virtual/mysql-5.0.3[static-libs] )
107 + sqlite? ( >=dev-db/sqlite-3.3.5[static-libs] )
108 + postgres? ( dev-db/postgresql:*[static-libs] )
109 + libxml2? ( dev-libs/libxml2[static-libs] )
110 + curl? ( net-misc/curl[static-libs] )
111 + ssh? ( net-libs/libssh2[static-libs] )
112 + odbc? ( dev-db/unixODBC[static-libs] )
113 + )
114 + virtual/pkgconfig"
115 +
116 +S=${WORKDIR}/${MY_P}
117 +
118 +ZABBIXJAVA_BASE="opt/zabbix_java"
119 +
120 +pkg_setup() {
121 + if use oracle; then
122 + if [ -z "${ORACLE_HOME}" ]; then
123 + eerror
124 + eerror "The environment variable ORACLE_HOME must be set"
125 + eerror "and point to the correct location."
126 + eerror "It looks like you don't have Oracle installed."
127 + eerror
128 + die "Environment variable ORACLE_HOME is not set"
129 + fi
130 + if has_version 'dev-db/oracle-instantclient-basic'; then
131 + ewarn
132 + ewarn "Please ensure you have a full install of the Oracle client."
133 + ewarn "dev-db/oracle-instantclient* is NOT sufficient."
134 + ewarn
135 + fi
136 + fi
137 +
138 + if use frontend; then
139 + webapp_pkg_setup
140 + fi
141 +
142 + enewgroup zabbix
143 + enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix
144 +}
145 +
146 +java_prepare() {
147 + cd "${S}/src/zabbix_java/lib"
148 + rm -v *.jar || die
149 +
150 + java-pkg_jar-from slf4j-api
151 +}
152 +
153 +src_prepare() {
154 + default
155 +}
156 +
157 +src_configure() {
158 + econf \
159 + $(use_enable server) \
160 + $(use_enable proxy) \
161 + $(use_enable agent) \
162 + $(use_enable ipv6) \
163 + $(use_enable static) \
164 + $(use_enable java) \
165 + $(use_with ldap) \
166 + $(use_with snmp net-snmp) \
167 + $(use_with mysql) \
168 + $(use_with postgres postgresql) \
169 + $(use_with oracle) \
170 + $(use_with sqlite sqlite3) \
171 + $(use_with xmpp jabber) \
172 + $(use_with curl libcurl) \
173 + $(use_with openipmi openipmi) \
174 + $(use_with ssh ssh2) \
175 + $(use_with libxml2) \
176 + $(use_with odbc unixodbc) \
177 + $(use_with ssl openssl) \
178 + || die "econf failed"
179 +}
180 +
181 +src_compile() {
182 + if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
183 + emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" || die "emake failed"
184 + fi
185 +}
186 +
187 +src_install() {
188 + dodir \
189 + /etc/zabbix \
190 + /var/lib/zabbix \
191 + /var/lib/zabbix/home \
192 + /var/lib/zabbix/scripts \
193 + /var/lib/zabbix/alertscripts \
194 + /var/lib/zabbix/externalscripts \
195 + /var/log/zabbix
196 +
197 + keepdir \
198 + /etc/zabbix \
199 + /var/lib/zabbix \
200 + /var/lib/zabbix/home \
201 + /var/lib/zabbix/scripts \
202 + /var/lib/zabbix/alertscripts \
203 + /var/lib/zabbix/externalscripts \
204 + /var/log/zabbix
205 +
206 + if use server; then
207 + insinto /etc/zabbix
208 + doins "${FILESDIR}/3.0"/zabbix_server.conf
209 + doinitd "${FILESDIR}/3.0"/init.d/zabbix-server
210 + dosbin src/zabbix_server/zabbix_server
211 + fowners zabbix:zabbix /etc/zabbix/zabbix_server.conf
212 + fperms 0640 /etc/zabbix/zabbix_server.conf
213 + dodir /usr/share/zabbix
214 + /bin/cp -R "${S}/database/" "${D}"/usr/share/zabbix/
215 + systemd_dounit "${FILESDIR}/zabbix-server.service"
216 + systemd_newtmpfilesd "${FILESDIR}/zabbix-server.tmpfiles" zabbix-server.conf
217 + fi
218 +
219 + if use proxy; then
220 + doinitd "${FILESDIR}/3.0"/init.d/zabbix-proxy
221 + dosbin src/zabbix_proxy/zabbix_proxy
222 + insinto /etc/zabbix
223 + doins "${FILESDIR}/3.0"/zabbix_proxy.conf
224 + dodir /usr/share/zabbix
225 + /bin/cp -R "${S}/database/" "${D}"/usr/share/zabbix/
226 + systemd_dounit "${FILESDIR}/zabbix-proxy.service"
227 + systemd_newtmpfilesd "${FILESDIR}/zabbix-proxy.tmpfiles" zabbix-proxy.conf
228 + fi
229 +
230 + if use agent; then
231 + insinto /etc/zabbix
232 + doins "${FILESDIR}/3.0"/zabbix_agentd.conf
233 + doinitd "${FILESDIR}/3.0"/init.d/zabbix-agentd
234 + dosbin src/zabbix_agent/zabbix_agentd
235 + dobin \
236 + src/zabbix_sender/zabbix_sender \
237 + src/zabbix_get/zabbix_get
238 + fowners zabbix:zabbix /etc/zabbix/zabbix_agentd.conf
239 + fperms 0640 /etc/zabbix/zabbix_agentd.conf
240 + systemd_dounit "${FILESDIR}/zabbix-agentd.service"
241 + systemd_newtmpfilesd "${FILESDIR}/zabbix-agentd.tmpfiles" zabbix-agentd.conf
242 + fi
243 +
244 + fowners zabbix:zabbix \
245 + /etc/zabbix \
246 + /var/lib/zabbix \
247 + /var/lib/zabbix/home \
248 + /var/lib/zabbix/scripts \
249 + /var/lib/zabbix/alertscripts \
250 + /var/lib/zabbix/externalscripts \
251 + /var/log/zabbix
252 + fperms 0750 \
253 + /etc/zabbix \
254 + /var/lib/zabbix \
255 + /var/lib/zabbix/home \
256 + /var/lib/zabbix/scripts \
257 + /var/lib/zabbix/alertscripts \
258 + /var/lib/zabbix/externalscripts \
259 + /var/log/zabbix
260 +
261 + dodoc README INSTALL NEWS ChangeLog \
262 + conf/zabbix_agentd.conf \
263 + conf/zabbix_proxy.conf \
264 + conf/zabbix_agentd/userparameter_examples.conf \
265 + conf/zabbix_agentd/userparameter_mysql.conf \
266 + conf/zabbix_server.conf
267 +
268 + if use frontend; then
269 + webapp_src_preinst
270 + cp -R frontends/php/* "${D}/${MY_HTDOCSDIR}"
271 + webapp_configfile \
272 + "${MY_HTDOCSDIR}"/include/db.inc.php \
273 + "${MY_HTDOCSDIR}"/include/config.inc.php
274 + webapp_src_install
275 + fi
276 +
277 + if use java; then
278 + dodir \
279 + /${ZABBIXJAVA_BASE} \
280 + /${ZABBIXJAVA_BASE}/bin \
281 + /${ZABBIXJAVA_BASE}/lib
282 + keepdir /${ZABBIXJAVA_BASE}
283 + exeinto /${ZABBIXJAVA_BASE}/bin
284 + doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar
285 + exeinto /${ZABBIXJAVA_BASE}/lib
286 + doexe \
287 + src/zabbix_java/lib/logback-classic-0.9.27.jar \
288 + src/zabbix_java/lib/logback-console.xml \
289 + src/zabbix_java/lib/logback-core-0.9.27.jar \
290 + src/zabbix_java/lib/logback.xml \
291 + src/zabbix_java/lib/android-json-4.3_r3.1.jar \
292 + src/zabbix_java/lib/slf4j-api-1.6.1.jar
293 + exeinto /${ZABBIXJAVA_BASE}/
294 + doexe \
295 + src/zabbix_java/settings.sh \
296 + src/zabbix_java/startup.sh \
297 + src/zabbix_java/shutdown.sh
298 + fowners -R zabbix:zabbix /${ZABBIXJAVA_BASE}
299 + fi
300 +}
301 +
302 +pkg_postinst() {
303 + if use server || use proxy ; then
304 + elog
305 + elog "You may need to configure your database for Zabbix,"
306 + elog "if you have not already done so. "
307 + elog
308 +
309 + zabbix_homedir=$(egethome zabbix)
310 + if [ -n "${zabbix_homedir}" ] && \
311 + [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then
312 + ewarn
313 + ewarn "The user 'zabbix' should have his homedir changed"
314 + ewarn "to /var/lib/zabbix/home if you want to use"
315 + ewarn "custom alert scripts."
316 + ewarn
317 + ewarn "A real homedir might be needed for configfiles"
318 + ewarn "for custom alert scripts (e.g. ~/.sendxmpprc when"
319 + ewarn "using sendxmpp for Jabber alerts)."
320 + ewarn
321 + ewarn "To change the homedir use:"
322 + ewarn " usermod -d /var/lib/zabbix/home zabbix"
323 + ewarn
324 + fi
325 + fi
326 +
327 + if use server; then
328 + elog
329 + elog "For distributed monitoring you have to run:"
330 + elog
331 + elog "zabbix_server -n <nodeid>"
332 + elog
333 + elog "This will convert database data for use with Node ID"
334 + elog "and also adds a local node."
335 + elog
336 + fi
337 +
338 + elog "--"
339 + elog
340 + elog "You may need to add these lines to /etc/services:"
341 + elog
342 + elog "zabbix-agent 10050/tcp Zabbix Agent"
343 + elog "zabbix-agent 10050/udp Zabbix Agent"
344 + elog "zabbix-trapper 10051/tcp Zabbix Trapper"
345 + elog "zabbix-trapper 10051/udp Zabbix Trapper"
346 + elog
347 +
348 + if use server || use proxy ; then
349 + # check for fping
350 + fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null)
351 + case "${fping_perms}" in
352 + 4[157][157][157])
353 + ;;
354 + *)
355 + ewarn
356 + ewarn "If you want to use the checks 'icmpping' and 'icmppingsec',"
357 + ewarn "you have to make /usr/sbin/fping setuid root and executable"
358 + ewarn "by everyone. Run the following command to fix it:"
359 + ewarn
360 + ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping"
361 + ewarn
362 + ewarn "Please be aware that this might impose a security risk,"
363 + ewarn "depending on the code quality of fping."
364 + ewarn
365 + ;;
366 + esac
367 + fi
368 +}
369
370 diff --git a/net-analyzer/zabbix/zabbix-3.4.13.ebuild b/net-analyzer/zabbix/zabbix-3.4.13.ebuild
371 new file mode 100644
372 index 00000000000..94b8bc3cdff
373 --- /dev/null
374 +++ b/net-analyzer/zabbix/zabbix-3.4.13.ebuild
375 @@ -0,0 +1,329 @@
376 +# Copyright 1999-2018 Gentoo Foundation
377 +# Distributed under the terms of the GNU General Public License v2
378 +
379 +EAPI="6"
380 +
381 +# needed to make webapp-config dep optional
382 +WEBAPP_OPTIONAL="yes"
383 +inherit flag-o-matic webapp java-pkg-opt-2 user systemd toolchain-funcs
384 +
385 +DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers"
386 +HOMEPAGE="https://www.zabbix.com/"
387 +MY_P=${P/_/}
388 +MY_PV=${PV/_/}
389 +SRC_URI="https://prdownloads.sourceforge.net/zabbix/${MY_P}.tar.gz"
390 +LICENSE="GPL-2"
391 +SLOT="0"
392 +WEBAPP_MANUAL_SLOT="yes"
393 +KEYWORDS="~amd64 ~x86"
394 +IUSE="+agent java curl frontend ipv6 xmpp ldap libxml2 mysql openipmi oracle +postgres proxy server ssh ssl snmp sqlite odbc static"
395 +REQUIRED_USE="|| ( agent frontend proxy server )
396 + proxy? ( ^^ ( mysql oracle postgres sqlite odbc ) )
397 + server? ( ^^ ( mysql oracle postgres odbc ) )
398 + static? ( !oracle !snmp )"
399 +
400 +COMMON_DEPEND="snmp? ( net-analyzer/net-snmp )
401 + ldap? (
402 + net-nds/openldap
403 + =dev-libs/cyrus-sasl-2*
404 + net-libs/gnutls
405 + )
406 + mysql? ( >=virtual/mysql-5.0.3 )
407 + sqlite? ( >=dev-db/sqlite-3.3.5 )
408 + postgres? ( dev-db/postgresql:* )
409 + oracle? ( >=dev-db/oracle-instantclient-basic-10.0.0.0 )
410 + xmpp? ( dev-libs/iksemel )
411 + libxml2? ( dev-libs/libxml2 )
412 + curl? ( net-misc/curl )
413 + openipmi? ( sys-libs/openipmi )
414 + ssh? ( net-libs/libssh2 )
415 + java? ( virtual/jdk:* )
416 + odbc? ( dev-db/unixODBC )
417 + ssl? ( dev-libs/openssl:=[-bindist] )"
418 +
419 +RDEPEND="${COMMON_DEPEND}
420 + proxy? ( net-analyzer/fping[suid] )
421 + server? ( net-analyzer/fping[suid]
422 + app-admin/webapp-config
423 + dev-libs/libevent )
424 + java? (
425 + >=virtual/jre-1.4
426 + dev-java/slf4j-api
427 + )
428 + frontend? (
429 + >=dev-lang/php-5.3.0[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode]
430 + || ( dev-lang/php[apache2] dev-lang/php[cgi] dev-lang/php[fpm] )
431 + mysql? ( dev-lang/php[mysqli] )
432 + odbc? ( dev-lang/php[odbc] )
433 + oracle? ( dev-lang/php[oci8-instant-client] )
434 + postgres? ( dev-lang/php[postgres] )
435 + sqlite? ( dev-lang/php[sqlite] )
436 + media-libs/gd[png]
437 + app-admin/webapp-config )"
438 +DEPEND="${COMMON_DEPEND}
439 + static? (
440 + ldap? (
441 + net-nds/openldap[static-libs]
442 + =dev-libs/cyrus-sasl-2*[static-libs]
443 + net-libs/gnutls[static-libs]
444 + )
445 + mysql? ( >=virtual/mysql-5.0.3[static-libs] )
446 + sqlite? ( >=dev-db/sqlite-3.3.5[static-libs] )
447 + postgres? ( dev-db/postgresql:*[static-libs] )
448 + libxml2? ( dev-libs/libxml2[static-libs] )
449 + curl? ( net-misc/curl[static-libs] )
450 + ssh? ( net-libs/libssh2[static-libs] )
451 + odbc? ( dev-db/unixODBC[static-libs] )
452 + )
453 + virtual/pkgconfig"
454 +
455 +S=${WORKDIR}/${MY_P}
456 +
457 +ZABBIXJAVA_BASE="opt/zabbix_java"
458 +
459 +pkg_setup() {
460 + if use oracle; then
461 + if [ -z "${ORACLE_HOME}" ]; then
462 + eerror
463 + eerror "The environment variable ORACLE_HOME must be set"
464 + eerror "and point to the correct location."
465 + eerror "It looks like you don't have Oracle installed."
466 + eerror
467 + die "Environment variable ORACLE_HOME is not set"
468 + fi
469 + if has_version 'dev-db/oracle-instantclient-basic'; then
470 + ewarn
471 + ewarn "Please ensure you have a full install of the Oracle client."
472 + ewarn "dev-db/oracle-instantclient* is NOT sufficient."
473 + ewarn
474 + fi
475 + fi
476 +
477 + if use frontend; then
478 + webapp_pkg_setup
479 + fi
480 +
481 + enewgroup zabbix
482 + enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix
483 +}
484 +
485 +java_prepare() {
486 + cd "${S}/src/zabbix_java/lib"
487 + rm -v *.jar || die
488 +
489 + java-pkg_jar-from slf4j-api
490 +}
491 +
492 +src_prepare() {
493 + default
494 +}
495 +
496 +src_configure() {
497 + econf \
498 + $(use_enable server) \
499 + $(use_enable proxy) \
500 + $(use_enable agent) \
501 + $(use_enable ipv6) \
502 + $(use_enable static) \
503 + $(use_enable java) \
504 + $(use_with ldap) \
505 + $(use_with snmp net-snmp) \
506 + $(use_with mysql) \
507 + $(use_with postgres postgresql) \
508 + $(use_with oracle) \
509 + $(use_with sqlite sqlite3) \
510 + $(use_with xmpp jabber) \
511 + $(use_with curl libcurl) \
512 + $(use_with openipmi openipmi) \
513 + $(use_with ssh ssh2) \
514 + $(use_with libxml2) \
515 + $(use_with odbc unixodbc) \
516 + $(use_with ssl openssl) \
517 + || die "econf failed"
518 +}
519 +
520 +src_compile() {
521 + if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
522 + emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" || die "emake failed"
523 + fi
524 +}
525 +
526 +src_install() {
527 + dodir \
528 + /etc/zabbix \
529 + /var/lib/zabbix \
530 + /var/lib/zabbix/home \
531 + /var/lib/zabbix/scripts \
532 + /var/lib/zabbix/alertscripts \
533 + /var/lib/zabbix/externalscripts \
534 + /var/log/zabbix
535 +
536 + keepdir \
537 + /etc/zabbix \
538 + /var/lib/zabbix \
539 + /var/lib/zabbix/home \
540 + /var/lib/zabbix/scripts \
541 + /var/lib/zabbix/alertscripts \
542 + /var/lib/zabbix/externalscripts \
543 + /var/log/zabbix
544 +
545 + if use server; then
546 + insinto /etc/zabbix
547 + doins "${FILESDIR}/3.0"/zabbix_server.conf
548 + doinitd "${FILESDIR}/3.0"/init.d/zabbix-server
549 + dosbin src/zabbix_server/zabbix_server
550 + fowners zabbix:zabbix /etc/zabbix/zabbix_server.conf
551 + fperms 0640 /etc/zabbix/zabbix_server.conf
552 + dodir /usr/share/zabbix
553 + /bin/cp -R "${S}/database/" "${D}"/usr/share/zabbix/
554 + systemd_dounit "${FILESDIR}/zabbix-server.service"
555 + systemd_newtmpfilesd "${FILESDIR}/zabbix-server.tmpfiles" zabbix-server.conf
556 + fi
557 +
558 + if use proxy; then
559 + doinitd "${FILESDIR}/3.0"/init.d/zabbix-proxy
560 + dosbin src/zabbix_proxy/zabbix_proxy
561 + insinto /etc/zabbix
562 + doins "${FILESDIR}/3.0"/zabbix_proxy.conf
563 + dodir /usr/share/zabbix
564 + /bin/cp -R "${S}/database/" "${D}"/usr/share/zabbix/
565 + systemd_dounit "${FILESDIR}/zabbix-proxy.service"
566 + systemd_newtmpfilesd "${FILESDIR}/zabbix-proxy.tmpfiles" zabbix-proxy.conf
567 + fi
568 +
569 + if use agent; then
570 + insinto /etc/zabbix
571 + doins "${FILESDIR}/3.0"/zabbix_agentd.conf
572 + doinitd "${FILESDIR}/3.0"/init.d/zabbix-agentd
573 + dosbin src/zabbix_agent/zabbix_agentd
574 + dobin \
575 + src/zabbix_sender/zabbix_sender \
576 + src/zabbix_get/zabbix_get
577 + fowners zabbix:zabbix /etc/zabbix/zabbix_agentd.conf
578 + fperms 0640 /etc/zabbix/zabbix_agentd.conf
579 + systemd_dounit "${FILESDIR}/zabbix-agentd.service"
580 + systemd_newtmpfilesd "${FILESDIR}/zabbix-agentd.tmpfiles" zabbix-agentd.conf
581 + fi
582 +
583 + fowners zabbix:zabbix \
584 + /etc/zabbix \
585 + /var/lib/zabbix \
586 + /var/lib/zabbix/home \
587 + /var/lib/zabbix/scripts \
588 + /var/lib/zabbix/alertscripts \
589 + /var/lib/zabbix/externalscripts \
590 + /var/log/zabbix
591 + fperms 0750 \
592 + /etc/zabbix \
593 + /var/lib/zabbix \
594 + /var/lib/zabbix/home \
595 + /var/lib/zabbix/scripts \
596 + /var/lib/zabbix/alertscripts \
597 + /var/lib/zabbix/externalscripts \
598 + /var/log/zabbix
599 +
600 + dodoc README INSTALL NEWS ChangeLog \
601 + conf/zabbix_agentd.conf \
602 + conf/zabbix_proxy.conf \
603 + conf/zabbix_agentd/userparameter_examples.conf \
604 + conf/zabbix_agentd/userparameter_mysql.conf \
605 + conf/zabbix_server.conf
606 +
607 + if use frontend; then
608 + webapp_src_preinst
609 + cp -R frontends/php/* "${D}/${MY_HTDOCSDIR}"
610 + webapp_configfile \
611 + "${MY_HTDOCSDIR}"/include/db.inc.php \
612 + "${MY_HTDOCSDIR}"/include/config.inc.php
613 + webapp_src_install
614 + fi
615 +
616 + if use java; then
617 + dodir \
618 + /${ZABBIXJAVA_BASE} \
619 + /${ZABBIXJAVA_BASE}/bin \
620 + /${ZABBIXJAVA_BASE}/lib
621 + keepdir /${ZABBIXJAVA_BASE}
622 + exeinto /${ZABBIXJAVA_BASE}/bin
623 + doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar
624 + exeinto /${ZABBIXJAVA_BASE}/lib
625 + doexe \
626 + src/zabbix_java/lib/logback-classic-0.9.27.jar \
627 + src/zabbix_java/lib/logback-console.xml \
628 + src/zabbix_java/lib/logback-core-0.9.27.jar \
629 + src/zabbix_java/lib/logback.xml \
630 + src/zabbix_java/lib/android-json-4.3_r3.1.jar \
631 + src/zabbix_java/lib/slf4j-api-1.6.1.jar
632 + fowners -R zabbix:zabbix /${ZABBIXJAVA_BASE}
633 + doinitd "${FILESDIR}"/3.0/init.d/zabbix-jmx-proxy
634 + doconfd "${FILESDIR}"/3.0/conf.d/zabbix-jmx-proxy
635 + fi
636 +}
637 +
638 +pkg_postinst() {
639 + if use server || use proxy ; then
640 + elog
641 + elog "You may need to configure your database for Zabbix,"
642 + elog "if you have not already done so. "
643 + elog
644 +
645 + zabbix_homedir=$(egethome zabbix)
646 + if [ -n "${zabbix_homedir}" ] && \
647 + [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then
648 + ewarn
649 + ewarn "The user 'zabbix' should have his homedir changed"
650 + ewarn "to /var/lib/zabbix/home if you want to use"
651 + ewarn "custom alert scripts."
652 + ewarn
653 + ewarn "A real homedir might be needed for configfiles"
654 + ewarn "for custom alert scripts (e.g. ~/.sendxmpprc when"
655 + ewarn "using sendxmpp for Jabber alerts)."
656 + ewarn
657 + ewarn "To change the homedir use:"
658 + ewarn " usermod -d /var/lib/zabbix/home zabbix"
659 + ewarn
660 + fi
661 + fi
662 +
663 + if use server; then
664 + elog
665 + elog "For distributed monitoring you have to run:"
666 + elog
667 + elog "zabbix_server -n <nodeid>"
668 + elog
669 + elog "This will convert database data for use with Node ID"
670 + elog "and also adds a local node."
671 + elog
672 + fi
673 +
674 + elog "--"
675 + elog
676 + elog "You may need to add these lines to /etc/services:"
677 + elog
678 + elog "zabbix-agent 10050/tcp Zabbix Agent"
679 + elog "zabbix-agent 10050/udp Zabbix Agent"
680 + elog "zabbix-trapper 10051/tcp Zabbix Trapper"
681 + elog "zabbix-trapper 10051/udp Zabbix Trapper"
682 + elog
683 +
684 + if use server || use proxy ; then
685 + # check for fping
686 + fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null)
687 + case "${fping_perms}" in
688 + 4[157][157][157])
689 + ;;
690 + *)
691 + ewarn
692 + ewarn "If you want to use the checks 'icmpping' and 'icmppingsec',"
693 + ewarn "you have to make /usr/sbin/fping setuid root and executable"
694 + ewarn "by everyone. Run the following command to fix it:"
695 + ewarn
696 + ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping"
697 + ewarn
698 + ewarn "Please be aware that this might impose a security risk,"
699 + ewarn "depending on the code quality of fping."
700 + ewarn
701 + ;;
702 + esac
703 + fi
704 +}