]> git.pld-linux.org Git - packages/zabbix.git/blob - zabbix.spec
- use virtual webserver provide
[packages/zabbix.git] / zabbix.spec
1 # TODO
2 # - initscript for zabbix-agent-standalone 
3 # - missing zabbix_agentd.conf, zabbix_trapperd.conf
4 #   see http://www.zabbix.com/manual_install_server.php
5 #
6 # Conditional build:
7 %bcond_with     pgsql   # enable PostgreSQL support (by default use mysql)
8 #
9 Summary:        zabbix - network monitoring software
10 Summary(pl):    zabbix - oprogramowanie do monitorowania sieci
11 Name:           zabbix
12 Version:        1.0
13 Release:        0.12
14 License:        GPL v2+
15 Group:          Networking/Admin
16 Source0:        http://dl.sourceforge.net/zabbix/%{name}-%{version}.tar.gz
17 # Source0-md5:  e83a3b92f13942081ed2f3fe3f3084d8
18 Source1:        %{name}-agent.inetd
19 Source2:        %{name}-trapper.inetd
20 URL:            http://zabbix.sourceforge.net/
21 %{!?with_pgsql:BuildRequires:   mysql-devel}
22 %{?with_pgsql:BuildRequires:    postgresql-devel}
23 BuildRequires:  net-snmp-devel
24 BuildRequires:  openssl-devel >= 0.9.7d
25 BuildRequires:  rpmbuild(macros) >= 1.194
26 Requires(pre):  /bin/id
27 Requires(pre):  /usr/bin/getgid
28 Requires(pre):  /usr/sbin/groupadd
29 Requires(pre):  /usr/sbin/useradd
30 Requires(postun):       /usr/sbin/groupdel
31 Requires(postun):       /usr/sbin/userdel
32 Provides:       group(zabbix)
33 Provides:       user(zabbix)
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36 %define         _sysconfdir     /etc/%{name}
37 %define         htmldir         /home/services/httpd/html/%{name}
38
39 %description
40 zabbix is software that monitors numerous parameters of a network and
41 the servers on that network. zabbix is a useful tool for monitoring
42 the health and integrity of servers. zabbix uses a flexible
43 notification mechanism that allows users to configure email based
44 alerts for virtually any event. All monitored parameters are stored in
45 a database. zabbix offers excellent reporting and data visualisation
46 features based on the stored data. zabbix supports both polling and
47 trapping. All zabbix reports and statistics, as well as configuration
48 parameters, are accessed through a web-based front end.
49
50 %description -l pl
51 zabbix to oprogramowanie do monitorowania licznych parametrów sieci i
52 serwerów sieciowych. zabbix jest przydatny przy monitorowaniu
53 dzia³ania serwerów. zabbix korzysta z elastycznego mechanizmu
54 powiadamiania, który pozwala u¿ytkownikom konfigurowaæ powiadamianie
55 poczt± elektroniczn± dla praktycznie wszelkich zdarzeñ. Monitorowane
56 parametry s± przechowywane w bazie danych. zabbix oferuje, w oparciu o
57 przechowywane dane, ¶wietne raportowanie i funkcje wizualizacji.
58 zabbix wspiera zarówno odpytywanie, jak i pu³apkowanie. Dostêp do
59 wszystkich raportów i statystyk zabbiksa jest mo¿liwy poprzez
60 interfejs oparty o WWW.
61
62 %package frontend-php
63 Summary:        PHP frontend for zabbix
64 Summary(pl):    Interfejs PHP dla zabbiksa
65 Group:          Networking/Admin
66 Requires:       webserver = apache
67 Requires:       php
68 Requires:       php-gd
69 %{!?with_pgsql:Requires:        php-mysql}
70 %{?with_pgsql:Requires: php-pgsql}
71
72 %description frontend-php
73 This package provides web based (PHP) frontend for zabbix.
74
75 %description frontend-php -l pl
76 Ten pakiet dostarcza napisany w PHP frontend dla zabbiksa.
77
78 %package agent-inetd
79 Summary:        inetd agent for zabbix
80 Summary(pl):    Wersja inetd agenta zabbiksa
81 Group:          Networking/Admin
82 Requires:       %{name} = %{version}-%{release}
83 Requires:       inetdaemon
84 Obsoletes:      %{name}-agent-standalone
85
86 %description agent-inetd
87 This package provides inetd version of zabbix agent.
88
89 %description agent-inetd -l pl
90 Ten pakiet dostarcza agenta zabbiksa dla inetd.
91
92 %package agent-standalone
93 Summary:        Standalone agent for zabbix
94 Summary(pl):    Wersja wolnostoj±ca agenta zabbiksa
95 Group:          Networking/Admin
96 Requires:       %{name} = %{version}-%{release}
97 Obsoletes:      %{name}-agent-inetd
98
99 %description agent-standalone
100 This package provides standalone version of zabbix agent.
101
102 %description agent-standalone -l pl
103 Ten pakiet dostarcza wolnostoj±cej wersji agenta zabbiksa.
104
105 %package suckerd
106 Summary:        sucker daemon for zabbix
107 Summary(pl):    Demon sucker dla zabbiksa
108 Group:          Networking/Admin
109 Requires:       %{name} = %{version}-%{release}
110 %{!?with_pgsql:Requires:        mysql}
111 %{?with_pgsql:Requires: postgresql}
112
113 %description suckerd
114 This package provides the sucker daemon for zabbix.
115
116 %description suckerd -l pl
117 Ten pakiet zawiera demona sucker dla zabbiksa.
118
119 %package trapper-inetd
120 Summary:        inetd trapper for zabbix
121 Summary(pl):    Wersja inetd programu pu³apkuj±cego zabbiksa
122 Group:          Networking/Admin
123 Requires:       %{name} = %{version}-%{release}
124 Requires:       inetdaemon
125 Obsoletes:      %{name}-trapper-standalone
126
127 %description trapper-inetd
128 This package provides inetd version of zabbix trapper.
129
130 %description trapper-inetd -l pl
131 Ten pakiet zawiera program pu³apkuj±cy zabbiksa dla inetd.
132
133 %package trapper-standalone
134 Summary:        Standalone trapper for zabbix
135 Summary(pl):    Wersja wolnostoj±ca programu pu³apkuj±cego zabbiksa
136 Group:          Networking/Admin
137 Requires:       %{name} = %{version}-%{release}
138 Obsoletes:      %{name}-trapper-inetd
139
140 %description trapper-standalone
141 This package provides standalone version of zabbix trapper.
142
143 %description trapper-standalone -l pl
144 Ten pakiet zawiera wolnostoj±c± wersjê programu pu³apkuj±cego
145 zabbiksa.
146
147 %package sender
148 Summary:        zabbix's sender
149 Summary(pl):    Program zawiadamiaj±cy zabbiksa
150 Group:          Networking/Admin
151
152 %description sender
153 This package provides the zabbix sender.
154
155 %description sender -l pl
156 Ten pakiet zawiera program zawiadamiaj±cy zabbiksa.
157
158 %prep
159 %setup -q
160
161 %build
162 %configure \
163         %{!?with_pgsql:--with-mysql} \
164         %{?with_pgsql:--with-pgsql} \
165         --with-net-snmp
166
167 %{__make}
168
169 %install
170 rm -rf $RPM_BUILD_ROOT
171 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/sysconfig/rc-inetd,%{_sbindir},%{htmldir}}
172
173 install bin/zabbix_* $RPM_BUILD_ROOT%{_sbindir}
174 install misc/conf/* $RPM_BUILD_ROOT%{_sysconfdir}
175 cp -r frontends/php/* $RPM_BUILD_ROOT%{htmldir}
176
177 install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/zabbix-agent
178 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/zabbix-trapper
179
180 %clean
181 rm -rf $RPM_BUILD_ROOT
182
183 %pre
184 %groupadd -g 111 zabbix
185 %useradd -d / -u 111 -g zabbix -c "Zabbix User" -s /bin/false zabbix
186
187 %post
188 #if [ "$1" = 1 ]; then
189         %banner -e %{name} <<-EOF
190         You should create database for Zabbix.
191         Running these should be fine in most cases:
192 %if %{with pgsql}
193         psql -c 'create database zabbix'
194         zcat %{_docdir}/%{name}-%{version}/create/pgsql/schema.sql.gz | psql zabbix
195         zcat %{_docdir}/%{name}-%{version}/create/data/data.sql.gz | psql zabbix
196 %else
197         mysqladmin create zabbix
198         zcat %{_docdir}/%{name}-%{version}/create/mysql/schema.sql.gz | mysql zabbix
199         zcat %{_docdir}/%{name}-%{version}/create/data/data.sql.gz | mysql zabbix
200 %endif
201         %{?TODO:You also need zabbix-agent. install zabbix-agent-standalone %or zabbix-agent-inetd.}
202 EOF
203 #fi
204
205 %postun
206 if [ "$1" = "0" ]; then
207         %userremove zabbix
208         %groupremove zabbix
209 fi
210
211 %post agent-inetd
212 if [ -f /var/lock/subsys/rc-inetd ]; then
213         /etc/rc.d/init.d/rc-inetd reload
214 else
215         echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet server" 1>&2
216 fi
217
218 %postun agent-inetd
219 if [ -f /var/lock/subsys/rc-inetd ]; then
220         /etc/rc.d/init.d/rc-inetd reload
221 fi
222
223 %post trapper-inetd
224 if [ -f /var/lock/subsys/rc-inetd ]; then
225         /etc/rc.d/init.d/rc-inetd reload
226 else
227         echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet server" 1>&2
228 fi
229
230 %postun trapper-inetd
231 if [ -f /var/lock/subsys/rc-inetd ]; then
232         /etc/rc.d/init.d/rc-inetd reload
233 fi
234
235 %files
236 %defattr(644,root,root,755)
237 %doc doc/Zabbix\ Manual.pdf AUTHORS NEWS README ChangeLog create upgrades bin/ZabbixW32.exe
238 %attr(750,root,zabbix) %dir %{_sysconfdir}
239
240 %files frontend-php
241 %defattr(644,root,root,755)
242 %dir %{htmldir}
243 %{htmldir}/*.php
244 %{htmldir}/*.css
245 %{htmldir}/audio
246 %{htmldir}/images
247
248 %dir %{htmldir}/include
249 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{htmldir}/include/db.inc.php
250 %{htmldir}/include/.htaccess
251 %{htmldir}/include/classes.inc.php
252 %{htmldir}/include/config.inc.php
253 %{htmldir}/include/defines.inc.php
254
255 %files agent-inetd
256 %defattr(644,root,root,755)
257 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent.conf
258 %attr(640,root,root) %config(noreplace) %verify(not mtime md5 size) /etc/sysconfig/rc-inetd/zabbix-agent
259 %attr(755,root,root) %{_sbindir}/zabbix_agent
260
261 %files agent-standalone
262 %defattr(644,root,root,755)
263 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf
264 %attr(755,root,root) %{_sbindir}/zabbix_agentd
265
266 %files suckerd
267 %defattr(644,root,root,755)
268 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_suckerd.conf
269 %attr(755,root,root) %{_sbindir}/zabbix_suckerd
270
271 %files trapper-inetd
272 %defattr(644,root,root,755)
273 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_trapper.conf
274 %attr(640,root,root) %config(noreplace) %verify(not mtime md5 size) /etc/sysconfig/rc-inetd/zabbix-trapper
275 %attr(755,root,root) %{_sbindir}/zabbix_trapper
276
277 %files trapper-standalone
278 %defattr(644,root,root,755)
279 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_trapperd.conf
280 %attr(755,root,root) %{_sbindir}/zabbix_trapperd
281
282 %files sender
283 %defattr(644,root,root,755)
284 %attr(755,root,root) %{_sbindir}/zabbix_sender
This page took 0.110215 seconds and 4 git commands to generate.