1
0
mirror of https://github.com/jordansissel/fpm synced 2025-08-26 03:34:35 +02:00
fpm/templates/rpm.erb
Pieter Loubser 7de1dfe354 - Added license meta data to packages
- Added vendor meta data to packages
2012-02-18 16:43:15 +00:00

87 lines
2.0 KiB
Plaintext

%define __jar_repack 0
Name: <%= name %>
Version: <%= version %>
<% if epoch -%>
Epoch: <%= epoch %>
<% end -%>
Release: <%= iteration or 1 %>
<%# use the first line of the description as the summary -%>
Summary: <%= description.split("\n").first.empty? ? "_" : description.split("\n").first %>
BuildArch: <%= architecture %>
AutoReqProv: no
Group: <%= category %>
<%#
TODO: [Jay] rpms require a license
let's detect it intelligently
-%>
License: <%= license %>
Vendor: <%= vendor %>
URL: <%= url or "http://nourlgiven.example.com/" %>
<% if !maintainer.empty? -%>
Packager: <%= maintainer %>
<% end -%>
Source0: %{_sourcedir}/data.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
<% if !dependencies.empty? -%>
<%
properdeps = dependencies.collect { |d| fix_dependency(d) }
-%>Requires: <%= properdeps.join(", ") %>
<% end -%>
<% provides.each do |prov| -%>
Provides: <%= prov %>
<% end -%>
<% replaces.each do |repl| -%>
<%# The closes equivalent in RPM to "replaces" is "Obsoletes" -%>
Obsoletes: <%= repl %>
<% end -%>
<%# rpm rejects descriptions with blank lines (even between content), so hack
around it by replacing blank lines with ' .' -%>
%description
<%= description.gsub(/^\s*$/, " .") %>
%prep
# noop
%build
# noop
%install
# some rpm implementations delete the build dir and then recreate it by
# default, for some reason. Whatever, let's work around it.
cd $RPM_BUILD_ROOT
tar -zxf %SOURCE0
%clean
rm -rf $RPM_BUILD_ROOT
<% if scripts["pre-install"] -%>
%pre
<%= File.read(scripts["pre-install"]) %>
<% end -%>
<% if scripts["post-install"] -%>
%post
<%= File.read(scripts["post-install"]) %>
<% end -%>
<% if scripts["pre-uninstall"] -%>
%preun
<%= File.read(scripts["pre-uninstall"]) %>
<% end -%>
<% if scripts["post-uninstall"] -%>
%postun
<%= File.read(scripts["post-uninstall"]) %>
<% end -%>
%files
%defattr(-,root,root,-)
<%# Output config files and then regular files. -%>
<%= @config_files.collect { |c| '%config ' + c }.join("\n") %>
<%= paths.join("\n") %>
%changelog