Gentoo Archives: gentoo-commits

From: "Patrick Lauer (patrick)" <patrick@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-analyzer/zabbix: ChangeLog zabbix-1.9.3.ebuild
Date: Sat, 02 Apr 2011 13:36:39
Message-Id: 20110402133629.A095420054@flycatcher.gentoo.org
1 patrick 11/04/02 13:36:29
2
3 Modified: ChangeLog
4 Added: zabbix-1.9.3.ebuild
5 Log:
6 Adding zabbix 1.9 (2.0 prerelease)
7
8 (Portage version: 2.2.0_alpha29/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.44 net-analyzer/zabbix/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/zabbix/ChangeLog?rev=1.44&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/zabbix/ChangeLog?rev=1.44&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/zabbix/ChangeLog?r1=1.43&r2=1.44
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-analyzer/zabbix/ChangeLog,v
20 retrieving revision 1.43
21 retrieving revision 1.44
22 diff -u -r1.43 -r1.44
23 --- ChangeLog 4 Mar 2011 15:49:56 -0000 1.43
24 +++ ChangeLog 2 Apr 2011 13:36:29 -0000 1.44
25 @@ -1,6 +1,11 @@
26 # ChangeLog for net-analyzer/zabbix
27 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/zabbix/ChangeLog,v 1.43 2011/03/04 15:49:56 patrick Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/zabbix/ChangeLog,v 1.44 2011/04/02 13:36:29 patrick Exp $
30 +
31 +*zabbix-1.9.3 (02 Apr 2011)
32 +
33 + 02 Apr 2011; Patrick Lauer <patrick@g.o> +zabbix-1.9.3.ebuild:
34 + Adding zabbix 1.9 (2.0 prerelease)
35
36 *zabbix-1.6.9 (04 Mar 2011)
37
38
39
40
41 1.1 net-analyzer/zabbix/zabbix-1.9.3.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/zabbix/zabbix-1.9.3.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/zabbix/zabbix-1.9.3.ebuild?rev=1.1&content-type=text/plain
45
46 Index: zabbix-1.9.3.ebuild
47 ===================================================================
48 # Copyright 1999-2011 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/zabbix/zabbix-1.9.3.ebuild,v 1.1 2011/04/02 13:36:29 patrick Exp $
51
52 EAPI="2"
53
54 # needed to make webapp-config dep optional
55 WEBAPP_OPTIONAL="yes"
56 inherit eutils flag-o-matic webapp depend.php autotools
57
58 DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers."
59 HOMEPAGE="http://www.zabbix.com/"
60 SRC_URI="http://prdownloads.sourceforge.net/zabbix/${P}.tar.gz"
61 LICENSE="GPL-2"
62 SLOT="0"
63 WEBAPP_MANUAL_SLOT="yes"
64 KEYWORDS="~amd64 ~ppc ~x86"
65 IUSE="agent curl frontend ipv6 jabber ldap mysql openipmi oracle postgres proxy server -ssh snmp +sqlite3"
66
67 COMMON_DEPEND="snmp? ( net-analyzer/net-snmp )
68 ldap? (
69 net-nds/openldap
70 =dev-libs/cyrus-sasl-2*
71 net-libs/gnutls
72 )
73 mysql? ( virtual/mysql )
74 sqlite3? ( =dev-db/sqlite-3* )
75 postgres? ( dev-db/postgresql-base )
76 jabber? ( dev-libs/iksemel )
77 curl? ( net-misc/curl )
78 openipmi? ( sys-libs/openipmi )
79 ssh? ( net-libs/libssh2 )"
80
81 RDEPEND="${COMMON_DEPEND}
82 proxy? ( net-analyzer/fping )
83 server? ( net-analyzer/fping
84 app-admin/webapp-config )
85 frontend? ( dev-lang/php[bcmath,ctype,sockets,gd,truetype,xml,session]
86 media-libs/gd[png]
87 app-admin/webapp-config )"
88 DEPEND="${COMMON_DEPEND}
89 jabber? ( dev-util/pkgconfig )"
90
91 useq frontend && need_php_httpd
92
93 src_prepare() {
94 epatch "${FILESDIR}/${PN}-1.8.3-as-needed.patch"
95 eautoreconf
96 }
97
98 pkg_setup() {
99 if useq server || useq proxy ; then
100 local dbnum dbtypes="mysql oracle postgres sqlite3" dbtype
101 declare -i dbnum=0
102 for dbtype in ${dbtypes}; do
103 useq ${dbtype} && let dbnum++
104 done
105 if [ ${dbnum} -gt 1 ]; then
106 eerror
107 eerror "You can't use more than one database type in Zabbix."
108 eerror "Select exactly one database type out of these: ${dbtypes}"
109 eerror
110 die "Multiple database types selected."
111 elif [ ${dbnum} -lt 1 ]; then
112 eerror
113 eerror "Select exactly one database type out of these: ${dbtypes}"
114 eerror
115 die "No database type selected."
116 fi
117 if useq oracle; then
118 if [ -z "${ORACLE_HOME}" ]; then
119 eerror
120 eerror "The environment variable ORACLE_HOME must be set"
121 eerror "and point to the correct location."
122 eerror "It looks like you don't have Oracle installed."
123 eerror
124 die "Environment variable ORACLE_HOME is not set"
125 fi
126 if has_version 'dev-db/oracle-instantclient-basic'; then
127 ewarn
128 ewarn "Please ensure you have a full install of the Oracle client."
129 ewarn "dev-db/oracle-instantclient* is NOT sufficient."
130 ewarn
131 fi
132 fi
133 fi
134
135 if useq frontend; then
136 webapp_pkg_setup
137 fi
138
139 enewgroup zabbix
140 enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix
141 }
142
143 pkg_postinst() {
144 if useq server || useq proxy ; then
145 elog
146 elog "You need to configure your database for Zabbix."
147 elog
148 elog "Have a look at /usr/share/zabbix/database for"
149 elog "database creation and upgrades."
150 elog
151 elog "For more info read the Zabbix manual at"
152 elog "http://www.zabbix.com/documentation.php"
153 elog
154
155 zabbix_homedir="$(egetent passwd zabbix | cut -d : -f 6 )"
156 if [ -n "${zabbix_homedir}" ] && \
157 [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then
158 ewarn
159 ewarn "The user 'zabbix' should have his homedir changed"
160 ewarn "to /var/lib/zabbix/home if you want to use"
161 ewarn "custom alert scripts."
162 ewarn
163 ewarn "A real homedir might be needed for configfiles"
164 ewarn "for custom alert scripts (e.g. ~/.sendxmpprc when"
165 ewarn "using sendxmpp for Jabber alerts)."
166 ewarn
167 ewarn "To change the homedir use:"
168 ewarn " usermod -d /var/lib/zabbix/home zabbix"
169 ewarn
170 fi
171 fi
172
173 if useq server; then
174 elog
175 elog "For distributed monitoring you have to run:"
176 elog
177 elog "zabbix_server -n <nodeid>"
178 elog
179 elog "This will convert database data for use with Node ID"
180 elog "and also adds a local node."
181 elog
182 fi
183
184 elog "--"
185 elog
186 elog "Add these lines in the /etc/services :"
187 elog
188 elog "zabbix-agent 10050/tcp Zabbix Agent"
189 elog "zabbix-agent 10050/udp Zabbix Agent"
190 elog "zabbix-trapper 10051/tcp Zabbix Trapper"
191 elog "zabbix-trapper 10051/udp Zabbix Trapper"
192 elog
193
194 # repeat fowners/fperms functionality from src_install()
195 # here to catch wrong permissions on existing files in
196 # the live filesystem (yeah, that sucks).
197 chown -R zabbix:zabbix \
198 "${ROOT}"/etc/zabbix \
199 "${ROOT}"/var/lib/zabbix \
200 "${ROOT}"/var/lib/zabbix/home \
201 "${ROOT}"/var/lib/zabbix/scripts \
202 "${ROOT}"/var/log/zabbix \
203 "${ROOT}"/var/run/zabbix
204 chmod 0750 \
205 "${ROOT}"/etc/zabbix \
206 "${ROOT}"/var/lib/zabbix \
207 "${ROOT}"/var/lib/zabbix/home \
208 "${ROOT}"/var/lib/zabbix/scripts \
209 "${ROOT}"/var/log/zabbix \
210 "${ROOT}"/var/run/zabbix
211
212 chmod 0640 \
213 "${ROOT}"/etc/zabbix/zabbix_*
214
215 if useq server || useq proxy ; then
216 # check for fping
217 fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null)
218 case "${fping_perms}" in
219 4[157][157][157])
220 ;;
221 *)
222 ewarn
223 ewarn "If you want to use the checks 'icmpping' and 'icmppingsec',"
224 ewarn "you have to make /usr/sbin/fping setuid root and executable"
225 ewarn "by everyone. Run the following command to fix it:"
226 ewarn
227 ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping"
228 ewarn
229 ewarn "Please be aware that this might impose a security risk,"
230 ewarn "depending on the code quality of fping."
231 ewarn
232 ebeep 3
233 epause 5
234 ;;
235 esac
236 fi
237 }
238
239 src_configure() {
240 econf \
241 $(use_enable server) \
242 $(use_enable proxy) \
243 $(use_enable agent) \
244 $(use_enable ipv6) \
245 $(use_with ldap) \
246 $(use_with snmp net-snmp) \
247 $(use_with mysql) \
248 $(use_with postgres pgsql) \
249 $(use_with oracle) \
250 $(use_with sqlite3) \
251 $(use_with jabber) \
252 $(use_with curl libcurl) \
253 $(use_with openipmi openipmi) \
254 $(use_with ssh ssh2) \
255 || die "econf failed"
256 }
257
258 src_install() {
259 dodir \
260 /etc/zabbix \
261 /var/lib/zabbix \
262 /var/lib/zabbix/home \
263 /var/lib/zabbix/scripts \
264 /var/log/zabbix \
265 /var/run/zabbix
266
267 keepdir \
268 /etc/zabbix \
269 /var/lib/zabbix \
270 /var/lib/zabbix/home \
271 /var/lib/zabbix/scripts \
272 /var/log/zabbix \
273 /var/run/zabbix
274
275 if useq server; then
276 insinto /etc/zabbix
277 doins \
278 "${FILESDIR}/1.6.6"/zabbix_server.conf \
279 "${FILESDIR}/1.6.6"/zabbix_trapper.conf
280 doinitd \
281 "${FILESDIR}/1.6.6"/init.d/zabbix-server
282 dosbin \
283 src/zabbix_server/zabbix_server
284 dodir \
285 /usr/share/zabbix/database
286 insinto /usr/share/zabbix/database
287 doins -r \
288 upgrades \
289 create
290 fowners zabbix:zabbix \
291 /etc/zabbix/zabbix_server.conf \
292 /etc/zabbix/zabbix_trapper.conf
293 fperms 0640 \
294 /etc/zabbix/zabbix_server.conf \
295 /etc/zabbix/zabbix_trapper.conf
296 fi
297
298 if useq proxy; then
299 doinitd \
300 "${FILESDIR}/1.6.6"/init.d/zabbix-proxy
301 dosbin \
302 src/zabbix_proxy/zabbix_proxy
303 insinto /etc/zabbix
304 doins \
305 "${FILESDIR}/1.6.6"/zabbix_proxy.conf
306 dodir \
307 /usr/share/zabbix/database
308 insinto /usr/share/zabbix/database
309 doins -r \
310 upgrades \
311 create
312 fi
313
314 if useq agent; then
315 insinto /etc/zabbix
316 doins \
317 "${FILESDIR}/1.6.6"/zabbix_agent.conf \
318 "${FILESDIR}/1.6.6"/zabbix_agentd.conf
319 doinitd \
320 "${FILESDIR}/1.6.6"/init.d/zabbix-agentd
321 dosbin \
322 src/zabbix_agent/zabbix_agent \
323 src/zabbix_agent/zabbix_agentd
324 dobin \
325 src/zabbix_sender/zabbix_sender \
326 src/zabbix_get/zabbix_get
327 fowners zabbix:zabbix \
328 /etc/zabbix/zabbix_agent.conf \
329 /etc/zabbix/zabbix_agentd.conf
330 fperms 0640 \
331 /etc/zabbix/zabbix_agent.conf \
332 /etc/zabbix/zabbix_agentd.conf
333 fi
334
335 fowners zabbix:zabbix \
336 /etc/zabbix \
337 /var/lib/zabbix \
338 /var/lib/zabbix/home \
339 /var/lib/zabbix/scripts \
340 /var/log/zabbix \
341 /var/run/zabbix
342 fperms 0750 \
343 /etc/zabbix \
344 /var/lib/zabbix \
345 /var/lib/zabbix/home \
346 /var/lib/zabbix/scripts \
347 /var/log/zabbix \
348 /var/run/zabbix
349
350 dodoc README INSTALL NEWS ChangeLog
351
352 if useq frontend; then
353 webapp_src_preinst
354 cp -R frontends/php/* "${D}/${MY_HTDOCSDIR}"
355 webapp_postinst_txt en "${FILESDIR}/"1.6.6/postinstall-en.txt
356 webapp_configfile \
357 "${MY_HTDOCSDIR}"/include/db.inc.php \
358 "${MY_HTDOCSDIR}"/include/config.inc.php
359 webapp_src_install
360 fi
361 }