+# TODO
+# - initscript for zabbix-agent-standalone
+# - missing zabbix_agentd.conf, zabbix_trapperd.conf
+# see http://www.zabbix.com/manual_install_server.php
#
# Conditional build:
-%bcond_with pgsql # enable PostgreSQL support (by default use mysql)
+%bcond_with pgsql # enable PostgreSQL support (by default use mysql)
+%bcond_with oracle # enable Oracle support (by default use mysql)
+
#
-%define _beta beta14
Summary: zabbix - network monitoring software
-Summary(pl): zabbix - oprogramowanie do monitorowania sieci
+Summary(pl.UTF-8): zabbix - oprogramowanie do monitorowania sieci
Name: zabbix
-Version: 1.0
-Release: 0.%{_beta}.2
+Version: 1.1.7
+Release: 1
License: GPL v2+
Group: Networking/Admin
-Source0: http://dl.sourceforge.net/%{name}/%{name}-%{version}%{_beta}.tar.gz
-# Source0-md5: 0ac320c6cd99f801d8cb7923ca790419
+Source0: http://dl.sourceforge.net/zabbix/%{name}-%{version}.tar.gz
+# Source0-md5: ac24ab58ef1a985c1e2a5217386d5dba
Source1: %{name}-agent.inetd
Source2: %{name}-trapper.inetd
URL: http://zabbix.sourceforge.net/
%{!?with_pgsql:BuildRequires: mysql-devel}
-%{?with_pgsql:BuildRequires: postgresql-devel}
BuildRequires: net-snmp-devel
BuildRequires: openssl-devel >= 0.9.7d
-BuildRequires: rpmbuild(macros) >= 1.159
+%{?with_pgsql:BuildRequires: postgresql-devel}
+BuildRequires: rpmbuild(macros) >= 1.268
+Requires(postun): /usr/sbin/groupdel
+Requires(postun): /usr/sbin/userdel
Requires(pre): /bin/id
Requires(pre): /usr/bin/getgid
Requires(pre): /usr/sbin/groupadd
Requires(pre): /usr/sbin/useradd
-Requires(postun): /usr/sbin/groupdel
-Requires(postun): /usr/sbin/userdel
Provides: group(zabbix)
Provides: user(zabbix)
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _sysconfdir /etc/%{name}
-%define htmldir /home/services/html/zabbix
+%define htmldir /home/services/httpd/html/%{name}
%description
zabbix is software that monitors numerous parameters of a network and
trapping. All zabbix reports and statistics, as well as configuration
parameters, are accessed through a web-based front end.
-%description -l pl
-zabbix to oprogramowanie do monitorowania licznych parametrów sieci i
-serwerów sieciowych. zabbix jest przydatny przy monitorowaniu
-dzia³ania serwerów. zabbix korzysta z elastycznego mechanizmu
-powiadamiania, który pozwala u¿ytkownikom konfigurowaæ powiadamianie
-poczt± elektroniczn± dla praktycznie wszelkich zdarzeñ. Monitorowane
-parametry s± przechowywane w bazie danych. zabbix oferuje, w oparciu o
-przechowywane dane, ¶wietne raportowanie i funkcje wizualizacji.
-zabbix wspiera zarówno odpytywanie, jak i pu³apkowanie. Dostêp do
-wszystkich raportów i statystyk zabbiksa jest mo¿liwy poprzez
+%description -l pl.UTF-8
+zabbix to oprogramowanie do monitorowania licznych parametrów sieci i
+serwerów sieciowych. zabbix jest przydatny przy monitorowaniu
+działania serwerów. zabbix korzysta z elastycznego mechanizmu
+powiadamiania, który pozwala użytkownikom konfigurować powiadamianie
+pocztą elektroniczną dla praktycznie wszelkich zdarzeń. Monitorowane
+parametry są przechowywane w bazie danych. zabbix oferuje, w oparciu o
+przechowywane dane, świetne raportowanie i funkcje wizualizacji.
+zabbix wspiera zarówno odpytywanie, jak i pułapkowanie. Dostęp do
+wszystkich raportów i statystyk zabbiksa jest możliwy poprzez
interfejs oparty o WWW.
-%package frontend-php
-Summary: PHP frontend for zabbix
-Summary(pl): Interfejs PHP dla zabbiksa
-Group: Networking/Admin
-Requires: apache
-Requires: php
-%{!?with_pgsql:Requires: php-mysql}
-%{?with_pgsql:Requires: php-pgsql}
-
-%description frontend-php
-This package provides web based (PHP) frontend for zabbix.
-
-%description frontend-php -l pl
-Ten pakiet dostarcza napisany w PHP frontend dla zabbiksa.
-
%package agent-inetd
Summary: inetd agent for zabbix
-Summary(pl): Wersja inetd agenta zabbiksa
+Summary(pl.UTF-8): Wersja inetd agenta zabbiksa
Group: Networking/Admin
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
Requires: inetdaemon
-Obsoletes: %{name}-agent-standalone
+Obsoletes: zabbix-agent-standalone
%description agent-inetd
This package provides inetd version of zabbix agent.
-%description agent-inetd -l pl
+%description agent-inetd -l pl.UTF-8
Ten pakiet dostarcza agenta zabbiksa dla inetd.
%package agent-standalone
Summary: Standalone agent for zabbix
-Summary(pl): Wersja wolnostoj±ca agenta zabbiksa
+Summary(pl.UTF-8): Wersja wolnostojąca agenta zabbiksa
Group: Networking/Admin
-Requires: %{name} = %{version}
-Obsoletes: %{name}-agent-inetd
+Requires: %{name} = %{version}-%{release}
+Obsoletes: zabbix-agent-inetd
%description agent-standalone
This package provides standalone version of zabbix agent.
-%description agent-standalone -l pl
-Ten pakiet dostarcza wolnostoj±cej wersji agenta zabbiksa.
-
-%package suckerd
-Summary: sucker daemon for zabbix
-Summary(pl): Demon sucker dla zabbiksa
-Group: Networking/Admin
-Requires: %{name} = %{version}
-%{!?with_pgsql:Requires: mysql}
-%{?with_pgsql:Requires: postgresql}
-
-%description suckerd
-This package provides the sucker daemon for zabbix.
-
-%description suckerd -l pl
-Ten pakiet zawiera demona sucker dla zabbiksa.
+%description agent-standalone -l pl.UTF-8
+Ten pakiet dostarcza wolnostojącej wersji agenta zabbiksa.
-%package trapper-inetd
-Summary: inetd trapper for zabbix
-Summary(pl): Wersja inetd programu pu³apkuj±cego zabbiksa
+%package sender
+Summary: zabbix's sender
+Summary(pl.UTF-8): Program zawiadamiający zabbiksa
Group: Networking/Admin
-Requires: %{name} = %{version}
-Requires: inetdaemon
-Obsoletes: %{name}-trapper-standalone
-%description trapper-inetd
-This package provides inetd version of zabbix trapper.
+%description sender
+This package provides the zabbix sender.
-%description trapper-inetd -l pl
-Ten pakiet zawiera program pu³apkuj±cy zabbiksa dla inetd.
+%description sender -l pl.UTF-8
+Ten pakiet zawiera program zawiadamiający zabbiksa.
-%package trapper-standalone
-Summary: Standalone trapper for zabbix
-Summary(pl): Wersja wolnostoj±ca programu pu³apkuj±cego zabbiksa
-Group: Networking/Admin
-Requires: %{name} = %{version}
-Obsoletes: %{name}-trapper-inetd
+%package get
+Summary: zabbix's get
+#Summary(pl.UTF-8): Program zawiadamiajÄy zabbiksa
+Group: Networking/Admin
-%description trapper-standalone
-This package provides standalone version of zabbix trapper.
+%description get
+This package provides the zabbix get.
-%description trapper-standalone -l pl
-Ten pakiet zawiera wolnostoj±c± wersjê programu pu³apkuj±cego
-zabbiksa.
+#%description get -l pl.UTF-8
+#Ten pakiet zawiera program zawiadamiajÄy zabbiksa.
-%package sender
-Summary: zabbix's sender
-Summary(pl): Program zawiadamiaj±cy zabbiksa
-Group: Networking/Admin
+%package server
+Summary: zabbix's server
+Summary(pl.UTF-8): Serwer zabbiksa
+Group: Networking/Admin
-%description sender
-This package provides the zabbix sender.
+%description server
+This package provides the zabbix server.
-%description sender -l pl
-Ten pakiet zawiera program zawiadamiaj±cy zabbiksa.
+%description server -l pl.UTF-8
+Ten pakiet zawiera serwer zabbiksa.
%prep
-%setup -q -n %{name}-%{version}%{_beta}
+%setup -q
%build
%configure \
%{!?with_pgsql:--with-mysql} \
%{?with_pgsql:--with-pgsql} \
- --with-net-snmp
+ %{?with_oracle:--with-oracle} \
+ --enable-server \
+ --enable-agent \
+ --with-net-snmp \
+# --with-ldap=DIR \
+# --with-ucd-snmp=DIR \
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/sysconfig/rc-inetd,%{_sbindir},%{htmldir}}
-install bin/zabbix_* $RPM_BUILD_ROOT%{_sbindir}
-install misc/conf/* $RPM_BUILD_ROOT%{_sysconfdir}
-cp -r frontends/php/* $RPM_BUILD_ROOT%{htmldir}
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
-install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/zabbix-agent
-install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/zabbix-trapper
+#install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/sysconfig/rc-inetd,%{_sbindir},%{htmldir}}
+#install bin/zabbix_* $RPM_BUILD_ROOT%{_sbindir}
+#install misc/conf/* $RPM_BUILD_ROOT%{_sysconfdir}
+#cp -r frontends/php/* $RPM_BUILD_ROOT%{htmldir}
+#install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/zabbix-agent
+#install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/zabbix-trapper
%clean
rm -rf $RPM_BUILD_ROOT
%pre
-if [ -n "`/usr/bin/getgid zabbix`" ]; then
- if [ "`/usr/bin/getgid zabbix`" != "111" ]; then
- echo "Error: group zabbix doesn't have gid=111. Correct this before installing zabbix." 1>&2
- exit 1
- fi
-else
- /usr/sbin/groupadd -g 111 zabbix
-fi
-if [ -n "`/bin/id -u zabbix 2>/dev/null`" ]; then
- if [ "`/bin/id -u zabbix`" != "111" ]; then
- echo "Error: user zabbix doesn't have uid=111. Correct this before installing zabbix." 1>&2
- exit 1
- fi
-else
- /usr/sbin/useradd -d / -u 111 -g zabbix -c "Zabbix User" -s /bin/false zabbix
+%groupadd -g 111 zabbix
+%useradd -d / -u 111 -g zabbix -c "Zabbix User" -s /bin/false zabbix
+
+%post
+if [ "$1" = 1 ]; then
+ %banner -e %{name} <<-EOF
+ You should create database for Zabbix.
+ Running these should be fine in most cases:
+%if %{with pgsql}
+ psql -c 'create database zabbix'
+ zcat %{_docdir}/%{name}-%{version}/create/pgsql/schema.sql.gz | psql zabbix
+ zcat %{_docdir}/%{name}-%{version}/create/data/data.sql.gz | psql zabbix
+%else
+ mysqladmin create zabbix
+ zcat %{_docdir}/%{name}-%{version}/create/mysql/schema.sql.gz | mysql zabbix
+ zcat %{_docdir}/%{name}-%{version}/create/data/data.sql.gz | mysql zabbix
+%endif
+ %{?TODO:You also need zabbix-agent. install zabbix-agent-standalone %or zabbix-agent-inetd.}
+EOF
fi
%postun
fi
%post agent-inetd
-if [ -f /var/lock/subsys/rc-inetd ]; then
- /etc/rc.d/init.d/rc-inetd reload
-else
- echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet server" 1>&2
-fi
+%service -q rc-inetd reload
%postun agent-inetd
-if [ -f /var/lock/subsys/rc-inetd ]; then
- /etc/rc.d/init.d/rc-inetd reload
-fi
-
-%post trapper-inetd
-if [ -f /var/lock/subsys/rc-inetd ]; then
- /etc/rc.d/init.d/rc-inetd reload
-else
- echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet server" 1>&2
-fi
-
-%postun trapper-inetd
-if [ -f /var/lock/subsys/rc-inetd ]; then
- /etc/rc.d/init.d/rc-inetd reload
+if [ "$1" = 0 ]; then
+ %service -q rc-inetd reload
fi
%files
%defattr(644,root,root,755)
-%doc doc/Zabbix\ Manual.pdf AUTHORS ChangeLog FAQ TODO create bin/ZabbixW32.exe
-%attr(750,root,zabbix) %dir %{_sysconfdir}
-
-%files frontend-php
-%defattr(644,root,root,755)
-%{htmldir}
+#%doc doc/Zabbix\ Manual.pdf AUTHORS NEWS README ChangeLog create upgrades bin/ZabbixW32.exe
+#%attr(750,root,zabbix) %dir %{_sysconfdir}
+%{_libdir}/*.a
%files agent-inetd
%defattr(644,root,root,755)
-%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent.conf
-%attr(640,root,root) %config(noreplace) %verify(not mtime md5 size) /etc/sysconfig/rc-inetd/zabbix-agent
-%attr(755,root,root) %{_sbindir}/zabbix_agent
+#%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent.conf
+#%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/zabbix-agent
+%attr(755,root,root) %{_bindir}/zabbix_agent
%files agent-standalone
%defattr(644,root,root,755)
-%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf
-%attr(755,root,root) %{_sbindir}/zabbix_agentd
+#%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf
+%attr(755,root,root) %{_bindir}/zabbix_agentd
-%files suckerd
-%defattr(644,root,root,755)
-%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_suckerd.conf
-%attr(755,root,root) %{_sbindir}/zabbix_suckerd
-
-%files trapper-inetd
+%files sender
%defattr(644,root,root,755)
-%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_trapper.conf
-%attr(640,root,root) %config(noreplace) %verify(not mtime md5 size) /etc/sysconfig/rc-inetd/zabbix-trapper
-%attr(755,root,root) %{_sbindir}/zabbix_trapper
+%attr(755,root,root) %{_bindir}/zabbix_sender
-%files trapper-standalone
+%files get
%defattr(644,root,root,755)
-%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_trapperd.conf
-%attr(755,root,root) %{_sbindir}/zabbix_trapperd
+%attr(755,root,root) %{_bindir}/zabbix_get
-%files sender
+%files server
%defattr(644,root,root,755)
-%attr(755,root,root) %{_sbindir}/zabbix_sender
+%attr(755,root,root) %{_bindir}/zabbix_server