|
# FIXME:
|
|
# 1. Edit foreman-proxy requirement and specify minimum version
|
|
# 2. Delete these lines
|
|
#
|
|
# Generated from <%= package.spec.file_name %> by gem2rpm -*- rpm-spec -*-
|
|
%global gem_name <%= spec.name %>
|
|
%global plugin_name <%= spec.name.sub(/\Asmart_proxy_/, '') %>
|
|
|
|
%global foreman_proxy_dir %{_datarootdir}/foreman-proxy
|
|
%global foreman_proxy_bundlerd_dir %{foreman_proxy_dir}/bundler.d
|
|
%global foreman_proxy_settingsd_dir %{_sysconfdir}/foreman-proxy/settings.d
|
|
|
|
Name: rubygem-%{gem_name}
|
|
Version: <%= spec.version %>
|
|
Release: 1%{?foremandist}%{?dist}
|
|
Summary: <%= spec.summary.gsub(/\.$/, "") %>
|
|
Group: Applications/Internet
|
|
License: <%= spec.licenses.join(" and ") %>
|
|
<% if spec.homepage -%>
|
|
URL: <%= spec.homepage %>
|
|
<% end -%>
|
|
Source0: <%= download_path %>%{gem_name}-%{version}.gem
|
|
Requires: foreman-proxy >= FIXME
|
|
%if 0%{?rhel} == 6
|
|
Requires: ruby(abi)
|
|
%else
|
|
Requires: ruby(release)
|
|
%endif
|
|
<% for req in spec.required_ruby_version -%>
|
|
Requires: ruby <%= req %>
|
|
<% end -%>
|
|
<% for req in spec.required_rubygems_version -%>
|
|
Requires: ruby(rubygems) <%= req %>
|
|
<% end -%>
|
|
<% for d in spec.runtime_dependencies -%>
|
|
<% for req in d.requirement -%>
|
|
Requires: rubygem(<%= d.name %>) <%= req %>
|
|
<% end -%>
|
|
<% end -%>
|
|
%if 0%{?rhel} == 6
|
|
BuildRequires: ruby(abi)
|
|
%else
|
|
BuildRequires: ruby(release)
|
|
%endif
|
|
<% for req in spec.required_ruby_version -%>
|
|
BuildRequires: ruby<%= "-devel" unless spec.extensions.empty? %> <%= req %>
|
|
<% end -%>
|
|
<% for req in spec.required_rubygems_version -%>
|
|
BuildRequires: rubygems-devel <%= req %>
|
|
<% end -%>
|
|
<% if spec.extensions.empty? -%>
|
|
BuildArch: noarch
|
|
<% end -%>
|
|
Provides: rubygem(%{gem_name}) = %{version}
|
|
Provides: foreman-proxy-plugin-%{plugin_name}
|
|
|
|
%description
|
|
<%= spec.description %>
|
|
|
|
<% if doc_subpackage -%>
|
|
%package doc
|
|
Summary: Documentation for %{name}
|
|
Group: Documentation
|
|
Requires: %{name} = %{version}-%{release}
|
|
BuildArch: noarch
|
|
|
|
%description doc
|
|
Documentation for %{name}.
|
|
<% end # if doc_subpackage -%>
|
|
|
|
%prep
|
|
gem unpack %{SOURCE0}
|
|
|
|
%setup -q -D -T -n %{gem_name}-%{version}
|
|
|
|
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
|
|
|
|
%build
|
|
# Create the gem as gem install only works on a gem file
|
|
gem build %{gem_name}.gemspec
|
|
|
|
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
|
|
# by default, so that we can move it into the buildroot in %%install
|
|
%gem_install
|
|
|
|
%install
|
|
mkdir -p %{buildroot}%{gem_dir}
|
|
cp -a .%{gem_dir}/* \
|
|
%{buildroot}%{gem_dir}/
|
|
|
|
<% unless spec.extensions.empty? -%>
|
|
mkdir -p %{buildroot}%{gem_extdir_mri}
|
|
cp -a .%{gem_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{gem_extdir_mri}/
|
|
|
|
<% for ext in spec.extensions -%>
|
|
# Prevent dangling symlink in -debuginfo (rhbz#878863).
|
|
rm -rf %{buildroot}%{gem_instdir}/<%= ext.split(File::SEPARATOR).first %>/
|
|
<% end -%>
|
|
|
|
<% end -%>
|
|
<% unless spec.executables.nil? or spec.executables.empty? -%>
|
|
mkdir -p %{buildroot}%{_bindir}
|
|
cp -pa .%{_bindir}/* \
|
|
%{buildroot}%{_bindir}/
|
|
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
|
|
|
|
<% end -%>
|
|
# bundler file
|
|
mkdir -p %{buildroot}%{foreman_proxy_bundlerd_dir}
|
|
mv %{buildroot}%{gem_instdir}/bundler.d/%{plugin_name}.rb \
|
|
%{buildroot}%{foreman_proxy_bundlerd_dir}
|
|
|
|
# sample config
|
|
mkdir -p %{buildroot}%{foreman_proxy_settingsd_dir}
|
|
mv %{buildroot}%{gem_instdir}/settings.d/%{plugin_name}.yml.example \
|
|
%{buildroot}%{foreman_proxy_settingsd_dir}/%{plugin_name}.yml
|
|
|
|
%files
|
|
%dir %{gem_instdir}
|
|
<% unless spec.executables.nil? or spec.executables.empty? -%>
|
|
<% for f in spec.executables -%>
|
|
%{_bindir}/<%= f %>
|
|
<% end -%>
|
|
<% end -%>
|
|
<% unless spec.extensions.empty? -%>
|
|
%{gem_extdir_mri}
|
|
<% end -%>
|
|
<%= main_file_entries(spec).gsub(/^%license/, '%doc') %>
|
|
<% unless doc_subpackage -%>
|
|
%doc %{gem_docdir}
|
|
<%= doc_file_entries(spec) -%>
|
|
<% end -%>
|
|
%{foreman_proxy_bundlerd_dir}/%{plugin_name}.rb
|
|
%config(noreplace) %attr(0640, root, foreman-proxy) %{foreman_proxy_settingsd_dir}/%{plugin_name}.yml
|
|
%exclude %{gem_cache}
|
|
%{gem_spec}
|
|
|
|
<% if doc_subpackage -%>
|
|
%files doc
|
|
%doc %{gem_docdir}
|
|
<%= doc_file_entries(spec) %>
|
|
<% end # if doc_subpackage -%>
|
|
|
|
%changelog
|