collectd.spec: fix typo, missing "%" sign
[collectd.git] / contrib / redhat / collectd.spec
index ce37c52..3a4afdc 100644 (file)
@@ -53,6 +53,7 @@
 %define with_contextswitch 0%{!?_without_contextswitch:1}
 %define with_cpu 0%{!?_without_cpu:1}
 %define with_cpufreq 0%{!?_without_cpufreq:1}
+%define with_cpusleep 0%{!?_without_cpusleep:1}
 %define with_csv 0%{!?_without_csv:1}
 %define with_curl 0%{!?_without_curl:1}
 %define with_curl_json 0%{!?_without_curl_json:1}
 %define with_aquaero 0%{!?_without_aquaero:0}
 # plugin barometer disabled, requires a libi2c
 %define with_barometer 0%{!?_without_barometer:0}
+# plugin grpc disabled, requires protobuf-compiler >= 3.0
+%define with_grpc 0%{!?_without_grpc:0}
 # plugin lpar disabled, requires AIX
 %define with_lpar 0%{!?_without_lpar:0}
 # plugin mic disabled, requires Mic
 
 # Plugins not buildable on RHEL < 7
 %if 0%{?rhel} && 0%{?rhel} < 7
+%define with_cpusleep 0
 %define with_mqtt 0
 %define with_rrdcached 0
 %define with_xmms 0
 %endif
 
-Summary:       statistics collection and monitoring daemon
+Summary:       Statistics collection and monitoring daemon
 Name:          collectd
-Version:       5.5.1
+Version:       5.5.2
 Release:       1%{?dist}
-URL:           http://collectd.org
-Source:                http://collectd.org/files/%{name}-%{version}.tar.bz2
+URL:           https://collectd.org
+Source:                https://collectd.org/files/%{name}-%{version}.tar.bz2
 License:       GPLv2
 Group:         System Environment/Daemons
 BuildRoot:     %{_tmppath}/%{name}-%{version}-root
-BuildRequires: libgcrypt-devel, kernel-headers, libtool-ltdl-devel, libcap-devel
+BuildRequires: libgcrypt-devel, kernel-headers, libtool-ltdl-devel, libcap-devel, which
 Vendor:                collectd development team <collectd@verplant.org>
 
-%if 0%{?el7:1}
-Requires(pre):         initscripts
-Requires(post):                systemd
-Requires(preun):       systemd
-Requires(postun):      systemd
+%if 0%{?fedora} || 0%{?rhel} >= 7
+%{?systemd_requires}
+BuildRequires:         systemd
 %else
 Requires(post):                chkconfig
 Requires(preun):       chkconfig, initscripts
@@ -416,6 +418,16 @@ The gmond plugin subscribes to a Multicast group to receive data from gmond,
 the client daemon of the Ganglia project.
 %endif
 
+%if %{with_grpc}
+%package grpc
+Summary:       GRPC plugin for collectd
+Group:         System Environment/Daemons
+Requires:      %{name}%{?_isa} = %{version}-%{release}
+BuildRequires: protobuf-compiler
+%description grpc
+This plugin embeds a gRPC server into Collectd.
+%endif
+
 %if %{with_hddtemp}
 %package hddtemp
 Summary:       Hddtemp plugin for collectd
@@ -603,10 +615,10 @@ Summary:  Perl plugin for collectd
 Group:         System Environment/Daemons
 Requires:      %{name}%{?_isa} = %{version}-%{release}
 Requires:      perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
-       %if 0%{?rhel} >= 6
-BuildRequires: perl-ExtUtils-Embed
-       %else
+       %if 0%{?rhel} && 0%{?rhel} < 6
 BuildRequires: perl
+       %else
+BuildRequires: perl-ExtUtils-Embed
        %endif
 %description perl
 The Perl plugin embeds a Perl interpreter into collectd and exposes the
@@ -651,10 +663,10 @@ database.
 Summary:       Python plugin for collectd
 Group:         System Environment/Daemons
 Requires:      %{name}%{?_isa} = %{version}-%{release}
-       %if 0%{?rhel} >= 6
-BuildRequires: python-devel
-       %else
+       %if 0%{?rhel} && 0%{?rhel} < 6
 BuildRequires: python26-devel
+       %else
+BuildRequires: python-devel
        %endif
 %description python
 The Python plugin embeds a Python interpreter into collectd and exposes the
@@ -771,7 +783,7 @@ using HTTP POST requests.
 Summary:       Write-kafka plugin for collectd
 Group:         System Environment/Daemons
 Requires:      %{name}%{?_isa} = %{version}-%{release}
-BuildRequires: rdkafka-devel
+BuildRequires: librdkafka-devel
 %description write_kafka
 The write_kafka plugin sends values to kafka, a distributed messaging system.
 %endif
@@ -966,6 +978,12 @@ Collectd utilities
 %define _with_cpufreq --disable-cpufreq
 %endif
 
+%if %{with_cpusleep}
+%define _with_cpusleep --enable-cpusleep
+%else
+%define _with_cpusleep --disable-cpusleep
+%endif
+
 %if %{with_csv}
 %define _with_csv --enable-csv
 %else
@@ -1074,6 +1092,12 @@ Collectd utilities
 %define _with_gmond --disable-gmond
 %endif
 
+%if %{with_grpc}
+%define _with_grpc --enable-grpc
+%else
+%define _with_grpc --disable-grpc
+%endif
+
 %if %{with_hddtemp}
 %define _with_hddtemp --enable-hddtemp
 %else
