lib/gem2rpm.rb in gem2rpm-0.5.1 vs lib/gem2rpm.rb in gem2rpm-0.5.2
- old
+ new
@@ -24,11 +24,11 @@
end
end
end
module Gem2Rpm
- Gem2Rpm::VERSION = "0.5.1"
+ Gem2Rpm::VERSION = "0.5.2"
def Gem2Rpm.convert(fname, template=TEMPLATE, out=$stdout,
nongem=true, local=false)
format = Gem::Format.from_file_by_path(fname)
spec = format.spec
@@ -64,18 +64,17 @@
%define gemname <%= spec.name %>
%define geminstdir %{gemdir}/gems/%{gemname}-%{version}
Summary: <%= spec.summary.gsub(/\.$/, "") %>
Name: rubygem-%{gemname}
-
Version: <%= spec.version %>
Release: 1%{?dist}
Group: Development/Languages
-License: Ruby License/GPL
+License: GPLv2+ or Ruby
URL: <%= spec.homepage %>
Source0: <%= download_path %>%{gemname}-%{version}.gem
-BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: rubygems
<% for d in spec.dependencies %>
Requires: rubygem(<%= d.name %>) <%= d.version_requirements.to_rpm %>
<% end %>
BuildRequires: rubygems
@@ -102,14 +101,15 @@
%prep
%build
%install
-%{__rm} -rf %{buildroot}
+rm -rf %{buildroot}
mkdir -p %{buildroot}%{gemdir}
<% rdoc_opt = spec.has_rdoc ? "--rdoc " : "" %>
-gem install --local --install-dir %{buildroot}%{gemdir} --force <%= rdoc_opt %>%{SOURCE0}
+gem install --local --install-dir %{buildroot}%{gemdir} \
+ --force <%= rdoc_opt %>%{SOURCE0}
<% unless spec.executables.empty? %>
mkdir -p %{buildroot}/%{_bindir}
mv %{buildroot}%{gemdir}/bin/* %{buildroot}/%{_bindir}
rmdir %{buildroot}%{gemdir}/bin
find %{buildroot}%{geminstdir}/bin -type f | xargs chmod a+x
@@ -120,14 +120,14 @@
ln -s %{gemdir}/gems/%{gemname}-%{version}/<%= p %> %{buildroot}%{ruby_sitelib}
<% end %>
<% end # if nongem %>
%clean
-%{__rm} -rf %{buildroot}
+rm -rf %{buildroot}
%files
-%defattr(-, root, root)
+%defattr(-, root, root, -)
<% for f in spec.executables %>
%{_bindir}/<%= f %>
<% end %>
%{gemdir}/gems/%{gemname}-%{version}/
<% if spec.has_rdoc %>
@@ -139,9 +139,10 @@
%{gemdir}/cache/%{gemname}-%{version}.gem
%{gemdir}/specifications/%{gemname}-%{version}.gemspec
<% if nongem %>
%files -n ruby-%{gemname}
+%defattr(-, root, root, -)
%{ruby_sitelib}/*
<% end # if nongem %>
%changelog
* <%= Time.now.strftime("%a %b %d %Y") %> <%= packager %> - <%= spec.version %>-1