forked from larsks/ganglia-plugin-varnish
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathganglia-plugin-varnish.spec
53 lines (41 loc) · 1.27 KB
/
ganglia-plugin-varnish.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif
Name: ganglia-plugin-varnish
Version: 1.1.1
Release: 2%{?dist}
Summary: Ganglia metric plugin for Varnish.
Group: System Environment/Base
License: BSD
Source0: %{name}-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch: noarch
BuildRequires: python-setuptools
Requires: python-setuptools
Requires: ganglia-gmond-modules-python
Requires: ganglia-gmond
Requires: varnish
%description
Publish Varnish cache metrics to Gmond.
%prep
%setup -q
%build
make
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT libdir=%{_libdir}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc README.rst
%{_sysconfdir}/ganglia/conf.d/varnish_plugin.pyconf.sample
%{_libdir}/ganglia/python_modules/varnish_plugin.py*
%{python_sitelib}/varnish/
%{python_sitelib}/ganglia_plugin_varnish*.egg-info
%post
cf=%{_sysconfdir}/ganglia/conf.d/varnish_plugin.pyconf
if [ ! -f $cf ]; then
cp $cf.sample $cf
fi