]> git.pld-linux.org Git - packages/collectd.git/blobdiff - collectd.spec
- rel.2 STBR
[packages/collectd.git] / collectd.spec
index 2d167b983a510d83a2f335f4e017f5eee08db9dc..426e5152d348f2940eb9e00ff6a28465d8f304af 100644 (file)
@@ -1,6 +1,5 @@
 # TODO:
 # - lm_sensors subpackage
-# - initscripts for local/client/server mode (subpackage ?)
 # - package contrib scripts as %doc
 # - put every plugin into subpackages
 # - Current plugins status:
 #    vserver . . . . . . yes
 #    wireless  . . . . . yes
 #    xmms  . . . . . . . yes
-
+%bcond_without dns
+%bcond_without iptables
+%bcond_without netlink
+
+#http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=358637
+%ifarch %{x8664}
+%undefine with_iptables
+%undefine with_netlink
+%endif
 Summary:       Collects system information in RRD files
 Summary(pl.UTF-8):     Zbieranie informacji o systemie w plikach RRD
 Name:          collectd
-Version:       4.4.0
-Release:       0.4
+Version:       4.4.2
+Release:       2
 License:       GPL v2
 Group:         Daemons
 Source0:       http://collectd.org/files/%{name}-%{version}.tar.gz
-# Source0-md5: a677ddcad97fdb3cdd09efac4842b11d
+# Source0-md5: dbffe35a2d19840e86253c7052485ff0
 Source1:       %{name}.conf
 Source2:       %{name}.init
+Source3:       %{name}-http.conf
 URL:           http://collectd.org/
 BuildRequires: OpenIPMI-devel
 BuildRequires: autoconf
@@ -87,6 +95,7 @@ BuildRequires:        mysql-devel
 BuildRequires: perl-devel
 BuildRequires: rpmbuild(macros) >= 1.268
 BuildRequires: rrdtool-devel
+BuildRequires: net-snmp-devel
 BuildRequires: xmms-devel
 Requires(post,preun):  /sbin/chkconfig
 Requires:      rc-scripts
@@ -201,6 +210,15 @@ Requires:  %{name} = %{version}-%{release}
 %description ping
 ping plugin for collectd.
 
+%package powerdns
+Summary:       powerdns-plugin for collectd
+Summary(pl_PL.UTF-8):  Wtyczka powerdns dla collectd
+Group:         Daemons
+Requires:      %{name} = %{version}-%{release}
+
+%description powerdns
+powerdns plugin for collectd.
+
 %package rrdtool
 Summary:       rrdtool-plugin for collectd
 Summary(pl_PL.UTF-8):  Wtyczka rrdtool dla collectd
@@ -262,29 +280,40 @@ EOF
 %{__autoconf}
 %{__autoheader}
 %{__automake}
+
 %configure \
        --with-libstatgrab=/usr \
        --with-lm-sensors=/usr \
-       --with-libmysql=/usr
+       --with-libmysql=/usr \
+       --%{?with_dns:en}%{?!with_dns:dis}able-dns \
+       --%{?with_iptables:en}%{?!with_iptables:dis}able-iptables \
+       --%{?with_netlink:en}%{?!with_netlink:dis}able-netlink
+
+
 %{__make} LDFLAGS="%{rpmldflags} -lstatgrab"
 
 %install
 rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_var}/{log/,lib/%{name}},/etc/rc.d/init.d/} \
+       $RPM_BUILD_ROOT{%{_appdir}/cgi-bin,%{_webappdir},%{_pkglibdir}}
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
 
-install -d $RPM_BUILD_ROOT%{_var}/{log/,lib/%{name}}
-install -d $RPM_BUILD_ROOT/home/services/httpd/cgi-bin
-install -d $RPM_BUILD_ROOT/etc/rc.d/init.d/
 #install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/collectd.conf
 touch $RPM_BUILD_ROOT%{_var}/log/collectd.log
 install src/collectd.conf $RPM_BUILD_ROOT%{_sysconfdir}/collectd.conf
-install contrib/collection.conf $RPM_BUILD_ROOT%{_sysconfdir}
-install contrib/collection.cgi $RPM_BUILD_ROOT/home/services/httpd/cgi-bin
-rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.la
 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
 
+# Web frontend:
+install contrib/collection.conf $RPM_BUILD_ROOT%{_webappdir}
+install contrib/collection.cgi $RPM_BUILD_ROOT%{_appdir}/cgi-bin
+install %{SOURCE3} $RPM_BUILD_ROOT%{_webappdir}/apache.conf
+install %{SOURCE3} $RPM_BUILD_ROOT%{_webappdir}/httpd.conf
+
+# Cleanups:
+rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.la
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -298,6 +327,18 @@ if [ "$1" = "0" ]; then
        /sbin/chkconfig --del %{name}
 fi
 
+%triggerin collection -- apache1 < 1.3.37-3, apache1-base
+%webapp_register apache %{_webapp}
+
+%triggerun collection -- apache1 < 1.3.37-3, apache1-base
+%webapp_unregister apache %{_webapp}
+
+%triggerin collection -- apache < 2.2.0, apache-base
+%webapp_register httpd %{_webapp}
+
+%triggerun collection -- apache < 2.2.0, apache-base
+%webapp_unregister httpd %{_webapp}
+
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS ChangeLog README TODO contrib
@@ -318,7 +359,9 @@ fi
 %attr(755,root,root) %{_libdir}/%{name}/entropy.so
 %attr(755,root,root) %{_libdir}/%{name}/exec.so
 %attr(755,root,root) %{_libdir}/%{name}/interface.so
+%if %{with iptables}
 %attr(755,root,root) %{_libdir}/%{name}/iptables.so
+%endif
 %attr(755,root,root) %{_libdir}/%{name}/irq.so
 %attr(755,root,root) %{_libdir}/%{name}/load.so
 %attr(755,root,root) %{_libdir}/%{name}/logfile.so
@@ -326,12 +369,13 @@ fi
 %attr(755,root,root) %{_libdir}/%{name}/memcached.so
 %attr(755,root,root) %{_libdir}/%{name}/memory.so
 %attr(755,root,root) %{_libdir}/%{name}/multimeter.so
+%if %{with netlink}
 %attr(755,root,root) %{_libdir}/%{name}/netlink.so
+%endif
 %attr(755,root,root) %{_libdir}/%{name}/network.so
 %attr(755,root,root) %{_libdir}/%{name}/nfs.so
 %attr(755,root,root) %{_libdir}/%{name}/ntpd.so
 #%attr(755,root,root) %{_libdir}/%{name}/perl.so
-%attr(755,root,root) %{_libdir}/%{name}/powerdns.so
 %attr(755,root,root) %{_libdir}/%{name}/processes.so
 %attr(755,root,root) %{_libdir}/%{name}/serial.so
 %attr(755,root,root) %{_libdir}/%{name}/swap.so
@@ -376,8 +420,10 @@ fi
 
 %files collection
 %defattr(644,root,root,755)
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/collection.conf
-%attr(755,root,root) /home/services/httpd/cgi-bin/collection.cgi
+%config(noreplace) %verify(not md5 mtime size) %{_webappdir}/collection.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/apache.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/httpd.conf
+%attr(755,root,root) %{_appdir}/cgi-bin/collection.cgi
 
 %files dns
 %defattr(644,root,root,755)
@@ -399,6 +445,10 @@ fi
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/%{name}/ping.so
 
+%files powerdns
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/%{name}/powerdns.so
+
 %files rrdtool
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/%{name}/rrdtool.so
This page took 0.041338 seconds and 4 git commands to generate.