]>
Commit | Line | Data |
---|---|---|
749a1624 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | ||
f0d3c1e6 | 5 | Summary: Generate rpm specfiles from gems |
e8e50a98 | 6 | Name: gem2rpm |
a0c08b44 | 7 | Version: 0.9.2 |
449a20af | 8 | Release: 2 |
f0d3c1e6 ER |
9 | License: GPL v2+ |
10 | Group: Development/Languages | |
749a1624 ER |
11 | Source0: https://github.com/lutter/gem2rpm/archive/v%{version}.tar.gz |
12 | # Source0-md5: 133c4cae2e26c24a5db0453e2cbe2a72 | |
7d625e4e | 13 | Source2: pld.spec.erb |
f51775da | 14 | Patch0: gems.patch |
7d625e4e | 15 | Patch1: pld.patch |
bf1dd385 | 16 | Patch2: style.patch |
e8e50a98 ER |
17 | URL: https://github.com/lutter/gem2rpm/ |
18 | BuildRequires: rpm-rubyprov | |
19 | BuildRequires: rpmbuild(macros) >= 1.656 | |
749a1624 ER |
20 | %if %{with tests} |
21 | %if %(locale -a | grep -q '^en_US$'; echo $?) | |
22 | BuildRequires: glibc-localedb-all | |
23 | %endif | |
24 | %endif | |
f0d3c1e6 ER |
25 | BuildArch: noarch |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
27 | ||
28 | %description | |
29 | Generate source rpms and rpm spec files from a Ruby Gem. The spec file | |
30 | tries to follow the gem as closely as possible, and be compliant with | |
31 | the Fedora rubygem packaging guidelines | |
32 | ||
33 | %package doc | |
34 | Summary: Documentation for %{name} | |
35 | Group: Documentation | |
36 | Requires: %{name} = %{version}-%{release} | |
37 | ||
38 | %description doc | |
39 | Documentation for %{name}. | |
40 | ||
41 | %prep | |
e8e50a98 | 42 | %setup -q |
f51775da | 43 | %patch0 -p1 |
7d625e4e | 44 | %patch1 -p1 |
bf1dd385 | 45 | %patch2 -p1 |
7d625e4e | 46 | cp -p %{SOURCE2} templates |
f0d3c1e6 | 47 | |
b978c369 ER |
48 | %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/* |
49 | ||
f0d3c1e6 ER |
50 | %build |
51 | %if %{with tests} | |
749a1624 ER |
52 | # tests need UTF-8 locale |
53 | LC_ALL=en_US.UTF-8 \ | |
f0d3c1e6 ER |
54 | testrb -Itest test/ |
55 | %endif | |
56 | ||
57 | %install | |
58 | rm -rf $RPM_BUILD_ROOT | |
59 | install -d $RPM_BUILD_ROOT{%{ruby_rubylibdir},%{_bindir}} | |
60 | ||
61 | cp -a bin/* $RPM_BUILD_ROOT%{_bindir} | |
62 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_rubylibdir} | |
63 | ||
c2e552c8 ER |
64 | install -d $RPM_BUILD_ROOT%{_datadir}/ruby/templates |
65 | cp -a templates/* $RPM_BUILD_ROOT%{_datadir}/ruby/templates | |
66 | ||
f0d3c1e6 ER |
67 | %clean |
68 | rm -rf $RPM_BUILD_ROOT | |
69 | ||
70 | %files | |
71 | %defattr(644,root,root,755) | |
72 | %doc README AUTHORS | |
73 | %attr(755,root,root) %{_bindir}/gem2rpm | |
74 | %{ruby_rubylibdir}/gem2rpm.rb | |
75 | %{ruby_rubylibdir}/gem2rpm | |
c2e552c8 | 76 | %{_datadir}/ruby/templates |