/
rpm.erb
56 lines (47 loc) · 1.15 KB
/
rpm.erb
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
Name: <%= @name %>
Version: <%= @version %>
Release: <%= @iteration %>
Summary: <%= @summary %>
BuildArch: <%= architecture %>
Group: <%= @category %>
<%#
TODO: [Jay] rpms require a license
let's detect it intelligently
%>
License: <%= @license %>
Source0: %{_sourcedir}/data.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
<% if !dependencies.empty? %>
<%
properdeps = dependencies.collect do |d|
# Convert gem ~> X.Y.Z to '>= X.Y.Z' and < X.Y+1.0
if d =~ /\~>/
name, version = d.gsub(/[()~>]/, "").split(/ +/)[0..1]
nextversion = version.split(".").collect { |v| v.to_i }
nextversion[1] += 1
nextversion[2] = 0
nextversion = nextversion.join(".")
["#{name} >= #{version}", "#{name} < #{nextversion}"]
else
d
end
end
%>Requires: <%= properdeps.join(", ") %>
<% end %>
%description
<%= @summary %>
%prep
echo "PREP"
pwd
tar -zvxf %SOURCE0
%build
#noop
%install
#noop
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
<%# Trim leading '.' from paths if they are './blah...' %>
<%= @source.paths.collect { |p| p.gsub(/^\.\//, "/") }.join("\n") %>
%changelog