@@ -1369,10 +1393,11 @@ Collectd utilities
 %endif
 
 %if %{with_python}
-       %if 0%{?rhel} >= 6
-%define _with_python --enable-python
-       %else
+       %if 0%{?rhel} && 0%{?rhel} < 6
 %define _with_python --enable-python --with-python=%{_bindir}/python2.6
+%define _python_config PYTHON_CONFIG=%{_bindir}/python2.6-config
+       %else
+%define _with_python --enable-python
        %endif
 %else
 %define _with_python --disable-python
@@ -1648,7 +1673,8 @@ Collectd utilities
 %define _with_zookeeper --disable-zookeeper
 %endif
 
-%configure CFLAGS="%{optflags} -DLT_LAZY_OR_NOW=\"RTLD_LAZY|RTLD_GLOBAL\"" \
+%configure CFLAGS="%{optflags} %{?_python_config} \
+       -DLT_LAZY_OR_NOW=\"RTLD_LAZY|RTLD_GLOBAL\"" \
        --disable-static \
        --without-included-ltdl \
        --enable-all-plugins=yes \
@@ -1678,6 +1704,7 @@ Collectd utilities
        %{?_with_conntrack} \
        %{?_with_contextswitch} \
        %{?_with_cpufreq} \
+       %{?_with_cpusleep} \
        %{?_with_cpu} \
        %{?_with_csv} \
        %{?_with_curl_json} \
@@ -1696,6 +1723,7 @@ Collectd utilities
        %{?_with_filecount} \
        %{?_with_fscache} \
        %{?_with_gmond} \
+       %{?_with_grpc} \
        %{?_with_hddtemp} \
        %{?_with_interface} \
        %{?_with_ipc} \
@@ -1800,7 +1828,7 @@ Collectd utilities
 %install
 rm -rf %{buildroot}
 %{__make} install DESTDIR=%{buildroot}
-%if 0%{?el7:1}
+%if 0%{?fedora} || 0%{?rhel} >= 7
 %{__install} -Dp -m0644 contrib/systemd.collectd.service %{buildroot}%{_unitdir}/collectd.service
 %else
 %{__install} -Dp -m0755 contrib/redhat/init.d-collectd %{buildroot}%{_initrddir}/collectd
@@ -1856,26 +1884,15 @@ rm -f %{buildroot}%{_mandir}/man5/collectd-snmp.5*
 %clean
 rm -rf %{buildroot}
 
-%pre
-%if 0%{?el7:1}
-# stop sysv-based instance before upgrading to systemd
-if [ $1 -eq 2 ] && [ -f /var/lock/subsys/collectd ]; then
-       SYSTEMCTL_SKIP_REDIRECT=1 %{_initddir}/collectd stop >/dev/null 2>&1 || :
-fi
-%endif
-
 %post
-%if 0%{?el7:1}
-if [ $1 -eq 2 ]; then
-       /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%if 0%{?fedora} || 0%{?rhel} >= 7
 %systemd_post collectd.service
 %else
 /sbin/chkconfig --add collectd || :
 %endif
 
 %preun
-%if 0%{?el7:1}
+%if 0%{?fedora} || 0%{?rhel} >= 7
 %systemd_preun collectd.service
 %else
 # stop collectd only when uninstalling
@@ -1886,7 +1903,7 @@ fi
 %endif
 
 %postun
-%if 0%{?el7:1}
+%if 0%{?fedora} || 0%{?rhel} >= 7
 %systemd_postun_with_restart collectd.service
 %else
 # restart collectd only when upgrading
@@ -1902,7 +1919,7 @@ fi
 %files
 %doc AUTHORS COPYING ChangeLog README
 %config(noreplace) %{_sysconfdir}/collectd.conf
-%if 0%{?el7:1}
+%if 0%{?fedora} || 0%{?rhel} >= 7
 %{_unitdir}/collectd.service
 %else
 %{_initrddir}/collectd
@@ -1956,6 +1973,9 @@ fi
 %if %{with_cpufreq}
 %{_libdir}/%{name}/cpufreq.so
 %endif
+%if %{with_cpusleep}
+%{_libdir}/%{name}/cpusleep.so
+%endif
 %if %{with_csv}
 %{_libdir}/%{name}/csv.so
 %endif
@@ -2227,6 +2247,11 @@ fi
 %{_libdir}/%{name}/gmond.so
 %endif
 
+%if %{with_grpc}
+%files grpc
+%{_libdir}/%{name}/grpc.so
+%endif
+
 %if %{with_hddtemp}
 %files hddtemp
 %{_libdir}/%{name}/hddtemp.so
@@ -2434,10 +2459,15 @@ fi
 %doc contrib/
 
 %changelog
+* Tue Jul 26 2016 Ruben Kerkhof <ruben@rubenkerkhof.com> - 5.5.2-1
+- New upstream version
+- Contains fix for CVE-2016-6254
+- Change collectd.org url to https
+
 * Sat Jun 04 2016 Ruben Kerkhof <ruben@rubenkerkhof.com> 5.5.1-1
 - New upstream version
 - New plugins enabled by default: chrony, mqtt, notify_nagios
-- New plugins disabled by default: zone, xencpu
+- New plugins disabled by default: grpc, zone, xencpu
 
 * Wed May 27 2015 Marc Fournier <marc.fournier@camptocamp.com> 5.5.0-1
 - New upstream version