d11def7cf4ed71f7594f5e6ed7feab780c5fbdd5
[packages/precise/mcollective.git] / ext / redhat / mcollective.spec
1 %{!?ruby_sitelib: %global ruby_sitelib %(ruby -rrbconfig -e "puts RbConfig::CONFIG['sitelibdir']")}
2 %define release %{rpm_release}%{?dist}
3
4 Summary: Application Server for hosting Ruby code on any capable middleware
5 Name: mcollective
6 Version: %{version}
7 Release: %{release}
8 Group: System Environment/Daemons
9 License: ASL 2.0
10 URL: http://puppetlabs.com/mcollective/introduction/
11 Source0: http://downloads.puppetlabs.com/mcollective/%{name}-%{version}.tgz
12 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
13 BuildRequires: ruby
14 BuildRequires: ruby(abi) >= 1.8
15 Requires: mcollective-common = %{version}-%{release}
16 Packager: R.I.Pienaar <rip@devco.net>
17 BuildArch: noarch
18
19 %package common
20 Summary: Common libraries for the mcollective clients and servers
21 Group: System Environment/Libraries
22 Requires: ruby
23 Requires: ruby(abi) >= 1.8
24 Requires: rubygems
25 Requires: rubygem(stomp)
26
27 %description common
28 The Marionette Collective:
29
30 Common libraries for the mcollective clients and servers
31
32 %package client
33 Summary: Client tools for the mcollective Application Server
34 Requires: mcollective-common = %{version}-%{release}
35 Group: Applications/System
36
37 %description client
38 The Marionette Collective:
39
40 Client tools for the mcollective Application Server
41
42 %description
43 The Marionette Collective:
44
45 Server for the mcollective Application Server
46
47 %prep
48 %setup -q
49
50 %build
51
52 %install
53 rm -rf %{buildroot}
54 %{__install} -d -m0755  %{buildroot}/%{ruby_sitelib}/mcollective
55 %{__install} -d -m0755  %{buildroot}%{_bindir}
56 %{__install} -d -m0755  %{buildroot}%{_sbindir}
57 %{__install} -d -m0755  %{buildroot}%{_sysconfdir}/init.d
58 %{__install} -d -m0755  %{buildroot}%{_libexecdir}/mcollective/
59 %{__install} -d -m0755  %{buildroot}%{_sysconfdir}/mcollective
60 %{__install} -d -m0755  %{buildroot}%{_sysconfdir}/mcollective/plugin.d
61 %{__install} -d -m0755  %{buildroot}%{_sysconfdir}/mcollective/ssl
62 %{__install} -d -m0755  %{buildroot}%{_sysconfdir}/mcollective/ssl/clients
63 %{__install} -m0755 bin/mcollectived %{buildroot}%{_sbindir}/mcollectived
64 %{__install} -m0640 etc/server.cfg.dist %{buildroot}%{_sysconfdir}/mcollective/server.cfg
65 %{__install} -m0644 etc/client.cfg.dist %{buildroot}%{_sysconfdir}/mcollective/client.cfg
66 %{__install} -m0444 etc/facts.yaml.dist %{buildroot}%{_sysconfdir}/mcollective/facts.yaml
67 %{__install} -m0444 etc/rpc-help.erb %{buildroot}%{_sysconfdir}/mcollective/rpc-help.erb
68 %{__install} -m0444 etc/data-help.erb %{buildroot}%{_sysconfdir}/mcollective/data-help.erb
69 %{__install} -m0444 etc/discovery-help.erb %{buildroot}%{_sysconfdir}/mcollective/discovery-help.erb
70 %{__install} -m0444 etc/metadata-help.erb %{buildroot}%{_sysconfdir}/mcollective/metadata-help.erb
71 %{__install} -m0444 etc/msg-help.erb %{buildroot}%{_sysconfdir}/mcollective/msg-help.erb
72 %if 0%{?suse_version}
73 %{__install} -m0755 mcollective.init %{buildroot}%{_sysconfdir}/init.d/mcollective
74 %else
75 %{__install} -m0755 ext/redhat/mcollective.init %{buildroot}%{_sysconfdir}/init.d/mcollective
76 %endif
77
78
79 cp -R lib/* %{buildroot}/%{ruby_sitelib}/
80 cp -R plugins/* %{buildroot}%{_libexecdir}/mcollective/
81 cp bin/mc-* %{buildroot}%{_sbindir}/
82 cp bin/mco %{buildroot}%{_bindir}/
83 chmod 0755 %{buildroot}%{_sbindir}/*
84
85 %clean
86 rm -rf %{buildroot}
87
88 %post
89 /sbin/chkconfig --add mcollective || :
90
91 %postun
92 if [ "$1" -ge 1 ]; then
93   /sbin/service mcollective condrestart &>/dev/null || :
94 fi
95
96 %preun
97 if [ "$1" = 0 ] ; then
98   /sbin/service mcollective stop > /dev/null 2>&1
99   /sbin/chkconfig --del mcollective || :
100 fi
101
102 %files common
103 %doc COPYING
104 %{ruby_sitelib}/mcollective.rb
105 %{ruby_sitelib}/mcollective
106 %{_libexecdir}/mcollective/mcollective
107 %dir %{_sysconfdir}/mcollective
108 %dir %{_sysconfdir}/mcollective/ssl
109 %config %{_sysconfdir}/mcollective/*.erb
110
111 %files client
112 %attr(0755, root, root)%{_sbindir}/mc-call-agent
113 %attr(0755, root, root)%{_bindir}/mco
114 %doc COPYING
115 %config(noreplace)%{_sysconfdir}/mcollective/client.cfg
116 %{_libexecdir}/mcollective/mcollective/application
117 %{_libexecdir}/mcollective/mcollective/pluginpackager
118
119 %files
120 %doc COPYING
121 %{_sbindir}/mcollectived
122 %{_sysconfdir}/init.d/mcollective
123 %config(noreplace)%{_sysconfdir}/mcollective/server.cfg
124 %config(noreplace)%{_sysconfdir}/mcollective/facts.yaml
125 %dir %{_sysconfdir}/mcollective/ssl/clients
126 %config(noreplace)%{_sysconfdir}/mcollective/plugin.d
127
128 %changelog
129 * Tue Nov 03 2009 R.I.Pienaar <rip@devco.net>
130 - First release