X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=gem2rpm.spec;h=8e46718c212cb857b5b742c41ff8396313024c65;hb=05522086e176b2e05c3a44996618a5debd6761a6;hp=03581e031a825aa08fe1ab9ea88e9524b6e78192;hpb=bf1dd385665c460549c24654b2bbea058862ca41;p=packages%2Fgem2rpm.git diff --git a/gem2rpm.spec b/gem2rpm.spec index 03581e0..8e46718 100644 --- a/gem2rpm.spec +++ b/gem2rpm.spec @@ -1,23 +1,27 @@ +# +# Conditional build: +%bcond_with tests # tests require networking + Summary: Generate rpm specfiles from gems Name: gem2rpm -Version: 0.8.1 -Release: 0.7 +Version: 0.11.3 +Release: 1 License: GPL v2+ Group: Development/Languages -Source0: http://rubygems.org/gems/%{name}-%{version}.gem -# Source0-md5: d3c9416f225ae944fd195e69e122d46e -# git clone https://github.com/lutter/gem2rpm.git && cd gem2rpm && git checkout v0.8.1 -# tar czvf gem2rpm-0.8.1-tests.tgz test/ -Source1: %{name}-%{version}-tests.tgz -# Source1-md5: d7d8bc231dc405bbce00f570c89f530e +Source0: https://github.com/fedora-ruby/gem2rpm/archive/v%{version}/%{name}-%{version}.tar.gz +# Source0-md5: 5d81c9a3a9849f905819781fb61f86aa Source2: pld.spec.erb Patch0: gems.patch -Patch1: pld.patch +Patch1: os-release-quotes.patch Patch2: style.patch -URL: https://github.com/lutter/gem2rpm/ +URL: https://github.com/fedora-ruby/gem2rpm BuildRequires: rpm-rubyprov BuildRequires: rpmbuild(macros) >= 1.656 -Requires: ruby +%if %{with tests} +BuildRequires: ruby-rake +%endif +Requires: pld-release +Requires: ruby-rubygems BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -36,24 +40,26 @@ Documentation for %{name}. %prep %setup -q +%{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/* %patch0 -p1 %patch1 -p1 %patch2 -p1 cp -p %{SOURCE2} templates -%{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/* +# cleanup backups after patching +find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f %build %if %{with tests} -testrb -Itest test/ +rake test %endif %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT{%{ruby_rubylibdir},%{_bindir}} +install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{_bindir}} cp -a bin/* $RPM_BUILD_ROOT%{_bindir} -cp -a lib/* $RPM_BUILD_ROOT%{ruby_rubylibdir} +cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir} install -d $RPM_BUILD_ROOT%{_datadir}/ruby/templates cp -a templates/* $RPM_BUILD_ROOT%{_datadir}/ruby/templates @@ -63,16 +69,8 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) -%doc README AUTHORS +%doc README.md AUTHORS %attr(755,root,root) %{_bindir}/gem2rpm -%{ruby_rubylibdir}/gem2rpm.rb -%{ruby_rubylibdir}/gem2rpm +%{ruby_vendorlibdir}/gem2rpm.rb +%{ruby_vendorlibdir}/gem2rpm %{_datadir}/ruby/templates - -%if 0 -%files doc -%defattr(644,root,root,755) -%doc %{gem_docdir} -%doc %{gem_instdir}/README -%doc %{gem_instdir}/AUTHORS -%endif