mirror of
https://github.com/jordansissel/fpm
synced 2025-09-04 08:54:39 +02:00
- Abort if rpmbuild fails so we can debug it. - Fix dependency conversion for rpm - Fix path prefixing so rpm accepts our list of files (rpm requires paths in %files section start with '/'
56 lines
1.1 KiB
Plaintext
56 lines
1.1 KiB
Plaintext
Name: <%= @name %>
|
|
Version: <%= @version %>
|
|
Release: <%= @iteration %>
|
|
Summary: <%= @summary %>
|
|
|
|
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
|