1 %define pkgname <%= spec.name %>
2 Summary: <%= spec.summary %>
4 Version: <%= spec.version %>
6 License: <%= spec.licenses.empty? ? "GPL v2+ or Ruby" : spec.licenses.join(", ") %>
7 Group: Development/Languages
8 Source0: http://rubygems.org/downloads/%{pkgname}-%{version}.gem
10 URL: <%= spec.homepage %>
11 BuildRequires: rpm-rubyprov
12 BuildRequires: rpmbuild(macros) >= 1.656
13 <% if ! spec.extensions.empty? -%>
14 BuildRequires: ruby-devel
16 <% if ! spec.executables.empty? -%>
17 BuildRequires: sed >= 4.0
19 <% for d in spec.runtime_dependencies -%>
20 <% for req in d.requirement -%>
21 Requires: ruby-<%= d.name %> <%= req %>
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28 <%= spec.description %>
31 %setup -q -n %{pkgname}-%{version}
32 <% if ! spec.executables.empty? -%>
33 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
37 rm -rf $RPM_BUILD_ROOT
38 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{_bindir}}
39 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
40 <% if ! spec.executables.empty? -%>
41 cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
45 rm -rf $RPM_BUILD_ROOT
48 %defattr(644,root,root,755)
49 <% for f in spec.executables -%>
50 %attr(755,root,root) %{_bindir}/<%= f %>
52 %{ruby_vendorlibdir}/%{pkgname}.rb
53 %{ruby_vendorlibdir}/%{pkgname}