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