]> git.pld-linux.org Git - packages/zabbix.git/blobdiff - zabbix.spec
- release 4 (by relup.sh)
[packages/zabbix.git] / zabbix.spec
index 07c918185dcf5489b65bc5a85b12feb1fc1c58a7..3b93e1d6d02f15dd69a855c38a4ca27afda3e188 100644 (file)
@@ -1,5 +1,5 @@
 # TODO:
-# - initscript for zabbix-agentd, zabbix-server, zabbix-proxy and zabbix-java
+# - initscript for zabbix-server, zabbix-proxy and zabbix-java
 #
 # Conditional build:
 %bcond_without pgsql   # enable PostgreSQL support
@@ -7,43 +7,50 @@
 %bcond_without mysql   # enable MySQL support
 %bcond_without java    # disable java support
 
-%define databases %{?with_pgsql:postgresql} %{?with_mysql:mysql} %{?with_sqlite3:sqlite3}
+%define databases %{?with_sqlite3:sqlite3} %{?with_pgsql:postgresql} %{?with_mysql:mysql}
 %define any_database %{with pgsql}%{with mysql}%{with sqlite3}
 
 %define                php_min_version 5.4.0
 Summary:       Zabbix - network monitoring software
 Summary(pl.UTF-8):     Zabbix - oprogramowanie do monitorowania sieci
 Name:          zabbix
-Version:       3.2.0
-Release:       1
+Version:       4.2.0
+Release:       4
 License:       GPL v2+
 Group:         Networking/Utilities
 Source0:       http://downloads.sourceforge.net/zabbix/%{name}-%{version}.tar.gz
-# Source0-md5: e2491b482868059f251902d5f636eacb
+# Source0-md5: 20f261708f95787f3dbea3eab89f804d
 Source1:       %{name}-apache.conf
 Source2:       %{name}_server.service
 Source3:       %{name}_agentd.service
 Source4:       %{name}_proxy.service
 Source5:       %{name}_java.service
 Source6:       %{name}.tmpfiles
+Source7:       %{name}_agentd.init
 Patch0:                config.patch
 Patch1:                sqlite3_dbname.patch
-Patch2:                tag_conditions.patch
+Patch2:                always_compile_ipc.patch
 URL:           http://zabbix.sourceforge.net/
 BuildRequires: OpenIPMI-devel
+BuildRequires: autoconf
+BuildRequires: automake >= 1:1.15
 BuildRequires: curl-devel
 BuildRequires: iksemel-devel
 %{?with_java:BuildRequires:    jdk}
+BuildRequires: libevent-devel
 BuildRequires: libssh2-devel
+BuildRequires: libtool
 BuildRequires: libxml2-devel
 %{?with_mysql:BuildRequires:   mysql-devel}
 BuildRequires: net-snmp-devel
 BuildRequires: openldap-devel >= 2.4.6
 BuildRequires: openssl-devel >= 0.9.7d
+BuildRequires: pcre-devel
 %{?with_pgsql:BuildRequires:   postgresql-devel}
 BuildRequires: rpmbuild(macros) >= 1.671
 %{?with_sqlite3:BuildRequires: sqlite3-devel}
 BuildRequires: unixODBC-devel
+BuildRequires: zlib-devel
 Requires:      %{name}-agentd = %{version}-%{release}
 Requires:      %{name}-frontend-php = %{version}-%{release}
 Requires:      %{name}-server = %{version}-%{release}
@@ -103,6 +110,8 @@ Requires:   %{name}-common = %{version}-%{release}
 Requires:      systemd-units >= 38
 Obsoletes:     zabbix-agent-inetd
 Obsoletes:     zabbix-agent-standalone
+Requires(post,preun):  /sbin/chkconfig
+Requires:      rc-scripts
 
 %description agentd
 Zabbix agent collects data from the local system for a Zabbix server.
@@ -136,6 +145,7 @@ Suggests:   php(pgsql)
 Suggests:      php(sqlite3)
 # used with sqlite3
 Suggests:      php(sysvsem)
+BuildArch:     noarch
 
 %description frontend-php
 This package provides web based (PHP) frontend for Zabbix.
@@ -159,8 +169,8 @@ Summary:    Zabbix proxy
 Summary(pl.UTF-8):     Proxy do Zabbiksa
 Group:         Networking/Utilities
 Requires:      %{name}-common = %{version}-%{release}
-Requires:      zabbix-proxy(db) = %{version}-%{release}
 Requires:      systemd-units >= 38
