Skip to content

Commit 783d0df

Browse files
committed
Restore templates for F27-F37
This is separate commit mainly to keep the git history for the "main" templates linear.
1 parent 974d189 commit 783d0df

File tree

3 files changed

+225
-0
lines changed

3 files changed

+225
-0
lines changed
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Generated from <%= spec.file_name %> by gem2rpm -*- rpm-spec -*-
2+
%global vagrant_plugin_name <%= spec.name %>
3+
4+
Name: %{vagrant_plugin_name}
5+
Version: <%= spec.version %>
6+
Release: 1%{?dist}
7+
Summary: <%= spec.summary.gsub(/\.$/, "") %>
8+
License: <%= spec.licenses.join(" and ") %>
9+
<% if spec.homepage -%>
10+
URL: <%= spec.homepage %>
11+
<% end -%>
12+
Source0: <%= download_path %>%{vagrant_plugin_name}-%{version}.gem
13+
Requires: vagrant
14+
BuildRequires: vagrant
15+
<% if spec.extensions.empty? -%>
16+
BuildArch: noarch
17+
<% end -%>
18+
Provides: vagrant(%{vagrant_plugin_name}) = %{version}
19+
20+
%description
21+
<%= spec.description %>
22+
23+
<% if doc_subpackage -%>
24+
%package doc
25+
Summary: Documentation for %{name}
26+
Requires: %{name} = %{version}-%{release}
27+
BuildArch: noarch
28+
29+
%description doc
30+
Documentation for %{name}.
31+
<% end # if doc_subpackage -%>
32+
33+
%prep
34+
%setup -q -n %{vagrant_plugin_name}-%{version}
35+
36+
%build
37+
# Create the gem as gem install only works on a gem file
38+
gem build ../%{vagrant_plugin_name}-%{version}.gemspec
39+
40+
# %%vagrant_plugin_install compiles any C extensions and installs the gem into ./%%gem_dir
41+
# by default, so that we can move it into the buildroot in %%install
42+
%vagrant_plugin_install
43+
44+
%install
45+
mkdir -p %{buildroot}%{vagrant_plugin_dir}
46+
cp -a .%{vagrant_plugin_dir}/* \
47+
%{buildroot}%{vagrant_plugin_dir}/
48+
49+
<% unless spec.extensions.empty? -%>
50+
mkdir -p %{buildroot}%{vagrant_plugin_extdir_mri}
51+
cp -a .%{vagrant_plugin_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{vagrant_plugin_extdir_mri}/
52+
53+
<% for ext in spec.extensions -%>
54+
# Prevent dangling symlink in -debuginfo (rhbz#878863).
55+
rm -rf %{buildroot}%{vagrant_plugin_instdir}/<%= ext.split(File::SEPARATOR).first %>/
56+
<% end -%>
57+
<% end -%>
58+
59+
<% unless spec.executables.empty? -%>
60+
mkdir -p %{buildroot}%{_bindir}
61+
cp -a .%{_bindir}/* \
62+
%{buildroot}%{_bindir}/
63+
64+
find %{buildroot}%{vagrant_plugin_instdir}/<%= spec.bindir %> -type f | xargs chmod a+x
65+
<% end -%>
66+
67+
%check
68+
pushd .%{gem_instdir}
69+
<% if tests.entries.empty? -%>
70+
# Run the test suite.
71+
<% end -%>
72+
<% for t in tests -%>
73+
# <%= t.command %>
74+
<% end -%>
75+
popd
76+
77+
<%
78+
# Change macros for Vagrant packaging
79+
config.macros[:instdir] = '%{vagrant_plugin_instdir}'
80+
config.macros[:libdir] = '%{vagrant_plugin_libdir}'
81+
-%>
82+
%files
83+
%dir %{vagrant_plugin_instdir}
84+
<% for f in spec.executables -%>
85+
%{_bindir}/<%= f %>
86+
<% end -%>
87+
<% unless spec.extensions.empty? -%>
88+
%{vagrant_plugin_extdir_mri}
89+
<% end -%>
90+
<%= main_files.reject do |item|
91+
spec.extensions.detect { |extension| item =~ /^#{extension.split(File::SEPARATOR).first}$/}
92+
end.to_rpm %>
93+
<% unless doc_subpackage -%>
94+
%doc %{vagrant_plugin_docdir}
95+
<%= doc_files.to_rpm %>
96+
<% end -%>
97+
%exclude %{vagrant_plugin_cache}
98+
%{vagrant_plugin_spec}
99+
100+
<% if doc_subpackage -%>
101+
%files doc
102+
%doc %{vagrant_plugin_docdir}
103+
<%= files.top_level_entries.doc_entries.to_rpm %>
104+
<% end # if doc_subpackage -%>
105+
106+
%changelog
107+
* <%= Time.now.strftime("%a %b %d %Y") %> <%= packager %> - <%= spec.version %>-1
108+
- Initial package

templates/fedora-27-37.spec.erb

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Generated from <%= spec.file_name %> by gem2rpm -*- rpm-spec -*-
2+
%global gem_name <%= spec.name %>
3+
4+
Name: rubygem-%{gem_name}
5+
Version: <%= spec.version %>
6+
Release: 1%{?dist}
7+
Summary: <%= spec.summary.gsub(/\.$/, "") %>
8+
License: <%= spec.licenses.join(" and ") %>
9+
<% if spec.homepage -%>
10+
URL: <%= spec.homepage %>
11+
<% end -%>
12+
Source0: <%= download_path %>%{gem_name}-%{version}.gem
13+
BuildRequires: ruby(release)
14+
<% for req in spec.required_rubygems_version -%>
15+
BuildRequires: <%= requirement 'rubygems-devel', req %>
16+
<% end -%>
17+
<% for req in spec.required_ruby_version -%>
18+
BuildRequires: <%= requirement "ruby#{'-devel' unless spec.extensions.empty?}", req %>
19+
<% end -%>
20+
<% unless spec.extensions.empty? -%>
21+
# Compiler is required for build of gem binary extension.
22+
# https://fedoraproject.org/wiki/Packaging:C_and_C++#BuildRequires_and_Requires
23+
BuildRequires: gcc
24+
<% end -%>
25+
<%= development_dependencies.reject do |d|
26+
["rdoc", "rake", "bundler"].include? d.name
27+
end.virtualize.with_requires.comment_out.to_rpm -%>
28+
<% if spec.extensions.empty? -%>
29+
BuildArch: noarch
30+
<% end -%>
31+
32+
%description
33+
<%= spec.description %>
34+
35+
<% if doc_subpackage -%>
36+
%package doc
37+
Summary: Documentation for %{name}
38+
Requires: %{name} = %{version}-%{release}
39+
BuildArch: noarch
40+
41+
%description doc
42+
Documentation for %{name}.
43+
<% end # if doc_subpackage -%>
44+
45+
%prep
46+
%setup -q -n %{gem_name}-%{version}
47+
48+
%build
49+
# Create the gem as gem install only works on a gem file
50+
gem build ../%{gem_name}-%{version}.gemspec
51+
52+
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
53+
# by default, so that we can move it into the buildroot in %%install
54+
%gem_install
55+
56+
%install
57+
mkdir -p %{buildroot}%{gem_dir}
58+
cp -a .%{gem_dir}/* \
59+
%{buildroot}%{gem_dir}/
60+
61+
<% unless spec.extensions.empty? -%>
62+
mkdir -p %{buildroot}%{gem_extdir_mri}
63+
cp -a .%{gem_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{gem_extdir_mri}/
64+
65+
<% for ext in spec.extensions -%>
66+
# Prevent dangling symlink in -debuginfo (rhbz#878863).
67+
rm -rf %{buildroot}%{gem_instdir}/<%= ext.split(File::SEPARATOR).first %>/
68+
<% end -%>
69+
<% end -%>
70+
71+
<% unless spec.executables.empty? -%>
72+
mkdir -p %{buildroot}%{_bindir}
73+
cp -a .%{_bindir}/* \
74+
%{buildroot}%{_bindir}/
75+
76+
find %{buildroot}%{gem_instdir}/<%= spec.bindir %> -type f | xargs chmod a+x
77+
<% end -%>
78+
79+
%check
80+
pushd .%{gem_instdir}
81+
<% if tests.entries.empty? -%>
82+
# Run the test suite.
83+
<% end -%>
84+
<% for t in tests -%>
85+
# <%= t.command %>
86+
<% end -%>
87+
popd
88+
89+
%files
90+
%dir %{gem_instdir}
91+
<% for f in spec.executables -%>
92+
%{_bindir}/<%= f %>
93+
<% end -%>
94+
<% unless spec.extensions.empty? -%>
95+
%{gem_extdir_mri}
96+
<% end -%>
97+
<%= main_files.reject do |item|
98+
spec.extensions.detect { |extension| item =~ /^#{extension.split(File::SEPARATOR).first}$/}
99+
end.to_rpm %>
100+
<% unless doc_subpackage -%>
101+
%doc %{gem_docdir}
102+
<%= doc_files.to_rpm %>
103+
<% end -%>
104+
%exclude %{gem_cache}
105+
%{gem_spec}
106+
107+
<% if doc_subpackage -%>
108+
%files doc
109+
%doc %{gem_docdir}
110+
<%= doc_files.to_rpm %>
111+
<% end # if doc_subpackage -%>
112+
113+
%changelog
114+
* <%= Time.now.strftime("%a %b %d %Y") %> <%= packager %> - <%= spec.version %>-1
115+
- Initial package

test/test_template.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ def test_list
1515
fedora-21-25.spec.erb
1616
fedora-26-vagrant-plugin.spec.erb
1717
fedora-26.spec.erb
18+
fedora-27-37-vagrant-plugin.spec.erb
19+
fedora-27-37.spec.erb
1820
fedora-38-rawhide-vagrant-plugin.spec.erb
1921
fedora-38-rawhide.spec.erb
2022
fedora.spec.erb

0 commit comments

Comments
 (0)