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