[packages/nagios-plugin-check_raid/dev-4.0] test 4.0 installing
glen
glen at pld-linux.org
Sat Oct 10 01:32:54 CEST 2015
commit b58f13f9dc5fcc0d5ea31bf6a26d13ae7f332fd4
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Thu Oct 8 17:26:58 2015 +0300
test 4.0 installing
nagios-plugin-check_raid.spec | 38 +++++++++++++++++++++++++++++++-------
1 file changed, 31 insertions(+), 7 deletions(-)
---
diff --git a/nagios-plugin-check_raid.spec b/nagios-plugin-check_raid.spec
index 4b77bf3..266a8b5 100644
--- a/nagios-plugin-check_raid.spec
+++ b/nagios-plugin-check_raid.spec
@@ -1,15 +1,19 @@
# TODO
# - see and adopt: http://gist.github.com/359890
%define plugin check_raid
+%include /usr/lib/rpm/macros.perl
Summary: Nagios plugin to check current server's RAID status
Name: nagios-plugin-%{plugin}
-Version: 3.2.5
-Release: 1
+Version: 4.0
+Release: 0.2
License: GPL v2
Group: Networking
-Source0: https://github.com/glensc/nagios-plugin-check_raid/archive/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: b7eaa179090cbb8ed14e9163f6c0c8f3
+#Source0: https://github.com/glensc/nagios-plugin-check_raid/archive/%{version}/%{name}-%{version}.tar.gz
+Source0: https://github.com/glensc/nagios-plugin-check_raid/archive/master/%{name}-%{version}.tar.gz
+# Source0-md5: 282b06fa7ffce9572688ec14db2f9630
URL: https://github.com/glensc/nagios-plugin-check_raid
+BuildRequires: perl-Monitoring-Plugin >= 0.37
+BuildRequires: rpm-perlprov >= 4.1-13
BuildRequires: rpmbuild(macros) >= 1.685
Requires: grep
Requires: nagios-common
@@ -70,16 +74,32 @@ Supports:
mv nagios-plugin-check_raid-*/* .
%build
-ver=$(./%{plugin}.pl -V)
+# version check exits with "3", here's explanation:
+# https://github.com/monitoring-plugins/monitoring-plugins/pull/1363
+ver=$(./%{plugin}.sh -V || :)
test "$(echo "$ver" | awk '{print $NF}')" = %{version}
+%{__perl} Makefile.PL \
+ INSTALLVENDORSCRIPT=%{plugindir} \
+ INSTALLDIRS=vendor
+%{__make}
+
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{nrpeddir},%{plugindir}}
-install -p %{plugin}.pl $RPM_BUILD_ROOT%{plugindir}/%{plugin}
-cp -p %{plugin}.cfg $RPM_BUILD_ROOT%{_sysconfdir}/%{plugin}.cfg
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+cp -p %{plugin}.cfg $RPM_BUILD_ROOT%{_sysconfdir}
touch $RPM_BUILD_ROOT%{nrpeddir}/%{plugin}.cfg
+# no .ext
+mv $RPM_BUILD_ROOT%{plugindir}/%{plugin}{.pl,}
+
+# cleanup
+%{__rm} $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod
+%{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/App/Monitoring/Plugin/CheckRaid/.packlist
+
%clean
rm -rf $RPM_BUILD_ROOT
@@ -121,3 +141,7 @@ fi
%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.cfg
%attr(755,root,root) %{plugindir}/%{plugin}
%ghost %{nrpeddir}/%{plugin}.cfg
+%dir %{perl_vendorlib}/App/Monitoring
+%dir %{perl_vendorlib}/App/Monitoring/Plugin
+%{perl_vendorlib}/App/Monitoring/Plugin/CheckRaid.pm
+%{perl_vendorlib}/App/Monitoring/Plugin/CheckRaid
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/nagios-plugin-check_raid.git/commitdiff/b58f13f9dc5fcc0d5ea31bf6a26d13ae7f332fd4
More information about the pld-cvs-commit
mailing list