]>
Commit | Line | Data |
---|---|---|
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.sort -%> | |
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.sort -%> | |
36 | <% for req in d.requirement -%> | |
37 | Requires: ruby-<%= d.name %> <%= req %> | |
38 | <% end -%> | |
39 | <% end -%> | |
40 | %endif | |
41 | <% end -%> | |
42 | <% if spec.extensions.empty? -%> | |
43 | BuildArch: noarch | |
44 | <% end -%> | |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
46 | ||
47 | %description | |
48 | <%= spec.description %> | |
49 | ||
50 | %prep | |
51 | %setup -q -n %{pkgname}-%{version} | |
52 | <% if ! spec.executables.empty? -%> | |
53 | %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/* | |
54 | <% end -%> | |
55 | ||
56 | %install | |
57 | rm -rf $RPM_BUILD_ROOT | |
58 | install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{_bindir}} | |
59 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir} | |
60 | <% if ! spec.executables.empty? -%> | |
61 | cp -a bin/* $RPM_BUILD_ROOT%{_bindir} | |
62 | <% end -%> | |
63 | ||
64 | %clean | |
65 | rm -rf $RPM_BUILD_ROOT | |
66 | ||
67 | %files | |
68 | %defattr(644,root,root,755) | |
69 | <% for f in spec.executables.sort -%> | |
70 | %attr(755,root,root) %{_bindir}/<%= f %> | |
71 | <% end -%> | |
72 | %{ruby_vendorlibdir}/%{pkgname}.rb | |
73 | %{ruby_vendorlibdir}/%{pkgname} |