+Requires:      zabbix-proxy(db) = %{version}-%{release}
 
 %description proxy
 This package provides the Zabbix proxy.
@@ -173,8 +183,8 @@ Summary:    MySQL support for Zabbix proxy
 Summary(pl.UTF-8):     Obsługa MySQL dla proxy do Zabbiksa
 Group:         Networking/Utilities
 Provides:      %{name}-proxy(db) = %{version}-%{release}
-Obsoletes:     %{name}-proxy-postgresql
-Obsoletes:     %{name}-proxy-sqlite3
+Obsoletes:     zabbix-proxy-postgresql
+Obsoletes:     zabbix-proxy-sqlite3
 
 %description proxy-mysql
 This package provides the Zabbix proxy binary with MySQL support.
@@ -187,8 +197,8 @@ Summary:    PostgreSQL support for Zabbix proxy
 Summary(pl.UTF-8):     Obsługa PostgreSQL dla proxy do Zabbiksa
 Group:         Networking/Utilities
 Provides:      %{name}-proxy(db) = %{version}-%{release}
-Obsoletes:     %{name}-proxy-mysql
-Obsoletes:     %{name}-proxy-sqlite3
+Obsoletes:     zabbix-proxy-mysql
+Obsoletes:     zabbix-proxy-sqlite3
 
 %description proxy-postgresql
 This package provides the Zabbix proxy binary with PostgreSQL support.
@@ -201,8 +211,8 @@ Summary:    SQLite 3 support for Zabbix proxy
 Summary(pl.UTF-8):     Obsługa SQLite 3 dla proxy do Zabbiksa
 Group:         Networking/Utilities
 Provides:      %{name}-proxy(db) = %{version}-%{release}
-Obsoletes:     %{name}-proxy-mysql
-Obsoletes:     %{name}-proxy-postgresql
+Obsoletes:     zabbix-proxy-mysql
+Obsoletes:     zabbix-proxy-postgresql
 
 %description proxy-sqlite3
 This package provides the Zabbix proxy binary with SQLite 3 support.
@@ -243,11 +253,12 @@ Summary:  MySQL support for Zabbix server
 Summary(pl.UTF-8):     Obsługa MySQL sla serwera Zabbiksa
 Group:         Networking/Utilities
 Provides:      %{name}-server(db) = %{version}-%{release}
-Obsoletes:     %{name}-server-postgresql
-Obsoletes:     %{name}-server-sqlite3
+Obsoletes:     zabbix-server-postgresql
+Obsoletes:     zabbix-server-sqlite3
 
 %description server-mysql
-This package provides the Zabbix server binary for use with MySQL database.
+This package provides the Zabbix server binary for use with MySQL
+database.
 
 %description server-mysql -l pl.UTF-8
 Ten pakiet zawiera serwer Zabbiksa z obsługą bazy danych MySQL.
@@ -257,30 +268,16 @@ Summary:  PostgreSQL support for Zabbix server
 Summary(pl.UTF-8):     Obsługa PostgreSQL sla serwera Zabbiksa
 Group:         Networking/Utilities
 Provides:      %{name}-server(db) = %{version}-%{release}
-Obsoletes:     %{name}-server-mysql
-Obsoletes:     %{name}-server-sqlite3
+Obsoletes:     zabbix-server-mysql
+Obsoletes:     zabbix-server-sqlite3
 
 %description server-postgresql
-This package provides the Zabbix server binary for use with PostgreSQL database.
+This package provides the Zabbix server binary for use with PostgreSQL
+database.
 
 %description server-postgresql -l pl.UTF-8
 Ten pakiet zawiera serwer Zabbiksa z obsługą bazy danych PostgreSQL.
 
-%package server-sqlite3
-Summary:       SQLite 3 support for Zabbix server
-Summary(pl.UTF-8):     Obsługa SQLite 3 sla serwera Zabbiksa
-Group:         Networking/Utilities
-Requires(post):        /bin/zcat
-Provides:      %{name}-server(db) = %{version}-%{release}
-Obsoletes:     %{name}-server-mysql
-Obsoletes:     %{name}-server-postgresql
-
-%description server-sqlite3
-This package provides the Zabbix server binary for use with SQLite 3 database.
-
-%description server-sqlite3 -l pl.UTF-8
-Ten pakiet zawiera serwer Zabbiksa z obsługą bazy danych SQLite 3.
-
 %package java
 Summary:       Zabbix Java Gateway
 Group:         Networking/Utilities
