1 |
commit: d9e96603aedd2a48f20dcec485417813fcb7b411 |
2 |
Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Apr 30 09:02:31 2020 +0000 |
4 |
Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Apr 30 09:02:58 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9e96603 |
7 |
|
8 |
net-analyzer/zabbix: bump to 4.4.8, 4.0.20 and 3.0.31 |
9 |
|
10 |
Package-Manager: Portage-2.3.99, Repoman-2.3.22 |
11 |
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org> |
12 |
|
13 |
net-analyzer/zabbix/Manifest | 3 + |
14 |
net-analyzer/zabbix/zabbix-3.0.31.ebuild | 350 +++++++++++++++++++++++++++++++ |
15 |
net-analyzer/zabbix/zabbix-4.0.20.ebuild | 350 +++++++++++++++++++++++++++++++ |
16 |
net-analyzer/zabbix/zabbix-4.4.8.ebuild | 347 ++++++++++++++++++++++++++++++ |
17 |
4 files changed, 1050 insertions(+) |
18 |
|
19 |
diff --git a/net-analyzer/zabbix/Manifest b/net-analyzer/zabbix/Manifest |
20 |
index 6cd40a58fc1..157252c9bd4 100644 |
21 |
--- a/net-analyzer/zabbix/Manifest |
22 |
+++ b/net-analyzer/zabbix/Manifest |
23 |
@@ -1,5 +1,8 @@ |
24 |
DIST zabbix-3.0.30.tar.gz 14700686 BLAKE2B 9caa772c8dfdd53411bc996b8c97dce7c24853ea1049fe3cb71048c089105af5c7d1cf51071d91d1d2a98113181e9977a1ca3b4304e42a4a2f8bb0b87cd725b8 SHA512 6e60c9e5570aa69e1d52f005094eda1618aafc6d7ee831d4e5dc26f64b0691e2d9e494845fd36d22b049175776057fca28142da31d5e8e06d6c6f3e003bde3a3 |
25 |
+DIST zabbix-3.0.31.tar.gz 14698394 BLAKE2B b8b5f94fe7fe08385b1b358c628b2047b437e6068dab8c3dbdab03e55e95e27f1b77ede4a1a57c4f79bf4a629d9dc5671bd144c002ace7c915f2fed382ac13b2 SHA512 35fec45667cdf217c2be21a164181f92f8f11ef9bcfb0c8dad914726e7c436bae5f8a97aebc3af82499e37125f4d1896ef74ad061a1ee3cbb674562c22a832b1 |
26 |
DIST zabbix-4.0.18.tar.gz 17200784 BLAKE2B 00c447459518d4c3a600e82f42f2ae14bcda6d8a933eb25a31fb00951f556355925e90960b76e273c2cc08a83b476e7c1a98b2e94aa4c23363fd639d4b199ac5 SHA512 c686611f60242cb2bef408bacbd71b7f3e88ad01b5ac9c34566c36812c9469c85c2388a9efd2ded5b329a3ffa7ec474845f2bac4e100e66b80078823c276cecb |
27 |
DIST zabbix-4.0.19.tar.gz 17211769 BLAKE2B 1f7ac3fb195c35a41fae84a2b9a7985bee49664df8469ef7a14b9e264348447e5d5822fdc05feca4041ca57e74d15bc8b5cae262024fc5dca7749af263224d2d SHA512 c279af3d8b1b9125420d65e4e20a8892f9531a345e1f0046214fa14ab6204d535fd0cb672b5f3c6b5e325b7d8ff44e317bde58611f4bef9d89aba70851326daf |
28 |
+DIST zabbix-4.0.20.tar.gz 17215217 BLAKE2B 144b334e78b121d0ba01b285590a6d354ed54be8dcebc12216b51f9829dba98c76d122bb329efbf67931237636fe178ecf5dfd141954fe37d1063c24c3c6dcda SHA512 5f761ba8bd3eac67de9f8d3614ebf437a6a4cdad8f0bf961c8b4cbe39f13bafe64bdb58b6ba56f1a27304ebdaa32109447bd3328fd3e2fcc1aacde056fb1d5dd |
29 |
DIST zabbix-4.4.6.tar.gz 19371211 BLAKE2B b63d946f360c529bfc32070e2907cdfada34ee3615c24c6a65ada7379e2ad65ff8e1d182ff9b59e11c844103cb608aafeab0f2bc6bb97fc1a31183214a6df01e SHA512 f9e84872f0210e497261462de95e9096391fc74bee6fd511087825fcfdd8f363003bd090e01a8a092a69ef1f01c4dd31d623f5321cf77dbced0bd337fb91682c |
30 |
DIST zabbix-4.4.7.tar.gz 19413652 BLAKE2B 3c7d55a64f8d0e94d7fca3d088bb40592f56ffd5ca8025fb2cdd82ae7946bca1449b354e74cc3e50a6fca9b0bc2b46cf995b74d31d4b462f3d0b4be734f7c19b SHA512 2b96771bb555fae3df67665ac2e47c94662b071eb97c943d59b8f1fc7d31e2bf349c551a0015c6e239321f069b3ab87373c397a023cbff3daad8bd310d11fb6a |
31 |
+DIST zabbix-4.4.8.tar.gz 19457802 BLAKE2B 4cc566b744d500c5f3a95eeaebe5418ff58cf3852318f474991706b0f81d1a9b0a1b3793e3e28b99fc45f4a6bfb9281c4d42acb5bb8fc49c37802d3c245dd853 SHA512 bd850d4ec8f30b9bcd531d84606c900692be5b91424cb06f66cde24ed4634a93d25476010e4387b51933406c2552a611e2e7ec4691b57ca6c38fc874c4b1aef1 |
32 |
|
33 |
diff --git a/net-analyzer/zabbix/zabbix-3.0.31.ebuild b/net-analyzer/zabbix/zabbix-3.0.31.ebuild |
34 |
new file mode 100644 |
35 |
index 00000000000..e92843dc7b0 |
36 |
--- /dev/null |
37 |
+++ b/net-analyzer/zabbix/zabbix-3.0.31.ebuild |
38 |
@@ -0,0 +1,350 @@ |
39 |
+# Copyright 1999-2020 Gentoo Authors |
40 |
+# Distributed under the terms of the GNU General Public License v2 |
41 |
+ |
42 |
+EAPI=7 |
43 |
+ |
44 |
+# needed to make webapp-config dep optional |
45 |
+WEBAPP_OPTIONAL="yes" |
46 |
+inherit flag-o-matic webapp java-pkg-opt-2 user systemd toolchain-funcs |
47 |
+ |
48 |
+DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers" |
49 |
+HOMEPAGE="https://www.zabbix.com/" |
50 |
+MY_P=${P/_/} |
51 |
+MY_PV=${PV/_/} |
52 |
+SRC_URI="https://cdn.zabbix.com/stable/${PV}/${P}.tar.gz" |
53 |
+LICENSE="GPL-2" |
54 |
+SLOT="0" |
55 |
+WEBAPP_MANUAL_SLOT="yes" |
56 |
+KEYWORDS="~amd64 ~x86" |
57 |
+IUSE="+agent java curl frontend ipv6 xmpp ldap libxml2 mysql openipmi oracle +postgres proxy server ssh ssl snmp sqlite odbc static" |
58 |
+REQUIRED_USE="|| ( agent frontend proxy server ) |
59 |
+ proxy? ( ^^ ( mysql oracle postgres sqlite odbc ) ) |
60 |
+ server? ( ^^ ( mysql oracle postgres odbc ) ) |
61 |
+ static? ( !oracle !snmp )" |
62 |
+ |
63 |
+COMMON_DEPEND=" |
64 |
+ curl? ( net-misc/curl ) |
65 |
+ java? ( >=virtual/jdk-1.8:* ) |
66 |
+ ldap? ( |
67 |
+ =dev-libs/cyrus-sasl-2* |
68 |
+ net-libs/gnutls |
69 |
+ net-nds/openldap |
70 |
+ ) |
71 |
+ libxml2? ( dev-libs/libxml2 ) |
72 |
+ mysql? ( dev-db/mysql-connector-c ) |
73 |
+ odbc? ( dev-db/unixODBC ) |
74 |
+ openipmi? ( sys-libs/openipmi ) |
75 |
+ oracle? ( dev-db/oracle-instantclient-basic ) |
76 |
+ postgres? ( dev-db/postgresql:* ) |
77 |
+ proxy? ( sys-libs/zlib ) |
78 |
+ server? ( |
79 |
+ dev-libs/libevent |
80 |
+ sys-libs/zlib |
81 |
+ ) |
82 |
+ snmp? ( net-analyzer/net-snmp ) |
83 |
+ sqlite? ( dev-db/sqlite ) |
84 |
+ ssh? ( net-libs/libssh2 ) |
85 |
+ ssl? ( dev-libs/openssl:=[-bindist] ) |
86 |
+ xmpp? ( dev-libs/iksemel ) |
87 |
+" |
88 |
+ |
89 |
+RDEPEND="${COMMON_DEPEND} |
90 |
+ java? ( >=virtual/jre-1.8:* ) |
91 |
+ mysql? ( virtual/mysql ) |
92 |
+ proxy? ( net-analyzer/fping[suid] ) |
93 |
+ server? ( |
94 |
+ app-admin/webapp-config |
95 |
+ dev-libs/libevent |
96 |
+ dev-libs/libpcre |
97 |
+ net-analyzer/fping[suid] |
98 |
+ ) |
99 |
+ frontend? ( |
100 |
+ app-admin/webapp-config |
101 |
+ dev-lang/php:*[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode] |
102 |
+ media-libs/gd[png] |
103 |
+ virtual/httpd-php:* |
104 |
+ mysql? ( dev-lang/php[mysqli] ) |
105 |
+ odbc? ( dev-lang/php[odbc] ) |
106 |
+ oracle? ( dev-lang/php[oci8-instant-client] ) |
107 |
+ postgres? ( dev-lang/php[postgres] ) |
108 |
+ sqlite? ( dev-lang/php[sqlite] ) |
109 |
+ ) |
110 |
+" |
111 |
+DEPEND="${COMMON_DEPEND} |
112 |
+ static? ( |
113 |
+ curl? ( net-misc/curl[static-libs] ) |
114 |
+ ldap? ( |
115 |
+ =dev-libs/cyrus-sasl-2*[static-libs] |
116 |
+ net-libs/gnutls[static-libs] |
117 |
+ net-nds/openldap[static-libs] |
118 |
+ ) |
119 |
+ libxml2? ( dev-libs/libxml2[static-libs] ) |
120 |
+ mysql? ( dev-db/mysql-connector-c[static-libs] ) |
121 |
+ odbc? ( dev-db/unixODBC[static-libs] ) |
122 |
+ postgres? ( dev-db/postgresql:*[static-libs] ) |
123 |
+ sqlite? ( dev-db/sqlite[static-libs] ) |
124 |
+ ssh? ( net-libs/libssh2 ) |
125 |
+ ) |
126 |
+" |
127 |
+BDEPEND=" |
128 |
+ virtual/pkgconfig |
129 |
+" |
130 |
+ |
131 |
+PATCHES=( |
132 |
+ "${FILESDIR}/${P}-security-disable-PidFile.patch" |
133 |
+ "${FILESDIR}/${P}-mysql8.patch" |
134 |
+) |
135 |
+ |
136 |
+S=${WORKDIR}/${MY_P} |
137 |
+ |
138 |
+ZABBIXJAVA_BASE="opt/zabbix_java" |
139 |
+ |
140 |
+pkg_setup() { |
141 |
+ if use oracle; then |
142 |
+ if [ -z "${ORACLE_HOME}" ]; then |
143 |
+ eerror |
144 |
+ eerror "The environment variable ORACLE_HOME must be set" |
145 |
+ eerror "and point to the correct location." |
146 |
+ eerror "It looks like you don't have Oracle installed." |
147 |
+ eerror |
148 |
+ die "Environment variable ORACLE_HOME is not set" |
149 |
+ fi |
150 |
+ if has_version 'dev-db/oracle-instantclient-basic'; then |
151 |
+ ewarn |
152 |
+ ewarn "Please ensure you have a full install of the Oracle client." |
153 |
+ ewarn "dev-db/oracle-instantclient* is NOT sufficient." |
154 |
+ ewarn |
155 |
+ fi |
156 |
+ fi |
157 |
+ |
158 |
+ if use frontend; then |
159 |
+ webapp_pkg_setup |
160 |
+ fi |
161 |
+ |
162 |
+ enewgroup zabbix |
163 |
+ enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix |
164 |
+ |
165 |
+ java-pkg-opt-2_pkg_setup |
166 |
+} |
167 |
+ |
168 |
+src_prepare() { |
169 |
+ default |
170 |
+} |
171 |
+ |
172 |
+src_configure() { |
173 |
+ econf \ |
174 |
+ $(use_enable agent) \ |
175 |
+ $(use_enable ipv6) \ |
176 |
+ $(use_enable java) \ |
177 |
+ $(use_enable proxy) \ |
178 |
+ $(use_enable server) \ |
179 |
+ $(use_enable static) \ |
180 |
+ $(use_with curl libcurl) \ |
181 |
+ $(use_with ldap) \ |
182 |
+ $(use_with libxml2) \ |
183 |
+ $(use_with mysql) \ |
184 |
+ $(use_with odbc unixodbc) \ |
185 |
+ $(use_with openipmi openipmi) \ |
186 |
+ $(use_with oracle) \ |
187 |
+ $(use_with postgres postgresql) \ |
188 |
+ $(use_with snmp net-snmp) \ |
189 |
+ $(use_with sqlite sqlite3) \ |
190 |
+ $(use_with ssh ssh2) \ |
191 |
+ $(use_with ssl openssl) \ |
192 |
+ $(use_with xmpp jabber) |
193 |
+} |
194 |
+ |
195 |
+src_compile() { |
196 |
+ if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then |
197 |
+ emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" |
198 |
+ fi |
199 |
+} |
200 |
+ |
201 |
+src_install() { |
202 |
+ local dirs=( |
203 |
+ /etc/zabbix |
204 |
+ /var/lib/zabbix |
205 |
+ /var/lib/zabbix/home |
206 |
+ /var/lib/zabbix/scripts |
207 |
+ /var/lib/zabbix/alertscripts |
208 |
+ /var/lib/zabbix/externalscripts |
209 |
+ /var/log/zabbix |
210 |
+ ) |
211 |
+ |
212 |
+ for dir in "${dirs[@]}"; do |
213 |
+ dodir "${dir}" |
214 |
+ keepdir "${dir}" |
215 |
+ done |
216 |
+ |
217 |
+ if use server; then |
218 |
+ insinto /etc/zabbix |
219 |
+ doins "${S}"/conf/zabbix_server.conf |
220 |
+ fperms 0640 /etc/zabbix/zabbix_server.conf |
221 |
+ fowners root:zabbix /etc/zabbix/zabbix_server.conf |
222 |
+ |
223 |
+ newinitd "${FILESDIR}"/zabbix-server.init zabbix-server |
224 |
+ |
225 |
+ dosbin src/zabbix_server/zabbix_server |
226 |
+ |
227 |
+ insinto /usr/share/zabbix |
228 |
+ doins -r "${S}"/database/ |
229 |
+ |
230 |
+ systemd_dounit "${FILESDIR}"/zabbix-server.service |
231 |
+ systemd_newtmpfilesd "${FILESDIR}"/zabbix-server.tmpfiles zabbix-server.conf |
232 |
+ fi |
233 |
+ |
234 |
+ if use proxy; then |
235 |
+ insinto /etc/zabbix |
236 |
+ doins "${S}"/conf/zabbix_proxy.conf |
237 |
+ fperms 0640 /etc/zabbix/zabbix_proxy.conf |
238 |
+ fowners root:zabbix /etc/zabbix/zabbix_proxy.conf |
239 |
+ |
240 |
+ newinitd "${FILESDIR}"/zabbix-proxy.init zabbix-proxy |
241 |
+ |
242 |
+ dosbin src/zabbix_proxy/zabbix_proxy |
243 |
+ |
244 |
+ insinto /usr/share/zabbix |
245 |
+ doins -r "${S}"/database/ |
246 |
+ |
247 |
+ systemd_dounit "${FILESDIR}"/zabbix-proxy.service |
248 |
+ systemd_newtmpfilesd "${FILESDIR}"/zabbix-proxy.tmpfiles zabbix-proxy.conf |
249 |
+ fi |
250 |
+ |
251 |
+ if use agent; then |
252 |
+ insinto /etc/zabbix |
253 |
+ doins "${S}"/conf/zabbix_agentd.conf |
254 |
+ fperms 0640 /etc/zabbix/zabbix_agentd.conf |
255 |
+ fowners root:zabbix /etc/zabbix/zabbix_agentd.conf |
256 |
+ |
257 |
+ newinitd "${FILESDIR}"/zabbix-agentd.init zabbix-agentd |
258 |
+ |
259 |
+ dosbin src/zabbix_agent/zabbix_agentd |
260 |
+ dobin \ |
261 |
+ src/zabbix_sender/zabbix_sender \ |
262 |
+ src/zabbix_get/zabbix_get |
263 |
+ |
264 |
+ systemd_dounit "${FILESDIR}"/zabbix-agentd.service |
265 |
+ systemd_newtmpfilesd "${FILESDIR}"/zabbix-agentd.tmpfiles zabbix-agentd.conf |
266 |
+ fi |
267 |
+ |
268 |
+ fowners root:zabbix /etc/zabbix |
269 |
+ fowners zabbix:zabbix \ |
270 |
+ /var/lib/zabbix \ |
271 |
+ /var/lib/zabbix/home \ |
272 |
+ /var/lib/zabbix/scripts \ |
273 |
+ /var/lib/zabbix/alertscripts \ |
274 |
+ /var/lib/zabbix/externalscripts \ |
275 |
+ /var/log/zabbix |
276 |
+ fperms 0750 \ |
277 |
+ /etc/zabbix \ |
278 |
+ /var/lib/zabbix \ |
279 |
+ /var/lib/zabbix/home \ |
280 |
+ /var/lib/zabbix/scripts \ |
281 |
+ /var/lib/zabbix/alertscripts \ |
282 |
+ /var/lib/zabbix/externalscripts \ |
283 |
+ /var/log/zabbix |
284 |
+ |
285 |
+ dodoc README INSTALL NEWS ChangeLog \ |
286 |
+ conf/zabbix_agentd.conf \ |
287 |
+ conf/zabbix_proxy.conf \ |
288 |
+ conf/zabbix_agentd/userparameter_examples.conf \ |
289 |
+ conf/zabbix_agentd/userparameter_mysql.conf \ |
290 |
+ conf/zabbix_server.conf |
291 |
+ |
292 |
+ if use frontend; then |
293 |
+ webapp_src_preinst |
294 |
+ cp -R frontends/php/* "${D}/${MY_HTDOCSDIR}" |
295 |
+ webapp_configfile \ |
296 |
+ "${MY_HTDOCSDIR}"/include/db.inc.php \ |
297 |
+ "${MY_HTDOCSDIR}"/include/config.inc.php |
298 |
+ webapp_src_install |
299 |
+ fi |
300 |
+ |
301 |
+ if use java; then |
302 |
+ dodir \ |
303 |
+ /${ZABBIXJAVA_BASE} \ |
304 |
+ /${ZABBIXJAVA_BASE}/bin \ |
305 |
+ /${ZABBIXJAVA_BASE}/lib |
306 |
+ keepdir /${ZABBIXJAVA_BASE} |
307 |
+ exeinto /${ZABBIXJAVA_BASE}/bin |
308 |
+ doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar |
309 |
+ exeinto /${ZABBIXJAVA_BASE}/lib |
310 |
+ doexe \ |
311 |
+ src/zabbix_java/lib/logback-classic-0.9.27.jar \ |
312 |
+ src/zabbix_java/lib/logback-console.xml \ |
313 |
+ src/zabbix_java/lib/logback-core-0.9.27.jar \ |
314 |
+ src/zabbix_java/lib/logback.xml \ |
315 |
+ src/zabbix_java/lib/android-json-4.3_r3.1.jar \ |
316 |
+ src/zabbix_java/lib/slf4j-api-1.6.1.jar |
317 |
+ newinitd "${FILESDIR}"/zabbix-jmx-proxy.init zabbix-jmx-proxy |
318 |
+ newconfd "${FILESDIR}"/zabbix-jmx-proxy.conf zabbix-jmx-proxy |
319 |
+ fi |
320 |
+} |
321 |
+ |
322 |
+pkg_postinst() { |
323 |
+ if use server || use proxy ; then |
324 |
+ elog |
325 |
+ elog "You may need to configure your database for Zabbix" |
326 |
+ elog "if you have not already done so." |
327 |
+ elog |
328 |
+ |
329 |
+ zabbix_homedir=$(egethome zabbix) |
330 |
+ if [ -n "${zabbix_homedir}" ] && \ |
331 |
+ [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then |
332 |
+ ewarn |
333 |
+ ewarn "The user 'zabbix' should have his homedir changed" |
334 |
+ ewarn "to /var/lib/zabbix/home if you want to use" |
335 |
+ ewarn "custom alert scripts." |
336 |
+ ewarn |
337 |
+ ewarn "A real homedir might be needed for configfiles" |
338 |
+ ewarn "for custom alert scripts (e.g. ~/.sendxmpprc when" |
339 |
+ ewarn "using sendxmpp for Jabber alerts)." |
340 |
+ ewarn |
341 |
+ ewarn "To change the homedir use:" |
342 |
+ ewarn " usermod -d /var/lib/zabbix/home zabbix" |
343 |
+ ewarn |
344 |
+ fi |
345 |
+ fi |
346 |
+ |
347 |
+ if use server; then |
348 |
+ elog |
349 |
+ elog "For distributed monitoring you have to run:" |
350 |
+ elog |
351 |
+ elog "zabbix_server -n <nodeid>" |
352 |
+ elog |
353 |
+ elog "This will convert database data for use with Node ID" |
354 |
+ elog "and also adds a local node." |
355 |
+ elog |
356 |
+ fi |
357 |
+ |
358 |
+ elog "--" |
359 |
+ elog |
360 |
+ elog "You may need to add these lines to /etc/services:" |
361 |
+ elog |
362 |
+ elog "zabbix-agent 10050/tcp Zabbix Agent" |
363 |
+ elog "zabbix-agent 10050/udp Zabbix Agent" |
364 |
+ elog "zabbix-trapper 10051/tcp Zabbix Trapper" |
365 |
+ elog "zabbix-trapper 10051/udp Zabbix Trapper" |
366 |
+ elog |
367 |
+ |
368 |
+ if use server || use proxy ; then |
369 |
+ # check for fping |
370 |
+ fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null) |
371 |
+ case "${fping_perms}" in |
372 |
+ 4[157][157][157]) |
373 |
+ ;; |
374 |
+ *) |
375 |
+ ewarn |
376 |
+ ewarn "If you want to use the checks 'icmpping' and 'icmppingsec'," |
377 |
+ ewarn "you have to make /usr/sbin/fping setuid root and executable" |
378 |
+ ewarn "by everyone. Run the following command to fix it:" |
379 |
+ ewarn |
380 |
+ ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping" |
381 |
+ ewarn |
382 |
+ ewarn "Please be aware that this might impose a security risk," |
383 |
+ ewarn "depending on the code quality of fping." |
384 |
+ ewarn |
385 |
+ ;; |
386 |
+ esac |
387 |
+ fi |
388 |
+} |
389 |
|
390 |
diff --git a/net-analyzer/zabbix/zabbix-4.0.20.ebuild b/net-analyzer/zabbix/zabbix-4.0.20.ebuild |
391 |
new file mode 100644 |
392 |
index 00000000000..c9d90c43e3e |
393 |
--- /dev/null |
394 |
+++ b/net-analyzer/zabbix/zabbix-4.0.20.ebuild |
395 |
@@ -0,0 +1,350 @@ |
396 |
+# Copyright 1999-2020 Gentoo Authors |
397 |
+# Distributed under the terms of the GNU General Public License v2 |
398 |
+ |
399 |
+EAPI=7 |
400 |
+ |
401 |
+# needed to make webapp-config dep optional |
402 |
+WEBAPP_OPTIONAL="yes" |
403 |
+inherit flag-o-matic webapp java-pkg-opt-2 user systemd toolchain-funcs |
404 |
+ |
405 |
+DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers" |
406 |
+HOMEPAGE="https://www.zabbix.com/" |
407 |
+MY_P=${P/_/} |
408 |
+MY_PV=${PV/_/} |
409 |
+SRC_URI="https://cdn.zabbix.com/stable/${PV}/${P}.tar.gz" |
410 |
+LICENSE="GPL-2" |
411 |
+SLOT="0" |
412 |
+WEBAPP_MANUAL_SLOT="yes" |
413 |
+KEYWORDS="~amd64 ~x86" |
414 |
+IUSE="+agent java curl frontend ipv6 xmpp ldap libxml2 mysql openipmi oracle +postgres proxy server ssh ssl snmp sqlite odbc static" |
415 |
+REQUIRED_USE="|| ( agent frontend proxy server ) |
416 |
+ proxy? ( ^^ ( mysql oracle postgres sqlite odbc ) ) |
417 |
+ server? ( ^^ ( mysql oracle postgres odbc ) ) |
418 |
+ static? ( !oracle !snmp )" |
419 |
+ |
420 |
+COMMON_DEPEND=" |
421 |
+ curl? ( net-misc/curl ) |
422 |
+ java? ( >=virtual/jdk-1.8:* ) |
423 |
+ ldap? ( |
424 |
+ =dev-libs/cyrus-sasl-2* |
425 |
+ net-libs/gnutls |
426 |
+ net-nds/openldap |
427 |
+ ) |
428 |
+ libxml2? ( dev-libs/libxml2 ) |
429 |
+ mysql? ( dev-db/mysql-connector-c ) |
430 |
+ odbc? ( dev-db/unixODBC ) |
431 |
+ openipmi? ( sys-libs/openipmi ) |
432 |
+ oracle? ( dev-db/oracle-instantclient-basic ) |
433 |
+ postgres? ( dev-db/postgresql:* ) |
434 |
+ proxy? ( sys-libs/zlib ) |
435 |
+ server? ( |
436 |
+ dev-libs/libevent |
437 |
+ sys-libs/zlib |
438 |
+ ) |
439 |
+ snmp? ( net-analyzer/net-snmp ) |
440 |
+ sqlite? ( dev-db/sqlite ) |
441 |
+ ssh? ( net-libs/libssh2 ) |
442 |
+ ssl? ( dev-libs/openssl:=[-bindist] ) |
443 |
+ xmpp? ( dev-libs/iksemel ) |
444 |
+" |
445 |
+ |
446 |
+RDEPEND="${COMMON_DEPEND} |
447 |
+ java? ( >=virtual/jre-1.8:* ) |
448 |
+ mysql? ( virtual/mysql ) |
449 |
+ proxy? ( net-analyzer/fping[suid] ) |
450 |
+ server? ( |
451 |
+ app-admin/webapp-config |
452 |
+ dev-libs/libevent |
453 |
+ dev-libs/libpcre |
454 |
+ net-analyzer/fping[suid] |
455 |
+ ) |
456 |
+ frontend? ( |
457 |
+ app-admin/webapp-config |
458 |
+ dev-lang/php:*[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode] |
459 |
+ media-libs/gd[png] |
460 |
+ virtual/httpd-php:* |
461 |
+ mysql? ( dev-lang/php[mysqli] ) |
462 |
+ odbc? ( dev-lang/php[odbc] ) |
463 |
+ oracle? ( dev-lang/php[oci8-instant-client] ) |
464 |
+ postgres? ( dev-lang/php[postgres] ) |
465 |
+ sqlite? ( dev-lang/php[sqlite] ) |
466 |
+ ) |
467 |
+" |
468 |
+DEPEND="${COMMON_DEPEND} |
469 |
+ static? ( |
470 |
+ curl? ( net-misc/curl[static-libs] ) |
471 |
+ ldap? ( |
472 |
+ =dev-libs/cyrus-sasl-2*[static-libs] |
473 |
+ net-libs/gnutls[static-libs] |
474 |
+ net-nds/openldap[static-libs] |
475 |
+ ) |
476 |
+ libxml2? ( dev-libs/libxml2[static-libs] ) |
477 |
+ mysql? ( dev-db/mysql-connector-c[static-libs] ) |
478 |
+ odbc? ( dev-db/unixODBC[static-libs] ) |
479 |
+ postgres? ( dev-db/postgresql:*[static-libs] ) |
480 |
+ sqlite? ( dev-db/sqlite[static-libs] ) |
481 |
+ ssh? ( net-libs/libssh2 ) |
482 |
+ ) |
483 |
+" |
484 |
+BDEPEND=" |
485 |
+ virtual/pkgconfig |
486 |
+" |
487 |
+ |
488 |
+PATCHES=( |
489 |
+ "${FILESDIR}/${P}-modulepathfix.patch" |
490 |
+ "${FILESDIR}/${PN}-3.0.30-security-disable-PidFile.patch" |
491 |
+) |
492 |
+ |
493 |
+S=${WORKDIR}/${MY_P} |
494 |
+ |
495 |
+ZABBIXJAVA_BASE="opt/zabbix_java" |
496 |
+ |
497 |
+pkg_setup() { |
498 |
+ if use oracle; then |
499 |
+ if [ -z "${ORACLE_HOME}" ]; then |
500 |
+ eerror |
501 |
+ eerror "The environment variable ORACLE_HOME must be set" |
502 |
+ eerror "and point to the correct location." |
503 |
+ eerror "It looks like you don't have Oracle installed." |
504 |
+ eerror |
505 |
+ die "Environment variable ORACLE_HOME is not set" |
506 |
+ fi |
507 |
+ if has_version 'dev-db/oracle-instantclient-basic'; then |
508 |
+ ewarn |
509 |
+ ewarn "Please ensure you have a full install of the Oracle client." |
510 |
+ ewarn "dev-db/oracle-instantclient* is NOT sufficient." |
511 |
+ ewarn |
512 |
+ fi |
513 |
+ fi |
514 |
+ |
515 |
+ if use frontend; then |
516 |
+ webapp_pkg_setup |
517 |
+ fi |
518 |
+ |
519 |
+ enewgroup zabbix |
520 |
+ enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix |
521 |
+ |
522 |
+ java-pkg-opt-2_pkg_setup |
523 |
+} |
524 |
+ |
525 |
+src_prepare() { |
526 |
+ default |
527 |
+} |
528 |
+ |
529 |
+src_configure() { |
530 |
+ econf \ |
531 |
+ $(use_enable agent) \ |
532 |
+ $(use_enable ipv6) \ |
533 |
+ $(use_enable java) \ |
534 |
+ $(use_enable proxy) \ |
535 |
+ $(use_enable server) \ |
536 |
+ $(use_enable static) \ |
537 |
+ $(use_with curl libcurl) \ |
538 |
+ $(use_with ldap) \ |
539 |
+ $(use_with libxml2) \ |
540 |
+ $(use_with mysql) \ |
541 |
+ $(use_with odbc unixodbc) \ |
542 |
+ $(use_with openipmi openipmi) \ |
543 |
+ $(use_with oracle) \ |
544 |
+ $(use_with postgres postgresql) \ |
545 |
+ $(use_with snmp net-snmp) \ |
546 |
+ $(use_with sqlite sqlite3) \ |
547 |
+ $(use_with ssh ssh2) \ |
548 |
+ $(use_with ssl openssl) \ |
549 |
+ $(use_with xmpp jabber) |
550 |
+} |
551 |
+ |
552 |
+src_compile() { |
553 |
+ if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then |
554 |
+ emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" |
555 |
+ fi |
556 |
+} |
557 |
+ |
558 |
+src_install() { |
559 |
+ local dirs=( |
560 |
+ /etc/zabbix |
561 |
+ /var/lib/zabbix |
562 |
+ /var/lib/zabbix/home |
563 |
+ /var/lib/zabbix/scripts |
564 |
+ /var/lib/zabbix/alertscripts |
565 |
+ /var/lib/zabbix/externalscripts |
566 |
+ /var/log/zabbix |
567 |
+ ) |
568 |
+ |
569 |
+ for dir in "${dirs[@]}"; do |
570 |
+ dodir "${dir}" |
571 |
+ keepdir "${dir}" |
572 |
+ done |
573 |
+ |
574 |
+ if use server; then |
575 |
+ insinto /etc/zabbix |
576 |
+ doins "${S}"/conf/zabbix_server.conf |
577 |
+ fperms 0640 /etc/zabbix/zabbix_server.conf |
578 |
+ fowners root:zabbix /etc/zabbix/zabbix_server.conf |
579 |
+ |
580 |
+ newinitd "${FILESDIR}"/zabbix-server.init zabbix-server |
581 |
+ |
582 |
+ dosbin src/zabbix_server/zabbix_server |
583 |
+ |
584 |
+ insinto /usr/share/zabbix |
585 |
+ doins -r "${S}"/database/ |
586 |
+ |
587 |
+ systemd_dounit "${FILESDIR}"/zabbix-server.service |
588 |
+ systemd_newtmpfilesd "${FILESDIR}"/zabbix-server.tmpfiles zabbix-server.conf |
589 |
+ fi |
590 |
+ |
591 |
+ if use proxy; then |
592 |
+ insinto /etc/zabbix |
593 |
+ doins "${S}"/conf/zabbix_proxy.conf |
594 |
+ fperms 0640 /etc/zabbix/zabbix_proxy.conf |
595 |
+ fowners root:zabbix /etc/zabbix/zabbix_proxy.conf |
596 |
+ |
597 |
+ newinitd "${FILESDIR}"/zabbix-proxy.init zabbix-proxy |
598 |
+ |
599 |
+ dosbin src/zabbix_proxy/zabbix_proxy |
600 |
+ |
601 |
+ insinto /usr/share/zabbix |
602 |
+ doins -r "${S}"/database/ |
603 |
+ |
604 |
+ systemd_dounit "${FILESDIR}"/zabbix-proxy.service |
605 |
+ systemd_newtmpfilesd "${FILESDIR}"/zabbix-proxy.tmpfiles zabbix-proxy.conf |
606 |
+ fi |
607 |
+ |
608 |
+ if use agent; then |
609 |
+ insinto /etc/zabbix |
610 |
+ doins "${S}"/conf/zabbix_agentd.conf |
611 |
+ fperms 0640 /etc/zabbix/zabbix_agentd.conf |
612 |
+ fowners root:zabbix /etc/zabbix/zabbix_agentd.conf |
613 |
+ |
614 |
+ newinitd "${FILESDIR}"/zabbix-agentd.init zabbix-agentd |
615 |
+ |
616 |
+ dosbin src/zabbix_agent/zabbix_agentd |
617 |
+ dobin \ |
618 |
+ src/zabbix_sender/zabbix_sender \ |
619 |
+ src/zabbix_get/zabbix_get |
620 |
+ |
621 |
+ systemd_dounit "${FILESDIR}"/zabbix-agentd.service |
622 |
+ systemd_newtmpfilesd "${FILESDIR}"/zabbix-agentd.tmpfiles zabbix-agentd.conf |
623 |
+ fi |
624 |
+ |
625 |
+ fowners root:zabbix /etc/zabbix |
626 |
+ fowners zabbix:zabbix \ |
627 |
+ /var/lib/zabbix \ |
628 |
+ /var/lib/zabbix/home \ |
629 |
+ /var/lib/zabbix/scripts \ |
630 |
+ /var/lib/zabbix/alertscripts \ |
631 |
+ /var/lib/zabbix/externalscripts \ |
632 |
+ /var/log/zabbix |
633 |
+ fperms 0750 \ |
634 |
+ /etc/zabbix \ |
635 |
+ /var/lib/zabbix \ |
636 |
+ /var/lib/zabbix/home \ |
637 |
+ /var/lib/zabbix/scripts \ |
638 |
+ /var/lib/zabbix/alertscripts \ |
639 |
+ /var/lib/zabbix/externalscripts \ |
640 |
+ /var/log/zabbix |
641 |
+ |
642 |
+ dodoc README INSTALL NEWS ChangeLog \ |
643 |
+ conf/zabbix_agentd.conf \ |
644 |
+ conf/zabbix_proxy.conf \ |
645 |
+ conf/zabbix_agentd/userparameter_examples.conf \ |
646 |
+ conf/zabbix_agentd/userparameter_mysql.conf \ |
647 |
+ conf/zabbix_server.conf |
648 |
+ |
649 |
+ if use frontend; then |
650 |
+ webapp_src_preinst |
651 |
+ cp -R frontends/php/* "${D}/${MY_HTDOCSDIR}" |
652 |
+ webapp_configfile \ |
653 |
+ "${MY_HTDOCSDIR}"/include/db.inc.php \ |
654 |
+ "${MY_HTDOCSDIR}"/include/config.inc.php |
655 |
+ webapp_src_install |
656 |
+ fi |
657 |
+ |
658 |
+ if use java; then |
659 |
+ dodir \ |
660 |
+ /${ZABBIXJAVA_BASE} \ |
661 |
+ /${ZABBIXJAVA_BASE}/bin \ |
662 |
+ /${ZABBIXJAVA_BASE}/lib |
663 |
+ keepdir /${ZABBIXJAVA_BASE} |
664 |
+ exeinto /${ZABBIXJAVA_BASE}/bin |
665 |
+ doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar |
666 |
+ exeinto /${ZABBIXJAVA_BASE}/lib |
667 |
+ doexe \ |
668 |
+ src/zabbix_java/lib/logback-classic-0.9.27.jar \ |
669 |
+ src/zabbix_java/lib/logback-console.xml \ |
670 |
+ src/zabbix_java/lib/logback-core-0.9.27.jar \ |
671 |
+ src/zabbix_java/lib/logback.xml \ |
672 |
+ src/zabbix_java/lib/android-json-4.3_r3.1.jar \ |
673 |
+ src/zabbix_java/lib/slf4j-api-1.6.1.jar |
674 |
+ newinitd "${FILESDIR}"/zabbix-jmx-proxy.init zabbix-jmx-proxy |
675 |
+ newconfd "${FILESDIR}"/zabbix-jmx-proxy.conf zabbix-jmx-proxy |
676 |
+ fi |
677 |
+} |
678 |
+ |
679 |
+pkg_postinst() { |
680 |
+ if use server || use proxy ; then |
681 |
+ elog |
682 |
+ elog "You may need to configure your database for Zabbix" |
683 |
+ elog "if you have not already done so." |
684 |
+ elog |
685 |
+ |
686 |
+ zabbix_homedir=$(egethome zabbix) |
687 |
+ if [ -n "${zabbix_homedir}" ] && \ |
688 |
+ [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then |
689 |
+ ewarn |
690 |
+ ewarn "The user 'zabbix' should have his homedir changed" |
691 |
+ ewarn "to /var/lib/zabbix/home if you want to use" |
692 |
+ ewarn "custom alert scripts." |
693 |
+ ewarn |
694 |
+ ewarn "A real homedir might be needed for configfiles" |
695 |
+ ewarn "for custom alert scripts (e.g. ~/.sendxmpprc when" |
696 |
+ ewarn "using sendxmpp for Jabber alerts)." |
697 |
+ ewarn |
698 |
+ ewarn "To change the homedir use:" |
699 |
+ ewarn " usermod -d /var/lib/zabbix/home zabbix" |
700 |
+ ewarn |
701 |
+ fi |
702 |
+ fi |
703 |
+ |
704 |
+ if use server; then |
705 |
+ elog |
706 |
+ elog "For distributed monitoring you have to run:" |
707 |
+ elog |
708 |
+ elog "zabbix_server -n <nodeid>" |
709 |
+ elog |
710 |
+ elog "This will convert database data for use with Node ID" |
711 |
+ elog "and also adds a local node." |
712 |
+ elog |
713 |
+ fi |
714 |
+ |
715 |
+ elog "--" |
716 |
+ elog |
717 |
+ elog "You may need to add these lines to /etc/services:" |
718 |
+ elog |
719 |
+ elog "zabbix-agent 10050/tcp Zabbix Agent" |
720 |
+ elog "zabbix-agent 10050/udp Zabbix Agent" |
721 |
+ elog "zabbix-trapper 10051/tcp Zabbix Trapper" |
722 |
+ elog "zabbix-trapper 10051/udp Zabbix Trapper" |
723 |
+ elog |
724 |
+ |
725 |
+ if use server || use proxy ; then |
726 |
+ # check for fping |
727 |
+ fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null) |
728 |
+ case "${fping_perms}" in |
729 |
+ 4[157][157][157]) |
730 |
+ ;; |
731 |
+ *) |
732 |
+ ewarn |
733 |
+ ewarn "If you want to use the checks 'icmpping' and 'icmppingsec'," |
734 |
+ ewarn "you have to make /usr/sbin/fping setuid root and executable" |
735 |
+ ewarn "by everyone. Run the following command to fix it:" |
736 |
+ ewarn |
737 |
+ ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping" |
738 |
+ ewarn |
739 |
+ ewarn "Please be aware that this might impose a security risk," |
740 |
+ ewarn "depending on the code quality of fping." |
741 |
+ ewarn |
742 |
+ ;; |
743 |
+ esac |
744 |
+ fi |
745 |
+} |
746 |
|
747 |
diff --git a/net-analyzer/zabbix/zabbix-4.4.8.ebuild b/net-analyzer/zabbix/zabbix-4.4.8.ebuild |
748 |
new file mode 100644 |
749 |
index 00000000000..645e6735326 |
750 |
--- /dev/null |
751 |
+++ b/net-analyzer/zabbix/zabbix-4.4.8.ebuild |
752 |
@@ -0,0 +1,347 @@ |
753 |
+# Copyright 1999-2020 Gentoo Authors |
754 |
+# Distributed under the terms of the GNU General Public License v2 |
755 |
+ |
756 |
+EAPI=7 |
757 |
+ |
758 |
+# needed to make webapp-config dep optional |
759 |
+WEBAPP_OPTIONAL="yes" |
760 |
+inherit flag-o-matic webapp java-pkg-opt-2 user systemd toolchain-funcs |
761 |
+ |
762 |
+DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers" |
763 |
+HOMEPAGE="https://www.zabbix.com/" |
764 |
+MY_P=${P/_/} |
765 |
+MY_PV=${PV/_/} |
766 |
+SRC_URI="https://cdn.zabbix.com/stable/${PV}/${P}.tar.gz" |
767 |
+LICENSE="GPL-2" |
768 |
+SLOT="0" |
769 |
+WEBAPP_MANUAL_SLOT="yes" |
770 |
+KEYWORDS="~amd64 ~x86" |
771 |
+IUSE="+agent java curl frontend ipv6 ldap libxml2 mysql openipmi oracle +postgres proxy server ssh ssl snmp sqlite odbc static" |
772 |
+REQUIRED_USE="|| ( agent frontend proxy server ) |
773 |
+ proxy? ( ^^ ( mysql oracle postgres sqlite odbc ) ) |
774 |
+ server? ( ^^ ( mysql oracle postgres odbc ) ) |
775 |
+ static? ( !oracle !snmp )" |
776 |
+ |
777 |
+COMMON_DEPEND=" |
778 |
+ curl? ( net-misc/curl ) |
779 |
+ java? ( >=virtual/jdk-1.8:* ) |
780 |
+ ldap? ( |
781 |
+ =dev-libs/cyrus-sasl-2* |
782 |
+ net-libs/gnutls |
783 |
+ net-nds/openldap |
784 |
+ ) |
785 |
+ libxml2? ( dev-libs/libxml2 ) |
786 |
+ mysql? ( dev-db/mysql-connector-c ) |
787 |
+ odbc? ( dev-db/unixODBC ) |
788 |
+ openipmi? ( sys-libs/openipmi ) |
789 |
+ oracle? ( dev-db/oracle-instantclient-basic ) |
790 |
+ postgres? ( dev-db/postgresql:* ) |
791 |
+ proxy? ( sys-libs/zlib ) |
792 |
+ server? ( |
793 |
+ dev-libs/libevent |
794 |
+ sys-libs/zlib |
795 |
+ ) |
796 |
+ snmp? ( net-analyzer/net-snmp ) |
797 |
+ sqlite? ( dev-db/sqlite ) |
798 |
+ ssh? ( net-libs/libssh2 ) |
799 |
+ ssl? ( dev-libs/openssl:=[-bindist] ) |
800 |
+" |
801 |
+ |
802 |
+RDEPEND="${COMMON_DEPEND} |
803 |
+ java? ( >=virtual/jre-1.8:* ) |
804 |
+ mysql? ( virtual/mysql ) |
805 |
+ proxy? ( net-analyzer/fping[suid] ) |
806 |
+ server? ( |
807 |
+ app-admin/webapp-config |
808 |
+ dev-libs/libevent |
809 |
+ dev-libs/libpcre |
810 |
+ net-analyzer/fping[suid] |
811 |
+ ) |
812 |
+ frontend? ( |
813 |
+ app-admin/webapp-config |
814 |
+ dev-lang/php:*[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode] |
815 |
+ media-libs/gd[png] |
816 |
+ virtual/httpd-php:* |
817 |
+ mysql? ( dev-lang/php[mysqli] ) |
818 |
+ odbc? ( dev-lang/php[odbc] ) |
819 |
+ oracle? ( dev-lang/php[oci8-instant-client] ) |
820 |
+ postgres? ( dev-lang/php[postgres] ) |
821 |
+ sqlite? ( dev-lang/php[sqlite] ) |
822 |
+ ) |
823 |
+" |
824 |
+DEPEND="${COMMON_DEPEND} |
825 |
+ static? ( |
826 |
+ curl? ( net-misc/curl[static-libs] ) |
827 |
+ ldap? ( |
828 |
+ =dev-libs/cyrus-sasl-2*[static-libs] |
829 |
+ net-libs/gnutls[static-libs] |
830 |
+ net-nds/openldap[static-libs] |
831 |
+ ) |
832 |
+ libxml2? ( dev-libs/libxml2[static-libs] ) |
833 |
+ mysql? ( dev-db/mysql-connector-c[static-libs] ) |
834 |
+ odbc? ( dev-db/unixODBC[static-libs] ) |
835 |
+ postgres? ( dev-db/postgresql:*[static-libs] ) |
836 |
+ sqlite? ( dev-db/sqlite[static-libs] ) |
837 |
+ ssh? ( net-libs/libssh2 ) |
838 |
+ ) |
839 |
+" |
840 |
+BDEPEND=" |
841 |
+ virtual/pkgconfig |
842 |
+" |
843 |
+ |
844 |
+PATCHES=( |
845 |
+ "${FILESDIR}/${PN}-4.0.18-modulepathfix.patch" |
846 |
+ "${FILESDIR}/${PN}-3.0.30-security-disable-PidFile.patch" |
847 |
+) |
848 |
+ |
849 |
+S=${WORKDIR}/${MY_P} |
850 |
+ |
851 |
+ZABBIXJAVA_BASE="opt/zabbix_java" |
852 |
+ |
853 |
+pkg_setup() { |
854 |
+ if use oracle; then |
855 |
+ if [ -z "${ORACLE_HOME}" ]; then |
856 |
+ eerror |
857 |
+ eerror "The environment variable ORACLE_HOME must be set" |
858 |
+ eerror "and point to the correct location." |
859 |
+ eerror "It looks like you don't have Oracle installed." |
860 |
+ eerror |
861 |
+ die "Environment variable ORACLE_HOME is not set" |
862 |
+ fi |
863 |
+ if has_version 'dev-db/oracle-instantclient-basic'; then |
864 |
+ ewarn |
865 |
+ ewarn "Please ensure you have a full install of the Oracle client." |
866 |
+ ewarn "dev-db/oracle-instantclient* is NOT sufficient." |
867 |
+ ewarn |
868 |
+ fi |
869 |
+ fi |
870 |
+ |
871 |
+ if use frontend; then |
872 |
+ webapp_pkg_setup |
873 |
+ fi |
874 |
+ |
875 |
+ enewgroup zabbix |
876 |
+ enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix |
877 |
+ |
878 |
+ java-pkg-opt-2_pkg_setup |
879 |
+} |
880 |
+ |
881 |
+src_prepare() { |
882 |
+ default |
883 |
+} |
884 |
+ |
885 |
+src_configure() { |
886 |
+ econf \ |
887 |
+ $(use_enable agent) \ |
888 |
+ $(use_enable ipv6) \ |
889 |
+ $(use_enable java) \ |
890 |
+ $(use_enable proxy) \ |
891 |
+ $(use_enable server) \ |
892 |
+ $(use_enable static) \ |
893 |
+ $(use_with curl libcurl) \ |
894 |
+ $(use_with ldap) \ |
895 |
+ $(use_with libxml2) \ |
896 |
+ $(use_with mysql) \ |
897 |
+ $(use_with odbc unixodbc) \ |
898 |
+ $(use_with openipmi openipmi) \ |
899 |
+ $(use_with oracle) \ |
900 |
+ $(use_with postgres postgresql) \ |
901 |
+ $(use_with snmp net-snmp) \ |
902 |
+ $(use_with sqlite sqlite3) \ |
903 |
+ $(use_with ssh ssh2) \ |
904 |
+ $(use_with ssl openssl) |
905 |
+} |
906 |
+ |
907 |
+src_compile() { |
908 |
+ if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then |
909 |
+ emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" |
910 |
+ fi |
911 |
+} |
912 |
+ |
913 |
+src_install() { |
914 |
+ local dirs=( |
915 |
+ /etc/zabbix |
916 |
+ /var/lib/zabbix |
917 |
+ /var/lib/zabbix/home |
918 |
+ /var/lib/zabbix/scripts |
919 |
+ /var/lib/zabbix/alertscripts |
920 |
+ /var/lib/zabbix/externalscripts |
921 |
+ /var/log/zabbix |
922 |
+ ) |
923 |
+ |
924 |
+ for dir in "${dirs[@]}"; do |
925 |
+ dodir "${dir}" |
926 |
+ keepdir "${dir}" |
927 |
+ done |
928 |
+ |
929 |
+ if use server; then |
930 |
+ insinto /etc/zabbix |
931 |
+ doins "${S}"/conf/zabbix_server.conf |
932 |
+ fperms 0640 /etc/zabbix/zabbix_server.conf |
933 |
+ fowners root:zabbix /etc/zabbix/zabbix_server.conf |
934 |
+ |
935 |
+ newinitd "${FILESDIR}"/zabbix-server.init zabbix-server |
936 |
+ |
937 |
+ dosbin src/zabbix_server/zabbix_server |
938 |
+ |
939 |
+ insinto /usr/share/zabbix |
940 |
+ doins -r "${S}"/database/ |
941 |
+ |
942 |
+ systemd_dounit "${FILESDIR}"/zabbix-server.service |
943 |
+ systemd_newtmpfilesd "${FILESDIR}"/zabbix-server.tmpfiles zabbix-server.conf |
944 |
+ fi |
945 |
+ |
946 |
+ if use proxy; then |
947 |
+ insinto /etc/zabbix |
948 |
+ doins "${S}"/conf/zabbix_proxy.conf |
949 |
+ fperms 0640 /etc/zabbix/zabbix_proxy.conf |
950 |
+ fowners root:zabbix /etc/zabbix/zabbix_proxy.conf |
951 |
+ |
952 |
+ newinitd "${FILESDIR}"/zabbix-proxy.init zabbix-proxy |
953 |
+ |
954 |
+ dosbin src/zabbix_proxy/zabbix_proxy |
955 |
+ |
956 |
+ insinto /usr/share/zabbix |
957 |
+ doins -r "${S}"/database/ |
958 |
+ |
959 |
+ systemd_dounit "${FILESDIR}"/zabbix-proxy.service |
960 |
+ systemd_newtmpfilesd "${FILESDIR}"/zabbix-proxy.tmpfiles zabbix-proxy.conf |
961 |
+ fi |
962 |
+ |
963 |
+ if use agent; then |
964 |
+ insinto /etc/zabbix |
965 |
+ doins "${S}"/conf/zabbix_agentd.conf |
966 |
+ fperms 0640 /etc/zabbix/zabbix_agentd.conf |
967 |
+ fowners root:zabbix /etc/zabbix/zabbix_agentd.conf |
968 |
+ |
969 |
+ newinitd "${FILESDIR}"/zabbix-agentd.init zabbix-agentd |
970 |
+ |
971 |
+ dosbin src/zabbix_agent/zabbix_agentd |
972 |
+ dobin \ |
973 |
+ src/zabbix_sender/zabbix_sender \ |
974 |
+ src/zabbix_get/zabbix_get |
975 |
+ |
976 |
+ systemd_dounit "${FILESDIR}"/zabbix-agentd.service |
977 |
+ systemd_newtmpfilesd "${FILESDIR}"/zabbix-agentd.tmpfiles zabbix-agentd.conf |
978 |
+ fi |
979 |
+ |
980 |
+ fowners root:zabbix /etc/zabbix |
981 |
+ fowners zabbix:zabbix \ |
982 |
+ /var/lib/zabbix \ |
983 |
+ /var/lib/zabbix/home \ |
984 |
+ /var/lib/zabbix/scripts \ |
985 |
+ /var/lib/zabbix/alertscripts \ |
986 |
+ /var/lib/zabbix/externalscripts \ |
987 |
+ /var/log/zabbix |
988 |
+ fperms 0750 \ |
989 |
+ /etc/zabbix \ |
990 |
+ /var/lib/zabbix \ |
991 |
+ /var/lib/zabbix/home \ |
992 |
+ /var/lib/zabbix/scripts \ |
993 |
+ /var/lib/zabbix/alertscripts \ |
994 |
+ /var/lib/zabbix/externalscripts \ |
995 |
+ /var/log/zabbix |
996 |
+ |
997 |
+ dodoc README INSTALL NEWS ChangeLog \ |
998 |
+ conf/zabbix_agentd.conf \ |
999 |
+ conf/zabbix_proxy.conf \ |
1000 |
+ conf/zabbix_agentd/userparameter_examples.conf \ |
1001 |
+ conf/zabbix_agentd/userparameter_mysql.conf \ |
1002 |
+ conf/zabbix_server.conf |
1003 |
+ |
1004 |
+ if use frontend; then |
1005 |
+ webapp_src_preinst |
1006 |
+ cp -R frontends/php/* "${D}/${MY_HTDOCSDIR}" |
1007 |
+ webapp_configfile \ |
1008 |
+ "${MY_HTDOCSDIR}"/include/db.inc.php \ |
1009 |
+ "${MY_HTDOCSDIR}"/include/config.inc.php |
1010 |
+ webapp_src_install |
1011 |
+ fi |
1012 |
+ |
1013 |
+ if use java; then |
1014 |
+ dodir \ |
1015 |
+ /${ZABBIXJAVA_BASE} \ |
1016 |
+ /${ZABBIXJAVA_BASE}/bin \ |
1017 |
+ /${ZABBIXJAVA_BASE}/lib |
1018 |
+ keepdir /${ZABBIXJAVA_BASE} |
1019 |
+ exeinto /${ZABBIXJAVA_BASE}/bin |
1020 |
+ doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar |
1021 |
+ exeinto /${ZABBIXJAVA_BASE}/lib |
1022 |
+ doexe \ |
1023 |
+ src/zabbix_java/lib/logback-classic-0.9.27.jar \ |
1024 |
+ src/zabbix_java/lib/logback-console.xml \ |
1025 |
+ src/zabbix_java/lib/logback-core-0.9.27.jar \ |
1026 |
+ src/zabbix_java/lib/logback.xml \ |
1027 |
+ src/zabbix_java/lib/android-json-4.3_r3.1.jar \ |
1028 |
+ src/zabbix_java/lib/slf4j-api-1.6.1.jar |
1029 |
+ newinitd "${FILESDIR}"/zabbix-jmx-proxy.init zabbix-jmx-proxy |
1030 |
+ newconfd "${FILESDIR}"/zabbix-jmx-proxy.conf zabbix-jmx-proxy |
1031 |
+ fi |
1032 |
+} |
1033 |
+ |
1034 |
+pkg_postinst() { |
1035 |
+ if use server || use proxy ; then |
1036 |
+ elog |
1037 |
+ elog "You may need to configure your database for Zabbix" |
1038 |
+ elog "if you have not already done so." |
1039 |
+ elog |
1040 |
+ |
1041 |
+ zabbix_homedir=$(egethome zabbix) |
1042 |
+ if [ -n "${zabbix_homedir}" ] && \ |
1043 |
+ [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then |
1044 |
+ ewarn |
1045 |
+ ewarn "The user 'zabbix' should have his homedir changed" |
1046 |
+ ewarn "to /var/lib/zabbix/home if you want to use" |
1047 |
+ ewarn "custom alert scripts." |
1048 |
+ ewarn |
1049 |
+ ewarn "A real homedir might be needed for configfiles" |
1050 |
+ ewarn "for custom alert scripts." |
1051 |
+ ewarn |
1052 |
+ ewarn "To change the homedir use:" |
1053 |
+ ewarn " usermod -d /var/lib/zabbix/home zabbix" |
1054 |
+ ewarn |
1055 |
+ fi |
1056 |
+ fi |
1057 |
+ |
1058 |
+ if use server; then |
1059 |
+ elog |
1060 |
+ elog "For distributed monitoring you have to run:" |
1061 |
+ elog |
1062 |
+ elog "zabbix_server -n <nodeid>" |
1063 |
+ elog |
1064 |
+ elog "This will convert database data for use with Node ID" |
1065 |
+ elog "and also adds a local node." |
1066 |
+ elog |
1067 |
+ fi |
1068 |
+ |
1069 |
+ elog "--" |
1070 |
+ elog |
1071 |
+ elog "You may need to add these lines to /etc/services:" |
1072 |
+ elog |
1073 |
+ elog "zabbix-agent 10050/tcp Zabbix Agent" |
1074 |
+ elog "zabbix-agent 10050/udp Zabbix Agent" |
1075 |
+ elog "zabbix-trapper 10051/tcp Zabbix Trapper" |
1076 |
+ elog "zabbix-trapper 10051/udp Zabbix Trapper" |
1077 |
+ elog |
1078 |
+ |
1079 |
+ if use server || use proxy ; then |
1080 |
+ # check for fping |
1081 |
+ fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null) |
1082 |
+ case "${fping_perms}" in |
1083 |
+ 4[157][157][157]) |
1084 |
+ ;; |
1085 |
+ *) |
1086 |
+ ewarn |
1087 |
+ ewarn "If you want to use the checks 'icmpping' and 'icmppingsec'," |
1088 |
+ ewarn "you have to make /usr/sbin/fping setuid root and executable" |
1089 |
+ ewarn "by everyone. Run the following command to fix it:" |
1090 |
+ ewarn |
1091 |
+ ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping" |
1092 |
+ ewarn |
1093 |
+ ewarn "Please be aware that this might impose a security risk," |
1094 |
+ ewarn "depending on the code quality of fping." |
1095 |
+ ewarn |
1096 |
+ ;; |
1097 |
+ esac |
1098 |
+ fi |
1099 |
+} |