]>
Commit | Line | Data |
---|---|---|
aed41730 ER |
1 | %define pkgname <%= spec.name %> |
2 | Summary: <%= spec.summary %> | |
3 | Name: ruby-%{pkgname} | |
4 | Version: <%= spec.version %> | |
5 | Release: 0.1 | |
a0c08b44 | 6 | License: <%= spec.licenses.empty? ? "GPL v2+ or Ruby" : spec.licenses.join(", ") %> |
aed41730 ER |
7 | Group: Development/Languages |
8 | Source0: http://rubygems.org/downloads/%{pkgname}-%{version}.gem | |
9 | # Source0-md5: - | |
10 | URL: <%= spec.homepage %> | |
11 | BuildRequires: rpm-rubyprov | |
12 | BuildRequires: rpmbuild(macros) >= 1.656 | |
a0c08b44 ER |
13 | <% if ! spec.extensions.empty? -%> |
14 | BuildRequires: ruby-devel | |
15 | <% end -%> | |
b978c369 ER |
16 | <% if ! spec.executables.empty? -%> |
17 | BuildRequires: sed >= 4.0 | |
18 | <% end -%> | |
a0c08b44 | 19 | <% for d in spec.runtime_dependencies -%> |
7d625e4e | 20 | <% for req in d.requirement -%> |
aed41730 | 21 | Requires: ruby-<%= d.name %> <%= req %> |
7d625e4e ER |
22 | <% end -%> |
23 | <% end -%> | |
aed41730 ER |
24 | BuildArch: noarch |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
7d625e4e ER |
26 | |
27 | %description | |
28 | <%= spec.description %> | |
29 | ||
30 | %prep | |
aed41730 | 31 | %setup -q -n %{pkgname}-%{version} |
b978c369 ER |
32 | <% if ! spec.executables.empty? -%> |
33 | %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/* | |
34 | <% end -%> | |
7d625e4e ER |
35 | |
36 | %install | |
aed41730 ER |
37 | rm -rf $RPM_BUILD_ROOT |
38 | install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{_bindir}} | |
39 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir} | |
7d625e4e | 40 | <% if ! spec.executables.empty? -%> |
aed41730 | 41 | cp -a bin/* $RPM_BUILD_ROOT%{_bindir} |
7d625e4e ER |
42 | <% end -%> |
43 | ||
44 | %clean | |
aed41730 | 45 | rm -rf $RPM_BUILD_ROOT |
7d625e4e ER |
46 | |
47 | %files | |
aed41730 | 48 | %defattr(644,root,root,755) |
7d625e4e | 49 | <% for f in spec.executables -%> |
aed41730 | 50 | %attr(755,root,root) %{_bindir}/<%= f %> |
7d625e4e | 51 | <% end -%> |
aed41730 ER |
52 | %{ruby_vendorlibdir}/%{pkgname}.rb |
53 | %{ruby_vendorlibdir}/%{pkgname} |