Adam Miller 33f7ada
# Fedora 17 and later use vendorlibdir instead of sitelibdir (see https://fedoraproject.org/wiki/Packaging:Ruby?rd=Packaging/Ruby#Pure_Ruby_packages)
Adam Miller 33f7ada
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
Adam Miller 33f7ada
%global         ruby_libdir %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["vendorlibdir"]')
Adam Miller 33f7ada
%else
Adam Miller 33f7ada
%global         ruby_libdir %(ruby -rrbconfig -e "puts RbConfig::CONFIG['sitelibdir']")
0ccf279
%endif
1f13e14
Adam Miller 33f7ada
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
Adam Miller 33f7ada
%global         _with_systemd 1
Adam Miller 33f7ada
%else
Adam Miller 33f7ada
%global         _with_systemd 0
Adam Miller 33f7ada
%endif
1f13e14
Adam Miller 33f7ada
Summary:        Application Server for hosting Ruby code on any capable middleware
Adam Miller 33f7ada
Name:           mcollective
Adam Miller 33f7ada
Version:        2.8.4
d3e5a33
Release:        3%{?dist}
Adam Miller 33f7ada
Group:          System Environment/Daemons
Adam Miller 33f7ada
License:        ASL 2.0
Adam Miller 33f7ada
URL:            http://puppetlabs.com/mcollective/introduction/
Adam Miller 33f7ada
Source0:        http://downloads.puppetlabs.com/mcollective/%{name}-%{version}.tar.gz
Adam Miller 33f7ada
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Adam Miller 33f7ada
BuildRequires:  ruby >= 1.8
Adam Miller 33f7ada
Requires:       mcollective-common = %{version}-%{release}
Adam Miller 33f7ada
Packager:       Puppet Labs <info@puppetlabs.com>
Adam Miller 33f7ada
BuildArch:      noarch
Adam Miller 33f7ada
Adam Miller 33f7ada
%if 0%{?_with_systemd}
Adam Miller 33f7ada
# Required for %%post, %%preun, %%postun
Adam Miller 33f7ada
Requires:       systemd
0265d37
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
Adam Miller 33f7ada
BuildRequires:  systemd
Adam Miller 33f7ada
%else
Adam Miller 33f7ada
BuildRequires:  systemd-units
Adam Miller 33f7ada
%endif
Adam Miller 33f7ada
%else
Adam Miller 33f7ada
# Required for %%post and %%preun
Adam Miller 33f7ada
Requires:       chkconfig
Adam Miller 33f7ada
# Required for %%preun and %%postun
Adam Miller 33f7ada
Requires:       initscripts
1f13e14
%endif
1f13e14
Adam Miller 33f7ada
%description
Adam Miller 33f7ada
The Marionette Collective:
1f13e14
Adam Miller 33f7ada
Server for the mcollective Application Server
1f13e14
1f13e14
%package common
Adam Miller 33f7ada
Summary:        Common libraries for the mcollective clients and servers
Adam Miller 33f7ada
Group:          System Environment/Libraries
Adam Miller 33f7ada
Requires:       ruby >= 1.8
Adam Miller 33f7ada
Requires:       rubygems >= 1.3.7
Adam Miller 33f7ada
Requires:       rubygem-stomp
Adam Miller 33f7ada
Requires:       rubygem-json
1f13e14
1f13e14
%description common
Adam Miller 33f7ada
The Marionette Collective:
Adam Miller 33f7ada
1f13e14
Common libraries for the mcollective clients and servers
1f13e14
1f13e14
%package client
Adam Miller 33f7ada
Summary:        Client tools for the mcollective Application Server
Adam Miller 33f7ada
Requires:       mcollective-common = %{version}-%{release}
Adam Miller 33f7ada
Group:          Applications/System
1f13e14
1f13e14
%description client
Adam Miller 33f7ada
The Marionette Collective:
1f13e14
Adam Miller 33f7ada
Client tools for the mcollective Application Server
1f13e14
1f13e14
%prep
Adam Miller 33f7ada
%setup -q -n %{name}-%{version}
1f13e14
1f13e14
%build
1f13e14
1f13e14
%install
1f13e14
rm -rf %{buildroot}
1f13e14
Adam Miller 33f7ada
ruby install.rb --destdir=%{buildroot} --no-rdoc --sitelibdir=%{ruby_libdir} --plugindir=%{_libexecdir}/mcollective
1f13e14
Adam Miller 33f7ada
%if 0%{?_with_systemd}
1f13e14
%{__install} -d -m0755  %{buildroot}%{_unitdir}
Adam Miller 33f7ada
%{__install} -m0644 ext/redhat/mcollective.service %{buildroot}%{_unitdir}/mcollective.service
Adam Miller 33f7ada
%else
Adam Miller 33f7ada
%{__install} -d -m0755  %{buildroot}%{_sysconfdir}/init.d
Adam Miller 33f7ada
%if 0%{?suse_version}
Adam Miller 33f7ada
%{__install} -m0755 mcollective.init %{buildroot}%{_sysconfdir}/init.d/mcollective
Adam Miller 33f7ada
%else
Adam Miller 33f7ada
%{__install} -m0755 ext/redhat/mcollective.init %{buildroot}%{_sysconfdir}/init.d/mcollective
Adam Miller 33f7ada
%endif
1f13e14
%endif
1f13e14
Adam Miller 33f7ada
%{__install} -d -m0755  %{buildroot}%{_sysconfdir}/mcollective/plugin.d
Adam Miller 33f7ada
%{__install} -d -m0755  %{buildroot}%{_sysconfdir}/mcollective/ssl/clients
1f13e14
1f13e14
%clean
1f13e14
rm -rf %{buildroot}
1f13e14
1f13e14
%post
Adam Miller 33f7ada
%if 0%{?_with_systemd}
Adam Miller 33f7ada
if [ $1 -eq 1 ] ; then
Adam Miller 33f7ada
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
Adam Miller 33f7ada
fi
Adam Miller 33f7ada
%else
1f13e14
/sbin/chkconfig --add mcollective || :
1f13e14
%endif
1f13e14
1f13e14
%postun
Adam Miller 33f7ada
%if 0%{?_with_systemd}
Adam Miller 33f7ada
if [ $1 -ge 1 ] ; then
Adam Miller 33f7ada
    # Package upgrade, not uninstall
