Module Gem2Rpm
In: lib/gem2rpm5.rb

Methods

Constants

VERSION = "0.6.4"
TEMPLATE = %q{# Generated from <%= File::basename(format.gem_path) %> by gem2rpm5 -*- rpm-spec -*- %define rbname <%= spec.name %> Summary: <%= spec.summary.gsub(/\.$/, "") %> Name: rubygem-%{rbname} Version: <%= spec.version %> Release: 1 Group: Development/Ruby License: GPLv2+ or Ruby URL: <%= spec.homepage %> Source0: <%= download_path %>%{rbname}-%{version}.gem BuildRequires: rubygems <% if spec.required_rubygems_version %><%= spec.required_rubygems_version.to_rpm %><% end %> <% if spec.extensions.empty? %> BuildArch: noarch <% else %> BuildRequires: ruby-devel BuildRequires: rubygem(rake) <% end %> %description <%= spec.description.to_s.chomp.word_wrap(78) + "\n" %> %package doc Summary: Documentation for %{name} Group: Books/Computer books Requires: %{name} = %{EVRD} <% if spec.extensions %> BuildArch: noarch <% end %> %description doc Documents<% if spec.has_rdoc %>, RDoc <% end %>& RI documentation for %{name}. %prep %setup -q %build %gem_build %install rm -rf %{buildroot} %gem_install %clean rm -rf %{buildroot} %files <% for f in spec.executables.sort %> %{_bindir}/<%= f %> <% end %> <% directories = [] %> <% suffixes = [] %> <% docfiles = [] %> <% format.file_entries.each do |entry, data| %> <% path = entry['path'] %> <% dir = File.dirname(path) %> <% dir = (dir == "." ? "" : "/"+dir) %> <% unless directories.index(dir) %> <% directories.push(dir) %> <% end %> <% suffix = "%s/%s" % [dir, File.basename(path).gsub(/.*\./, "*.")] %> <% if spec.extra_rdoc_files.include?(path) %> <% unless docfiles.index(suffix) %> <% docfiles.push(suffix) %> <% end %> <% elsif !suffixes.index(suffix) %> <% suffixes.push(suffix) %> <% end %> <% end %> <% for d in directories.sort %> %dir %{ruby_gemdir}/gems/%{rbname}-%{version}<%= d %> <% for s in suffixes.sort %> <% if s[0..s.rindex("/")-1] == d %> %{ruby_gemdir}/gems/%{rbname}-%{version}<%= s %> <% end %> <% end %> <% end %> %{ruby_gemdir}/specifications/%{rbname}-%{version}.gemspec %files doc <% for d in docfiles.sort %> %doc %{ruby_gemdir}/gems/%{rbname}-%{version}<%= d %> <% end %><% if spec.has_rdoc %> %doc %{ruby_gemdir}/doc/%{rbname}-%{version} <% end %> %changelog * <%= Time.now.strftime("%a %b %d %Y") %> <%= packager %> <%= spec.version %>-1 - Initial package }

Public Class methods

Returns the email address of the packager (i.e., the person running gem2spec). Taken from RPM macros if present, constructed from system username and hostname otherwise.

[Validate]