def Gem2Rpm.convert(fname, template=TEMPLATE, out=$stdout,
nongem=true, local=false, doc_subpackage = true)
package = Gem2Rpm::Package.new(fname)
format = Gem2Rpm::Format.new(package)
spec = Gem2Rpm::Specification.new(package.spec)
spec.description ||= spec.summary
download_path = ""
unless local
begin
download_path = find_download_url(spec.name, spec.version)
rescue DownloadUrlError => e
$stderr.puts "Warning: Could not retrieve full URL for #{spec.name}\nWarning: Edit the specfile and enter the full download URL as 'Source0' manually"
$stderr.puts e.inspect
end
end
template = ERB.new(template, 0, '-')
out.puts template.result(binding)
rescue Gem::Exception => e
puts e
end