]>
Commit | Line | Data |
---|---|---|
c4962172 | 1 | # TODO |
cd323295 JK |
2 | # - systemd units for zabbix-agentd, zabbix-server and zabbix-java |
3 | # - initscript for zabbix-agentd, zabbix-server and zabbix-java | |
10a854a6 TO |
4 | # |
5 | # Conditional build: | |
cd323295 JK |
6 | %bcond_with pgsql # enable PostgreSQL support |
7 | %bcond_with oracle # enable Oracle support | |
8 | %bcond_with sqlite3 # enable sqlite3 support | |
9 | %bcond_without mysql # enable MySQL support | |
10 | ||
11 | %bcond_without java # disable java support | |
12 | ||
13 | %if %{with pgsql} || %{with oracle} || %{with sqlite3} | |
14 | %undefine with_mysql | |
15 | %endif | |
16 | ||
17 | %if %{?with_pgsql:1}%{?with_oracle:1}%{?with_sqlite3:1}%{?with_mysql:1} != 1 | |
18 | ERROR: exactly one database must be selected | |
19 | %endif | |
2fe2194b | 20 | |
7f4b6a83 | 21 | Summary: zabbix - network monitoring software |
5750cc93 | 22 | Summary(pl.UTF-8): zabbix - oprogramowanie do monitorowania sieci |
10a854a6 | 23 | Name: zabbix |
cd323295 | 24 | Version: 3.2.0 |
3b06db17 | 25 | Release: 0.1 |
10a854a6 | 26 | License: GPL v2+ |
d0e25550 | 27 | Group: Networking/Utilities |
b37e41ff | 28 | Source0: http://dl.sourceforge.net/zabbix/%{name}-%{version}.tar.gz |
cd323295 JK |
29 | # Source0-md5: e2491b482868059f251902d5f636eacb |
30 | Source1: %{name}-apache.conf | |
10a854a6 | 31 | URL: http://zabbix.sourceforge.net/ |
cd323295 | 32 | BuildRequires: OpenIPMI-devel |
73af344b | 33 | BuildRequires: curl-devel |
34 | BuildRequires: iksemel-devel | |
cd323295 JK |
35 | %{?with_java:BuildRequires: jdk} |
36 | BuildRequires: libxml2-devel | |
37 | BuildRequires: libssh2-devel | |
38 | %{?with_mysql:BuildRequires: mysql-devel} | |
39709426 | 39 | BuildRequires: net-snmp-devel |
246efd79 | 40 | BuildRequires: openldap-devel >= 2.4.6 |
2886d983 | 41 | BuildRequires: openssl-devel >= 0.9.7d |
9ffbc0d2 | 42 | %{?with_pgsql:BuildRequires: postgresql-devel} |
cd323295 JK |
43 | %{?with_sqlite3:BuildRequires: sqlite3-devel} |
44 | BuildRequires: unixODBC-devel | |
96b8972f | 45 | BuildRequires: rpmbuild(macros) >= 1.268 |
9ffbc0d2 ER |
46 | Requires(postun): /usr/sbin/groupdel |
47 | Requires(postun): /usr/sbin/userdel | |
a5bb35f6 | 48 | Requires(pre): /bin/id |
9b19117f | 49 | Requires(pre): /usr/bin/getgid |
a5bb35f6 JB |
50 | Requires(pre): /usr/sbin/groupadd |
51 | Requires(pre): /usr/sbin/useradd | |
9b19117f | 52 | Provides: group(zabbix) |
53 | Provides: user(zabbix) | |
10a854a6 TO |
54 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
55 | ||
a5bb35f6 | 56 | %define _sysconfdir /etc/%{name} |
7dcff817 TP |
57 | %define _appdir %{_datadir}/%{name} |
58 | %define _webapps /etc/webapps | |
59 | %define _webapp %{name} | |
10a854a6 TO |
60 | |
61 | %description | |
b82afc4b | 62 | zabbix is software that monitors numerous parameters of a network and |
1266ba50 | 63 | the servers on that network. It is a useful tool for monitoring |
b82afc4b | 64 | the health and integrity of servers. zabbix uses a flexible |
7f4b6a83 | 65 | notification mechanism that allows users to configure email based |
66 | alerts for virtually any event. All monitored parameters are stored in | |
b82afc4b | 67 | a database. zabbix offers excellent reporting and data visualisation |
68 | features based on the stored data. zabbix supports both polling and | |
69 | trapping. All zabbix reports and statistics, as well as configuration | |
7f4b6a83 | 70 | parameters, are accessed through a web-based front end. |
71 | ||
ff14176a JR |
72 | %description -l pl.UTF-8 |
73 | zabbix to oprogramowanie do monitorowania licznych parametrów sieci i | |
1266ba50 TP |
74 | serwerów sieciowych. Jest przydatny przy monitorowaniu działania |
75 | serwerów. Jorzysta z elastycznego mechanizmu powiadamiania, który | |
76 | pozwala użytkownikom konfigurować powiadamianie pocztą elektroniczną | |
77 | dla praktycznie wszelkich zdarzeń. Monitorowane parametry są | |
78 | przechowywane w bazie danych. W oparciu o przechowywane dane zabbix | |
79 | oferuje świetne raportowanie i funkcje wizualizacji. Wspiera zarówno | |
80 | odpytywanie jak i pułapkowanie. Dostęp do wszystkich raportów i | |
81 | statystyk zabbiksa jest możliwy poprzez interfejs oparty o WWW. | |
10a854a6 | 82 | |
cd323295 | 83 | %package agentd |
7f4b6a83 | 84 | Summary: Standalone agent for zabbix |
5750cc93 | 85 | Summary(pl.UTF-8): Wersja wolnostojąca agenta zabbiksa |
d0e25550 | 86 | Group: Networking/Utilities |
b37e41ff | 87 | Requires: %{name} = %{version}-%{release} |
96b8972f | 88 | Obsoletes: zabbix-agent-inetd |
cd323295 | 89 | Obsoletes: zabbix-agent-standalone |
10a854a6 | 90 | |
cd323295 JK |
91 | %description agentd |
92 | This package provides the zabbix agent. | |
90e6d4b1 | 93 | |
cd323295 JK |
94 | %description agentd -l pl.UTF-8 |
95 | Ten pakiet dostarcza agenta zabbiksa. | |
7dcff817 TP |
96 | |
97 | %package frontend-php | |
98 | Summary: PHP frontend for zabbix | |
99 | Summary(pl.UTF-8): Interfejs PHP dla zabbiksa | |
d0e25550 | 100 | Group: Applications/WWW |
7dcff817 | 101 | Requires: php(gd) |
cd323295 JK |
102 | Requires: php(bcmath) |
103 | Requires: php(ctype) | |
104 | Requires: php(mbstring) | |
105 | Requires: php(pcre) | |
106 | Requires: php(sockets) | |
107 | Requires: php(session) | |
108 | %{?with_mysql:Requires: php(mysql)} | |
109 | %{?with_pgsql:Requires: php(pgsql)} | |
7dcff817 | 110 | Requires: webapps |
7dcff817 TP |
111 | Requires: webserver(php) |
112 | ||
113 | %description frontend-php | |
114 | This package provides web based (PHP) frontend for zabbix. | |
115 | ||
116 | %description frontend-php -l pl.UTF-8 | |
117 | Ten pakiet dostarcza napisany w PHP frontend dla zabbiksa. | |
118 | ||
119 | %package get | |
120 | Summary: Program retrieving data from zabbix agent | |
121 | Summary(pl.UTF-8): Program odpytujÄcy agenta zabbiksa | |
d0e25550 | 122 | Group: Networking/Utilities |
7dcff817 TP |
123 | |
124 | %description get | |
125 | This package provides a program retrieving data from zabbix agent. | |
126 | ||
127 | %description get -l pl.UTF-8 | |
128 | Ten pakiet zawiera program odpytujÄcy agenta zabbiksa. | |
10a854a6 | 129 | |
1b6bdd87 | 130 | %package proxy |
131 | Summary: Zabbix proxy | |
132 | Summary(pl.UTF-8): Proxy do zabbiksa | |
133 | Group: Networking/Utilities | |
134 | ||
135 | %description proxy | |
136 | This package provides the zabbix proxy. | |
137 | ||
138 | %description proxy -l pl.UTF-8 | |
139 | Ten pakiet zawiera proxy zabbix. | |
140 | ||
10a854a6 | 141 | %package sender |
7dcff817 | 142 | Summary: Zabbix sender |
5750cc93 | 143 | Summary(pl.UTF-8): Program zawiadamiający zabbiksa |
d0e25550 | 144 | Group: Networking/Utilities |
10a854a6 TO |
145 | |
146 | %description sender | |
39709426 | 147 | This package provides the zabbix sender. |
10a854a6 | 148 | |
ff14176a JR |
149 | %description sender -l pl.UTF-8 |
150 | Ten pakiet zawiera program zawiadamiający zabbiksa. | |
a5bb35f6 | 151 | |
a7e2963d | 152 | %package server |
7dcff817 TP |
153 | Summary: Zabbix server |
154 | Summary(pl.UTF-8): Serwer zabbiksa | |
d0e25550 | 155 | Group: Networking/Utilities |
7dcff817 | 156 | Requires: %{name} = %{version}-%{release} |
1266ba50 TP |
157 | Obsoletes: %{name}-suckerd |
158 | Obsoletes: %{name}-trapper-inetd | |
159 | Obsoletes: %{name}-trapper-standalone | |
a7e2963d | 160 | |
161 | %description server | |
162 | This package provides the zabbix server. | |
163 | ||
164 | %description server -l pl.UTF-8 | |
165 | Ten pakiet zawiera serwer zabbiksa. | |
166 | ||
cd323295 JK |
167 | %package java |
168 | Summary: Zabbix Java Gateway | |
169 | Group: Networking/Utilities | |
170 | Requires: %{name} = %{version}-%{release} | |
171 | ||
172 | %description java | |
173 | This package provides the Zabbix Java Gateway. | |
174 | ||
10a854a6 | 175 | %prep |
5d18cc59 | 176 | %setup -q |
10a854a6 TO |
177 | |
178 | %build | |
10a854a6 | 179 | %configure \ |
cd323295 | 180 | %{?with_mysql:--with-mysql} \ |
39709426 | 181 | %{?with_pgsql:--with-pgsql} \ |
2fe2194b | 182 | %{?with_oracle:--with-oracle} \ |
cd323295 | 183 | %{?with_sqlite3:--with-sqlite3} \ |
2fe2194b MWP |
184 | --enable-server \ |
185 | --enable-agent \ | |
1b6bdd87 | 186 | --enable-proxy \ |
cd323295 JK |
187 | --enable-ipv6 \ |
188 | %{__enable_disable java} \ | |
73af344b | 189 | --with-jabber \ |
cd323295 JK |
190 | --with-ldap \ |
191 | --with-libcurl \ | |
192 | --with-libxml2 \ | |
193 | --with-net-snmp \ | |
194 | --with-openipmi \ | |
195 | --with-openssl \ | |
196 | --with-ssh2 \ | |
197 | --with-unixodbc | |
10a854a6 TO |
198 | |
199 | %{__make} | |
200 | ||
201 | %install | |
202 | rm -rf $RPM_BUILD_ROOT | |
cd323295 | 203 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/webapps/%{_webapp},%{_appdir}} |
10a854a6 | 204 | |
2fe2194b | 205 | %{__make} install \ |
cd323295 JK |
206 | DESTDIR=$RPM_BUILD_ROOT \ |
207 | ZJG_DEST=$RPM_BUILD_ROOT%{_datadir}/zabbix_java | |
10a854a6 | 208 | |
7dcff817 | 209 | cp -r frontends $RPM_BUILD_ROOT%{_appdir} |
27f8996a | 210 | #mv -f $RPM_BUILD_ROOT%{_appdir}/frontends/php/include/db.inc.php $RPM_BUILD_ROOT%{_webapps}/%{_webapp} |
211 | #ln -s %{_webapps}/%{_webapp}/db.inc.php $RPM_BUILD_ROOT%{_appdir}/frontends/php/include | |
cd323295 JK |
212 | install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf |
213 | install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf | |
214 | ||
215 | %if %{with java} | |
216 | mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh $RPM_BUILD_ROOT%{_sysconfdir}/zabbix_java.conf | |
217 | ln -s %{_sysconfdir}/zabbix_java.conf $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh | |
218 | ||
219 | cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-start <<'EOF' | |
220 | #!/bin/sh | |
221 | ||
222 | exec %{_datadir}/zabbix_java/startup.sh "$@" | |
223 | EOF | |
224 | ||
225 | cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-stop <<'EOF' | |
226 | #!/bin/sh | |
227 | ||
228 | exec %{_datadir}/zabbix_java/shutdown.sh "$@" | |
229 | EOF | |
230 | %endif | |
10a854a6 TO |
231 | |
232 | %clean | |
233 | rm -rf $RPM_BUILD_ROOT | |
234 | ||
7dcff817 TP |
235 | %triggerin frontend-php -- apache1 < 1.3.37-3, apache1-base |
236 | %webapp_register apache %{_webapp} | |
237 | ||
238 | %triggerun frontend-php -- apache1 < 1.3.37-3, apache1-base | |
239 | %webapp_unregister apache %{_webapp} | |
240 | ||
241 | %triggerin frontend-php -- apache < 2.2.0, apache-base | |
242 | %webapp_register httpd %{_webapp} | |
243 | ||
244 | %triggerun frontend-php -- apache < 2.2.0, apache-base | |
245 | %webapp_unregister httpd %{_webapp} | |
246 | ||
e9e15753 | 247 | %pre |
78794d78 ER |
248 | %groupadd -g 111 zabbix |
249 | %useradd -d / -u 111 -g zabbix -c "Zabbix User" -s /bin/false zabbix | |
10a854a6 | 250 | |
27f8996a | 251 | %post server |
96b8972f | 252 | if [ "$1" = 1 ]; then |
cd323295 | 253 | %banner -e %{name}-server <<-EOF |
c4962172 | 254 | You should create database for Zabbix. |
c4962172 | 255 | %if %{with pgsql} |
cd323295 | 256 | Running these should be fine in most cases: |
c4962172 | 257 | psql -c 'create database zabbix' |
cd323295 JK |
258 | zcat %{_docdir}/%{name}-server-%{version}/postgresql/schema.sql.gz | psql zabbix |
259 | zcat %{_docdir}/%{name}-server-%{version}/postgresql/data.sql.gz | psql zabbix | |
260 | zcat %{_docdir}/%{name}-server-%{version}/postgresql/images.sql.gz | psql zabbix | |
c4962172 | 261 | %else |
cd323295 JK |
262 | %if %{with mysql} |
263 | Running these should be fine in most cases: | |
c4962172 | 264 | mysqladmin create zabbix |
cd323295 JK |
265 | zcat %{_docdir}/%{name}-server-%{version}/mysql/schema.sql.gz | mysql zabbix |
266 | zcat %{_docdir}/%{name}-server-%{version}/mysql/images.sql.gz | mysql zabbix | |
267 | zcat %{_docdir}/%{name}-server-%{version}/mysql/data.sql.gz | mysql zabbix | |
268 | %else | |
269 | Database template is available in %{_docdir}/%{name}-%{version} | |
270 | %endif | |
c4962172 | 271 | %endif |
cd323295 | 272 | %{?TODO:You also need zabbix-agent. install zabbix-agentd.} |
c4962172 | 273 | EOF |
96b8972f | 274 | fi |
c4962172 | 275 | |
e9e15753 | 276 | %postun |
10a854a6 | 277 | if [ "$1" = "0" ]; then |
9b19117f | 278 | %userremove zabbix |
279 | %groupremove zabbix | |
10a854a6 TO |
280 | fi |
281 | ||
10a854a6 TO |
282 | %files |
283 | %defattr(644,root,root,755) | |
cd323295 | 284 | %doc AUTHORS ChangeLog README |
7dcff817 | 285 | %attr(750,root,zabbix) %dir %{_sysconfdir} |
e4c376d6 | 286 | %dir %{_appdir} |
7dcff817 | 287 | %dir %{_appdir}/frontends |
10a854a6 | 288 | |
cd323295 | 289 | %files agentd |
10a854a6 | 290 | %defattr(644,root,root,755) |
7dcff817 | 291 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf |
b0f13a65 | 292 | %attr(755,root,root) %{_sbindir}/zabbix_agentd |
ed93a3d2 | 293 | %{_mandir}/man8/zabbix_agentd* |
10a854a6 | 294 | |
7dcff817 | 295 | %files frontend-php |
10a854a6 | 296 | %defattr(644,root,root,755) |
7dcff817 TP |
297 | %attr(750,root,http) %dir %{_webapps}/%{_webapp} |
298 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/* | |
299 | %{_appdir}/frontends/php | |
10a854a6 | 300 | |
a7e2963d | 301 | %files get |
10a854a6 | 302 | %defattr(644,root,root,755) |
ed93a3d2 | 303 | %attr(755,root,root) %{_bindir}/zabbix_get |
304 | %{_mandir}/man1/zabbix_get* | |
10a854a6 | 305 | |
1b6bdd87 | 306 | %files proxy |
307 | %defattr(644,root,root,755) | |
cd323295 | 308 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_proxy.conf |
1b6bdd87 | 309 | %attr(755,root,root) %{_sbindir}/zabbix_proxy |
310 | %{_mandir}/man8/zabbix_proxy* | |
311 | ||
7dcff817 TP |
312 | %files sender |
313 | %defattr(644,root,root,755) | |
ed93a3d2 | 314 | %attr(755,root,root) %{_bindir}/zabbix_sender |
315 | %{_mandir}/man1/zabbix_sender* | |
7dcff817 | 316 | |
a7e2963d | 317 | %files server |
10a854a6 | 318 | %defattr(644,root,root,755) |
cd323295 JK |
319 | %doc upgrades/dbpatches |
320 | %if %{with mysql} | |
321 | %doc database/mysql | |
322 | %endif | |
323 | %if %{with postgresql} | |
324 | %doc database/postgresql | |
325 | %endif | |
326 | %if %{with oracle} | |
327 | %doc database/oracle | |
328 | %endif | |
329 | %if %{with sqlite3} | |
330 | %doc database/sqlite3 | |
331 | %endif | |
7dcff817 | 332 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_server.conf |
b0f13a65 | 333 | %attr(755,root,root) %{_sbindir}/zabbix_server |
ed93a3d2 | 334 | %{_mandir}/man8/zabbix_server* |
cd323295 JK |
335 | |
336 | %if %{with java} | |
337 | %files java | |
338 | %defattr(644,root,root,755) | |
339 | %attr(755,root,root) %{_sbindir}/zabbix_java-start | |
340 | %attr(755,root,root) %{_sbindir}/zabbix_java-stop | |
341 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_java.conf | |
342 | %dir %{_datadir}/zabbix_java | |
343 | %{_datadir}/zabbix_java/bin | |
344 | %{_datadir}/zabbix_java/lib | |
345 | %{_datadir}/zabbix_java/settings.sh | |
346 | %attr(755,root,root) %{_datadir}/zabbix_java/shutdown.sh | |
347 | %attr(755,root,root) %{_datadir}/zabbix_java/startup.sh | |
348 | %endif |