]> git.pld-linux.org Git - packages/gem2rpm.git/blobdiff - pld.spec.erb
add tests bcond if spec.development_dependencies present
[packages/gem2rpm.git] / pld.spec.erb
index 19dcb79363462a0cd57e9a64adea944993aa704d..4f4b720012749a302d13f87c8642f73ad4babff4 100644 (file)
@@ -1,20 +1,44 @@
+<% if ! spec.development_dependencies.empty? -%>
+#
+# Conditional build:
+%bcond_without tests           # build without tests
+
+<% end -%>
 %define        pkgname <%= spec.name %>
 Summary:       <%= spec.summary %>
 Name:          ruby-%{pkgname}
 Version:       <%= spec.version %>
 Release:       0.1
-License:       Distributable
+License:       <%= spec.licenses.empty? ? "GPL v2+ or Ruby" : spec.licenses.join(", ") %>
 Group:         Development/Languages
 Source0:       http://rubygems.org/downloads/%{pkgname}-%{version}.gem
 # Source0-md5: -
 URL:           <%= spec.homepage %>
 BuildRequires: rpm-rubyprov
 BuildRequires: rpmbuild(macros) >= 1.656
-<% for d in spec.dependencies -%>
+<% if ! spec.extensions.empty? -%>
+BuildRequires: ruby-devel
+<% end -%>
+<% 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)
 
@@ -23,6 +47,9 @@ BuildRoot:    %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %prep
 %setup -q -n %{pkgname}-%{version}
+<% if ! spec.executables.empty? -%>
+%{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
+<% end -%>
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -37,7 +64,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %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
This page took 0.059461 seconds and 4 git commands to generate.