-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.spec.template
72 lines (61 loc) · 1.93 KB
/
default.spec.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
68
69
70
71
72
# Generated from <%= format.gem_path %> by gem2rpm -*- rpm-spec -*-
%define rbname <%= spec.name %>
%define version <%= spec.version %>
%define release 1
Summary: <%= spec.summary %>
Name: ruby-gems-%{rbname}
Version: %{version}
Release: %{release}
Group: Development/Ruby
License: Distributable
URL: <%= spec.homepage %>
Source0: %{rbname}-%{version}.gem
# Make sure the spec template is included in the SRPM
Source1: ruby-gems-%{rbname}.spec.in
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Requires: ruby <%= spec.required_ruby_version.to_rpm %>
Requires: ruby-gems >= <%= Gem::RubyGemsVersion %>
<% for d in spec.dependencies %>
<% for req in d.version_requirements.to_rpm %>
Requires: ruby-gems-<%= d.name %> <%= req %>
<% end %>
<% end %>
BuildRequires: ruby <%= spec.required_ruby_version.to_rpm %>
BuildRequires: ruby-gems >= <%= Gem::RubyGemsVersion %>
BuildArch: noarch
Provides: ruby(<%= spec.name.capitalize %>) = %{version}
%define gemdir <%= Gem.dir %>
%define gembuilddir %{buildroot}%{gemdir}
%description
<%= spec.description %>
%prep
%setup -T -c
%build
%install
%{__rm} -rf %{buildroot}
mkdir -p %{gembuilddir}
<% rdoc_opt = spec.has_rdoc ? "--rdoc " : "" %>
gem install --local --install-dir %{gembuilddir} --force <%= rdoc_opt %>%{SOURCE0}
<% 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 %>
<% if spec.has_rdoc %>
%doc %{gemdir}/doc/<%= spec.name %>-<%= spec.version %>
<% end %>
%{gemdir}/cache/<%= format.gem_path %>
%{gemdir}/specifications/<%= format.gem_path %>spec
%changelog