1 <% if ! spec.development_dependencies.empty? -%>
4 %bcond_without tests # build without tests
7 %define pkgname <%= spec.name %>
8 Summary: <%= spec.summary %>
10 Version: <%= spec.version %>
12 License: <%= spec.licenses.empty? ? "GPL v2+ or Ruby" : spec.licenses.join(", ") %>
13 Group: Development/Languages
14 Source0: http://rubygems.org/downloads/%{pkgname}-%{version}.gem
16 URL: <%= spec.homepage %>
17 BuildRequires: rpm-rubyprov
18 BuildRequires: rpmbuild(macros) >= 1.656
19 <% if ! spec.extensions.empty? -%>
20 BuildRequires: ruby-devel
22 <% if ! spec.executables.empty? -%>
23 BuildRequires: sed >= 4.0
25 <% if ! spec.required_rubygems_version.empty? and ! spec.required_rubygems_version.first.empty? -%>
26 Requires: ruby-rubygems <%= spec.required_rubygems_version.first %>
28 <% for d in spec.runtime_dependencies -%>
29 <% for req in d.requirement -%>
30 Requires: ruby-<%= d.name %> <%= req %>
33 <% if ! spec.development_dependencies.empty? -%>
35 <% for d in spec.development_dependencies -%>
36 <% for req in d.requirement -%>
37 Requires: ruby-<%= d.name %> <%= req %>
43 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 <%= spec.description %>
49 %setup -q -n %{pkgname}-%{version}
50 <% if ! spec.executables.empty? -%>
51 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
55 rm -rf $RPM_BUILD_ROOT
56 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{_bindir}}
57 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
58 <% if ! spec.executables.empty? -%>
59 cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
63 rm -rf $RPM_BUILD_ROOT
66 %defattr(644,root,root,755)
67 <% for f in spec.executables.sort -%>
68 %attr(755,root,root) %{_bindir}/<%= f %>
70 %{ruby_vendorlibdir}/%{pkgname}.rb
71 %{ruby_vendorlibdir}/%{pkgname}