Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37042099
en ru br
Репозитории ALT
S:5.12.0-alt4
D:4.4.1-alt3
5.1: 4.10.2-alt3.M51.2
4.1: 3.11.7-alt4
4.0: 3.11.5-alt1
www.altlinux.org/Changes

Группа :: Мониторинг
Пакет: collectd

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

# mysql4 and apache1 seem problematic right now
# mysql5 OK
%def_without apache
%def_with cgi
%def_with mysql
%def_with sensors
%def_disable static

Name: collectd
Version: 3.11.7
Release: alt4

Summary: Statistics collection for filling RRD files
License: GPL
Group: Monitoring

Url: http://collectd.org
Source0: %url/files/%name-%version.tar.bz2
Source1: %name.init
Source2: %name.conf
Source3: %name.htaccess

Patch0: collectd-3.9.0-alt-hddtemp.patch
Patch1: %name-syslog.patch
Patch2: collectd-3.11.7-alt-cgi-tmpfile.patch
Packager: Michael Shigorin <mike at altlinux.org>

Requires: rrdtool

# Automatically added by buildreq on Sun Jan 28 2007 (-bi)

BuildRequires: gcc-c++ libMySQL-devel libcurl-devel libe2fs-devel librrd-devel libsensors-devel libxfs-devel perl-CGI python-modules-compiler python-modules-encodings rrd-perl
BuildRequires: perl-devel

#BuildRequires: linux-libc-headers


%if_with apache
BuildRequires(pre): apache-devel
%endif

%if_with cgi
BuildRequires: perl-CGI
BuildRequires(pre): apache-devel
%endif

%if_with mysql
BuildRequires: libMySQL-devel
%endif

%if_with sensors
BuildRequires: libsensors-devel
%endif

%description
collectd is a small program written in C for performance. It reads various
system statistics and updates RRD files, creating them if neccessary.
Since it doesn't need to startup every time it wants to update the files
it's very fast and easy on the system. Also, the statistics are very
fine grained since the files are updated every 10 seconds.

%if_with cgi
%package cgi
Summary: CGI script for collectd
Group: Monitoring
Requires: collectd = %version
Requires: apache-common, perl

%description cgi
This CGI frontend for collectd allows to browse the stats online

Check http://localhost/%name/collection.cgi for collectd views
%endif

%if_with mysql
%package mysql
Summary: MySQL support module for collectd
Group: Monitoring
Requires: collectd = %version
Requires: libMySQL

%description mysql
This plugin for collectd provides querying of MySQL server
%endif

%if_with sensors
%package sensors
Summary: lm_sensors support module for collectd
Group: Monitoring
Requires: collectd = %version
Requires: lm_sensors

%description sensors
This plugin for collectd provides querying of sensors supported
by lm_sensors
%endif

%prep
%setup -q
%patch0 -p1
#patch1
#patch2 -p1 --> better subst below using macro
subst 's/ -Werror//' src/Makefile.*
subst 's,/tmp/collection.log,%_cachedir/httpd/%name/collection.log,' contrib/collection.cgi

%build
CONFFLAGS="--disable-apple_sensors"

%if_without apache
CONFFLAGS="$CONFFLAGS --disable-apache"
%endif

%if_without mysql
CONFFLAGS="$CONFFLAGS --disable-mysql"
%endif

%if_without sensors
CONFFLAGS="$CONFFLAGS --disable-sensors"
%endif

# didn't help

%add_optflags -Wno-unused

# all mainstreams uses localstatedir as var, but ALT set in in /var/lib :(

autoreconf -fisv
%configure $CONFFLAGS %{subst_enable static} --localstatedir=%_var
%make

%install
%make_install DESTDIR=%buildroot install
install -pD -m644 src/collectd.conf %buildroot%_sysconfdir/%name.conf
install -pD -m755 %SOURCE1 %buildroot%_initdir/%name
install -d %buildroot%_libdir/%name/ %buildroot%_localstatedir/%name/
rm -f %buildroot%_libdir/%name/*.la

%if_with cgi
install -d  -m0770 %buildroot%_cachedir/httpd/%name/
install -pD -m0755 contrib/collection.cgi %buildroot%apache_cgibindir/%name/collection.cgi
install -pD -m0644 %SOURCE2 %buildroot%_sysconfdir/httpd/conf/addon-modules.d/%name.conf
install -pD -m0644 %SOURCE3 %buildroot%apache_cgibindir/%name/.htaccess
%endif

%post
%post_service %name

%preun
%preun_service %name

%if_with cgi
%post cgi
%_initdir/httpd condrestart >&/dev/null
%endif

%files
%doc AUTHORS ChangeLog README TODO
%doc contrib/
%config(noreplace) %_sysconfdir/%name.conf
%_initdir/%name
%_sbindir/%name
%_man1dir/*.1*
%_man5dir/*.5*
%dir %_libdir/%name/
%dir %_localstatedir/%name/
%_libdir/%name/*.so*

%if_with sensors
%exclude %_libdir/%name/sensors.so*
%endif

%if_with mysql
%exclude %_libdir/%name/mysql.so*
%endif

%if_with cgi
%files cgi
# FIXME: macroize apache
%attr(0770,root,apache) %dir %_cachedir/httpd/%name/
%dir %apache_cgibindir/%name/
%apache_cgibindir/%name/collection.cgi
%config(noreplace) %apache_cgibindir/%name/.htaccess
%config(noreplace) %_sysconfdir/httpd/conf/addon-modules.d/%name.conf
%endif

%if_with mysql
%files mysql
%_libdir/%name/mysql.so*
%endif

%if_with sensors
%files sensors
%_libdir/%name/sensors.so*
%endif

# TODO:

# - apache.c: figure out what's wrong,
#   supposedly they want apache2
# - consider building with: libcurl, libiokit,
#   liboping (system), libstatgrab (orphaned)
# - better fix for collection.cgi tmpfile

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin