%define template varnish
Summary: Varnish Cache statistics template for Cacti
Name: cacti-template-%{template}
-Version: 0.0.2
-Release: 1
+Version: 0.0.3
+Release: 0.2
License: GPL v2
Group: Applications/WWW
-Source0: http://forums.cacti.net/download.php?id=16163&/varnish-cacti-stats-%{version}.zip
-# Source0-md5: b7a4ff93877cbd395c58525887b52dd9
-URL: http://forums.cacti.net/viewtopic.php?t=31260
+Source1: get_varnish_stats.py
+Source2: cacti_host_template_varnish.xml
+URL: http://forums.cacti.net/viewtopic.php?p=182152
+BuildRequires: unrar
Requires: cacti >= 0.8.6j
Requires: cacti-add_template
BuildArch: noarch
%description
Template for Cacti - Varnish Cache statistics.
-%prep
-%setup -q -n varnish-cacti-stats-%{version}
+Uses advanced template from
+<http://forums.cacti.net/viewtopic.php?p=182152>
+
+Combines script to pull data via varnish telnet port from
+<http://forums.cacti.net/viewtopic.php?t=31260>
-%{__sed} -i -e '
-s,/usr/bin/python <path_cacti>/scripts/get_varnish_stats.py,%{scriptsdir}/get_varnish_stats.py,
-' templates/*.xml
+%prep
+%setup -qcT
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{resourcedir},%{scriptsdir}}
-cp -a templates/*.xml $RPM_BUILD_ROOT%{resourcedir}
-install -p scripts/*.py $RPM_BUILD_ROOT%{scriptsdir}
+install -p %{SOURCE1} $RPM_BUILD_ROOT%{scriptsdir}
+cp -a %{SOURCE2} $RPM_BUILD_ROOT%{resourcedir}
%post
%{_sbindir}/cacti-add_template \
- %{resourcedir}/cacti_data_template_varnish_statistics.xml \
- %{resourcedir}/cacti_graph_template_varnish_-_cache_hitrate.xml \
- %{resourcedir}/cacti_graph_template_varnish_-_number_of_requests.xml
+ %{resourcedir}/cacti_host_template_varnish.xml
%clean
rm -rf $RPM_BUILD_ROOT