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