]>
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 -%> | |
891ab30e ER |
25 | <% if ! spec.development_dependencies.empty? -%> |
26 | %if %{with tests} | |
5c65f0d7 | 27 | <% for d in spec.development_dependencies.sort -%> |
891ab30e | 28 | <% for req in d.requirement -%> |
2d0bd773 | 29 | BuildRequires: ruby-<%= d.name %> <%= req %> |
891ab30e ER |
30 | <% end -%> |
31 | <% end -%> | |
32 | %endif | |
33 | <% end -%> | |
2d0bd773 ER |
34 | <% if ! spec.required_rubygems_version.empty? and ! spec.required_rubygems_version.first.empty? -%> |
35 | Requires: ruby-rubygems <%= spec.required_rubygems_version.first %> | |
36 | <% end -%> | |
37 | <% for d in spec.runtime_dependencies.sort -%> | |
38 | <% for req in d.requirement -%> | |
39 | Requires: ruby-<%= d.name %> <%= req %> | |
40 | <% end -%> | |
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 | 55 | |
ce19db2c ER |
56 | %build |
57 | # write .gemspec | |
58 | %__gem_helper spec | |
59 | ||
b4f912cc ER |
60 | <% if !spec.extensions.empty? -%> |
61 | cd ext/%{pkgname} | |
62 | %{__ruby} extconf.rb | |
63 | %{__make} \ | |
64 | CC="%{__cc}" \ | |
65 | LDFLAGS="%{rpmldflags}" \ | |
66 | CFLAGS="%{rpmcflags} -fPIC" | |
67 | <% end -%> | |
68 | ||
7d625e4e | 69 | %install |
aed41730 | 70 | rm -rf $RPM_BUILD_ROOT |
0340da3d | 71 | <% if spec.executables.empty? -%> |
ce19db2c | 72 | install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir}} |
0340da3d | 73 | <% else -%> |
ce19db2c | 74 | install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{_bindir}} |
0340da3d | 75 | <% end -%> |
aed41730 | 76 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir} |
7d625e4e | 77 | <% if ! spec.executables.empty? -%> |
aed41730 | 78 | cp -a bin/* $RPM_BUILD_ROOT%{_bindir} |
7d625e4e | 79 | <% end -%> |
ce19db2c | 80 | cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir} |
7d625e4e ER |
81 | |
82 | %clean | |
aed41730 | 83 | rm -rf $RPM_BUILD_ROOT |
7d625e4e ER |
84 | |
85 | %files | |
aed41730 | 86 | %defattr(644,root,root,755) |
967420bc | 87 | <% for f in spec.executables.sort -%> |
aed41730 | 88 | %attr(755,root,root) %{_bindir}/<%= f %> |
7d625e4e | 89 | <% end -%> |
aed41730 ER |
90 | %{ruby_vendorlibdir}/%{pkgname}.rb |
91 | %{ruby_vendorlibdir}/%{pkgname} | |
ce19db2c | 92 | %{ruby_specdir}/%{pkgname}-%{version}.gemspec |