1 # Fedora 17 and later use vendorlibdir instead of sitelibdir (see https://fedoraproject.org/wiki/Packaging:Ruby?rd=Packaging/Ruby#Pure_Ruby_packages)
2 %if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
3 %global ruby_libdir %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["vendorlibdir"]')
5 %global ruby_libdir %(ruby -rrbconfig -e "puts RbConfig::CONFIG['sitelibdir']")
8 %if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
9 %global _with_systemd 1
11 %global _with_systemd 0
14 # VERSION is subbed out during rake package:srpm process
15 %global realversion 2.3.3
16 %global rpmversion 2.3.3
18 Summary: Application Server for hosting Ruby code on any capable middleware
20 Version: %{rpmversion}
22 Group: System Environment/Daemons
24 URL: http://puppetlabs.com/mcollective/introduction/
25 Source0: http://downloads.puppetlabs.com/mcollective/%{name}-%{realversion}.tar.gz
26 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
27 BuildRequires: ruby >= 1.8
28 Requires: mcollective-common = %{version}-%{release}
29 Packager: Puppet Labs <info@puppetlabs.com>
32 %if 0%{?_with_systemd}
33 # Required for %%post, %%preun, %%postun
36 BuildRequires: systemd
38 BuildRequires: systemd-units
41 # Required for %%post and %%preun
43 # Required for %%preun and %%postun
48 The Marionette Collective:
50 Server for the mcollective Application Server
53 Summary: Common libraries for the mcollective clients and servers
54 Group: System Environment/Libraries
57 Requires: rubygem-stomp
60 The Marionette Collective:
62 Common libraries for the mcollective clients and servers
65 Summary: Client tools for the mcollective Application Server
66 Requires: mcollective-common = %{version}-%{release}
67 Group: Applications/System
70 The Marionette Collective:
72 Client tools for the mcollective Application Server
75 %setup -q -n %{name}-%{realversion}
82 ruby install.rb --destdir=%{buildroot} --no-rdoc --sitelibdir=%{ruby_libdir} --plugindir=%{_libexecdir}/mcollective
84 %if 0%{?_with_systemd}
85 %{__install} -d -m0755 %{buildroot}%{_unitdir}
86 %{__install} -m0644 ext/redhat/mcollective.service %{buildroot}%{_unitdir}/mcollective.service
88 %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/init.d
90 %{__install} -m0755 mcollective.init %{buildroot}%{_sysconfdir}/init.d/mcollective
92 %{__install} -m0755 ext/redhat/mcollective.init %{buildroot}%{_sysconfdir}/init.d/mcollective
96 %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/mcollective/plugin.d
97 %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/mcollective/ssl/clients
103 %if 0%{?_with_systemd}
104 if [ $1 -eq 1 ] ; then
105 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
108 /sbin/chkconfig --add mcollective || :
112 %if 0%{?_with_systemd}
113 if [ $1 -ge 1 ] ; then
114 # Package upgrade, not uninstall
115 /bin/systemctl try-restart mcollective.service >/dev/null 2>&1 || :
118 if [ "$1" -ge 1 ]; then
119 /sbin/service mcollective condrestart &>/dev/null || :
124 %if 0%{?_with_systemd}
125 if [ $1 -eq 0 ] ; then
126 # Package removal, not upgrade
127 /bin/systemctl --no-reload disable mcollective.service > /dev/null 2>&1 || :
128 /bin/systemctl stop mcollective.service > /dev/null 2>&1 || :
131 if [ "$1" = 0 ] ; then
132 /sbin/service mcollective stop > /dev/null 2>&1
133 /sbin/chkconfig --del mcollective || :
138 %defattr(-, root, root, 0755)
141 %{ruby_libdir}/mcollective.rb
142 %{ruby_libdir}/mcollective
143 %{_libexecdir}/mcollective/mcollective
144 %dir %{_sysconfdir}/mcollective
145 %dir %{_sysconfdir}/mcollective/ssl
146 %config %{_sysconfdir}/mcollective/*.erb
149 %defattr(-, root, root, 0755)
150 %attr(0755, root, root)%{_sbindir}/mc-call-agent
151 %attr(0755, root, root)%{_bindir}/mco
153 %config(noreplace)%{_sysconfdir}/mcollective/client.cfg
154 %{_libexecdir}/mcollective/mcollective/application
155 %{_libexecdir}/mcollective/mcollective/pluginpackager
158 %defattr(-, root, root, 0755)
160 %attr(0755, root, root)%{_sbindir}/mcollectived
161 %if 0%{?_with_systemd}
162 %{_unitdir}/mcollective.service
164 %{_sysconfdir}/init.d/mcollective
166 %config(noreplace)%{_sysconfdir}/mcollective/server.cfg
167 %config(noreplace)%{_sysconfdir}/mcollective/facts.yaml
168 %dir %{_sysconfdir}/mcollective/ssl/clients
169 %config(noreplace)%{_sysconfdir}/mcollective/plugin.d
172 * Fri Nov 29 2013 Puppet Labs Release <info@puppetlabs.com> - 2.3.3-1
175 * Tue Nov 03 2009 R.I.Pienaar <rip@devco.net>