Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add template for Fedora 19 #19

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
File renamed without changes.
117 changes: 117 additions & 0 deletions templates/fedora-19-rawhide.spec.erb
@@ -0,0 +1,117 @@
# Generated from <%= File::basename(format.gem_path) %> by gem2rpm -*- rpm-spec -*-
%global gem_name <%= spec.name %>

Name: rubygem-%{gem_name}
Version: <%= spec.version %>
Release: 1%{?dist}
Summary: <%= spec.summary.gsub(/\.$/, "") %>
Group: Development/Languages
License: <%= spec.licenses.join(" and ") %>
<% if spec.homepage -%>
URL: <%= spec.homepage %>
<% end -%>
Source0: <%= download_path %>%{gem_name}-%{version}.gem
Requires: ruby(release)
<% 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 -%>
BuildRequires: ruby(abi) = %{rubyabi}
<% for req in spec.required_rubygems_version -%>
BuildRequires: rubygems-devel <%= req %>
<% end -%>
<%# TODO: Unfortunatelly this do not match with ruby(abi) yet -%>
<% for req in spec.required_ruby_version -%>
BuildRequires: ruby<%= "-devel" unless spec.extensions.empty? %> <%= req %>
<% end -%>
<% if spec.extensions.empty? -%>
BuildArch: noarch
<% end -%>
Provides: rubygem(%{gem_name}) = %{version}

%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 -pa .%{gem_dir}/* \
%{buildroot}%{gem_dir}/

<% unless spec.extensions.empty? -%>
mkdir -p %{buildroot}%{gem_extdir}/<%= spec.require_paths.first %>
mv %{buildroot}%{gem_instdir}/<%= spec.require_paths.first %>/shared_object.so %{buildroot}%{gem_extdir}/<%= spec.require_paths.first %>/
<% end -%>

<% unless spec.executables.nil? or spec.executables.empty? -%>
mkdir -p %{buildroot}%{_bindir}
cp -pa .%{_bindir}/* \
%{buildroot}%{_bindir}/
<% end -%>

<% unless spec.executables.empty? -%>
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
<% end -%>

%files
%dir %{gem_instdir}
<% unless spec.executables.nil? or spec.executables.empty? -%>
<% for f in spec.executables -%>
%{_bindir}/<%= f %>
<% end -%>
%{gem_instdir}/bin
<% end -%>
%{gem_libdir}
<% unless spec.extensions.empty? -%>
%exclude %{gem_instdir}/ext
%{gem_extdir}
<% end -%>
<% unless doc_subpackage -%>
%doc %{gem_docdir}
<% for f in spec.extra_rdoc_files -%>
%doc %{gem_instdir}/<%= f %>
<% end -%>
<% end -%>
%exclude %{gem_cache}
%{gem_spec}

<% if doc_subpackage -%>
%files doc
%doc %{gem_docdir}
<% for f in spec.extra_rdoc_files -%>
%doc %{gem_instdir}/<%= f %>
<% end -%>
<% end # if doc_subpackage -%>

%changelog
* <%= Time.now.strftime("%a %b %d %Y") %> <%= packager %> - <%= spec.version %>-1
- Initial package