+%package target_replace
+Summary: target_replace-plugin for collectd
+Summary(pl_PL.UTF-8): Wtyczka target_replace dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description target_replace
+target_replace plugin for collectd.
+
+%package target_scale
+Summary: target_scale-plugin for collectd
+Summary(pl_PL.UTF-8): Wtyczka target_scale dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description target_scale
+Target to scale (multiply) values by an arbitrary value.
+
+%package target_set
+Summary: target_set-plugin for collectd
+Summary(pl_PL.UTF-8): Wtyczka target_set dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description target_set
+target_set plugin for collectd.
+
+%package tail
+Summary: tail-plugin for collectd
+Summary(pl_PL.UTF-8): Wtyczka tail dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description tail
+The tail-plugin can be used to "tail" logfiles, i.e. follow them as
+tail -F does. Each line is given to one or more "matches" which test
+if the line is relevant for any statistics using a regular expression.
+
+%package tcpconns
+Summary: tcpconns-plugin for collectd
+Summary(pl_PL.UTF-8): Wtyczka tcpconns dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description tcpconns
+The tcpconns-plugin counts the number of TCP connections to or from a
+specified port. Typically the connectioins where you specify the local
+port are incoming connections while the connections where you specify
+the remote port are outgoing connections.
+
+%package teamspeak2
+Summary: teamspeak2-plugin for collectd
+Summary(pl_PL.UTF-8): Wtyczka teamspeak2 dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description teamspeak2
+The teamspeak2 plugin connects to the query port of a teamspeak2
+server and polls interesting global and virtual server data. The
+plugin can query only one physical server but unlimited virtual
+servers.
+
+%package ted
+Summary: ted-plugin for collectd
+Summary(pl_PL.UTF-8): Wtyczka ted dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description ted
+The TED-plugin reads power consumption measurements from “The Energy
+Detective” (TED).
+
+%package thermal
+Summary: thermal-plugin for collectd
+Summary(pl_PL.UTF-8): Wtyczka thermal dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description thermal
+The thermal plugin reads ACPI thermal zone information from the sysfs or
+procfs file system, i. e. mostly system temperature information.
+
+%package unixsock
+Summary: unixsock-plugin for collectd
+Summary(pl_PL.UTF-8): Wtyczka unixsock dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description unixsock
+The unixsock plugin opens an UNIX-socket over which one can interact
+with the daemon. This can be used to use the values collected by
+collectd in other applications, such as monitoring, or submit
+externally collected values to collectd.
+
+%package uptime
+Summary: uptime-plugin for collectd
+Summary(pl_PL.UTF-8): Wtyczka uptime dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description uptime
+The uptime-plugin can collect the server's uptime.
+
+%package users
+Summary: users-plugin for collectd
+Summary(pl_PL.UTF-8): Wtyczka users dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description users
+Number of users currently logged in.
+
+%package uuid
+Summary: uuid-plugin for collectd
+Summary(pl_PL.UTF-8): Wtyczka uuid dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description uuid
+This plugin, if loaded, causes the Hostname to be taken from the
+machine's UUID. The UUID is a universally unique designation for the
+machine, usually taken from the machine's BIOS. This is most useful if
+the machine is running in a virtual environment such as Xen, in which
+case the UUID is preserved across shutdowns and migration.
+
+%package vmem
+Summary: vmem-plugin for collectd
+Summary(pl_PL.UTF-8): Wtyczka vmem dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description vmem
+The vmem plugin collects information about the usage of virtual
+memory. Since the statistics provided by the Linux kernel are very
+detailed, they are collected very detailed.
+
+%package vserver
+Summary: vserver-plugin for collectd
+Summary(pl_PL.UTF-8): Wtyczka vserver dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description vserver
+Collects information about the virtual servers running on a system,
+using Linux-Vserver.
+
+%package write_http
+Summary: write_http-plugin for collectd
+Summary(pl_PL.UTF-8): Wtyczka write_http dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description write_http
+The Write HTTP plugin sends the values collected by collectd to a
+web-server using HTTP POST requests. The data is formatted as PUTVAL
+commands.
+
+%package wireless
+Summary: wireless-plugin for collectd
+Summary(pl_PL.UTF-8): Wtyczka wireless dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description wireless
+The Wireless plugin collects signal quality, signal power and
+signal-to-noise ratio for wireless LAN cards.
+
+%package xmms
+Summary: xmms-plugin for collectd
+Summary(pl_PL.UTF-8): Wtyczka xmms dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description xmms
+The XMMS plugin is a plugin for the XMMS music player. It graphs the
+bit-rate and sampling rate as you play songs. Not really useful, just
+something that got written because we can.
+
+%package -n perl-Collectd
+Summary: Perl files from Collectd package
+Group: Daemons
+
+%description -n perl-Collectd
+Perl files from Collectd package
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+
+%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+
+%configure \
+ --with-libstatgrab=/usr \
+ --with-lm-sensors=/usr \
+ --with-libmysql=/usr \
+ --%{?with_dns:en}%{!?with_dns:dis}able-dns \
+ --%{?with_ipmi:en}%{!?with_ipmi:dis}able-ipmi \
+ --%{?with_iptables:en}%{!?with_iptables:dis}able-iptables \
+ --%{?with_multimeter:en}%{!?with_multimeter:dis}able-multimeter \
+ --%{?with_mysql:en}%{!?with_mysql:dis}able-mysql \
+ --%{?with_netlink:en}%{!?with_netlink:dis}able-netlink \
+ --%{?with_notify:en}%{!?with_notify:dis}able-notify_desktop \
+ --%{?with_libesmtp:en}%{!?with_libesmtp:dis}able-notify_email \
+ --%{?with_ups:en}%{!?with_ups:dis}able-nut \
+ --%{?with_ping:en}%{!?with_ping:dis}able-ping \
+ --%{?with_pgsql:en}%{!?with_pgsql:dis}able-postgresql \
+ --%{?with_rrd:en}%{!?with_rrd:dis}able-rrdtool \
+ --%{?with_sensors:en}%{!?with_sensors:dis}able-sensors \
+ --%{?with_snmp:en}%{!?with_snmp:dis}able-snmp \
+ --%{?with_xmms:en}%{!?with_xmms:dis}able-xmms \
+ %{!?with_curl:--disable-{apache,ascent,bind,curl,nginx}} \
+ %{!?with_xml:--disable-{ascent,bind,libvirt}} \
+ --disable-ipvs \
+ --disable-libvirt \
+ --disable-perl
+
+
+%{__make} LDFLAGS="%{rpmldflags} -lstatgrab" \
+ BUILD_WITH_OPENIPMI_CFLAGS="-I/usr/include" \
+ BUILD_WITH_OPENIPMI_LIBS="-L%{_libdir} -lOpenIPMIutils -lOpenIPMIpthread"
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_var}/{log/,lib/%{name}},/etc/{rc.d/init.d/,collectd.d}} \
+ $RPM_BUILD_ROOT{%{_appdir}/cgi-bin,%{_webappdir},%{_pkglibdir},%{perl_vendorlib}/}
+
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+touch $RPM_BUILD_ROOT%{_var}/log/collectd.log
+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
+install %{SOURCE4} $RPM_BUILD_ROOT%{_webappdir}/lighttpd.conf
+
+cp -R contrib/collection3 $RPM_BUILD_ROOT%{_appdir}
+
+### Configs instalation ###
+for i in `egrep "^(#|)LoadPlugin" src/collectd.conf |awk '{print $NF}' ` ; do
+ egrep "LoadPlugin $i$" src/collectd.conf | %{__sed} -e "s/^#//" > $RPM_BUILD_ROOT%{_sysconfdir}/collectd.d/$i.conf
+ grep -v LoadPlugin src/collectd.conf |%{__sed} -e '/./{H;$!d;}' -e "x;/ $i>/!d;" >> $RPM_BUILD_ROOT%{_sysconfdir}/collectd.d/$i.conf
+done
+
+# Example config in sources: src/collectd.conf
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/collectd.conf
+
+# Overwrite only files which we want to change:
+install %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/collectd.d/df.conf
+install %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/collectd.d/rrdtool.conf
+
+mv $RPM_BUILD_ROOT%{_datadir}/perl5/Collectd* $RPM_BUILD_ROOT%{perl_vendorlib}/
+
+# Cleanups: