1 |
commit: 1755226b494876c2d42e1f681293efb2bb154bbb |
2 |
Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Mar 30 08:30:08 2020 +0000 |
4 |
Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Mar 30 08:30:08 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1755226b |
7 |
|
8 |
net-analyzer/zabbix: bump to 4.0.19 and 4.4.7 |
9 |
|
10 |
Package-Manager: Portage-2.3.96, Repoman-2.3.22 |
11 |
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org> |
12 |
|
13 |
net-analyzer/zabbix/Manifest | 2 + |
14 |
net-analyzer/zabbix/zabbix-4.0.19.ebuild | 350 +++++++++++++++++++++++++++++++ |
15 |
net-analyzer/zabbix/zabbix-4.4.7.ebuild | 347 ++++++++++++++++++++++++++++++ |
16 |
3 files changed, 699 insertions(+) |
17 |
|
18 |
diff --git a/net-analyzer/zabbix/Manifest b/net-analyzer/zabbix/Manifest |
19 |
index 4f50f6f2d42..6cd40a58fc1 100644 |
20 |
--- a/net-analyzer/zabbix/Manifest |
21 |
+++ b/net-analyzer/zabbix/Manifest |
22 |
@@ -1,3 +1,5 @@ |
23 |
DIST zabbix-3.0.30.tar.gz 14700686 BLAKE2B 9caa772c8dfdd53411bc996b8c97dce7c24853ea1049fe3cb71048c089105af5c7d1cf51071d91d1d2a98113181e9977a1ca3b4304e42a4a2f8bb0b87cd725b8 SHA512 6e60c9e5570aa69e1d52f005094eda1618aafc6d7ee831d4e5dc26f64b0691e2d9e494845fd36d22b049175776057fca28142da31d5e8e06d6c6f3e003bde3a3 |
24 |
DIST zabbix-4.0.18.tar.gz 17200784 BLAKE2B 00c447459518d4c3a600e82f42f2ae14bcda6d8a933eb25a31fb00951f556355925e90960b76e273c2cc08a83b476e7c1a98b2e94aa4c23363fd639d4b199ac5 SHA512 c686611f60242cb2bef408bacbd71b7f3e88ad01b5ac9c34566c36812c9469c85c2388a9efd2ded5b329a3ffa7ec474845f2bac4e100e66b80078823c276cecb |
25 |
+DIST zabbix-4.0.19.tar.gz 17211769 BLAKE2B 1f7ac3fb195c35a41fae84a2b9a7985bee49664df8469ef7a14b9e264348447e5d5822fdc05feca4041ca57e74d15bc8b5cae262024fc5dca7749af263224d2d SHA512 c279af3d8b1b9125420d65e4e20a8892f9531a345e1f0046214fa14ab6204d535fd0cb672b5f3c6b5e325b7d8ff44e317bde58611f4bef9d89aba70851326daf |
26 |
DIST zabbix-4.4.6.tar.gz 19371211 BLAKE2B b63d946f360c529bfc32070e2907cdfada34ee3615c24c6a65ada7379e2ad65ff8e1d182ff9b59e11c844103cb608aafeab0f2bc6bb97fc1a31183214a6df01e SHA512 f9e84872f0210e497261462de95e9096391fc74bee6fd511087825fcfdd8f363003bd090e01a8a092a69ef1f01c4dd31d623f5321cf77dbced0bd337fb91682c |
27 |
+DIST zabbix-4.4.7.tar.gz 19413652 BLAKE2B 3c7d55a64f8d0e94d7fca3d088bb40592f56ffd5ca8025fb2cdd82ae7946bca1449b354e74cc3e50a6fca9b0bc2b46cf995b74d31d4b462f3d0b4be734f7c19b SHA512 2b96771bb555fae3df67665ac2e47c94662b071eb97c943d59b8f1fc7d31e2bf349c551a0015c6e239321f069b3ab87373c397a023cbff3daad8bd310d11fb6a |
28 |
|
29 |
diff --git a/net-analyzer/zabbix/zabbix-4.0.19.ebuild b/net-analyzer/zabbix/zabbix-4.0.19.ebuild |
30 |
new file mode 100644 |
31 |
index 00000000000..28210112c73 |
32 |
--- /dev/null |
33 |
+++ b/net-analyzer/zabbix/zabbix-4.0.19.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="mirror://sourceforge/project/zabbix/ZABBIX%20Latest%20Stable/${PV}/${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}/${P}-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 |
+} |
385 |
|
386 |
diff --git a/net-analyzer/zabbix/zabbix-4.4.7.ebuild b/net-analyzer/zabbix/zabbix-4.4.7.ebuild |
387 |
new file mode 100644 |
388 |
index 00000000000..8d4030480f5 |
389 |
--- /dev/null |
390 |
+++ b/net-analyzer/zabbix/zabbix-4.4.7.ebuild |
391 |
@@ -0,0 +1,347 @@ |
392 |
+# Copyright 1999-2020 Gentoo Authors |
393 |
+# Distributed under the terms of the GNU General Public License v2 |
394 |
+ |
395 |
+EAPI=7 |
396 |
+ |
397 |
+# needed to make webapp-config dep optional |
398 |
+WEBAPP_OPTIONAL="yes" |
399 |
+inherit flag-o-matic webapp java-pkg-opt-2 user systemd toolchain-funcs |
400 |
+ |
401 |
+DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers" |
402 |
+HOMEPAGE="https://www.zabbix.com/" |
403 |
+MY_P=${P/_/} |
404 |
+MY_PV=${PV/_/} |
405 |
+SRC_URI="mirror://sourceforge/project/zabbix/ZABBIX%20Latest%20Stable/${PV}/${P}.tar.gz" |
406 |
+LICENSE="GPL-2" |
407 |
+SLOT="0" |
408 |
+WEBAPP_MANUAL_SLOT="yes" |
409 |
+KEYWORDS="~amd64 ~x86" |
410 |
+IUSE="+agent java curl frontend ipv6 ldap libxml2 mysql openipmi oracle +postgres proxy server ssh ssl snmp sqlite odbc static" |
411 |
+REQUIRED_USE="|| ( agent frontend proxy server ) |
412 |
+ proxy? ( ^^ ( mysql oracle postgres sqlite odbc ) ) |
413 |
+ server? ( ^^ ( mysql oracle postgres odbc ) ) |
414 |
+ static? ( !oracle !snmp )" |
415 |
+ |
416 |
+COMMON_DEPEND=" |
417 |
+ curl? ( net-misc/curl ) |
418 |
+ java? ( >=virtual/jdk-1.8:* ) |
419 |
+ ldap? ( |
420 |
+ =dev-libs/cyrus-sasl-2* |
421 |
+ net-libs/gnutls |
422 |
+ net-nds/openldap |
423 |
+ ) |
424 |
+ libxml2? ( dev-libs/libxml2 ) |
425 |
+ mysql? ( dev-db/mysql-connector-c ) |
426 |
+ odbc? ( dev-db/unixODBC ) |
427 |
+ openipmi? ( sys-libs/openipmi ) |
428 |
+ oracle? ( dev-db/oracle-instantclient-basic ) |
429 |
+ postgres? ( dev-db/postgresql:* ) |
430 |
+ proxy? ( sys-libs/zlib ) |
431 |
+ server? ( |
432 |
+ dev-libs/libevent |
433 |
+ sys-libs/zlib |
434 |
+ ) |
435 |
+ snmp? ( net-analyzer/net-snmp ) |
436 |
+ sqlite? ( dev-db/sqlite ) |
437 |
+ ssh? ( net-libs/libssh2 ) |
438 |
+ ssl? ( dev-libs/openssl:=[-bindist] ) |
439 |
+" |
440 |
+ |
441 |
+RDEPEND="${COMMON_DEPEND} |
442 |
+ java? ( >=virtual/jre-1.8:* ) |
443 |
+ mysql? ( virtual/mysql ) |
444 |
+ proxy? ( net-analyzer/fping[suid] ) |
445 |
+ server? ( |
446 |
+ app-admin/webapp-config |
447 |
+ dev-libs/libevent |
448 |
+ dev-libs/libpcre |
449 |
+ net-analyzer/fping[suid] |
450 |
+ ) |
451 |
+ frontend? ( |
452 |
+ app-admin/webapp-config |
453 |
+ dev-lang/php:*[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode] |
454 |
+ media-libs/gd[png] |
455 |
+ virtual/httpd-php:* |
456 |
+ mysql? ( dev-lang/php[mysqli] ) |
457 |
+ odbc? ( dev-lang/php[odbc] ) |
458 |
+ oracle? ( dev-lang/php[oci8-instant-client] ) |
459 |
+ postgres? ( dev-lang/php[postgres] ) |
460 |
+ sqlite? ( dev-lang/php[sqlite] ) |
461 |
+ ) |
462 |
+" |
463 |
+DEPEND="${COMMON_DEPEND} |
464 |
+ static? ( |
465 |
+ curl? ( net-misc/curl[static-libs] ) |
466 |
+ ldap? ( |
467 |
+ =dev-libs/cyrus-sasl-2*[static-libs] |
468 |
+ net-libs/gnutls[static-libs] |
469 |
+ net-nds/openldap[static-libs] |
470 |
+ ) |
471 |
+ libxml2? ( dev-libs/libxml2[static-libs] ) |
472 |
+ mysql? ( dev-db/mysql-connector-c[static-libs] ) |
473 |
+ odbc? ( dev-db/unixODBC[static-libs] ) |
474 |
+ postgres? ( dev-db/postgresql:*[static-libs] ) |
475 |
+ sqlite? ( dev-db/sqlite[static-libs] ) |
476 |
+ ssh? ( net-libs/libssh2 ) |
477 |
+ ) |
478 |
+" |
479 |
+BDEPEND=" |
480 |
+ virtual/pkgconfig |
481 |
+" |
482 |
+ |
483 |
+PATCHES=( |
484 |
+ "${FILESDIR}/${PN}-4.0.18-modulepathfix.patch" |
485 |
+ "${FILESDIR}/${PN}-3.0.30-security-disable-PidFile.patch" |
486 |
+) |
487 |
+ |
488 |
+S=${WORKDIR}/${MY_P} |
489 |
+ |
490 |
+ZABBIXJAVA_BASE="opt/zabbix_java" |
491 |
+ |
492 |
+pkg_setup() { |
493 |
+ if use oracle; then |
494 |
+ if [ -z "${ORACLE_HOME}" ]; then |
495 |
+ eerror |
496 |
+ eerror "The environment variable ORACLE_HOME must be set" |
497 |
+ eerror "and point to the correct location." |
498 |
+ eerror "It looks like you don't have Oracle installed." |
499 |
+ eerror |
500 |
+ die "Environment variable ORACLE_HOME is not set" |
501 |
+ fi |
502 |
+ if has_version 'dev-db/oracle-instantclient-basic'; then |
503 |
+ ewarn |
504 |
+ ewarn "Please ensure you have a full install of the Oracle client." |
505 |
+ ewarn "dev-db/oracle-instantclient* is NOT sufficient." |
506 |
+ ewarn |
507 |
+ fi |
508 |
+ fi |
509 |
+ |
510 |
+ if use frontend; then |
511 |
+ webapp_pkg_setup |
512 |
+ fi |
513 |
+ |
514 |
+ enewgroup zabbix |
515 |
+ enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix |
516 |
+ |
517 |
+ java-pkg-opt-2_pkg_setup |
518 |
+} |
519 |
+ |
520 |
+src_prepare() { |
521 |
+ default |
522 |
+} |
523 |
+ |
524 |
+src_configure() { |
525 |
+ econf \ |
526 |
+ $(use_enable agent) \ |
527 |
+ $(use_enable ipv6) \ |
528 |
+ $(use_enable java) \ |
529 |
+ $(use_enable proxy) \ |
530 |
+ $(use_enable server) \ |
531 |
+ $(use_enable static) \ |
532 |
+ $(use_with curl libcurl) \ |
533 |
+ $(use_with ldap) \ |
534 |
+ $(use_with libxml2) \ |
535 |
+ $(use_with mysql) \ |
536 |
+ $(use_with odbc unixodbc) \ |
537 |
+ $(use_with openipmi openipmi) \ |
538 |
+ $(use_with oracle) \ |
539 |
+ $(use_with postgres postgresql) \ |
540 |
+ $(use_with snmp net-snmp) \ |
541 |
+ $(use_with sqlite sqlite3) \ |
542 |
+ $(use_with ssh ssh2) \ |
543 |
+ $(use_with ssl openssl) |
544 |
+} |
545 |
+ |
546 |
+src_compile() { |
547 |
+ if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then |
548 |
+ emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" |
549 |
+ fi |
550 |
+} |
551 |
+ |
552 |
+src_install() { |
553 |
+ local dirs=( |
554 |
+ /etc/zabbix |
555 |
+ /var/lib/zabbix |
556 |
+ /var/lib/zabbix/home |
557 |
+ /var/lib/zabbix/scripts |
558 |
+ /var/lib/zabbix/alertscripts |
559 |
+ /var/lib/zabbix/externalscripts |
560 |
+ /var/log/zabbix |
561 |
+ ) |
562 |
+ |
563 |
+ for dir in "${dirs[@]}"; do |
564 |
+ dodir "${dir}" |
565 |
+ keepdir "${dir}" |
566 |
+ done |
567 |
+ |
568 |
+ if use server; then |
569 |
+ insinto /etc/zabbix |
570 |
+ doins "${S}"/conf/zabbix_server.conf |
571 |
+ fperms 0640 /etc/zabbix/zabbix_server.conf |
572 |
+ fowners root:zabbix /etc/zabbix/zabbix_server.conf |
573 |
+ |
574 |
+ newinitd "${FILESDIR}"/zabbix-server.init zabbix-server |
575 |
+ |
576 |
+ dosbin src/zabbix_server/zabbix_server |
577 |
+ |
578 |
+ insinto /usr/share/zabbix |
579 |
+ doins -r "${S}"/database/ |
580 |
+ |
581 |
+ systemd_dounit "${FILESDIR}"/zabbix-server.service |
582 |
+ systemd_newtmpfilesd "${FILESDIR}"/zabbix-server.tmpfiles zabbix-server.conf |
583 |
+ fi |
584 |
+ |
585 |
+ if use proxy; then |
586 |
+ insinto /etc/zabbix |
587 |
+ doins "${S}"/conf/zabbix_proxy.conf |
588 |
+ fperms 0640 /etc/zabbix/zabbix_proxy.conf |
589 |
+ fowners root:zabbix /etc/zabbix/zabbix_proxy.conf |
590 |
+ |
591 |
+ newinitd "${FILESDIR}"/zabbix-proxy.init zabbix-proxy |
592 |
+ |
593 |
+ dosbin src/zabbix_proxy/zabbix_proxy |
594 |
+ |
595 |
+ insinto /usr/share/zabbix |
596 |
+ doins -r "${S}"/database/ |
597 |
+ |
598 |
+ systemd_dounit "${FILESDIR}"/zabbix-proxy.service |
599 |
+ systemd_newtmpfilesd "${FILESDIR}"/zabbix-proxy.tmpfiles zabbix-proxy.conf |
600 |
+ fi |
601 |
+ |
602 |
+ if use agent; then |
603 |
+ insinto /etc/zabbix |
604 |
+ doins "${S}"/conf/zabbix_agentd.conf |
605 |
+ fperms 0640 /etc/zabbix/zabbix_agentd.conf |
606 |
+ fowners root:zabbix /etc/zabbix/zabbix_agentd.conf |
607 |
+ |
608 |
+ newinitd "${FILESDIR}"/zabbix-agentd.init zabbix-agentd |
609 |
+ |
610 |
+ dosbin src/zabbix_agent/zabbix_agentd |
611 |
+ dobin \ |
612 |
+ src/zabbix_sender/zabbix_sender \ |
613 |
+ src/zabbix_get/zabbix_get |
614 |
+ |
615 |
+ systemd_dounit "${FILESDIR}"/zabbix-agentd.service |
616 |
+ systemd_newtmpfilesd "${FILESDIR}"/zabbix-agentd.tmpfiles zabbix-agentd.conf |
617 |
+ fi |
618 |
+ |
619 |
+ fowners root:zabbix /etc/zabbix |
620 |
+ fowners zabbix:zabbix \ |
621 |
+ /var/lib/zabbix \ |
622 |
+ /var/lib/zabbix/home \ |
623 |
+ /var/lib/zabbix/scripts \ |
624 |
+ /var/lib/zabbix/alertscripts \ |
625 |
+ /var/lib/zabbix/externalscripts \ |
626 |
+ /var/log/zabbix |
627 |
+ fperms 0750 \ |
628 |
+ /etc/zabbix \ |
629 |
+ /var/lib/zabbix \ |
630 |
+ /var/lib/zabbix/home \ |
631 |
+ /var/lib/zabbix/scripts \ |
632 |
+ /var/lib/zabbix/alertscripts \ |
633 |
+ /var/lib/zabbix/externalscripts \ |
634 |
+ /var/log/zabbix |
635 |
+ |
636 |
+ dodoc README INSTALL NEWS ChangeLog \ |
637 |
+ conf/zabbix_agentd.conf \ |
638 |
+ conf/zabbix_proxy.conf \ |
639 |
+ conf/zabbix_agentd/userparameter_examples.conf \ |
640 |
+ conf/zabbix_agentd/userparameter_mysql.conf \ |
641 |
+ conf/zabbix_server.conf |
642 |
+ |
643 |
+ if use frontend; then |
644 |
+ webapp_src_preinst |
645 |
+ cp -R frontends/php/* "${D}/${MY_HTDOCSDIR}" |
646 |
+ webapp_configfile \ |
647 |
+ "${MY_HTDOCSDIR}"/include/db.inc.php \ |
648 |
+ "${MY_HTDOCSDIR}"/include/config.inc.php |
649 |
+ webapp_src_install |
650 |
+ fi |
651 |
+ |
652 |
+ if use java; then |
653 |
+ dodir \ |
654 |
+ /${ZABBIXJAVA_BASE} \ |
655 |
+ /${ZABBIXJAVA_BASE}/bin \ |
656 |
+ /${ZABBIXJAVA_BASE}/lib |
657 |
+ keepdir /${ZABBIXJAVA_BASE} |
658 |
+ exeinto /${ZABBIXJAVA_BASE}/bin |
659 |
+ doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar |
660 |
+ exeinto /${ZABBIXJAVA_BASE}/lib |
661 |
+ doexe \ |
662 |
+ src/zabbix_java/lib/logback-classic-0.9.27.jar \ |
663 |
+ src/zabbix_java/lib/logback-console.xml \ |
664 |
+ src/zabbix_java/lib/logback-core-0.9.27.jar \ |
665 |
+ src/zabbix_java/lib/logback.xml \ |
666 |
+ src/zabbix_java/lib/android-json-4.3_r3.1.jar \ |
667 |
+ src/zabbix_java/lib/slf4j-api-1.6.1.jar |
668 |
+ newinitd "${FILESDIR}"/zabbix-jmx-proxy.init zabbix-jmx-proxy |
669 |
+ newconfd "${FILESDIR}"/zabbix-jmx-proxy.conf zabbix-jmx-proxy |
670 |
+ fi |
671 |
+} |
672 |
+ |
673 |
+pkg_postinst() { |
674 |
+ if use server || use proxy ; then |
675 |
+ elog |
676 |
+ elog "You may need to configure your database for Zabbix" |
677 |
+ elog "if you have not already done so." |
678 |
+ elog |
679 |
+ |
680 |
+ zabbix_homedir=$(egethome zabbix) |
681 |
+ if [ -n "${zabbix_homedir}" ] && \ |
682 |
+ [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then |
683 |
+ ewarn |
684 |
+ ewarn "The user 'zabbix' should have his homedir changed" |
685 |
+ ewarn "to /var/lib/zabbix/home if you want to use" |
686 |
+ ewarn "custom alert scripts." |
687 |
+ ewarn |
688 |
+ ewarn "A real homedir might be needed for configfiles" |
689 |
+ ewarn "for custom alert scripts." |
690 |
+ ewarn |
691 |
+ ewarn "To change the homedir use:" |
692 |
+ ewarn " usermod -d /var/lib/zabbix/home zabbix" |
693 |
+ ewarn |
694 |
+ fi |
695 |
+ fi |
696 |
+ |
697 |
+ if use server; then |
698 |
+ elog |
699 |
+ elog "For distributed monitoring you have to run:" |
700 |
+ elog |
701 |
+ elog "zabbix_server -n <nodeid>" |
702 |
+ elog |
703 |
+ elog "This will convert database data for use with Node ID" |
704 |
+ elog "and also adds a local node." |
705 |
+ elog |
706 |
+ fi |
707 |
+ |
708 |
+ elog "--" |
709 |
+ elog |
710 |
+ elog "You may need to add these lines to /etc/services:" |
711 |
+ elog |
712 |
+ elog "zabbix-agent 10050/tcp Zabbix Agent" |
713 |
+ elog "zabbix-agent 10050/udp Zabbix Agent" |
714 |
+ elog "zabbix-trapper 10051/tcp Zabbix Trapper" |
715 |
+ elog "zabbix-trapper 10051/udp Zabbix Trapper" |
716 |
+ elog |
717 |
+ |
718 |
+ if use server || use proxy ; then |
719 |
+ # check for fping |
720 |
+ fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null) |
721 |
+ case "${fping_perms}" in |
722 |
+ 4[157][157][157]) |
723 |
+ ;; |
724 |
+ *) |
725 |
+ ewarn |
726 |
+ ewarn "If you want to use the checks 'icmpping' and 'icmppingsec'," |
727 |
+ ewarn "you have to make /usr/sbin/fping setuid root and executable" |
728 |
+ ewarn "by everyone. Run the following command to fix it:" |
729 |
+ ewarn |
730 |
+ ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping" |
731 |
+ ewarn |
732 |
+ ewarn "Please be aware that this might impose a security risk," |
733 |
+ ewarn "depending on the code quality of fping." |
734 |
+ ewarn |
735 |
+ ;; |
736 |
+ esac |
737 |
+ fi |
738 |
+} |