]>
Commit | Line | Data |
---|---|---|
f0d3c1e6 ER |
1 | %define module gem2rpm |
2 | Summary: Generate rpm specfiles from gems | |
3 | Name: ruby-%{module} | |
4 | Version: 0.8.1 | |
5 | Release: 1 | |
6 | License: GPL v2+ | |
7 | Group: Development/Languages | |
8 | URL: https://github.com/lutter/gem2rpm/ | |
9 | Source0: http://rubygems.org/gems/%{module}-%{version}.gem | |
10 | # Source0-md5: d3c9416f225ae944fd195e69e122d46e | |
11 | # git clone https://github.com/lutter/gem2rpm.git && cd gem2rpm && git checkout v0.8.1 | |
12 | # tar czvf gem2rpm-0.8.1-tests.tgz test/ | |
13 | Source1: %{module}-%{version}-tests.tgz | |
14 | # Source1-md5: d7d8bc231dc405bbce00f570c89f530e | |
15 | BuildRequires: ruby | |
16 | Requires: ruby | |
17 | BuildArch: noarch | |
18 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
19 | ||
20 | %description | |
21 | Generate source rpms and rpm spec files from a Ruby Gem. The spec file | |
22 | tries to follow the gem as closely as possible, and be compliant with | |
23 | the Fedora rubygem packaging guidelines | |
24 | ||
25 | %package doc | |
26 | Summary: Documentation for %{name} | |
27 | Group: Documentation | |
28 | Requires: %{name} = %{version}-%{release} | |
29 | ||
30 | %description doc | |
31 | Documentation for %{name}. | |
32 | ||
33 | %prep | |
34 | %setup -qc | |
35 | %{__tar} xf %{SOURCE0} -O data.tar.gz | %{__tar} xz | |
36 | find -newer README -o -print | xargs touch --reference %{SOURCE0} | |
37 | ||
38 | %build | |
39 | %if %{with tests} | |
40 | testrb -Itest test/ | |
41 | %endif | |
42 | ||
43 | %install | |
44 | rm -rf $RPM_BUILD_ROOT | |
45 | install -d $RPM_BUILD_ROOT{%{ruby_rubylibdir},%{_bindir}} | |
46 | ||
47 | cp -a bin/* $RPM_BUILD_ROOT%{_bindir} | |
48 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_rubylibdir} | |
49 | ||
50 | %clean | |
51 | rm -rf $RPM_BUILD_ROOT | |
52 | ||
53 | %files | |
54 | %defattr(644,root,root,755) | |
55 | %doc README AUTHORS | |
56 | %attr(755,root,root) %{_bindir}/gem2rpm | |
57 | %{ruby_rubylibdir}/gem2rpm.rb | |
58 | %{ruby_rubylibdir}/gem2rpm | |
59 | ||
60 | %if 0 | |
61 | %files doc | |
62 | %defattr(644,root,root,755) | |
63 | %doc %{gem_docdir} | |
64 | %doc %{gem_instdir}/README | |
65 | %doc %{gem_instdir}/AUTHORS | |
66 | %endif |