Summary(pl.UTF-8): Zabbix - oprogramowanie do monitorowania sieci
Name: zabbix
Version: 7.0.22
-Release: 1
+Release: 2
License: GPL v2+
Group: Networking/Utilities
Source0: https://cdn.zabbix.com/zabbix/sources/stable/7.0/%{name}-%{version}.tar.gz
# Source0-md5: 42f8eedcc9ee2d36e57dc4715126d276
-Source1: %{name}-apache.conf
-Source2: %{name}_agentd.init
-Source3: %{name}_server.init
-Source4: %{name}_proxy.init
-Source5: %{name}_agent2.init
-Source6: %{name}_agent2.sysconfig
+Source1: https://cdn.zabbix.com/zabbix-agent2-plugins/sources/postgresql/zabbix-agent2-plugin-postgresql-%{version}.tar.gz
+# Source1-md5: e7fcc78f22e93a6900f37c074ce4eb20
+Source2: %{name}-apache.conf
+Source3: %{name}_agentd.init
+Source4: %{name}_server.init
+Source5: %{name}_proxy.init
+Source6: %{name}_agent2.init
+Source7: %{name}_agent2.sysconfig
Patch0: tld.patch
Patch1: sqlite3_dbname.patch
Patch2: always_compile_ipc.patch
Patch3: agent2.patch
Patch4: go.patch
+Patch5: agent2-postgresql-plugin-path.patch
+Patch6: agent2-postgresql-plugin-go.patch
URL: https://www.zabbix.com/
BuildRequires: OpenIPMI-devel
BuildRequires: autoconf
%description agent2 -l pl.UTF-8
Agent zbiera dane z lokalnej maszyny dla serwera Zabbix.
+%package agent2-plugin-postgresql
+Summary: Zabbix Agent 2 - PostgreSQL plugin
+Summary(pl.UTF-8): Agent 2 Zabbixa - wtyczka PostgreSQL
+Group: Networking/Utilities
+Requires: %{name}-agent2 = %{version}-%{release}
+
+%description agent2-plugin-postgresql
+Zabbix Agent2 - plugin for monitoring of PostgreSQL databases.
+
+%description agent2-plugin-postgresql -l pl.UTF-8
+Wtyczka Zabbix Agent2 do monitorowania baz danych PostgreSQL.
+
%package web
Summary: Web frontend for Zabbix
Summary(pl.UTF-8): Interfejs Web dla Zabbixa
This package provides the Zabbix Java Gateway.
%prep
-%setup -q
+%setup -q -a1
%patch -P0 -p1
%patch -P1 -p1
%patch -P3 -p1
%patch -P4 -p1
+cd zabbix-agent2-plugin-postgresql-%{version}
+%patch -P5 -p0
+%patch -P6 -p0
+
%build
%{__libtoolize}
%{__aclocal} -I m4
DESTDIR=$PWD/install-${database}
done
+cd zabbix-agent2-plugin-postgresql-%{version}
+%{__make}
+
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_sysconfdir}/zabbix_agent2.conf.d,/etc/{rc.d/init.d,sysconfig},/etc/webapps/%{_webapp},%{_appdir}} \
- $RPM_BUILD_ROOT{/var/run/zabbix,/var/log/zabbix}
+ $RPM_BUILD_ROOT{%{_libexecdir}/zabbix-agent2,/var/run/zabbix,/var/log/zabbix}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT \
ln -sf %{_sbindir}/zabbix_proxy-$database $RPM_BUILD_ROOT%{_sbindir}/zabbix_proxy
fi
+cp zabbix-agent2-plugin-postgresql-%{version}/zabbix-agent2-plugin-postgresql $RPM_BUILD_ROOT%{_libexecdir}/zabbix-agent2/postgresql
+cp zabbix-agent2-plugin-postgresql-%{version}/postgresql.conf $RPM_BUILD_ROOT%{_sysconfdir}/zabbix_agent2.d/plugins.d/
+
cp -r ui $RPM_BUILD_ROOT%{_appdir}
-cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
-cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
+cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
+cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
-install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/zabbix_agentd
-install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/zabbix_server
-install %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/zabbix_proxy
-install %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/zabbix_agent2
-install %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/zabbix_agent2
+install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/zabbix_agentd
+install %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/zabbix_server
+install %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/zabbix_proxy
+install %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/zabbix_agent2
+install %{SOURCE7} $RPM_BUILD_ROOT/etc/sysconfig/zabbix_agent2
mv $RPM_BUILD_ROOT%{_appdir}/ui/conf $RPM_BUILD_ROOT%{_sysconfdir}/web
ln -s %{_sysconfdir}/web $RPM_BUILD_ROOT%{_appdir}/ui/conf
%{_mandir}/man8/zabbix_agent2*
%endif
+%files agent2-plugin-postgresql
+%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent2.d/plugins.d/postgresql.conf
+%attr(755,root,root) %{_libexecdir}/zabbix-agent2/postgresql
+
%files web
%defattr(644,root,root,755)
%attr(750,root,http) %dir %{_webapps}/%{_webapp}