X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=collectd.spec;h=d818ff1e93de648770af1009e881109f464cf263;hb=96376a8d902172f50c5fe8f63d090d830db87bbf;hp=deebb62cee7496ff8f83dd3de117af744438992d;hpb=907cfb5636f6119f5164d06e341557e01e7ebe74;p=packages%2Fcollectd.git diff --git a/collectd.spec b/collectd.spec index deebb62..d818ff1 100644 --- a/collectd.spec +++ b/collectd.spec @@ -1,7 +1,6 @@ # TODO: # - lm_sensors subpackage # - initscripts for local/client/server mode (subpackage ?) -# - collection CGI script # - package contrib scripts as %doc # - put every plugin into subpackages # - Current plugins status: @@ -65,12 +64,14 @@ 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.3 +Release: 0.5 License: GPL v2 Group: Daemons Source0: http://collectd.org/files/%{name}-%{version}.tar.gz # Source0-md5: a677ddcad97fdb3cdd09efac4842b11d Source1: %{name}.conf +Source2: %{name}.init +Source3: %{name}-http.conf URL: http://collectd.org/ BuildRequires: OpenIPMI-devel BuildRequires: autoconf @@ -82,14 +83,22 @@ BuildRequires: liboping-devel BuildRequires: libpcap-devel BuildRequires: libstatgrab-devel >= 0.12 BuildRequires: libtool +BuildRequires: lm_sensors-devel BuildRequires: mysql-devel BuildRequires: perl-devel -BuildRequires: rpmbuild(macros) >= 1.228 +BuildRequires: rpmbuild(macros) >= 1.268 BuildRequires: rrdtool-devel BuildRequires: xmms-devel Requires(post,preun): /sbin/chkconfig +Requires: rc-scripts BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) +%define _pkglibdir /var/lib/%{name} +%define _webapps /etc/webapps +%define _webapp %{name} +%define _webappdir %{_webapps}/%{_webapp} +%define _appdir %{_datadir}/%{_webapp} + %description collectd is a small daemon which collects system information every 10 seconds and writes the results in an RRD-file. @@ -133,11 +142,21 @@ This plugin collectd data provided by Apache's `mod_status'. Wtyczka collectd zbierająca informacje udostępniane przez moduł 'mod_status' Apacha. +%package collection +Summary: Web script for collectiond +Summary(pl_PL.UTF-8): Web script for collectiond +Group: Applications/WWW +Requires: %{name} = %{version}-%{release} + +%description collection +Web script for collectiond + %package dns Summary: dns-plugin for collectd Summary(pl_PL.UTF-8): Wtyczka dns dla collectd Group: Daemons Requires: %{name} = %{version}-%{release} +Requires: perl-rrdtool %description dns dns plugin for collectd. @@ -233,6 +252,11 @@ This plugin collectd data provided by XMMS. %prep %setup -q +cat >> collection.conf <<'EOF' +datadir: "/var/lib/collectd/" +libdir: "/usr/lib/collectd/" +EOF + %build %{__libtoolize} %{__aclocal} @@ -242,20 +266,29 @@ This plugin collectd data provided by XMMS. %configure \ --with-libstatgrab=/usr \ --with-lm-sensors=/usr \ - --with-libmysql=/usr + --with-libmysql=/usr %{__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 %{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 %{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 @@ -271,6 +304,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 @@ -323,8 +368,7 @@ fi %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf -#%attr(754,root,root) /etc/rc.d/init.d/%{name} -#%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} +%attr(754,root,root) /etc/rc.d/init.d/%{name} %{_mandir}/man1/collectd.1* %{_mandir}/man1/collectd-nagios.1* @@ -348,6 +392,13 @@ fi %defattr(644,root,root,755) %attr(755,root,root) %{_libdir}/%{name}/apache.so +%files collection +%defattr(644,root,root,755) +%config(noreplace) %verify(not md5 mtime size) %{_webappdir}/collection.conf +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf +%attr(755,root,root) %{_appdir}/cgi-bin/collection.cgi + %files dns %defattr(644,root,root,755) %attr(755,root,root) %{_libdir}/%{name}/dns.so