%global gem_name ruby-rc4 %if 0%{?rhel} == 6 %global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) %global gem_docdir %{gem_dir}/doc/%{gem_name}-%{version} %global gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem %global gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec %global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version} %endif Summary: Pure Ruby implementation of the RC4 algorithm Name: rubygem-%{gem_name} Version: 0.1.5 Release: 2%{?dist} Group: Development/Languages License: MIT URL: https://github.com/caiges/Ruby-RC4 Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem Requires: rubygems %if 0%{?rhel} == 6 || 0%{?fedora} < 17 Requires: ruby(abi) = 1.8 %else Requires: ruby(abi) = 1.9.1 %endif %if 0%{?fedora} BuildRequires: rubygems-devel %endif BuildRequires: rubygems BuildRequires: rubygem-rspec BuildArch: noarch Provides: rubygem(%{gem_name}) = %{version} %description RC4 is a pure Ruby implementation of the RC4 algorithm. %package doc BuildArch: noarch Requires: %{name} = %{version}-%{release} Summary: Documentation for rubygem-%{gem_name} %description doc This package contains documentation for rubygem-%{gem_name}. %prep gem unpack %{SOURCE0} %setup -q -D -T -n %{gem_name}-%{version} gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec %build mkdir -p .%{gem_dir} # Create the gem as gem install only works on a gem file gem build %{gem_name}.gemspec gem install -V \ --local \ --install-dir ./%{gem_dir} \ --force \ --rdoc \ %{gem_name}-%{version}.gem rm -rf ./%{gem_dir}/gems/%{gem_name}-%{version}/.yardoc %install mkdir -p %{buildroot}%{gem_dir} cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/ rm %{buildroot}%{gem_instdir}/{README.md,LICENSE} %check rspec spec/ %files %dir %{gem_instdir} %{gem_instdir}/lib %{gem_cache} %{gem_spec} %doc LICENSE %files doc %doc %{gem_docdir} %{gem_instdir}/Rakefile %doc README.md %{gem_instdir}/spec %changelog * Thu Aug 09 2012 Miroslav Suchý 0.1.5-2 - use test suite (msuchy@redhat.com) - edit spec for Fedora review (msuchy@redhat.com) * Sun Aug 05 2012 Miroslav Suchý 0.1.5-1 - new package built with tito