Blob Blame History Raw
%if 0%{?el5}%{?el6}%{?fc16}
%global ruby_vendorlibdir %{_prefix}/lib/ruby/site_ruby/1.8
%global ruby_version 1.8
%endif

Summary:   A framework to build server orchestration or parallel job execution systems
Name:      mcollective
Version:   2.4.1
Release:   1%{?dist}
Group:     Applications/System
License:   ASL 2.0

URL:       http://docs.puppetlabs.com/mcollective/

Source0:   http://puppetlabs.com/downloads/mcollective/%{name}-%{version}.tar.gz
Source1:   mcollective.service


BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires: ruby-devel
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
BuildRequires: systemd
%endif

BuildArch: noarch

Requires:  mcollective-common = %{version}-%{release}

%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
Requires(post):   systemd
Requires(preun):  systemd
Requires(postun): systemd
%endif

%package common
Summary: Common libraries for the mcollective clients and servers
Group: Applications/System
Requires: ruby
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
Requires: ruby(release)
%else
Requires: ruby(abi) = %{ruby_version}
%endif
Requires: rubygems
Requires: rubygem(json)
Requires: rubygem(stomp)
Requires: rubygem(systemu)

%description common
Common libraries for the mcollective clients and servers

%package client
Summary: Client tools for the mcollective application server
Requires: mcollective-common = %{version}-%{release}
Group: Applications/System

%description client
Client tools for the mcollective application server

%description
The Marionette Collective is a framework to build server orchestration
or parallel job execution systems.

%prep
%setup0 -q
rm -rf lib/mcollective/vendor/json
rm -rf lib/mcollective/vendor/systemu
rm -rf lib/mcollective/vendor/load_*.rb

%build
# Nothing to build.

%install
rm -rf %{buildroot}