Adam Miller 33f7ada
    /bin/systemctl try-restart mcollective.service >/dev/null 2>&1 || :
Adam Miller 33f7ada
fi
Adam Miller 33f7ada
%else
1f13e14
if [ "$1" -ge 1 ]; then
Adam Miller 33f7ada
  /sbin/service mcollective condrestart &>/dev/null || :
1f13e14
fi
1f13e14
%endif
1f13e14
1f13e14
%preun
Adam Miller 33f7ada
%if 0%{?_with_systemd}
Adam Miller 33f7ada
if [ $1 -eq 0 ] ; then
Adam Miller 33f7ada
    # Package removal, not upgrade
Adam Miller 33f7ada
    /bin/systemctl --no-reload disable mcollective.service > /dev/null 2>&1 || :
Adam Miller 33f7ada
    /bin/systemctl stop mcollective.service > /dev/null 2>&1 || :
Adam Miller 33f7ada
fi
Adam Miller 33f7ada
%else
1f13e14
if [ "$1" = 0 ] ; then
1f13e14
  /sbin/service mcollective stop > /dev/null 2>&1
1f13e14
  /sbin/chkconfig --del mcollective || :
1f13e14
fi
1f13e14
%endif
1f13e14
1f13e14
%files common
Adam Miller 33f7ada
%defattr(-, root, root, 0755)
1f13e14
%doc COPYING
Adam Miller 33f7ada
%doc doc
Adam Miller 33f7ada
%{ruby_libdir}/mcollective.rb
Adam Miller 33f7ada
%{ruby_libdir}/mcollective
0ccf279
%dir %{_sysconfdir}/mcollective
0ccf279
%dir %{_sysconfdir}/mcollective/ssl
Adam Miller 33f7ada
%config %{_sysconfdir}/mcollective/*.erb
1f13e14
1f13e14
%files client
Adam Miller 33f7ada
%defattr(-, root, root, 0755)
Adam Miller 33f7ada
%attr(0755, root, root)%{_bindir}/mco
1f13e14
%doc COPYING
Adam Miller 33f7ada
%config(noreplace)%{_sysconfdir}/mcollective/client.cfg
1f13e14
1f13e14
%files
Adam Miller 33f7ada
%defattr(-, root, root, 0755)
1f13e14
%doc COPYING
Adam Miller 33f7ada
%attr(0755, root, root)%{_sbindir}/mcollectived
Adam Miller 33f7ada
%if 0%{?_with_systemd}
1f13e14
%{_unitdir}/mcollective.service
Adam Miller 33f7ada
%else
Adam Miller 33f7ada
%{_sysconfdir}/init.d/mcollective
1f13e14
%endif
Adam Miller 33f7ada
%config(noreplace)%{_sysconfdir}/mcollective/server.cfg
Adam Miller 33f7ada
%config(noreplace)%{_sysconfdir}/mcollective/facts.yaml
Adam Miller 33f7ada
%dir %{_sysconfdir}/mcollective/ssl/clients
Adam Miller 33f7ada
%config(noreplace)%{_sysconfdir}/mcollective/plugin.d
1f13e14
1f13e14
%changelog
d3e5a33
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.4-3
d3e5a33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
d3e5a33
57357b0
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.4-2
57357b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
57357b0
Adam Miller 33f7ada
* Fri Oct 30 2015 Adam Miller <maxamillion@fedoraproject.org> - 2.8.4-1
Adam Miller 33f7ada
- Update to latest upstream
Adam Miller 33f7ada
b7a380f
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.3-3
b7a380f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
b7a380f
02b9820
* Mon Jul 21 2014 Steve Traylen <steve.traylen@cern.ch> - 2.5.3-2
02b9820
- Correct bogus date in last commit.
02b9820
02b9820
* Mon Jul 21 2014 Steve Traylen <steve.traylen@cern.ch> - 2.5.3-1
60e683f
- Upstream 2.5.3
60e683f
2270c43
* Wed Jun 11 2014 Steve Traylen <steve.traylen@cern.ch> - 2.5.2-1
2270c43
- Upstream 2.5.2
2270c43
8335f2f
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.1-2
8335f2f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
8335f2f
0265d37
* Wed Feb 12 2014 Steve Traylen <steve.traylen@cern.ch> - 2.4.1-1
0265d37
- Upstream 2.4.1
0265d37
8041afc
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.3-2
8041afc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
8041afc
3f3b3eb
* Wed Apr 17 2013 Vít Ondruch <vondruch@redhat.com> - 2.2.3-1
3f3b3eb
- Upstream to 2.2.3
9dd9ec5
- Add mcollective-rhbz#952970.patch
10ee73c
- rhbz#850200 Use new systemd rpm macros.
f82108e
- rhbz#868417 Use deamonozie allways in configuration.
3f3b3eb
b283656
* Wed Mar 20 2013 Vít Ondruch <vondruch@redhat.com> - 2.2.0-3
b283656
- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
b283656
40d2afa
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.0-2
40d2afa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
40d2afa
f2919b5
* Sat Sep 22 2012 Steve Traylen <steve.traylen@cern.ch> - 2.2.0-1
f2919b5
- Update to 2.2.0, add plugin.d directory to package, add missing
f2919b5
  .erb help files.
f2919b5
f287961
* Wed Sep 5 2012 Steve Traylen <steve.traylen@cern.ch> - 2.0.0-6
f287961
- Fix rhbz#853574 in different way. 0644 client.cfg.
f287961
257a65e
* Wed Sep 5 2012 Steve Traylen <steve.traylen@cern.ch> - 2.0.0-5
257a65e
- Add mco unix group who can read client.cfg rhbz#853574
257a65e
ff461f3
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-4
ff461f3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
ff461f3
671a2ea
* Tue May 22 2012 Steve Traylen <steve.traylen@cern.ch> - 2.0.0-3
671a2ea
- Drop 0001-get-rid-of-vendor-libraries.patch and
671a2ea
  0002-Don-t-enable-services-by-default.patch. vendor load falls
671a2ea
  back to system path.
671a2ea
0ef7831
* Mon May 21 2012 Steve Traylen <steve.traylen@cern.ch> - 2.0.0-2
0ef7831
- Fix ExecReload in systemd file.
cf47a32
- Use alternate SysV start up file dropping lsb requires.
0ef7831
cc1b2d2
* Thu May 3 2012 Steve Traylen <steve.traylen@cern.ch> - 2.0.0-1
cc1b2d2
- New version.
cc1b2d2
caa5433
* Fri Apr 27 2012 Steve Traylen <steve.traylen@cern.ch> - 1.3.3-5
caa5433
- Finger trouble.
caa5433
06d3028
* Fri Apr 27 2012 Steve Traylen <steve.traylen@cern.ch> - 1.3.3-4
06d3028
- Fix patch 0001 to stop loading verdor directory.
06d3028
f94ae5c
* Tue Apr 24 2012 Steve Traylen <steve.traylen@cern.ch> - 1.3.3-3
f94ae5c
- Fix systemd start up file.
f94ae5c
0ccf279
* Wed Apr 18 2012 Steve Traylen <steve.traylen@cern.ch> - 1.3.3-2
0ccf279
- Update to Fedora's new ruby guidelines.
0ccf279
54860e3
* Tue Apr 17 2012 Jeffrey Ollie <jeff@ocjtech.us> - 1.3.3-1
54860e3
- 1.3.3
54860e3
- see releasenotes: http://docs.puppetlabs.com/mcollective/releasenotes.html
54860e3
d9d873a
* Fri Jan 13 2012 Jeffrey Ollie <jeff@ocjtech.us> - 1.3.2-1
d9d873a
- 1.3.2
d9d873a
- see releasenotes: http://docs.puppetlabs.com/mcollective/releasenotes.html
d9d873a
3134b54
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.1-7
3134b54
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
3134b54
1f13e14
* Wed Dec  7 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.3.1-6
1f13e14
- Use sed instead of perl in build section
1f13e14
1f13e14
* Tue Dec  6 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.3.1-5
1f13e14
- Use patches instead of perl
1f13e14
- Remove included copy of systemu
1f13e14
1f13e14
* Mon Dec  5 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.3.1-4
1f13e14
- More work on keeping init scripts disabled by default
1f13e14
- reorder defattr and doc lines
1f13e14
1f13e14
* Thu Dec  1 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.3.1-3
1f13e14
- Don't enable SysV init script by default
1f13e14
- use sbindir macro for a few more things
1f13e14
- fix config(noreplace) flag
1f13e14
- default file attributes for EPEL
1f13e14
1f13e14
* Thu Nov 17 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.3.1-2
1f13e14
- Remove internal copy of JSON library
1f13e14
1f13e14
* Thu Nov 17 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.3.1-1
1f13e14
- Update to 1.3.1
1f13e14
1f13e14
* Thu Aug 18 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.3.0-1
1f13e14
- Update to 1.3.0
1f13e14
1f13e14
* Fri May 27 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.2.0-2
1f13e14
- Add mco script
1f13e14
1f13e14
* Mon May 23 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.2.0-1
1f13e14
- Update to 1.2.0
1f13e14
1f13e14
* Wed Apr 20 2011 Jeffrey Ollie <jeff@ocjtech.us> - 1.1.3-3
1f13e14
- First version for Fedora