]>
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 |
fca7be54 | 7 | Version: 0.11.3 |
b4f912cc | 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 |
fca7be54 | 12 | # Source0-md5: 5d81c9a3a9849f905819781fb61f86aa |
7d625e4e | 13 | Source2: pld.spec.erb |
f51775da | 14 | Patch0: gems.patch |
e2fce429 | 15 | Patch1: os-release-quotes.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 | 20 | %if %{with tests} |
7cb22ffb | 21 | BuildRequires: ruby-rake |
749a1624 ER |
22 | %if %(locale -a | grep -q '^en_US$'; echo $?) |
23 | BuildRequires: glibc-localedb-all | |
24 | %endif | |
25 | %endif | |
e2fce429 | 26 | Requires: pld-release |
624d0b83 | 27 | Requires: ruby-rubygems |
f0d3c1e6 ER |
28 | BuildArch: noarch |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | Generate source rpms and rpm spec files from a Ruby Gem. The spec file | |
33 | tries to follow the gem as closely as possible, and be compliant with | |
34 | the Fedora rubygem packaging guidelines | |
35 | ||
36 | %package doc | |
37 | Summary: Documentation for %{name} | |
38 | Group: Documentation | |
39 | Requires: %{name} = %{version}-%{release} | |
40 | ||
41 | %description doc | |
42 | Documentation for %{name}. | |
43 | ||
44 | %prep | |
e8e50a98 | 45 | %setup -q |
b59b10ce | 46 | %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/* |
f51775da | 47 | %patch0 -p1 |
e2fce429 | 48 | %patch1 -p1 |
bf1dd385 | 49 | %patch2 -p1 |
7d625e4e | 50 | cp -p %{SOURCE2} templates |
f0d3c1e6 | 51 | |
b59b10ce ER |
52 | # cleanup backups after patching |
53 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
b978c369 | 54 | |
f0d3c1e6 ER |
55 | %build |
56 | %if %{with tests} | |
749a1624 ER |
57 | # tests need UTF-8 locale |
58 | LC_ALL=en_US.UTF-8 \ | |
7cb22ffb | 59 | rake test |
f0d3c1e6 ER |
60 | %endif |
61 | ||
62 | %install | |
63 | rm -rf $RPM_BUILD_ROOT | |
575f7dc5 | 64 | install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{_bindir}} |
f0d3c1e6 ER |
65 | |
66 | cp -a bin/* $RPM_BUILD_ROOT%{_bindir} | |
575f7dc5 | 67 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir} |
f0d3c1e6 | 68 | |
c2e552c8 ER |
69 | install -d $RPM_BUILD_ROOT%{_datadir}/ruby/templates |
70 | cp -a templates/* $RPM_BUILD_ROOT%{_datadir}/ruby/templates | |
71 | ||
f0d3c1e6 ER |
72 | %clean |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | ||
75 | %files | |
76 | %defattr(644,root,root,755) | |
b4f912cc | 77 | %doc README.md AUTHORS |
f0d3c1e6 | 78 | %attr(755,root,root) %{_bindir}/gem2rpm |
575f7dc5 ER |
79 | %{ruby_vendorlibdir}/gem2rpm.rb |
80 | %{ruby_vendorlibdir}/gem2rpm | |
c2e552c8 | 81 | %{_datadir}/ruby/templates |