@@ -298,6 +295,11 @@ This package provides the Zabbix Java Gateway.
 %patch2 -p1
 
 %build
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoconf}
+%{__autoheader}
+%{__automake}
 
 configure() {
        %configure \
@@ -318,60 +320,48 @@ configure() {
 
 configure \
        --disable-server \
-       --disable-proxy 
+       --disable-proxy
 
 %{__make}
 
-# keep timestamps to prevent unneccessary rebuilds
-cp -a include/config.h include/config.h.old
-cp -a include/stamp-h1 include/stamp-h1.old
-
 for database in %{databases} ; do
+       if [ "$database" = "sqlite3" ] ; then
+               enable_server=""
+       else
+               enable_server="--enable-server"
+       fi
        configure \
                --with-$database \
-               --enable-server \
+               $enable_server \
                --enable-proxy
 
-       # restore timestamps
-       touch --reference=include/config.h.old include/config.h
-       touch --reference=include/stamp-h1.old include/stamp-h1
-
-       # clean what needs rebuilding
-       for dir in src/libs/zbxdb* src/libs/zbxserver ; do
-               %{__make} -C $dir clean
-       done
-
-       touch include/zbxdb.h
-
        %{__make}
 
-       %{__make} install \
-               -C src/zabbix_server \
-               DESTDIR=$PWD/install-${database}
+       if [ "$enable_server" ] ; then
+               %{__make} install \
+                       -C src/zabbix_server \
+                       DESTDIR=$PWD/install-${database}
+       fi
+
        %{__make} install \
                -C src/zabbix_proxy \
                DESTDIR=$PWD/install-${database}
-
-       # prepare dirs for %%doc
-       for dir in upgrades/dbpatches/* ; do
-               [ -d $dir/${database} ] || continue
-               mkdir -p install-${database}/upgrade/$(basename $dir)
-               cp -a $dir/${databases}/* install-${database}/upgrade/$(basename $dir)
-       done
 done
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/webapps/%{_webapp},%{_appdir}} \
-       $RPM_BUILD_ROOT{/run/zabbix,/var/log/zabbix,%{systemdunitdir},%{systemdtmpfilesdir}}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/rc.d/init.d,/etc/webapps/%{_webapp},%{_appdir}} \
+       $RPM_BUILD_ROOT{/var/run/zabbix,/var/log/zabbix,%{systemdunitdir},%{systemdtmpfilesdir}}
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT \
        ZJG_DEST=$RPM_BUILD_ROOT%{_datadir}/zabbix_java
 
 for database in %{databases} ; do
-       cp -p install-$database/%{_sbindir}/zabbix_server \
-               $RPM_BUILD_ROOT%{_sbindir}/zabbix_server-$database
+       if [ "$database" != "sqlite3" ] ; then
+               cp -p install-$database/%{_sbindir}/zabbix_server \
+                       $RPM_BUILD_ROOT%{_sbindir}/zabbix_server-$database
+       fi
        cp -p install-$database/%{_sbindir}/zabbix_proxy \
                $RPM_BUILD_ROOT%{_sbindir}/zabbix_proxy-$database
 done
@@ -393,6 +383,7 @@ cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
 
 install        %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_server.service
 install        %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_agentd.service
+install        %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/zabbix_agentd
 install        %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_proxy.service
 install        %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_java.service
 
@@ -441,6 +432,7 @@ rm -rf $RPM_BUILD_ROOT
 %pre common
 %groupadd -g 111 zabbix
 %useradd -d / -u 111 -g zabbix -c "Zabbix User" -s /bin/false zabbix
+%addusertogroup -q zabbix proc
 
 %postun common
 if [ "$1" = "0" ]; then
@@ -478,21 +470,6 @@ EOF
 fi
 ln -sf %{_sbindir}/zabbix_server-postgresql %{_sbindir}/zabbix_server || :
 
-%post server-sqlite3
-if [ "$1" = 1 ]; then
-       if [ ! -f /var/lib/zabbix/zabbix.db ] ; then
-               %banner -e %{name}-server <<-EOF
-               Creating sqlite3 database for Zabbix in /var/lib/zabbix/zabbix.db
-EOF
-               zcat %{_docdir}/%{name}-server-sqlite3-%{version}/schema.sql.gz | sqlite3 /var/lib/zabbix/zabbix.db && \
-               zcat %{_docdir}/%{name}-server-sqlite3-%{version}/images.sql.gz | sqlite3 /var/lib/zabbix/zabbix.db && \
-               zcat %{_docdir}/%{name}-server-sqlite3-%{version}/data.sql.gz | sqlite3 /var/lib/zabbix/zabbix.db && \
-               chown zabbix:zabbix /var/lib/zabbix/zabbix.db && \
-               chmod 644 /var/lib/zabbix/zabbix.db || :
-       fi
-fi
-ln -sf %{_sbindir}/zabbix_server-sqlite3 %{_sbindir}/zabbix_server || :
-
 %post server
 %systemd_post zabbix_server.service
 
@@ -508,9 +485,15 @@ fi
 %systemd_reload
 
 %post agentd
+/sbin/chkconfig --add zabbix_agentd
+%service zabbix_agentd restart
 %systemd_post zabbix_agentd.service
 
 %preun agentd
+if [ "$1" = "0" ]; then
+       %service -q zabbix_agentd stop
+       /sbin/chkconfig --del zabbix_agentd
+fi
 %systemd_preun zabbix_agentd.service
 
 %postun agentd
@@ -554,7 +537,7 @@ ln -sf %{_sbindir}/zabbix_proxy-sqlite3 %{_sbindir}/zabbix_proxy || :
 %attr(751,root,http) %dir %{_sysconfdir}/frontend
 %dir %{_appdir}
 %dir %{_appdir}/frontends
-%dir %attr(770,root,zabbix) /run/zabbix
+%dir %attr(770,root,zabbix) /var/run/zabbix
 %dir %attr(775,root,zabbix) /var/log/zabbix
 %{systemdtmpfilesdir}/zabbix.conf
 
@@ -563,6 +546,7 @@ ln -sf %{_sbindir}/zabbix_proxy-sqlite3 %{_sbindir}/zabbix_proxy || :
 %doc conf/zabbix_agentd/*.conf
 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf
 %dir %attr(751,root,zabbix) %{_sysconfdir}/zabbix_agentd.conf.d
+%attr(754,root,root) /etc/rc.d/init.d/zabbix_agentd
 %attr(755,root,root) %{_sbindir}/zabbix_agentd
 %{_mandir}/man8/zabbix_agentd*
 %{systemdunitdir}/zabbix_agentd.service
@@ -570,12 +554,13 @@ ln -sf %{_sbindir}/zabbix_proxy-sqlite3 %{_sbindir}/zabbix_proxy || :
 %files frontend-php
 %defattr(644,root,root,755)
 %attr(750,root,http) %dir %{_webapps}/%{_webapp}
-%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/*
-%{_appdir}/frontends/php
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
 %ghost %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/zabbix.conf.php
 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/.htaccess
 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/maintenance.inc.php
 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/zabbix.conf.php.example
+%{_appdir}/frontends/php
 
 %files get
 %defattr(644,root,root,755)
@@ -618,7 +603,6 @@ ln -sf %{_sbindir}/zabbix_proxy-sqlite3 %{_sbindir}/zabbix_proxy || :
 %if %{any_database}
 %files server
 %defattr(644,root,root,755)
-%doc upgrades/dbpatches
 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_server.conf
 %dir %attr(751,root,zabbix) %{_sysconfdir}/zabbix_server.conf.d
 %ghost %attr(755,root,root) %{_sbindir}/zabbix_server
@@ -629,26 +613,17 @@ ln -sf %{_sbindir}/zabbix_proxy-sqlite3 %{_sbindir}/zabbix_proxy || :
 %if %{with mysql}
 %files server-mysql
 %defattr(644,root,root,755)
-%doc database/mysql/*.sql install-mysql/upgrade
+%doc database/mysql/*.sql
 %attr(755,root,root) %{_sbindir}/zabbix_server-mysql
 %endif
 
 %if %{with pgsql}
 %files server-postgresql
 %defattr(644,root,root,755)
-%doc database/postgresql/*.sql install-postgresql/upgrade
+%doc database/postgresql/*.sql
 %attr(755,root,root) %{_sbindir}/zabbix_server-postgresql
 %endif
 
-%if %{with sqlite3}
-%files server-sqlite3
-%defattr(644,root,root,755)
-%doc database/sqlite3/*.sql
-%attr(755,root,root) %{_sbindir}/zabbix_server-sqlite3
-%dir %attr(771,root,zabbix) /var/lib/zabbix
-%ghost %attr(644,zabbix,zabbix) /var/lib/zabbix/zabbix.db
-%endif
-
 %if %{with java}
 %files java
 %defattr(644,root,root,755)
This page took 0.148519 seconds and 4 git commands to generate.