forked from ripienaar/mcollective-server-provisioner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mcprovision.spec
103 lines (85 loc) · 3.17 KB
/
mcprovision.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
%define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
%define release %{rpm_release}%{?dist}
Summary: Server Provisioner for Puppet and MCollective
Name: mcprovision
Version: %{version}
Release: %{release}
Group: System Tools
License: Apache v2
URL: http://www.devco.net/
Source0: %{name}-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: ruby
Requires: mcollective-client
Requires: mcprovision-common = %{version}-%{release}
Packager: R.I.Pienaar <rip@devco.net>
BuildArch: noarch
%package agent
Summary: MCollective Provisioner Agent
Group: System Tools
Requires: ruby
Requires: mcollective
Requires: mcprovision-common = %{version}-%{release}
%package common
Summary: MCollective Provisioner common files
Group: System Tools
Requires: ruby
Requires: mcollective
%description
Automated the provisioning of servers in a Puppet environment via MCollective
%description agent
Agent providing services for the MCollective Server Provisioner
%description common
Common files needed for both the provisioner agent and server
%prep
%setup -q
%build
%install
rm -rf %{buildroot}
%{__install} -d -m0755 %{buildroot}/%{ruby_sitelib}/mcprovision
%{__install} -d -m0755 %{buildroot}/etc/mcollective
%{__install} -d -m0755 %{buildroot}/usr/sbin
%{__install} -d -m0755 %{buildroot}/etc/init.d
%{__install} -d -m0755 %{buildroot}/etc/sysconfig
%{__install} -d -m0755 %{buildroot}/usr/libexec/mcollective/mcollective/agent
%{__install} -d -m0755 %{buildroot}/usr/libexec/mcollective/mcollective/data
%{__install} -m0755 mcprovision.rb %{buildroot}/usr/sbin/mcprovision
%{__install} -m0755 mcprovision.init %{buildroot}/etc/init.d/mcprovision
%{__install} -m0644 etc/provisioner.yaml.dist %{buildroot}/etc/mcollective/mcprovision.yaml
%{__install} -m0644 agent/provision.ddl %{buildroot}/usr/libexec/mcollective/mcollective/agent/provision.ddl
%{__install} -m0644 agent/provision.rb %{buildroot}/usr/libexec/mcollective/mcollective/agent/provision.rb
%{__install} -m0644 data/provision_data.ddl %{buildroot}/usr/libexec/mcollective/mcollective/data/provision_data.ddl
%{__install} -m0644 data/provision_data.rb %{buildroot}/usr/libexec/mcollective/mcollective/data/provision_data.rb
%{__install} -m0600 etc/mcprovision.defaults %{buildroot}/etc/sysconfig/mcprovision
cp -R lib/* %{buildroot}/%{ruby_sitelib}/
%clean
rm -rf %{buildroot}
%post
/sbin/chkconfig --add mcprovision
%preun
if [ "$1" = 0 ]; then
/sbin/service mcprovision stop >/dev/null 2>&1 || :;
/sbin/chkconfig --del mcprovision || :;
fi
:;
%postun
if [ "$1" -ge 1 ]; then
/sbin/service mcprovision condrestart >/dev/null 2>&1 || :;
fi;
:;
%files agent
/usr/libexec/mcollective/mcollective/agent/provision.rb
/usr/libexec/mcollective/mcollective/data/provision_data.rb
%files common
/usr/libexec/mcollective/mcollective/agent/provision.ddl
/usr/libexec/mcollective/mcollective/data/provision_data.ddl
%files
%{ruby_sitelib}/mcprovision.rb
%{ruby_sitelib}/mcprovision
%config(noreplace) /etc/mcollective/mcprovision.yaml
%config(noreplace) /etc/sysconfig/mcprovision
/etc/init.d/mcprovision
/usr/sbin/mcprovision
%changelog
* Thu Feb 11 2011 R.I.Pienaar <rip@devco.net> - 1.0.0
- First release