-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsensu-plugins.spec
70 lines (47 loc) · 1.46 KB
/
sensu-plugins.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
%define name sensu-plugins
# hack to disable path checks. We probably should not do this..
#%define __arch_install_post /bin/true
# Disable debug find
%define debug_package %{nil}
Name: %{name}
Version: 0.1
Release: 1%{?dist}
Summary: A collection of ruby based sensu plugins
License: GPL
Group: Application/System
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: x86_64
Source: %{name}-%{version}.tar.gz
AutoReqProv: no
BuildRequires: gcc gcc-c++ sensu >= 1.0.1
Requires: nagios-plugins-all sensu >= 1.0.1
%description
A collection of ruby sensu plugins
%prep
%setup -q -n %{name}-%{version}
%build
/opt/sensu/embedded/bin/gem install -i %{_builddir}/ruby/2.4.0 bundler --no-rdoc --no-ri
GEM_HOME=%{_builddir}/ruby/2.4.0 %{_builddir}/ruby/2.4.0/bin/bundle install --path %{_builddir}
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/opt/sensu/embedded/lib/ruby/gems
mv %{_builddir}/ruby/2.4.0 %{buildroot}/opt/sensu/embedded/lib/ruby/gems
mkdir -p %{buildroot}/etc/sensu/plugins
mkdir -p %{buildroot}/etc/sensu/handlers
cp -a plugins/* %{buildroot}/etc/sensu/plugins
cp -a handlers/* %{buildroot}/etc/sensu/handlers
chmod -R 0755 %{buildroot}/etc/sensu/plugins
chmod -R 0755 %{buildroot}/etc/sensu/handlers
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,755)
%dir /opt/sensu
%dir /etc/sensu
%dir /etc/sensu/plugins
/etc/sensu/*
/opt/sensu/*
%post
%changelog
* Wed Aug 16 2017 Lee Briggs <[email protected]>
- Initial commit