Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > efdfc42b993fef2b32c06b0ee8ee7314 > files > 5

mcollective-1.3.1-6.fc15.src.rpm

%{!?ruby_sitelib: %global ruby_sitelib %(ruby -rrbconfig -e 'puts Config::CONFIG["sitelibdir"] ')}

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

URL: http://marionette-collective.org/

Source0: http://puppetlabs.com/downloads/mcollective/%{name}-%{version}.tgz
Source1: mcollective.service
Patch1: 0001-get-rid-of-vendor-libraries.patch
Patch2: 0002-Don-t-enable-services-by-default.patch

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

BuildRequires: ruby
%if 0%{?fedora} >= 15
BuildRequires: systemd-units
%endif

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

%if 0%{?fedora} >= 15
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
Requires(post): systemd-sysv
%endif

BuildArch: noarch

%package common
Summary: Common libraries for the mcollective clients and servers
Group: Applications/System
Requires: ruby
Requires: ruby(abi) = 1.8
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
%patch1 -p1
%patch2 -p1

%build
%if 0%{?fedora} <= 14 || 0%{?rhel}
%{__sed} -i -e 's/^daemonize = .*$/daemonize = 1/' etc/server.cfg.dist
%endif
%if 0%{?fedora} >= 15
%{__sed} -i -e 's/^daemonize = .*$/daemonize = 0/' etc/server.cfg.dist
%endif

%install
rm -rf %{buildroot}

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

%{__install} -d -m0755  %{buildroot}/usr/sbin
%{__install} -p -m0755 mcollectived.rb %{buildroot}/usr/sbin/mcollectived
for f in mc-*
do
  %{__install} -p -m0755 $f %{buildroot}/usr/sbin/$f
done
%{__install} -p -m0755 mco %{buildroot}/usr/sbin/mco

%if 0%{?fedora} <= 14 || 0%{?rhel}
%{__install} -d -m0755  %{buildroot}%{_initrddir}
%{__install} -p -m0755 mcollective.init %{buildroot}%{_initrddir}/mcollective
%endif

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

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

%{__install} -d -m0755  %{buildroot}/etc/mcollective
%{__install} -d -m0755  %{buildroot}/etc/mcollective/ssl
%{__install} -d -m0755  %{buildroot}/etc/mcollective/ssl/clients
%{__install} -p -m0640 etc/server.cfg.dist %{buildroot}/etc/mcollective/server.cfg
%{__install} -p -m0640 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/rpc-help.erb %{buildroot}/etc/mcollective/rpc-help.erb

%clean
rm -rf %{buildroot}

%post
%if 0%{?fedora} <= 14 || 0%{?rhel}
/sbin/chkconfig --add mcollective || :
%endif
%if 0%{?fedora} >= 15
if [ $1 -eq 1 ] ; then
    # Initial installation
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%endif

%postun
%if 0%{?fedora} <= 14 || 0%{?rhel}
if [ "$1" -ge 1 ]; then
        /sbin/service mcollective condrestart &>/dev/null || :
fi
%endif
%if 0%{?fedora} >= 15
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
    # Package upgrade, not uninstall
    /bin/systemctl try-restart mcollective.service >/dev/null 2>&1 || :
fi
%endif

%preun
%if 0%{?fedora} <= 14 || 0%{?rhel}
if [ "$1" = 0 ] ; then
  /sbin/service mcollective stop > /dev/null 2>&1
  /sbin/chkconfig --del mcollective || :
fi
%endif
%if 0%{?fedora} >= 15
if [ $1 -eq 0 ] ; then
    # Package removal, not upgrade
    /bin/systemctl --no-reload disable mcollective.service > /dev/null 2>&1 || :
    /bin/systemctl stop mcollective.service > /dev/null 2>&1 || :
fi
%endif

%if 0%{?fedora} >= 15
%triggerun -- mcollective < 1.3.1-1
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply httpd
# to migrate them to systemd targets
/usr/bin/systemd-sysv-convert --save mcollective >/dev/null 2>&1 ||:

# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del mcollective >/dev/null 2>&1 || :
/bin/systemctl try-restart mcollective.service >/dev/null 2>&1 || :
%endif

%files common
%defattr(-,root,root,-)
%doc COPYING
%{ruby_sitelib}/mcollective.rb
%{ruby_sitelib}/mcollective
/usr/libexec/mcollective
%dir /etc/mcollective
%dir /etc/mcollective/ssl

%files client
%defattr(-,root,root,-)
%doc COPYING
%config(noreplace) /etc/mcollective/client.cfg
%config(noreplace) /etc/mcollective/rpc-help.erb
%{_sbindir}/mc-*
%{_sbindir}/mco

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

%changelog
* 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