-
Notifications
You must be signed in to change notification settings - Fork 0
/
gem2rpm.template
67 lines (56 loc) · 1.69 KB
/
gem2rpm.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# gem2rpm frameos.org template
# Generated from <%= format.gem_path %> by gem2rpm -*- rpm-spec -*-
%define rbname <%= spec.name %>
Summary: <%= spec.summary %>
Name: rubygem-%{rbname}
Version: <%= spec.version %>
Release: 0
Group: Development/Ruby
License: Distributable
URL: <%= spec.homepage %>
Source0: http://rubygems.org/gems/%{rbname}-%{version}.gem
# Make sure the spec template is included in the SRPM
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Requires: ruby
Requires: rubygems
<% for d in spec.dependencies -%>
<% for req in d.requirement -%>
Requires: rubygem-<%= d.name %> <%= req %>
<% end -%>
<% end -%>
BuildRequires: ruby
BuildRequires: rubygems
BuildArch: noarch
Provides: ruby(<%= spec.name.capitalize %>) = %{version}
%define gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
%define gembuilddir %{buildroot}%{gemdir}
%description
<%= spec.description %>
%prep
%setup -T -c
%build
%install
%{__rm} -rf %{buildroot}
mkdir -p %{gembuilddir}
gem install --local --install-dir %{gembuilddir} --force %{SOURCE0}
%{__rm} -rf %{gembuilddir}/cache
<% if ! spec.executables.empty? -%>
mkdir -p %{buildroot}/%{_bindir}
mv %{gembuilddir}/bin/* %{buildroot}/%{_bindir}
rmdir %{gembuilddir}/bin
<% end -%>
%clean
%{__rm} -rf %{buildroot}
%files
%defattr(-, root, root)
<% for f in spec.executables -%>
%{_bindir}/<%= f %>
<% end -%>
<% format.file_entries.each do |entry, data| -%>
<% path = entry['path'] -%>
<% doc_prefix = spec.extra_rdoc_files.include?(path) ? "%doc " : "" -%>
<%= doc_prefix %>%{gemdir}/gems/<%= spec.name %>-<%= spec.version %>/<%= path %>
<% end %>
%doc %{gemdir}/doc/<%= spec.name %>-<%= spec.version %>
%{gemdir}/specifications/<%= format.gem_path %>spec
%changelog