3 %bcond_with tests # tests require networking
5 Summary: Generate rpm specfiles from gems
10 Group: Development/Languages
11 Source0: https://github.com/fedora-ruby/gem2rpm/archive/v%{version}/%{name}-%{version}.tar.gz
12 # Source0-md5: b1b60ade93fd61c22c17cfe4b95c3609
15 Patch1: os-release-quotes.patch
17 URL: https://github.com/fedora-ruby/gem2rpm
18 BuildRequires: rpm-rubyprov
19 BuildRequires: rpmbuild(macros) >= 1.656
21 %if %(locale -a | grep -q '^en_US$'; echo $?)
22 BuildRequires: glibc-localedb-all
26 Requires: ruby-rubygems
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 Generate source rpms and rpm spec files from a Ruby Gem. The spec file
32 tries to follow the gem as closely as possible, and be compliant with
33 the Fedora rubygem packaging guidelines
36 Summary: Documentation for %{name}
38 Requires: %{name} = %{version}-%{release}
41 Documentation for %{name}.
45 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
49 cp -p %{SOURCE2} templates
51 # cleanup backups after patching
52 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
56 # tests need UTF-8 locale
62 rm -rf $RPM_BUILD_ROOT
63 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{_bindir}}
65 cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
66 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
68 install -d $RPM_BUILD_ROOT%{_datadir}/ruby/templates
69 cp -a templates/* $RPM_BUILD_ROOT%{_datadir}/ruby/templates
72 rm -rf $RPM_BUILD_ROOT
75 %defattr(644,root,root,755)
76 %doc README.md AUTHORS
77 %attr(755,root,root) %{_bindir}/gem2rpm
78 %{ruby_vendorlibdir}/gem2rpm.rb
79 %{ruby_vendorlibdir}/gem2rpm
80 %{_datadir}/ruby/templates