1
0
mirror of https://github.com/jordansissel/fpm synced 2025-09-04 08:54:39 +02:00
fpm/templates/rpm.erb
Jordan Sissel ce1cb5e0a7 - Fix gem tar building to include only the gem install dir
- 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 '/'
2011-01-22 00:55:53 -08:00

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