%{__install} -d -m0755  %{buildroot}/%{ruby_vendorlibdir}/mcollective
cp --preserve=timestamps --recursive lib/* %{buildroot}/%{ruby_vendorlibdir}

%{__install} -d -m0755  %{buildroot}/usr/sbin
%{__install} -p -m0755 bin/mcollectived %{buildroot}/usr/sbin/mcollectived
%{__install} -p -m0755 bin/mco %{buildroot}/usr/sbin/mco

%if 0%{?rhel} 
%{__install} -d -m0755  %{buildroot}%{_initrddir}
%{__install} -p -m0755 ext/redhat/mcollective.init %{buildroot}%{_initrddir}/mcollective
%endif

%if 0%{?fedora} >= 18
%{__install} -d -m0755  %{buildroot}%{_unitdir}
%{__install} -p -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/mcollective.service
%endif

%{__install} -d -m0755  %{buildroot}%{_libexecdir}/mcollective
cp --preserve=timestamps --recursive plugins/* %{buildroot}%{_libexecdir}/mcollective

%{__install} -d -m0755  %{buildroot}/etc/mcollective
%{__install} -d -m0755  %{buildroot}/etc/mcollective/ssl
%{__install} -d -m0755  %{buildroot}/etc/mcollective/ssl/clients
%{__install} -d -m0755  %{buildroot}/etc/mcollective/plugin.d/clients
%{__install} -p -m0640 etc/server.cfg.dist %{buildroot}/etc/mcollective/server.cfg
%{__install} -p -m0644 etc/client.cfg.dist %{buildroot}/etc/mcollective/client.cfg
%{__install} -p -m0644 etc/facts.yaml.dist %{buildroot}/etc/mcollective/facts.yaml
%{__install} -p -m0644 etc/*.erb %{buildroot}/etc/mcollective/

%clean
rm -rf %{buildroot}

%post
%if 0%{?rhel}
/sbin/chkconfig --add mcollective || :
%endif
%if 0%{?fedora} >= 18
%systemd_post mcollective.service
%endif

%postun
%if 0%{?rhel}
if [ "$1" -ge 1 ]; then
        /sbin/service mcollective condrestart &>/dev/null || :
fi
%endif
%if 0%{?fedora} >= 18
%systemd_postun_with_restart mcollective.service
%endif

%preun
%if 0%{?rhel}
if [ "$1" = 0 ] ; then
  /sbin/service mcollective stop > /dev/null 2>&1
  /sbin/chkconfig --del mcollective || :
fi
%endif
%if 0%{?fedora} >= 18
%systemd_preun mcollective.service
%endif

%files common
%defattr(-,root,root,-)
%doc COPYING
%{ruby_vendorlibdir}/mcollective.rb
%{ruby_vendorlibdir}/mcollective
%{_libexecdir}/mcollective
%dir %{_sysconfdir}/mcollective
%dir %{_sysconfdir}/mcollective/ssl
%config(noreplace) %{_sysconfdir}/mcollective/*.erb

%files client
%defattr(-,root,root,-)
%doc COPYING
%config(noreplace) %{_sysconfdir}/mcollective/client.cfg
%{_sbindir}/mco

%files
%defattr(-,root,root,-)
%doc COPYING
%config(noreplace) /etc/mcollective/server.cfg
%config(noreplace) /etc/mcollective/facts.yaml
%{_sbindir}/mcollectived
%if 0%{?rhel} 
%{_initrddir}/mcollective
%endif
%if 0%{?fedora} >= 18
%{_unitdir}/mcollective.service
%endif
%dir /etc/mcollective/ssl/clients
%dir /etc/mcollective/plugin.d

%changelog
* Wed Feb 12 2014 Steve Traylen <steve.traylen@cern.ch> - 2.4.1-1
- Upstream 2.4.1

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Wed Apr 17 2013 Vít Ondruch <vondruch@redhat.com> - 2.2.3-1
- Upstream to 2.2.3
- Add mcollective-rhbz#952970.patch
- rhbz#850200 Use new systemd rpm macros.
- rhbz#868417 Use deamonozie allways in configuration.

* Wed Mar 20 2013 Vít Ondruch <vondruch@redhat.com> - 2.2.0-3
- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Sep 22 2012 Steve Traylen <steve.traylen@cern.ch> - 2.2.0-1
- Update to 2.2.0, add plugin.d directory to package, add missing
  .erb help files.

* Wed Sep 5 2012 Steve Traylen <steve.traylen@cern.ch> - 2.0.0-6
- Fix rhbz#853574 in different way. 0644 client.cfg.

* Wed Sep 5 2012 Steve Traylen <steve.traylen@cern.ch> - 2.0.0-5
- Add mco unix group who can read client.cfg rhbz#853574

* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Tue May 22 2012 Steve Traylen <steve.traylen@cern.ch> - 2.0.0-3
- Drop 0001-get-rid-of-vendor-libraries.patch and
  0002-Don-t-enable-services-by-default.patch. vendor load falls
  back to system path.

* Mon May 21 2012 Steve Traylen <steve.traylen@cern.ch> - 2.0.0-2
- Fix ExecReload in systemd file.
- Use alternate SysV start up file dropping lsb requires.

* Thu May 3 2012 Steve Traylen <steve.traylen@cern.ch> - 2.0.0-1
- New version.

* Fri Apr 27 2012 Steve Traylen <steve.traylen@cern.ch> - 1.3.3-5
- Finger trouble.

* Fri Apr 27 2012 Steve Traylen <steve.traylen@cern.ch> - 1.3.3-4
- Fix patch 0001 to stop loading verdor directory.

* Tue Apr 24 2012 Steve Traylen <steve.traylen@cern.ch> - 1.3.3-3
- Fix systemd start up file.

* Wed Apr 18 2012 Steve Traylen <steve.traylen@cern.ch> - 1.3.3-2
- Update to Fedora's new ruby guidelines.

* Tue Apr 17 2012 Jeffrey Ollie <jeff@ocjtech.us> - 1.3.3-1
- 1.3.3
- see releasenotes: http://docs.puppetlabs.com/mcollective/releasenotes.html

* Fri Jan 13 2012 Jeffrey Ollie <jeff@ocjtech.us> - 1.3.2-1
- 1.3.2
- see releasenotes: http://docs.puppetlabs.com/mcollective/releasenotes.html

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Wed Dec  7 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.3.1-6
- Use sed instead of perl in build section

* Tue Dec  6 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.3.1-5
- Use patches instead of perl
- Remove included copy of systemu

* Mon Dec  5 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.3.1-4
- More work on keeping init scripts disabled by default
- reorder defattr and doc lines

* Thu Dec  1 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.3.1-3
- Don't enable SysV init script by default
- use sbindir macro for a few more things
- fix config(noreplace) flag
- default file attributes for EPEL

* Thu Nov 17 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.3.1-2
- Remove internal copy of JSON library

* Thu Nov 17 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.3.1-1
- Update to 1.3.1

* Thu Aug 18 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.3.0-1
- Update to 1.3.0

* Fri May 27 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.2.0-2
- Add mco script

* Mon May 23 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.2.0-1
- Update to 1.2.0

* Wed Apr 20 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.1.3-3
- First version for Fedora