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