|
%{?scl:%scl_package rubygem-%{gem_name}}
|
|
%{!?scl:%global pkg_name %{name}}
|
|
|
|
%global gem_name foreman-mco
|
|
|
|
%define rubyabi 1.9.1
|
|
%global foreman_dir /usr/share/foreman
|
|
%global foreman_bundlerd_dir %{foreman_dir}/bundler.d
|
|
|
|
Summary: Manage remote hosts with MCollective and Foreman
|
|
Name: %{?scl_prefix}rubygem-%{gem_name}
|
|
Version: 0.0.1
|
|
Release: 4%{?dist}
|
|
Group: Applications/System
|
|
License: GPLv3
|
|
URL: http://github.com/witlessbird/foreman_mco
|
|
Source0: http://rubygems.org/downloads/%{gem_name}-%{version}.gem
|
|
|
|
Requires: foreman >= 1.2.0
|
|
|
|
%if 0%{?fedora} > 18
|
|
Requires: %{?scl_prefix_ruby}ruby(release)
|
|
%else
|
|
Requires: %{?scl_prefix_ruby}ruby(abi) >= %{rubyabi}
|
|
%endif
|
|
Requires: %{?scl_prefix_ruby}rubygems
|
|
Requires: %{?scl_prefix}rubygem(deface)
|
|
|
|
%if 0%{?fedora} > 18
|
|
BuildRequires: %{?scl_prefix_ruby}ruby(release)
|
|
%else
|
|
BuildRequires: %{?scl_prefix_ruby}ruby(abi) >= %{rubyabi}
|
|
%endif
|
|
BuildRequires: %{?scl_prefix_ruby}rubygems-devel
|
|
BuildRequires: %{?scl_prefix_ruby}rubygems
|
|
|
|
BuildArch: noarch
|
|
|
|
Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version}
|
|
Provides: foreman-plugin-mco
|
|
%{?scl:Obsoletes: ruby193-rubygem-%{gem_name}}
|
|
|
|
%description
|
|
Manage remote hosts with MCollective and Foreman.
|
|
|
|
%prep
|
|
%setup -n %{pkg_name}-%{version} -q -c -T
|
|
mkdir -p .%{gem_dir}
|
|
%{?scl:scl enable %{scl} "}
|
|
gem install --local --install-dir .%{gem_dir} \
|
|
--force %{SOURCE0} --no-rdoc --no-ri
|
|
%{?scl:"}
|
|
|
|
%build
|
|
|
|
%install
|
|
mkdir -p %{buildroot}%{gem_dir}
|
|
cp -a .%{gem_dir}/* \
|
|
%{buildroot}%{gem_dir}/
|
|
|
|
mkdir -p %{buildroot}%{foreman_bundlerd_dir}
|
|
cat <<GEMFILE > %{buildroot}%{foreman_bundlerd_dir}/%{gem_name}.rb
|
|
gem '%{gem_name}'
|
|
GEMFILE
|
|
|
|
%files
|
|
%dir %{gem_instdir}
|
|
%{gem_instdir}/lib
|
|
%{gem_instdir}/app
|
|
%{gem_instdir}/db
|
|
%{gem_instdir}/config
|
|
%{gem_instdir}/Rakefile
|
|
%exclude %{gem_cache}
|
|
%{gem_spec}
|
|
%{foreman_bundlerd_dir}/%{gem_name}.rb
|
|
|
|
%exclude %{gem_instdir}/test
|
|
%exclude %{gem_dir}/cache/%{gem_name}-%{version}.gem
|
|
|
|
%posttrans
|
|
su - foreman -s /bin/bash -c /usr/share/foreman/extras/dbmigrate >/dev/null 2>&1 ||:
|
|
(/sbin/service foreman status && /sbin/service foreman restart) >/dev/null 2>&1
|
|
exit 0
|
|
|
|
%changelog
|
|
* Wed Aug 26 2015 Dominic Cleal <dcleal@redhat.com> 0.0.1-4
|
|
- Converted to tfm SCL (dcleal@redhat.com)
|
|
|
|
* Tue Dec 17 2013 Dominic Cleal <dcleal@redhat.com> 0.0.1-3
|
|
- Update some references to mco (dcleal@redhat.com)
|
|
|
|
* Tue Dec 17 2013 Sam Kottler <shk@redhat.com> 0.0.1-2
|
|
- Initial tag with tito
|
|
|
|
* Mon Dec 13 2013 Sam Kottler <shk@redhat.com> - 0.0.1-1
|
|
- Initial package for foreman_mco
|