]>
Commit | Line | Data |
---|---|---|
c4962172 | 1 | # TODO |
7dcff817 | 2 | # - initscript for zabbix-agent-standalone and zabbix-server |
10a854a6 TO |
3 | # |
4 | # Conditional build: | |
625793cb | 5 | %bcond_with pgsql # enable PostgreSQL support (by default use mysql) |
2fe2194b MWP |
6 | %bcond_with oracle # enable Oracle support (by default use mysql) |
7 | ||
7f4b6a83 | 8 | Summary: zabbix - network monitoring software |
5750cc93 | 9 | Summary(pl.UTF-8): zabbix - oprogramowanie do monitorowania sieci |
10a854a6 | 10 | Name: zabbix |
ed93a3d2 | 11 | Version: 1.8.6 |
b0f13a65 | 12 | Release: 0.1 |
10a854a6 | 13 | License: GPL v2+ |
d0e25550 | 14 | Group: Networking/Utilities |
b37e41ff | 15 | Source0: http://dl.sourceforge.net/zabbix/%{name}-%{version}.tar.gz |
ed93a3d2 | 16 | # Source0-md5: 4642fd263167211a73a02fe7f3bcd998 |
10a854a6 | 17 | Source1: %{name}-agent.inetd |
7dcff817 | 18 | Source2: %{name}-apache.conf |
10a854a6 | 19 | URL: http://zabbix.sourceforge.net/ |
39709426 | 20 | %{!?with_pgsql:BuildRequires: mysql-devel} |
39709426 | 21 | BuildRequires: net-snmp-devel |
246efd79 | 22 | BuildRequires: openldap-devel >= 2.4.6 |
2886d983 | 23 | BuildRequires: openssl-devel >= 0.9.7d |
9ffbc0d2 | 24 | %{?with_pgsql:BuildRequires: postgresql-devel} |
96b8972f | 25 | BuildRequires: rpmbuild(macros) >= 1.268 |
9ffbc0d2 ER |
26 | Requires(postun): /usr/sbin/groupdel |
27 | Requires(postun): /usr/sbin/userdel | |
a5bb35f6 | 28 | Requires(pre): /bin/id |
9b19117f | 29 | Requires(pre): /usr/bin/getgid |
a5bb35f6 JB |
30 | Requires(pre): /usr/sbin/groupadd |
31 | Requires(pre): /usr/sbin/useradd | |
9b19117f | 32 | Provides: group(zabbix) |
33 | Provides: user(zabbix) | |
10a854a6 TO |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
35 | ||
a5bb35f6 | 36 | %define _sysconfdir /etc/%{name} |
7dcff817 TP |
37 | %define _appdir %{_datadir}/%{name} |
38 | %define _webapps /etc/webapps | |
39 | %define _webapp %{name} | |
10a854a6 | 40 | |
b0f13a65 AG |
41 | # FIXME |
42 | %define filterout_ld -Wl,--as-needed | |
43 | ||
10a854a6 | 44 | %description |
b82afc4b | 45 | zabbix is software that monitors numerous parameters of a network and |
1266ba50 | 46 | the servers on that network. It is a useful tool for monitoring |
b82afc4b | 47 | the health and integrity of servers. zabbix uses a flexible |
7f4b6a83 | 48 | notification mechanism that allows users to configure email based |
49 | alerts for virtually any event. All monitored parameters are stored in | |
b82afc4b | 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 | |
7f4b6a83 | 53 | parameters, are accessed through a web-based front end. |
54 | ||
ff14176a JR |
55 | %description -l pl.UTF-8 |
56 | zabbix to oprogramowanie do monitorowania licznych parametrów sieci i | |
1266ba50 TP |
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. | |
10a854a6 | 65 | |
10a854a6 TO |
66 | %package agent-inetd |
67 | Summary: inetd agent for zabbix | |
5750cc93 | 68 | Summary(pl.UTF-8): Wersja inetd agenta zabbiksa |
d0e25550 | 69 | Group: Networking/Utilities |
b37e41ff | 70 | Requires: %{name} = %{version}-%{release} |
10a854a6 | 71 | Requires: inetdaemon |
96b8972f | 72 | Obsoletes: zabbix-agent-standalone |
10a854a6 TO |
73 | |
74 | %description agent-inetd | |
90e6d4b1 AG |
75 | This package provides inetd version of zabbix agent. |
76 | ||
ff14176a | 77 | %description agent-inetd -l pl.UTF-8 |
90e6d4b1 | 78 | Ten pakiet dostarcza agenta zabbiksa dla inetd. |
10a854a6 TO |
79 | |
80 | %package agent-standalone | |
7f4b6a83 | 81 | Summary: Standalone agent for zabbix |
5750cc93 | 82 | Summary(pl.UTF-8): Wersja wolnostojąca agenta zabbiksa |
d0e25550 | 83 | Group: Networking/Utilities |
b37e41ff | 84 | Requires: %{name} = %{version}-%{release} |
96b8972f | 85 | Obsoletes: zabbix-agent-inetd |
10a854a6 | 86 | |
80945b42 | 87 | %description agent-standalone |
7dcff817 | 88 | This package provides standalone (recommended) version of zabbix agent. |
90e6d4b1 | 89 | |
ff14176a | 90 | %description agent-standalone -l pl.UTF-8 |
7dcff817 TP |
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 | |
d0e25550 | 96 | Group: Applications/WWW |
7dcff817 TP |
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 | |
d0e25550 | 113 | Group: Networking/Utilities |
7dcff817 TP |
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. | |
10a854a6 | 120 | |
10a854a6 | 121 | %package sender |
7dcff817 | 122 | Summary: Zabbix sender |
5750cc93 | 123 | Summary(pl.UTF-8): Program zawiadamiający zabbiksa |
d0e25550 | 124 | Group: Networking/Utilities |
10a854a6 TO |
125 | |
126 | %description sender | |
39709426 | 127 | This package provides the zabbix sender. |
10a854a6 | 128 | |
ff14176a JR |
129 | %description sender -l pl.UTF-8 |
130 | Ten pakiet zawiera program zawiadamiający zabbiksa. | |
a5bb35f6 | 131 | |
a7e2963d | 132 | %package server |
7dcff817 TP |
133 | Summary: Zabbix server |
134 | Summary(pl.UTF-8): Serwer zabbiksa | |
d0e25550 | 135 | Group: Networking/Utilities |
7dcff817 | 136 | Requires: %{name} = %{version}-%{release} |
1266ba50 TP |
137 | Obsoletes: %{name}-suckerd |
138 | Obsoletes: %{name}-trapper-inetd | |
139 | Obsoletes: %{name}-trapper-standalone | |
a7e2963d | 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 | ||
10a854a6 | 147 | %prep |
5d18cc59 | 148 | %setup -q |
10a854a6 TO |
149 | |
150 | %build | |
10a854a6 | 151 | %configure \ |
39709426 | 152 | %{!?with_pgsql:--with-mysql} \ |
153 | %{?with_pgsql:--with-pgsql} \ | |
2fe2194b MWP |
154 | %{?with_oracle:--with-oracle} \ |
155 | --enable-server \ | |
156 | --enable-agent \ | |
157 | --with-net-snmp \ | |
7dcff817 | 158 | --with-ldap \ |
2fe2194b | 159 | # --with-ucd-snmp=DIR \ |
10a854a6 TO |
160 | |
161 | %{__make} | |
162 | ||
163 | %install | |
164 | rm -rf $RPM_BUILD_ROOT | |
7dcff817 | 165 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{sysconfig/rc-inetd,webapps/%{_webapp}},%{_appdir}} |
10a854a6 | 166 | |
2fe2194b MWP |
167 | %{__make} install \ |
168 | DESTDIR=$RPM_BUILD_ROOT | |
10a854a6 | 169 | |
ed93a3d2 | 170 | install misc/conf/zabbix_{a*,s*}.conf $RPM_BUILD_ROOT%{_sysconfdir} |
7dcff817 TP |
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 | |
10a854a6 TO |
177 | |
178 | %clean | |
179 | rm -rf $RPM_BUILD_ROOT | |
180 | ||
7dcff817 TP |
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 | ||
e9e15753 | 193 | %pre |
78794d78 ER |
194 | %groupadd -g 111 zabbix |
195 | %useradd -d / -u 111 -g zabbix -c "Zabbix User" -s /bin/false zabbix | |
10a854a6 | 196 | |
c4962172 | 197 | %post |
96b8972f | 198 | if [ "$1" = 1 ]; then |
c4962172 ER |
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' | |
7dcff817 | 204 | zcat %{_docdir}/%{name}-%{version}/create/postgresql/schema.sql.gz | psql zabbix |
c4962172 | 205 | zcat %{_docdir}/%{name}-%{version}/create/data/data.sql.gz | psql zabbix |
02051dbe | 206 | zcat %{_docdir}/%{name}-%{version}/create/data/images_pgsql.sql.gz | psql zabbix |
c4962172 ER |
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 | |
02051dbe | 211 | zcat %{_docdir}/%{name}-%{version}/create/data/images.sql.gz | mysql zabbix |
c4962172 ER |
212 | %endif |
213 | %{?TODO:You also need zabbix-agent. install zabbix-agent-standalone %or zabbix-agent-inetd.} | |
214 | EOF | |
96b8972f | 215 | fi |
c4962172 | 216 | |
e9e15753 | 217 | %postun |
10a854a6 | 218 | if [ "$1" = "0" ]; then |
9b19117f | 219 | %userremove zabbix |
220 | %groupremove zabbix | |
10a854a6 TO |
221 | fi |
222 | ||
223 | %post agent-inetd | |
96b8972f | 224 | %service -q rc-inetd reload |
10a854a6 TO |
225 | |
226 | %postun agent-inetd | |
96b8972f ER |
227 | if [ "$1" = 0 ]; then |
228 | %service -q rc-inetd reload | |
10a854a6 TO |
229 | fi |
230 | ||
10a854a6 TO |
231 | %files |
232 | %defattr(644,root,root,755) | |
ed93a3d2 | 233 | %doc AUTHORS NEWS README ChangeLog create upgrades |
7dcff817 | 234 | %attr(750,root,zabbix) %dir %{_sysconfdir} |
e4c376d6 | 235 | %dir %{_appdir} |
7dcff817 | 236 | %dir %{_appdir}/frontends |
10a854a6 TO |
237 | |
238 | %files agent-inetd | |
239 | %defattr(644,root,root,755) | |
7dcff817 TP |
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 | |
b0f13a65 | 242 | %attr(755,root,root) %{_sbindir}/zabbix_agent |
10a854a6 TO |
243 | |
244 | %files agent-standalone | |
245 | %defattr(644,root,root,755) | |
7dcff817 | 246 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf |
b0f13a65 | 247 | %attr(755,root,root) %{_sbindir}/zabbix_agentd |
ed93a3d2 | 248 | %{_mandir}/man8/zabbix_agentd* |
10a854a6 | 249 | |
7dcff817 | 250 | %files frontend-php |
10a854a6 | 251 | %defattr(644,root,root,755) |
7dcff817 TP |
252 | %attr(750,root,http) %dir %{_webapps}/%{_webapp} |
253 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/* | |
254 | %{_appdir}/frontends/php | |
10a854a6 | 255 | |
a7e2963d | 256 | %files get |
10a854a6 | 257 | %defattr(644,root,root,755) |
ed93a3d2 | 258 | %attr(755,root,root) %{_bindir}/zabbix_get |
259 | %{_mandir}/man1/zabbix_get* | |
10a854a6 | 260 | |
7dcff817 TP |
261 | %files sender |
262 | %defattr(644,root,root,755) | |
ed93a3d2 | 263 | %attr(755,root,root) %{_bindir}/zabbix_sender |
264 | %{_mandir}/man1/zabbix_sender* | |
7dcff817 | 265 | |
a7e2963d | 266 | %files server |
10a854a6 | 267 | %defattr(644,root,root,755) |
7dcff817 | 268 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_server.conf |
b0f13a65 | 269 | %attr(755,root,root) %{_sbindir}/zabbix_server |
ed93a3d2 | 270 | %{_mandir}/man8/zabbix_server* |