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