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