]>
Commit | Line | Data |
---|---|---|
06317756 | 1 | # TODO: |
d93a02f8 | 2 | # - initscript for zabbix-server, zabbix-proxy and zabbix-java |
10a854a6 TO |
3 | # |
4 | # Conditional build: | |
7efbcfc2 JK |
5 | %bcond_without pgsql # enable PostgreSQL support |
6 | %bcond_without sqlite3 # enable sqlite3 support | |
cd323295 | 7 | %bcond_without mysql # enable MySQL support |
cd323295 JK |
8 | %bcond_without java # disable java support |
9 | ||
c4cfaa95 | 10 | %define databases %{?with_sqlite3:sqlite3} %{?with_pgsql:postgresql} %{?with_mysql:mysql} |
2a82feb1 | 11 | %define any_database %{with pgsql}%{with mysql}%{with sqlite3} |
2fe2194b | 12 | |
0196d0f6 | 13 | %define php_min_version 5.4.0 |
06317756 JK |
14 | Summary: Zabbix - network monitoring software |
15 | Summary(pl.UTF-8): Zabbix - oprogramowanie do monitorowania sieci | |
10a854a6 | 16 | Name: zabbix |
4d9dec78 | 17 | Version: 3.4.5 |
5d3ab960 | 18 | Release: 2 |
10a854a6 | 19 | License: GPL v2+ |
d0e25550 | 20 | Group: Networking/Utilities |
88b80688 | 21 | Source0: http://downloads.sourceforge.net/zabbix/%{name}-%{version}.tar.gz |
4d9dec78 | 22 | # Source0-md5: 954dd640973e476a619d0665553a3207 |
cd323295 | 23 | Source1: %{name}-apache.conf |
0196d0f6 ER |
24 | Source2: %{name}_server.service |
25 | Source3: %{name}_agentd.service | |
26 | Source4: %{name}_proxy.service | |
27 | Source5: %{name}_java.service | |
28 | Source6: %{name}.tmpfiles | |
d93a02f8 | 29 | Source7: %{name}_agentd.init |
06317756 | 30 | Patch0: config.patch |
7efbcfc2 | 31 | Patch1: sqlite3_dbname.patch |
c4cfaa95 | 32 | Patch2: always_compile_ipc.patch |
10a854a6 | 33 | URL: http://zabbix.sourceforge.net/ |
d93a02f8 | 34 | BuildRequires: OpenIPMI-devel |
e27bce28 JK |
35 | BuildRequires: autoconf |
36 | BuildRequires: automake >= 1:1.15 | |
73af344b | 37 | BuildRequires: curl-devel |
38 | BuildRequires: iksemel-devel | |
cd323295 | 39 | %{?with_java:BuildRequires: jdk} |
4ffaba52 | 40 | BuildRequires: libevent-devel |
cd323295 | 41 | BuildRequires: libssh2-devel |
d93a02f8 | 42 | BuildRequires: libtool |
0196d0f6 | 43 | BuildRequires: libxml2-devel |
cd323295 | 44 | %{?with_mysql:BuildRequires: mysql-devel} |
39709426 | 45 | BuildRequires: net-snmp-devel |
246efd79 | 46 | BuildRequires: openldap-devel >= 2.4.6 |
2886d983 | 47 | BuildRequires: openssl-devel >= 0.9.7d |
4ffaba52 | 48 | BuildRequires: pcre-devel |
9ffbc0d2 | 49 | %{?with_pgsql:BuildRequires: postgresql-devel} |
0196d0f6 | 50 | BuildRequires: rpmbuild(macros) >= 1.671 |
cd323295 JK |
51 | %{?with_sqlite3:BuildRequires: sqlite3-devel} |
52 | BuildRequires: unixODBC-devel | |
0196d0f6 ER |
53 | Requires: %{name}-agentd = %{version}-%{release} |
54 | Requires: %{name}-frontend-php = %{version}-%{release} | |
55 | Requires: %{name}-server = %{version}-%{release} | |
10a854a6 TO |
56 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
57 | ||
a5bb35f6 | 58 | %define _sysconfdir /etc/%{name} |
7dcff817 TP |
59 | %define _appdir %{_datadir}/%{name} |
60 | %define _webapps /etc/webapps | |
61 | %define _webapp %{name} | |
10a854a6 TO |
62 | |
63 | %description | |
06317756 | 64 | Zabbix is software that monitors numerous parameters of a network and |
0196d0f6 ER |
65 | the servers on that network. It is a useful tool for monitoring the |
66 | health and integrity of servers. Zabbix uses a flexible notification | |
67 | mechanism that allows users to configure email based alerts for | |
68 | virtually any event. All monitored parameters are stored in a | |
69 | database. Zabbix offers excellent reporting and data visualisation | |
06317756 JK |
70 | features based on the stored data. Zabbix supports both polling and |
71 | trapping. All Zabbix reports and statistics, as well as configuration | |
7f4b6a83 | 72 | parameters, are accessed through a web-based front end. |
73 | ||
ff14176a | 74 | %description -l pl.UTF-8 |
06317756 | 75 | Zabbix to oprogramowanie do monitorowania licznych parametrów sieci i |
1266ba50 TP |
76 | serwerów sieciowych. Jest przydatny przy monitorowaniu działania |
77 | serwerów. Jorzysta z elastycznego mechanizmu powiadamiania, który | |
78 | pozwala użytkownikom konfigurować powiadamianie pocztą elektroniczną | |
79 | dla praktycznie wszelkich zdarzeń. Monitorowane parametry są | |
06317756 | 80 | przechowywane w bazie danych. W oparciu o przechowywane dane Zabbix |
1266ba50 TP |
81 | oferuje świetne raportowanie i funkcje wizualizacji. Wspiera zarówno |
82 | odpytywanie jak i pułapkowanie. Dostęp do wszystkich raportów i | |
06317756 JK |
83 | statystyk Zabbiksa jest możliwy poprzez interfejs oparty o WWW. |
84 | ||
85 | %package common | |
86 | Summary: Common files for Zabbix monitoring software | |
87 | Summary(pl.UTF-8): Wspólne pliki dla oprogramowania monitorującego Zabbix | |
88 | Group: Networking/Utilities | |
89 | Requires(postun): /usr/sbin/groupdel | |
90 | Requires(postun): /usr/sbin/userdel | |
91 | Requires(pre): /bin/id | |
92 | Requires(pre): /usr/bin/getgid | |
93 | Requires(pre): /usr/sbin/groupadd | |
94 | Requires(pre): /usr/sbin/useradd | |
95 | Provides: group(zabbix) | |
96 | Provides: user(zabbix) | |
97 | ||
98 | %description common | |
99 | Common files for Zabbix monitoring software. | |
100 | ||
101 | %description common -l pl.UTF-8 | |
102 | Wspólne pliki dla oprogramowania monitorującego Zabbix. | |
10a854a6 | 103 | |
cd323295 | 104 | %package agentd |
06317756 JK |
105 | Summary: Zabbix Agent |
106 | Summary(pl.UTF-8): Agenta Zabbiksa | |
d0e25550 | 107 | Group: Networking/Utilities |
06317756 | 108 | Requires: %{name}-common = %{version}-%{release} |
0196d0f6 | 109 | Requires: systemd-units >= 38 |
96b8972f | 110 | Obsoletes: zabbix-agent-inetd |
cd323295 | 111 | Obsoletes: zabbix-agent-standalone |
d93a02f8 ER |
112 | Requires(post,preun): /sbin/chkconfig |
113 | Requires: rc-scripts | |
10a854a6 | 114 | |
cd323295 | 115 | %description agentd |
06317756 | 116 | Zabbix agent collects data from the local system for a Zabbix server. |
90e6d4b1 | 117 | |
cd323295 | 118 | %description agentd -l pl.UTF-8 |
06317756 | 119 | Agent zbiera dane z lokalnej maszyny dla serwera Zabbix. |
7dcff817 TP |
120 | |
121 | %package frontend-php | |
06317756 JK |
122 | Summary: PHP frontend for Zabbix |
123 | Summary(pl.UTF-8): Interfejs PHP dla Zabbiksa | |
d0e25550 | 124 | Group: Applications/WWW |
cd323295 | 125 | Requires: php(bcmath) |
1d07384b | 126 | Requires: php(core) >= %{php_min_version} |
cd323295 | 127 | Requires: php(ctype) |
1d07384b JK |
128 | Requires: php(gd) |
129 | Requires: php(gettext) | |
8cc30dbd | 130 | Requires: php(json) |
cd323295 JK |
131 | Requires: php(mbstring) |
132 | Requires: php(pcre) | |
cd323295 | 133 | Requires: php(session) |
1d07384b JK |
134 | Requires: php(sockets) |
135 | Requires: php(xml) | |
136 | Requires: php(xmlreader) | |
137 | Requires: php(xmlwriter) | |
7dcff817 | 138 | Requires: webapps |
cb5654b1 | 139 | Requires: webserver(alias) |
66fbc8af | 140 | Requires: webserver(indexfile) |
7dcff817 | 141 | Requires: webserver(php) |
7efbcfc2 JK |
142 | Suggests: php(mysql) |
143 | Suggests: php(pgsql) | |
144 | Suggests: php(sqlite3) | |
b8568b0f AM |
145 | # used with sqlite3 |
146 | Suggests: php(sysvsem) | |
ae9a7f61 | 147 | BuildArch: noarch |
7dcff817 TP |
148 | |
149 | %description frontend-php | |
06317756 | 150 | This package provides web based (PHP) frontend for Zabbix. |
7dcff817 TP |
151 | |
152 | %description frontend-php -l pl.UTF-8 | |
06317756 | 153 | Ten pakiet dostarcza napisany w PHP frontend dla Zabbiksa. |
7dcff817 TP |
154 | |
155 | %package get | |
06317756 JK |
156 | Summary: Program retrieving data from Zabbix agent |
157 | Summary(pl.UTF-8): Program odpytujÄcy agenta Zabbiksa | |
d0e25550 | 158 | Group: Networking/Utilities |
7dcff817 TP |
159 | |
160 | %description get | |
06317756 | 161 | This package provides a program retrieving data from Zabbix agent. |
7dcff817 TP |
162 | |
163 | %description get -l pl.UTF-8 | |
06317756 | 164 | Ten pakiet zawiera program odpytujÄcy agenta Zabbiksa. |
10a854a6 | 165 | |
1b6bdd87 | 166 | %package proxy |
167 | Summary: Zabbix proxy | |
06317756 | 168 | Summary(pl.UTF-8): Proxy do Zabbiksa |
1b6bdd87 | 169 | Group: Networking/Utilities |
06317756 | 170 | Requires: %{name}-common = %{version}-%{release} |
0196d0f6 | 171 | Requires: systemd-units >= 38 |
9a6ace5d | 172 | Requires: zabbix-proxy(db) = %{version}-%{release} |
1b6bdd87 | 173 | |
174 | %description proxy | |
06317756 | 175 | This package provides the Zabbix proxy. |
1b6bdd87 | 176 | |
177 | %description proxy -l pl.UTF-8 | |
06317756 | 178 | Ten pakiet zawiera proxy Zabbix. |
1b6bdd87 | 179 | |
7efbcfc2 JK |
180 | %package proxy-mysql |
181 | Summary: MySQL support for Zabbix proxy | |
182 | Summary(pl.UTF-8): Obsługa MySQL dla proxy do Zabbiksa | |
183 | Group: Networking/Utilities | |
184 | Provides: %{name}-proxy(db) = %{version}-%{release} | |
9a6ace5d ER |
185 | Obsoletes: zabbix-proxy-postgresql |
186 | Obsoletes: zabbix-proxy-sqlite3 | |
7efbcfc2 JK |
187 | |
188 | %description proxy-mysql | |
189 | This package provides the Zabbix proxy binary with MySQL support. | |
190 | ||
191 | %description proxy-mysql -l pl.UTF-8 | |
192 | Ten pakiet zawiera proxy Zabbix z obsługą MySQL. | |
193 | ||
194 | %package proxy-postgresql | |
195 | Summary: PostgreSQL support for Zabbix proxy | |
196 | Summary(pl.UTF-8): Obsługa PostgreSQL dla proxy do Zabbiksa | |
197 | Group: Networking/Utilities | |
198 | Provides: %{name}-proxy(db) = %{version}-%{release} | |
9a6ace5d ER |
199 | Obsoletes: zabbix-proxy-mysql |
200 | Obsoletes: zabbix-proxy-sqlite3 | |
7efbcfc2 JK |
201 | |
202 | %description proxy-postgresql | |
203 | This package provides the Zabbix proxy binary with PostgreSQL support. | |
204 | ||
205 | %description proxy-postgresql -l pl.UTF-8 | |
206 | Ten pakiet zawiera proxy Zabbix z obsługą PostgreSQL. | |
207 | ||
208 | %package proxy-sqlite3 | |
209 | Summary: SQLite 3 support for Zabbix proxy | |
210 | Summary(pl.UTF-8): Obsługa SQLite 3 dla proxy do Zabbiksa | |
211 | Group: Networking/Utilities | |
212 | Provides: %{name}-proxy(db) = %{version}-%{release} | |
9a6ace5d ER |
213 | Obsoletes: zabbix-proxy-mysql |
214 | Obsoletes: zabbix-proxy-postgresql | |
7efbcfc2 JK |
215 | |
216 | %description proxy-sqlite3 | |
217 | This package provides the Zabbix proxy binary with SQLite 3 support. | |
218 | ||
219 | %description proxy-sqlite3 -l pl.UTF-8 | |
220 | Ten pakiet zawiera proxy Zabbix z obsługą SQLite 3. | |
221 | ||
10a854a6 | 222 | %package sender |
7dcff817 | 223 | Summary: Zabbix sender |
06317756 | 224 | Summary(pl.UTF-8): Program zawiadamiający Zabbiksa |
d0e25550 | 225 | Group: Networking/Utilities |
10a854a6 TO |
226 | |
227 | %description sender | |
06317756 | 228 | This package provides the Zabbix sender. |
10a854a6 | 229 | |
ff14176a | 230 | %description sender -l pl.UTF-8 |
06317756 | 231 | Ten pakiet zawiera program zawiadamiający Zabbiksa. |
a5bb35f6 | 232 | |
a7e2963d | 233 | %package server |
7dcff817 | 234 | Summary: Zabbix server |
06317756 | 235 | Summary(pl.UTF-8): Serwer Zabbiksa |
d0e25550 | 236 | Group: Networking/Utilities |
06317756 | 237 | Requires: %{name}-common = %{version}-%{release} |
7efbcfc2 | 238 | Requires: %{name}-server(db) = %{version}-%{release} |
0196d0f6 ER |
239 | Requires: systemd-units >= 38 |
240 | Obsoletes: zabbix-suckerd | |
241 | Obsoletes: zabbix-trapper-inetd | |
242 | Obsoletes: zabbix-trapper-standalone | |
a7e2963d | 243 | |
244 | %description server | |
06317756 | 245 | This package provides the Zabbix server. |
a7e2963d | 246 | |
247 | %description server -l pl.UTF-8 | |
06317756 | 248 | Ten pakiet zawiera serwer Zabbiksa. |
a7e2963d | 249 | |
7efbcfc2 JK |
250 | %package server-mysql |
251 | Summary: MySQL support for Zabbix server | |
252 | Summary(pl.UTF-8): Obsługa MySQL sla serwera Zabbiksa | |
253 | Group: Networking/Utilities | |
254 | Provides: %{name}-server(db) = %{version}-%{release} | |
9a6ace5d ER |
255 | Obsoletes: zabbix-server-postgresql |
256 | Obsoletes: zabbix-server-sqlite3 | |
7efbcfc2 JK |
257 | |
258 | %description server-mysql | |
9a6ace5d ER |
259 | This package provides the Zabbix server binary for use with MySQL |
260 | database. | |
7efbcfc2 JK |
261 | |
262 | %description server-mysql -l pl.UTF-8 | |
263 | Ten pakiet zawiera serwer Zabbiksa z obsługą bazy danych MySQL. | |
264 | ||
265 | %package server-postgresql | |
266 | Summary: PostgreSQL support for Zabbix server | |
267 | Summary(pl.UTF-8): Obsługa PostgreSQL sla serwera Zabbiksa | |
268 | Group: Networking/Utilities | |
269 | Provides: %{name}-server(db) = %{version}-%{release} | |
9a6ace5d ER |
270 | Obsoletes: zabbix-server-mysql |
271 | Obsoletes: zabbix-server-sqlite3 | |
7efbcfc2 JK |
272 | |
273 | %description server-postgresql | |
9a6ace5d ER |
274 | This package provides the Zabbix server binary for use with PostgreSQL |
275 | database. | |
7efbcfc2 JK |
276 | |
277 | %description server-postgresql -l pl.UTF-8 | |
278 | Ten pakiet zawiera serwer Zabbiksa z obsługą bazy danych PostgreSQL. | |
279 | ||
cd323295 JK |
280 | %package java |
281 | Summary: Zabbix Java Gateway | |
282 | Group: Networking/Utilities | |
06317756 | 283 | Requires: %{name}-common = %{version}-%{release} |
0196d0f6 | 284 | Requires: systemd-units >= 38 |
cd323295 JK |
285 | |
286 | %description java | |
287 | This package provides the Zabbix Java Gateway. | |
288 | ||
10a854a6 | 289 | %prep |
5d18cc59 | 290 | %setup -q |
10a854a6 | 291 | |
06317756 | 292 | %patch0 -p1 |
7efbcfc2 | 293 | %patch1 -p1 |
4ffaba52 | 294 | %patch2 -p1 |
06317756 | 295 | |
10a854a6 | 296 | %build |
e27bce28 JK |
297 | %{__libtoolize} |
298 | %{__aclocal} -I m4 | |
299 | %{__autoconf} | |
300 | %{__autoheader} | |
301 | %{__automake} | |
7efbcfc2 JK |
302 | |
303 | configure() { | |
304 | %configure \ | |
2fe2194b | 305 | --enable-agent \ |
cd323295 JK |
306 | --enable-ipv6 \ |
307 | %{__enable_disable java} \ | |
73af344b | 308 | --with-jabber \ |
cd323295 JK |
309 | --with-ldap \ |
310 | --with-libcurl \ | |
311 | --with-libxml2 \ | |
312 | --with-net-snmp \ | |
313 | --with-openipmi \ | |
314 | --with-openssl \ | |
315 | --with-ssh2 \ | |
7efbcfc2 JK |
316 | --with-unixodbc \ |
317 | "$@" | |
318 | } | |
319 | ||
320 | configure \ | |
321 | --disable-server \ | |
9a6ace5d | 322 | --disable-proxy |
10a854a6 TO |
323 | |
324 | %{__make} | |
325 | ||
7efbcfc2 JK |
326 | # keep timestamps to prevent unneccessary rebuilds |
327 | cp -a include/config.h include/config.h.old | |
328 | cp -a include/stamp-h1 include/stamp-h1.old | |
329 | ||
330 | for database in %{databases} ; do | |
c4cfaa95 JK |
331 | if [ "$database" = "sqlite3" ] ; then |
332 | enable_server="" | |
333 | else | |
334 | enable_server="--enable-server" | |
335 | fi | |
7efbcfc2 JK |
336 | configure \ |
337 | --with-$database \ | |
c4cfaa95 | 338 | $enable_server \ |
7efbcfc2 JK |
339 | --enable-proxy |
340 | ||
341 | # restore timestamps | |
342 | touch --reference=include/config.h.old include/config.h | |
343 | touch --reference=include/stamp-h1.old include/stamp-h1 | |
344 | ||
345 | # clean what needs rebuilding | |
346 | for dir in src/libs/zbxdb* src/libs/zbxserver ; do | |
347 | %{__make} -C $dir clean | |
348 | done | |
349 | ||
350 | touch include/zbxdb.h | |
351 | ||
352 | %{__make} | |
353 | ||
c4cfaa95 JK |
354 | if [ "$enable_server" ] ; then |
355 | %{__make} install \ | |
356 | -C src/zabbix_server \ | |
357 | DESTDIR=$PWD/install-${database} | |
358 | ||
359 | # prepare dirs for %%doc | |
360 | for dir in upgrades/dbpatches/* ; do | |
361 | [ -d $dir/${database} ] || continue | |
362 | mkdir -p install-${database}/upgrade/$(basename $dir) | |
363 | cp -a $dir/${databases}/* install-${database}/upgrade/$(basename $dir) | |
364 | done | |
365 | fi | |
366 | ||
7efbcfc2 JK |
367 | %{__make} install \ |
368 | -C src/zabbix_proxy \ | |
369 | DESTDIR=$PWD/install-${database} | |
7efbcfc2 JK |
370 | done |
371 | ||
10a854a6 TO |
372 | %install |
373 | rm -rf $RPM_BUILD_ROOT | |
d93a02f8 | 374 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/rc.d/init.d,/etc/webapps/%{_webapp},%{_appdir}} \ |
6594aa3f | 375 | $RPM_BUILD_ROOT{/run/zabbix,/var/log/zabbix,%{systemdunitdir},%{systemdtmpfilesdir}} |
10a854a6 | 376 | |
2fe2194b | 377 | %{__make} install \ |
cd323295 JK |
378 | DESTDIR=$RPM_BUILD_ROOT \ |
379 | ZJG_DEST=$RPM_BUILD_ROOT%{_datadir}/zabbix_java | |
10a854a6 | 380 | |
7efbcfc2 | 381 | for database in %{databases} ; do |
c4cfaa95 JK |
382 | if [ "$database" != "sqlite3" ] ; then |
383 | cp -p install-$database/%{_sbindir}/zabbix_server \ | |
384 | $RPM_BUILD_ROOT%{_sbindir}/zabbix_server-$database | |
385 | fi | |
7efbcfc2 JK |
386 | cp -p install-$database/%{_sbindir}/zabbix_proxy \ |
387 | $RPM_BUILD_ROOT%{_sbindir}/zabbix_proxy-$database | |
388 | done | |
389 | ||
390 | if [ -n "$database" ] ; then | |
391 | ln -sf %{_sbindir}/zabbix_server-$database $RPM_BUILD_ROOT%{_sbindir}/zabbix_server | |
392 | ln -sf %{_sbindir}/zabbix_proxy-$database $RPM_BUILD_ROOT%{_sbindir}/zabbix_proxy | |
393 | fi | |
394 | ||
395 | %if %{with sqlite3} | |
396 | install -d $RPM_BUILD_ROOT/var/lib/zabbix | |
397 | touch $RPM_BUILD_ROOT/var/lib/zabbix/zabbix.db | |
398 | %endif | |
399 | ||
7dcff817 | 400 | cp -r frontends $RPM_BUILD_ROOT%{_appdir} |
06317756 | 401 | |
0196d0f6 ER |
402 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf |
403 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf | |
cd323295 | 404 | |
06317756 JK |
405 | install %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_server.service |
406 | install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_agentd.service | |
d93a02f8 | 407 | install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/zabbix_agentd |
06317756 JK |
408 | install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_proxy.service |
409 | install %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_java.service | |
410 | ||
6594aa3f | 411 | cp -p %{SOURCE6} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/zabbix.conf |
06317756 JK |
412 | |
413 | mv $RPM_BUILD_ROOT%{_appdir}/frontends/php/conf $RPM_BUILD_ROOT%{_sysconfdir}/frontend | |
414 | ln -s %{_sysconfdir}/frontend $RPM_BUILD_ROOT%{_appdir}/frontends/php/conf | |
415 | touch $RPM_BUILD_ROOT%{_sysconfdir}/frontend/zabbix.conf.php | |
416 | ||
cd323295 JK |
417 | %if %{with java} |
418 | mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh $RPM_BUILD_ROOT%{_sysconfdir}/zabbix_java.conf | |
419 | ln -s %{_sysconfdir}/zabbix_java.conf $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh | |
06317756 JK |
420 | mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback.xml $RPM_BUILD_ROOT%{_sysconfdir}/java-logback.xml |
421 | ln -s %{_sysconfdir}/java-logback.xml $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback.xml | |
422 | mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback-console.xml $RPM_BUILD_ROOT%{_sysconfdir}/java-logback-console.xml | |
423 | ln -s %{_sysconfdir}/java-logback-console.xml $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback-console.xml | |
cd323295 JK |
424 | |
425 | cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-start <<'EOF' | |
426 | #!/bin/sh | |
427 | ||
428 | exec %{_datadir}/zabbix_java/startup.sh "$@" | |
429 | EOF | |
430 | ||
431 | cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-stop <<'EOF' | |
432 | #!/bin/sh | |
433 | ||
434 | exec %{_datadir}/zabbix_java/shutdown.sh "$@" | |
435 | EOF | |
436 | %endif | |
10a854a6 TO |
437 | |
438 | %clean | |
439 | rm -rf $RPM_BUILD_ROOT | |
440 | ||
7dcff817 TP |
441 | %triggerin frontend-php -- apache1 < 1.3.37-3, apache1-base |
442 | %webapp_register apache %{_webapp} | |
443 | ||
444 | %triggerun frontend-php -- apache1 < 1.3.37-3, apache1-base | |
445 | %webapp_unregister apache %{_webapp} | |
446 | ||
447 | %triggerin frontend-php -- apache < 2.2.0, apache-base | |
448 | %webapp_register httpd %{_webapp} | |
449 | ||
450 | %triggerun frontend-php -- apache < 2.2.0, apache-base | |
451 | %webapp_unregister httpd %{_webapp} | |
452 | ||
06317756 | 453 | %pre common |
78794d78 ER |
454 | %groupadd -g 111 zabbix |
455 | %useradd -d / -u 111 -g zabbix -c "Zabbix User" -s /bin/false zabbix | |
68fab610 | 456 | %addusertogroup -q zabbix proc |
10a854a6 | 457 | |
06317756 JK |
458 | %postun common |
459 | if [ "$1" = "0" ]; then | |
460 | %userremove zabbix | |
461 | %groupremove zabbix | |
462 | fi | |
463 | ||
7efbcfc2 | 464 | %post server-mysql |
96b8972f | 465 | if [ "$1" = 1 ]; then |
cd323295 | 466 | %banner -e %{name}-server <<-EOF |
c4962172 | 467 | You should create database for Zabbix. |
7efbcfc2 | 468 | |
cd323295 | 469 | Running these should be fine in most cases: |
c4962172 | 470 | mysqladmin create zabbix |
7efbcfc2 JK |
471 | zcat %{_docdir}/%{name}-server-mysql-%{version}/schema.sql.gz | mysql zabbix |
472 | zcat %{_docdir}/%{name}-server-mysql-%{version}/images.sql.gz | mysql zabbix | |
473 | zcat %{_docdir}/%{name}-server-mysql-%{version}/data.sql.gz | mysql zabbix | |
474 | EOF | |
475 | fi | |
476 | ln -sf %{_sbindir}/zabbix_server-mysql %{_sbindir}/zabbix_server || : | |
477 | ||
478 | %post server-postgresql | |
479 | if [ "$1" = 1 ]; then | |
480 | %banner -e %{name}-server <<-EOF | |
481 | You should create database for Zabbix. | |
482 | ||
483 | Running these should be fine in most cases: | |
484 | ||
485 | createuser zabbix | |
486 | createdb -O zabbix zabbix | |
487 | zcat %{_docdir}/%{name}-server-postgresql-%{version}/schema.sql.gz | psql -u zabbix zabbix | |
488 | zcat %{_docdir}/%{name}-server-postgresql-%{version}/images.sql.gz | psql -u zabbix zabbix | |
489 | zcat %{_docdir}/%{name}-server-postgresql-%{version}/data.sql.gz | psql -u zabbix zabbix | |
490 | EOF | |
491 | fi | |
492 | ln -sf %{_sbindir}/zabbix_server-postgresql %{_sbindir}/zabbix_server || : | |
493 | ||
7efbcfc2 | 494 | %post server |
06317756 | 495 | %systemd_post zabbix_server.service |
c4962172 | 496 | |
06317756 JK |
497 | %preun server |
498 | %systemd_preun zabbix_server.service | |
499 | ||
500 | %postun server | |
7efbcfc2 JK |
501 | if [ "$1" = "0" ]; then |
502 | if [ -L %{_sbindir}/zabbix_server ] ; then | |
503 | rm -f %{_sbindir}/zabbix_server || : | |
504 | fi | |
505 | fi | |
06317756 JK |
506 | %systemd_reload |
507 | ||
508 | %post agentd | |
d93a02f8 ER |
509 | /sbin/chkconfig --add zabbix_agentd |
510 | %service zabbix_agentd restart | |
06317756 JK |
511 | %systemd_post zabbix_agentd.service |
512 | ||
513 | %preun agentd | |
d93a02f8 ER |
514 | if [ "$1" = "0" ]; then |
515 | %service -q zabbix_agentd stop | |
516 | /sbin/chkconfig --del zabbix_agentd | |
517 | fi | |
06317756 JK |
518 | %systemd_preun zabbix_agentd.service |
519 | ||
520 | %postun agentd | |
521 | %systemd_reload | |
522 | ||
7efbcfc2 JK |
523 | %post proxy-mysql |
524 | ln -sf %{_sbindir}/zabbix_proxy-mysql %{_sbindir}/zabbix_proxy || : | |
525 | ||
526 | %post proxy-postgresql | |
527 | ln -sf %{_sbindir}/zabbix_proxy-postgresql %{_sbindir}/zabbix_proxy || : | |
528 | ||
529 | %post proxy-sqlite3 | |
530 | ln -sf %{_sbindir}/zabbix_proxy-sqlite3 %{_sbindir}/zabbix_proxy || : | |
531 | ||
06317756 JK |
532 | %post proxy |
533 | %systemd_post zabbix_proxy.service | |
534 | ||
535 | %preun proxy | |
536 | %systemd_preun zabbix_proxy.service | |
537 | ||
538 | %postun proxy | |
539 | %systemd_reload | |
540 | ||
541 | %post java | |
542 | %systemd_post zabbix_java.service | |
543 | ||
544 | %preun java | |
545 | %systemd_preun zabbix_java.service | |
546 | ||
547 | %postun java | |
548 | %systemd_reload | |
10a854a6 | 549 | |
10a854a6 TO |
550 | %files |
551 | %defattr(644,root,root,755) | |
cd323295 | 552 | %doc AUTHORS ChangeLog README |
06317756 JK |
553 | |
554 | %files common | |
555 | %defattr(644,root,root,755) | |
556 | %doc AUTHORS ChangeLog README | |
557 | %attr(751,root,zabbix) %dir %{_sysconfdir} | |
558 | %attr(751,root,http) %dir %{_sysconfdir}/frontend | |
e4c376d6 | 559 | %dir %{_appdir} |
7dcff817 | 560 | %dir %{_appdir}/frontends |
06317756 JK |
561 | %dir %attr(770,root,zabbix) /run/zabbix |
562 | %dir %attr(775,root,zabbix) /var/log/zabbix | |
6594aa3f | 563 | %{systemdtmpfilesdir}/zabbix.conf |
10a854a6 | 564 | |
cd323295 | 565 | %files agentd |
10a854a6 | 566 | %defattr(644,root,root,755) |
3e3c35a0 | 567 | %doc conf/zabbix_agentd/*.conf |
7dcff817 | 568 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf |
3e3c35a0 | 569 | %dir %attr(751,root,zabbix) %{_sysconfdir}/zabbix_agentd.conf.d |
d93a02f8 | 570 | %attr(754,root,root) /etc/rc.d/init.d/zabbix_agentd |
b0f13a65 | 571 | %attr(755,root,root) %{_sbindir}/zabbix_agentd |
ed93a3d2 | 572 | %{_mandir}/man8/zabbix_agentd* |
06317756 | 573 | %{systemdunitdir}/zabbix_agentd.service |
10a854a6 | 574 | |
7dcff817 | 575 | %files frontend-php |
10a854a6 | 576 | %defattr(644,root,root,755) |
7dcff817 | 577 | %attr(750,root,http) %dir %{_webapps}/%{_webapp} |
7132ad20 ER |
578 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf |
579 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf | |
06317756 JK |
580 | %ghost %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/zabbix.conf.php |
581 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/.htaccess | |
582 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/maintenance.inc.php | |
583 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/zabbix.conf.php.example | |
7132ad20 | 584 | %{_appdir}/frontends/php |
10a854a6 | 585 | |
a7e2963d | 586 | %files get |
10a854a6 | 587 | %defattr(644,root,root,755) |
ed93a3d2 | 588 | %attr(755,root,root) %{_bindir}/zabbix_get |
589 | %{_mandir}/man1/zabbix_get* | |
10a854a6 | 590 | |
2a82feb1 | 591 | %if %{any_database} |
1b6bdd87 | 592 | %files proxy |
593 | %defattr(644,root,root,755) | |
cd323295 | 594 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_proxy.conf |
3e3c35a0 | 595 | %dir %attr(751,root,zabbix) %{_sysconfdir}/zabbix_proxy.conf.d |
7efbcfc2 | 596 | %ghost %attr(755,root,root) %{_sbindir}/zabbix_proxy |
1b6bdd87 | 597 | %{_mandir}/man8/zabbix_proxy* |
06317756 | 598 | %{systemdunitdir}/zabbix_proxy.service |
2a82feb1 | 599 | %endif |
1b6bdd87 | 600 | |
7efbcfc2 JK |
601 | %if %{with mysql} |
602 | %files proxy-mysql | |
603 | %defattr(644,root,root,755) | |
604 | %attr(755,root,root) %{_sbindir}/zabbix_proxy-mysql | |
605 | %endif | |
606 | ||
607 | %if %{with pgsql} | |
608 | %files proxy-postgresql | |
609 | %defattr(644,root,root,755) | |
610 | %attr(755,root,root) %{_sbindir}/zabbix_proxy-postgresql | |
611 | %endif | |
612 | ||
613 | %if %{with sqlite3} | |
614 | %files proxy-sqlite3 | |
615 | %defattr(644,root,root,755) | |
616 | %attr(755,root,root) %{_sbindir}/zabbix_proxy-sqlite3 | |
617 | %endif | |
618 | ||
7dcff817 TP |
619 | %files sender |
620 | %defattr(644,root,root,755) | |
ed93a3d2 | 621 | %attr(755,root,root) %{_bindir}/zabbix_sender |
622 | %{_mandir}/man1/zabbix_sender* | |
7dcff817 | 623 | |
2a82feb1 | 624 | %if %{any_database} |
a7e2963d | 625 | %files server |
10a854a6 | 626 | %defattr(644,root,root,755) |
cd323295 | 627 | %doc upgrades/dbpatches |
7efbcfc2 | 628 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_server.conf |
3e3c35a0 | 629 | %dir %attr(751,root,zabbix) %{_sysconfdir}/zabbix_server.conf.d |
7efbcfc2 JK |
630 | %ghost %attr(755,root,root) %{_sbindir}/zabbix_server |
631 | %{_mandir}/man8/zabbix_server* | |
632 | %{systemdunitdir}/zabbix_server.service | |
2a82feb1 | 633 | %endif |
7efbcfc2 | 634 | |
cd323295 | 635 | %if %{with mysql} |
7efbcfc2 JK |
636 | %files server-mysql |
637 | %defattr(644,root,root,755) | |
638 | %doc database/mysql/*.sql install-mysql/upgrade | |
639 | %attr(755,root,root) %{_sbindir}/zabbix_server-mysql | |
cd323295 | 640 | %endif |
7efbcfc2 | 641 | |
06317756 | 642 | %if %{with pgsql} |
7efbcfc2 JK |
643 | %files server-postgresql |
644 | %defattr(644,root,root,755) | |
645 | %doc database/postgresql/*.sql install-postgresql/upgrade | |
646 | %attr(755,root,root) %{_sbindir}/zabbix_server-postgresql | |
cd323295 | 647 | %endif |
7efbcfc2 | 648 | |
cd323295 JK |
649 | %if %{with java} |
650 | %files java | |
651 | %defattr(644,root,root,755) | |
652 | %attr(755,root,root) %{_sbindir}/zabbix_java-start | |
653 | %attr(755,root,root) %{_sbindir}/zabbix_java-stop | |
654 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_java.conf | |
06317756 JK |
655 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/java-logback.xml |
656 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/java-logback-console.xml | |
cd323295 JK |
657 | %dir %{_datadir}/zabbix_java |
658 | %{_datadir}/zabbix_java/bin | |
659 | %{_datadir}/zabbix_java/lib | |
660 | %{_datadir}/zabbix_java/settings.sh | |
661 | %attr(755,root,root) %{_datadir}/zabbix_java/shutdown.sh | |
662 | %attr(755,root,root) %{_datadir}/zabbix_java/startup.sh | |
06317756 | 663 | %{systemdunitdir}/zabbix_java.service |
cd323295 | 664 | %endif |