]>
Commit | Line | Data |
---|---|---|
891ab30e ER |
1 | <% if ! spec.development_dependencies.empty? -%> |
2 | # | |
3 | # Conditional build: | |
4 | %bcond_without tests # build without tests | |
5 | ||
6 | <% end -%> | |
aed41730 ER |
7 | %define pkgname <%= spec.name %> |
8 | Summary: <%= spec.summary %> | |
9 | Name: ruby-%{pkgname} | |
10 | Version: <%= spec.version %> | |
11 | Release: 0.1 | |
a0c08b44 | 12 | License: <%= spec.licenses.empty? ? "GPL v2+ or Ruby" : spec.licenses.join(", ") %> |
aed41730 ER |
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 | |
a0c08b44 ER |
19 | <% if ! spec.extensions.empty? -%> |
20 | BuildRequires: ruby-devel | |
21 | <% end -%> | |
b978c369 ER |
22 | <% if ! spec.executables.empty? -%> |
23 | BuildRequires: sed >= 4.0 | |
24 | <% end -%> | |
91b88370 ER |
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 -%> | |
5c65f0d7 | 28 | <% for d in spec.runtime_dependencies.sort -%> |
7d625e4e | 29 | <% for req in d.requirement -%> |
aed41730 | 30 | Requires: ruby-<%= d.name %> <%= req %> |
7d625e4e ER |
31 | <% end -%> |
32 | <% end -%> | |
891ab30e ER |
33 | <% if ! spec.development_dependencies.empty? -%> |
34 | %if %{with tests} | |
5c65f0d7 | 35 | <% for d in spec.development_dependencies.sort -%> |
891ab30e ER |
36 | <% for req in d.requirement -%> |
37 | Requires: ruby-<%= d.name %> <%= req %> | |
38 | <% end -%> | |
39 | <% end -%> | |
40 | %endif | |
41 | <% end -%> | |
132e6952 | 42 | <% if spec.extensions.empty? -%> |
aed41730 | 43 | BuildArch: noarch |
132e6952 | 44 | <% end -%> |
aed41730 | 45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
7d625e4e ER |
46 | |
47 | %description | |
48 | <%= spec.description %> | |
49 | ||
50 | %prep | |
aed41730 | 51 | %setup -q -n %{pkgname}-%{version} |
b978c369 ER |
52 | <% if ! spec.executables.empty? -%> |
53 | %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/* | |
54 | <% end -%> | |
7d625e4e ER |
55 | |
56 | %install | |
aed41730 ER |
57 | rm -rf $RPM_BUILD_ROOT |
58 | install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{_bindir}} | |
59 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir} | |
7d625e4e | 60 | <% if ! spec.executables.empty? -%> |
aed41730 | 61 | cp -a bin/* $RPM_BUILD_ROOT%{_bindir} |
7d625e4e ER |
62 | <% end -%> |
63 | ||
64 | %clean | |
aed41730 | 65 | rm -rf $RPM_BUILD_ROOT |
7d625e4e ER |
66 | |
67 | %files | |
aed41730 | 68 | %defattr(644,root,root,755) |
967420bc | 69 | <% for f in spec.executables.sort -%> |
aed41730 | 70 | %attr(755,root,root) %{_bindir}/<%= f %> |
7d625e4e | 71 | <% end -%> |
aed41730 ER |
72 | %{ruby_vendorlibdir}/%{pkgname}.rb |
73 | %{ruby_vendorlibdir}/%{pkgname} |