add tests bcond if spec.development_dependencies present
[packages/gem2rpm.git] / pld.spec.erb
1 <% if ! spec.development_dependencies.empty? -%>
2 #
3 # Conditional build:
4 %bcond_without  tests           # build without tests
5
6 <% end -%>
7 %define pkgname <%= spec.name %>
8 Summary:        <%= spec.summary %>
9 Name:           ruby-%{pkgname}
10 Version:        <%= spec.version %>
11 Release:        0.1
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
15 # Source0-md5:  -
16 URL:            <%= spec.homepage %>
17 BuildRequires:  rpm-rubyprov
18 BuildRequires:  rpmbuild(macros) >= 1.656
19 <% if ! spec.extensions.empty? -%>
20 BuildRequires:  ruby-devel
21 <% end -%>
22 <% if ! spec.executables.empty? -%>
23 BuildRequires:  sed >= 4.0
24 <% end -%>
25 <% if ! spec.required_rubygems_version.empty? and ! spec.required_rubygems_version.first.empty? -%>
26 Requires:       ruby-rubygems <%= spec.required_rubygems_version.first %>
27 <% end -%>
28 <% for d in spec.runtime_dependencies -%>
29 <% for req in d.requirement -%>
30 Requires:       ruby-<%= d.name %> <%= req %>
31 <% end -%>
32 <% end -%>
33 <% if ! spec.development_dependencies.empty? -%>
34 %if %{with tests}
35 <% for d in spec.development_dependencies -%>
36 <% for req in d.requirement -%>
37 Requires:       ruby-<%= d.name %> <%= req %>
38 <% end -%>
39 <% end -%>
40 %endif
41 <% end -%>
42 BuildArch:      noarch
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %description
46 <%= spec.description %>
47
48 %prep
49 %setup -q -n %{pkgname}-%{version}
50 <% if ! spec.executables.empty? -%>
51 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
52 <% end -%>
53
54 %install
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}
60 <% end -%>
61
62 %clean
63 rm -rf $RPM_BUILD_ROOT
64
65 %files
66 %defattr(644,root,root,755)
67 <% for f in spec.executables.sort -%>
68 %attr(755,root,root) %{_bindir}/<%= f %>
69 <% end -%>
70 %{ruby_vendorlibdir}/%{pkgname}.rb
71 %{ruby_vendorlibdir}/%{pkgname}
This page took 0.249127 seconds and 3 git commands to generate.