%global _hardened_build 1 # Build position-independent executables %define pie 1 %global _for_fedora_koji_builds 0 %if ( 0%{?fedora} && 0%{?fedora} > 16 ) || ( 0%{?rhel} && 0%{?rhel} > 6 ) %global _with_systemd true %endif %if ( 0%{?fedora} && 0%{?fedora} > 17 ) || ( 0%{?rhel} && 0%{?rhel} > 6 ) %global _with_firewalld true %endif # From https://fedoraproject.org/wiki/Packaging:Python#Macros %if ( 0%{?rhel} && 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 %if ( 0%{?_with_systemd:1} ) %define _init_enable() /bin/systemctl enable %1.service ; %define _init_disable() /bin/systemctl disable %1.service ; %define _init_restart() /bin/systemctl restart %1.service ; %define _init_try_restart() /bin/systemctl try-restart %1.service ; %define _init_stop() /bin/systemctl stop %1.service ; %define _init_install() install -D -p -m 0644 %1 %{buildroot}%{_unitdir}/%2.service ; %else %define _init_enable() /sbin/chkconfig --add %1 ; %define _init_disable() /sbin/chkconfig --del %1 ; %define _init_restart() /sbin/service %1 restart &>/dev/null ; %define _init_try_restart() /sbin/service %1 condrestart &>/dev/null ; %define _init_stop() /sbin/service %1 stop &>/dev/null ; %define _init_install() install -D -p -m 0755 %1 %{buildroot}%{_sysconfdir}/init.d/%2 ; %endif %define _start_conf_section() ### START - configuration section for gluster nrpe plugins ### %define _end_conf_section() ### END - configuration section for gluster nrpe plugins ### %define _remove_gluster_nagios_configs() /bin/sed -i -e "/%{_start_conf_section}/,/%{_end_conf_section}/d" %{_sysconfdir}/nagios/nrpe.cfg ; Summary: Gluster node management add-ons for Nagios Name: gluster-nagios-addons Version: 0.2.5 Release: 1%{?dist} License: GPLv2+ Group: Applications/System URL: http://www.redhat.com Vendor: Red Hat, Inc. Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-root #BuildRequires: pyflakes #BuildRequires: python-pep8 BuildRequires: python-mock BuildRequires: python-cpopen BuildRequires: python-ethtool BuildRequires: python-inotify BuildRequires: python-netaddr BuildRequires: python-argparse BuildRequires: python-nose BuildRequires: python-devel BuildRequires: libselinux-python BuildRequires: glusterfs-api-devel BuildRequires: gluster-nagios-common %if ( 0%{?_with_systemd:1} ) BuildRequires: systemd-units Requires(post): systemd-units Requires(preun): systemd-units %else Requires(post): /sbin/service Requires(post): /sbin/chkconfig Requires(preun): /sbin/service Requires(preun): /sbin/chkconfig %endif %if ( 0%{?_with_firewalld:1} ) Requires(post): firewalld %else Requires(post): iptables %endif Requires: gluster-nagios-common >= 0.2.1 Requires: libselinux-python Requires: nagios-plugins-ide_smart Requires: nagios-plugins-procs Requires: nrpe >= 2.14-1.2 Requires: nsca-client Requires: python-argparse Requires: python-ethtool Requires: python-inotify Requires: python-netaddr Requires: python-pthreading Requires: python-cpopen >= 1.3 Requires: python-lockfile Requires: python-daemon Requires: sysstat Requires(post): selinux-policy-targeted >= 3.7.19-279 Requires(post): policycoreutils Requires(post): libselinux-utils %description Nagios plugin, scripts, configuration files etc for gluster nodes. %package tests Summary: Unit/functional tests of Gluster node management add-ons for Nagios Group: Development/Tools Requires: %{name} = %{version}-%{release} Requires: pyflakes Requires: python-pep8 Requires: python-mock Requires: python-nose Requires: python-devel %description tests Unit/functional tests for Nagios plugin, scripts, configuration files etc for gluster nodes. %prep %setup -q %build %if %{pie} CFLAGS="$RPM_OPT_FLAGS -fpic" LDFLAGS="$RPM_LD_FLAGS -z relro -z now" export LDFLAGS %endif CFLAGS="$CFLAGS -DHAVE_INITGROUPS" export CFLAGS %{configure} make #%check #make check %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} %clean rm -rf %{buildroot} %post if grep -q "dont_blame_nrpe=0" %{_sysconfdir}/nagios/nrpe.cfg ; then sed -i -e 's/dont_blame_nrpe=0/dont_blame_nrpe=1/g' %{_sysconfdir}/nagios/nrpe.cfg fi if getsebool nagios_run_sudo &>/dev/null; then setsebool -P nagios_run_sudo 1 &> /dev/null || : fi if getsebool logging_syslogd_run_nagios_plugins &>/dev/null; then setsebool -P logging_syslogd_run_nagios_plugins 1 &> /dev/null || : fi %_remove_gluster_nagios_configs cat >> %{_sysconfdir}/nagios/nrpe.cfg </dev/null; then setsebool -P nagios_run_sudo 0 &> /dev/null || : fi if getsebool logging_syslogd_run_nagios_plugins &>/dev/null; then setsebool -P logging_syslogd_run_nagios_plugins 0 &> /dev/null || : fi fi %files %defattr(-,root,root,-) %attr(0755, -, -) %{_libdir}/nagios/plugins/gluster/* %attr(0755, -, -) %{_sysconfdir}/init.d/glusterpmd %{_sysconfdir}/cron.d/gluster-sysstat.crontab %{_sysconfdir}/rsyslog.d/glusternagios.conf %{_sysconfdir}/sudoers.d/nrpe %config(noreplace) %{_sysconfdir}/nagios/nagios_server.conf %{_sysconfdir}/init.d/glusterpmd %files tests %defattr(-,root,root,-) %{_datadir}/%{name}/tests/* %changelog * Mon Aug 17 2015 Ramesh Nachimuthu - 0.2.5-1 - Resolves: rhbz#1235651 1236290 * Mon Jul 6 2015 Ramesh Nachimuthu - 0.2.4-4 - Resolves: rhbz#1240235 - set dependency on selinux packages * Wed Jul 1 2015 Ramesh Nachimuthu - 0.2.4-3 - Resolves: rhbz#1235409 - set sebool logging_syslogd_run_nagios_plugins * Sat Jun 27 2015 Ramesh Nachimuthu - 0.2.4-2 - Resolves: rhbz#1223710 - reset sebool variables only during uninstall * Tue Jun 23 2015 Ramesh Nachimuthu - 0.2.4-1 - Resolves: rhbz#1232730 - Incorrect Gluster NFS service status in nagios * Fri Jun 12 2015 Ramesh Nachimuthu - 0.2.3-1 - Resolves: rhbz#1223710 1177129 1228533 * Mon Jun 1 2015 Ramesh Nachimuthu - 0.2.2-1 - Resolves: rhbz#1106421 * Fri May 15 2015 Ramesh Nachimuthu - 0.2.1-1 - Resolves: rhbz#1178765 1177129 1166602 * Thu May 7 2015 Ramesh Nachimuthu - 0.2.0-1 - Resolves: rhbz#1204314 1081900 * Thu Feb 19 2015 Ramesh Nachimuthu - 0.1.16-1 - fix bugs bz#1135983 1167771 * Fri Feb 13 2015 Ramesh Nachimuthu - 0.1.15-1 - fix bugs bz#1110804 * Thu Nov 27 2014 Ramesh Nachimuthu - 0.1.14-1 - fix bugs bz#1143995 * Tue Nov 18 2014 Ramesh Nachimuthu - 0.1.13-1 - fix bugs bz#1136205 1109843 1119273 1143995 1109702 1109702 * Fri Oct 31 2014 Ramesh Nachimuthu - 0.1.12-1 - fix bugs bz#1141171 1120832 * Wed Oct 15 2014 Ramesh Nachimuthu - 0.1.11-1 - fix bugs bz#1105568 1107997 1109752 * Fri Jul 18 2014 Kanagaraj Mayilsamy - 0.1.10-2 - Fixed bz#1116368 * Wed Jul 16 2014 Kanagaraj Mayilsamy - 0.1.10-1 - Fixed bz#1119717 * Thu Jul 10 2014 Kanagaraj Mayilsamy - 0.1.9-1 - Fixed bz#1116710 * Tue Jul 1 2014 Sahina Bose - 0.1.8-1 - Fixed BZ#1112966 and BZ#1110719 * Wed Jun 25 2014 Kanagaraj Mayilsamy - 0.1.7-1 - fix bugs bz#1112966 * Sat Jun 21 2014 Kanagaraj Mayilsamy - 0.1.6-1 - fix bugs bz#1111558 * Fri Jun 20 2014 Kanagaraj Mayilsamy - 0.1.5-1 - fix bugs bz#1110719 * Tue Jun 17 2014 Ramesh Nachimuthu - 0.1.4-2 - Building with RELRO flag * Mon Jun 16 2014 Kanagaraj Mayilsamy - 0.1.4-1 - fix bugs bz#1103759 * Fri Jun 13 2014 Ramesh Nachimuthu - 0.1.3-4 - fix bugs bz#1104185 * Fri Jun 13 2014 Sahina Bose - 0.1.3-3 - Bumped up dependency on gluster-nagios-commons to 0.1.3 * Fri Jun 13 2014 Kanagaraj Mayilsamy - v0.1.3-2 - Added requires for nrpe-2.14-1.2 * Thu Jun 12 2014 Kanagaraj Mayilsamy - v0.1.3-1 - fix bugs bz#1081495 bz#1107977 bz#1104183 * Sun Jun 08 2014 Kanagaraj Mayilsamy - v0.1.2-1 - fix bugs bz#1103268 bz#1090854 bz#1083451 bz#1096159 bz#1104014 bz#1085291 bz#1104490 * Thu May 29 2014 Kanagaraj Mayilsamy - v0.1.1-1 - fix bugs bz#1096620 bz#1089705 bz#1081375 bz#1101218 bz#1101223 bz#1084421 bz#1081953 * Tue May 20 2014 Kanagaraj Mayilsamy - v0.1.0-72.gitb8b7222 - fixes bugs bz#1094765 bz#1091998 bz#1081953 bz#1098393 bz#1098046 bz#1098427 bz#1085237 * Thu May 15 2014 Kanagaraj Mayilsamy - v0.1.0-66.gitaa44342 - fixes bugs bz#1097682 bz#1095611 bz#1090937 bz#1091170 * Thu May 08 2014 Kanagaraj Mayilsamy - v0.1.0-57.git9d252a3 - new build based on commit 9d252a3 * Wed May 07 2014 Kanagaraj Mayilsamy - v0.1.0-53.git4c63cea - new build based on commit 4c63cea * Tue May 06 2014 Kanagaraj Mayilsamy - v0.1.0-51.git10c9f0b - new build based on commit 10c9f0b * Sat Mar 08 2014 Bala FA - Initial build.