Gentoo Archives: gentoo-commits

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