+<% if ! spec.development_dependencies.empty? -%>
+#
+# Conditional build:
+%bcond_without tests # build without tests
+
+<% end -%>
%define pkgname <%= spec.name %>
Summary: <%= spec.summary %>
Name: ruby-%{pkgname}
<% if ! spec.executables.empty? -%>
BuildRequires: sed >= 4.0
<% end -%>
+<% if ! spec.required_rubygems_version.empty? and ! spec.required_rubygems_version.first.empty? -%>
+Requires: ruby-rubygems <%= spec.required_rubygems_version.first %>
+<% end -%>
<% for d in spec.runtime_dependencies -%>
<% for req in d.requirement -%>
Requires: ruby-<%= d.name %> <%= req %>
<% end -%>
<% end -%>
+<% if ! spec.development_dependencies.empty? -%>
+%if %{with tests}
+<% for d in spec.development_dependencies -%>
+<% for req in d.requirement -%>
+Requires: ruby-<%= d.name %> <%= req %>
+<% end -%>
+<% end -%>
+%endif
+<% end -%>
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%files
%defattr(644,root,root,755)
-<% for f in spec.executables -%>
+<% for f in spec.executables.sort -%>
%attr(755,root,root) %{_bindir}/<%= f %>
<% end -%>
%{ruby_vendorlibdir}/%{pkgname}.rb