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