]>
Commit | Line | Data |
---|---|---|
749a1624 ER |
1 | # |
2 | # Conditional build: | |
48ec4e40 | 3 | %bcond_with tests # tests require networking |
749a1624 | 4 | |
f0d3c1e6 | 5 | Summary: Generate rpm specfiles from gems |
e8e50a98 | 6 | Name: gem2rpm |
b59b10ce ER |
7 | Version: 0.10.1 |
8 | Release: 1 | |
f0d3c1e6 ER |
9 | License: GPL v2+ |
10 | Group: Development/Languages | |
26fbd092 | 11 | Source0: https://github.com/fedora-ruby/gem2rpm/archive/v%{version}/%{name}-%{version}.tar.gz |
b59b10ce | 12 | # Source0-md5: a22be828b4aeff0387a735daae969c5c |
7d625e4e | 13 | Source2: pld.spec.erb |
f51775da | 14 | Patch0: gems.patch |
7d625e4e | 15 | Patch1: pld.patch |
bf1dd385 | 16 | Patch2: style.patch |
26fbd092 | 17 | URL: https://github.com/fedora-ruby/gem2rpm |
e8e50a98 ER |
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 | |
624d0b83 | 25 | Requires: ruby-rubygems |
f0d3c1e6 ER |
26 | BuildArch: noarch |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
28 | ||
29 | %description | |
30 | Generate source rpms and rpm spec files from a Ruby Gem. The spec file | |
31 | tries to follow the gem as closely as possible, and be compliant with | |
32 | the Fedora rubygem packaging guidelines | |
33 | ||
34 | %package doc | |
35 | Summary: Documentation for %{name} | |
36 | Group: Documentation | |
37 | Requires: %{name} = %{version}-%{release} | |
38 | ||
39 | %description doc | |
40 | Documentation for %{name}. | |
41 | ||
42 | %prep | |
e8e50a98 | 43 | %setup -q |
b59b10ce | 44 | %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/* |
f51775da | 45 | %patch0 -p1 |
7d625e4e | 46 | %patch1 -p1 |
bf1dd385 | 47 | %patch2 -p1 |
7d625e4e | 48 | cp -p %{SOURCE2} templates |
f0d3c1e6 | 49 | |
b59b10ce ER |
50 | # cleanup backups after patching |
51 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
b978c369 | 52 | |
f0d3c1e6 ER |
53 | %build |
54 | %if %{with tests} | |
749a1624 ER |
55 | # tests need UTF-8 locale |
56 | LC_ALL=en_US.UTF-8 \ | |
f0d3c1e6 ER |
57 | testrb -Itest test/ |
58 | %endif | |
59 | ||
60 | %install | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | install -d $RPM_BUILD_ROOT{%{ruby_rubylibdir},%{_bindir}} | |
63 | ||
64 | cp -a bin/* $RPM_BUILD_ROOT%{_bindir} | |
65 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_rubylibdir} | |
66 | ||
c2e552c8 ER |
67 | install -d $RPM_BUILD_ROOT%{_datadir}/ruby/templates |
68 | cp -a templates/* $RPM_BUILD_ROOT%{_datadir}/ruby/templates | |
69 | ||
f0d3c1e6 ER |
70 | %clean |
71 | rm -rf $RPM_BUILD_ROOT | |
72 | ||
73 | %files | |
74 | %defattr(644,root,root,755) | |
75 | %doc README AUTHORS | |
76 | %attr(755,root,root) %{_bindir}/gem2rpm | |
77 | %{ruby_rubylibdir}/gem2rpm.rb | |
78 | %{ruby_rubylibdir}/gem2rpm | |
c2e552c8 | 79 | %{_datadir}/ruby/templates |