+%description target_v5upgrade
+The v5 upgrade target can be used to upgrade version 4 data to a
+changed version 5 layout.
+
+%package tail
+Summary: tail-plugin for collectd
+Summary(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.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.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.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.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 threshold
+Summary: threshold-plugin for collectd
+Summary(pl.UTF-8): Wtyczka threshold dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description threshold
+threshold-plugin for collectd.
+
+%package unixsock
+Summary: unixsock-plugin for collectd
+Summary(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.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.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.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 varnish
+Summary: varnish-plugin for collectd
+Summary(pl.UTF-8): Wtyczka varnish dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description varnish
+The Varnish plugin collects information about Varnish, an HTTP
+accelerator.
+
+%package vmem
+Summary: vmem-plugin for collectd
+Summary(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.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.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.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.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
+%patch2 -p1
+%patch3 -p1
+%patch4 -p0
+%patch5 -p1
+
+%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+
+%configure \
+ CPPFLAGS="-Wno-unused-but-set-variable" \
+ c_cv_have_libperl=yes \
+ --with-libiptc=/usr \
+ --with-libstatgrab=/usr \
+ --with-lm-sensors=/usr \
+ --with-libmysql=/usr \
+ --enable-perl \
+ %{__enable_disable dns} \
+ %{__enable_disable ipmi} \
+ %{__enable_disable iptables} \
+ %{__enable_disable multimeter} \
+ %{__enable_disable mysql} \
+ %{__enable_disable netlink} \
+ %{__enable_disable notify notify_desktop} \
+ %{__enable_disable libesmtp notify_email} \
+ %{__enable_disable libvirt} \
+ %{__enable_disable ups nut} \
+ %{__enable_disable ping} \
+ %{__enable_disable pgsql postgresql} \
+ %{__enable_disable rrd rrdtool} \
+ %{__enable_disable sensors} \
+ %{__enable_disable snmp} \
+ %{__enable_disable xmms} \
+ %{__enable_disable varnish} \
+ %{__enable_disable curl} \
+ %{__enable_disable curl apache} \
+ %{__enable_disable curl ngix} \
+ %{__enable_disable curl ascent} \
+ %{__disable curl ascent} \
+ %{__disable curl bind} \
+ %{__disable xml ascent} \
+ %{__disable xml bind} \
+ --disable-ipvs
+
+
+%{__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}/,%{_mandir}/man3}
+
+%{__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}
+mv $RPM_BUILD_ROOT%{_appdir}/collection3/etc/collection.conf $RPM_BUILD_ROOT%{_webappdir}/collection3.conf
+ln -sf %{_webappdir}/collection3.conf $RPM_BUILD_ROOT%{_appdir}/collection3/etc/collection.conf
+sed -i -e 's@#DataDir "/var/lib/collectd/rrd"@DataDir "%{_var}/lib/%{name}"@' $RPM_BUILD_ROOT%{_webappdir}/collection3.conf