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