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