%{?scl:%scl_package rubygem-%{gem_name}} %{!?scl:%global pkg_name %{name}} %global gem_name therubyracer %global rubyabi 1.9.1 %global majorver 0.11.0 %global release 9 %global preminorver beta5 %global fullver %{majorver}%{?preminorver} %{?preminorver:%global gem_instdir %{gem_dir}/gems/%{gem_name}-%{fullver}} %{?preminorver:%global gem_extdir %{_libdir}/gems/exts/%{gem_name}-%{fullver}} %{?preminorver:%global gem_docdir %{gem_dir}/doc/%{gem_name}-%{fullver}} %{?preminorver:%global gem_spec %{gem_dir}/specifications/%{gem_name}-%{fullver}.gemspec} %{?preminorver:%global gem_cache %{gem_dir}/cache/%{gem_name}-%{fullver}.gem} Summary: Embed the V8 Javascript interpreter into Ruby Name: %{?scl_prefix}rubygem-%{gem_name} Version: %{majorver} Release: %{?preminorver:0.}%{release}%{?preminorver:.%{preminorver}}%{?dist} Group: Development/Languages License: MIT URL: http://github.com/cowboyd/therubyracer Source0: http://rubygems.org/gems/%{gem_name}-%{version}%{?preminorver}.gem Patch0: rubygem-therubyracer-0.11.0beta5-v8-3.14.5.8-compatibility.patch Requires: %{?scl_prefix}ruby(abi) = %{rubyabi} Requires: %{?scl_prefix}rubygem(ref) Requires: %{?scl_prefix}ruby(rubygems) Requires: %{?scl_prefix}ruby BuildRequires: %{?scl_prefix}ruby(abi) = %{rubyabi} BuildRequires: %{?scl_prefix}rubygem(ref) BuildRequires: %{?scl_prefix}rubygem(rspec) BuildRequires: %{?scl_prefix}rubygems-devel BuildRequires: %{?scl_prefix}ruby-devel %{?scl:BuildRequires: scldevel(v8)} # some specs run "ps aux" BuildRequires: procps Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version} %description Call javascript code and manipulate javascript objects from ruby. Call ruby code and manipulate ruby objects from javascript. %package doc Summary: Documentation for %{pkg_name} Group: Documentation Requires: %{?scl_prefix}%{pkg_name} = %{version}-%{release} BuildArch: noarch %description doc Documentation for %{pkg_name} %prep %{?scl:scl enable %{scl} - << \EOF} gem unpack %{SOURCE0} gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec %setup -n %{gem_name}-%{version}%{?preminorver} -q -D -T %patch0 -p1 %{?scl:EOF} %build mkdir -p .%{gem_dir} CONFIGURE_ARGS="--with-cflags='%{optflags}' $CONFIGURE_ARGS" %{?scl:scl enable %{scl} %{scl_v8} - << \EOF} # Be carefull, which .gemspec is taken! gem build ../%{gem_name}.gemspec gem install --local --install-dir .%{gem_dir} \ -V \ --force %{gem_name}-%{version}%{?preminorver}.gem %{?scl:EOF} %install mkdir -p %{buildroot}%{gem_dir} cp -a .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ mkdir -p %{buildroot}%{gem_extdir}/lib/v8 mv %{buildroot}%{gem_instdir}/lib/v8/init.so %{buildroot}%{gem_extdir}/lib/v8 # Remove the binary extension sources and build leftovers. rm -rf %{buildroot}%{gem_instdir}/ext # remove shebang in non-executable file sed -i '1d' %{buildroot}%{gem_instdir}/Rakefile %check pushd .%{gem_instdir} # this spec doesn't test anything, only requires redjs, which is not in fedora mv spec/redjs_spec.rb spec/redjs_spec.rb.notest # fix the v8 version we're testing against %{?scl:scl enable %{scl} %{scl_v8} - << \EOF} V8_VERSION=`d8 -e "print(version())"` %{?scl:EOF} sed -i "s|V8::C::V8::GetVersion().*|V8::C::V8::GetVersion().should match /^${V8_VERSION}/|" spec/c/constants_spec.rb %{?scl:scl enable %{scl} %{scl_v8} - << \EOF} rspec spec %{?scl:EOF} popd %files %dir %{gem_instdir} %doc %{gem_instdir}/README.md %{gem_libdir} %{gem_extdir} %exclude %{gem_cache} %exclude %{gem_instdir}/.* %{gem_spec} %files doc %doc %{gem_docdir} %doc %{gem_instdir}/Changelog.md %{gem_instdir}/benchmarks.rb %{gem_instdir}/Gemfile %{gem_instdir}/Rakefile %{gem_instdir}/spec %{gem_instdir}/thefrontside.png %{gem_instdir}/therubyracer.gemspec %changelog * Thu Mar 20 2014 Josef Stribny - 0.11.0-0.9.beta5 - Depend on scldevel(v8) virtual provide - Resolves: rhbz#1070332 * Mon Feb 17 2014 Josef Stribny - 0.11.0-0.8.beta5 - Don't install v8 scl macros, they should come in v8 scldevel subpackage - Resolves: rhbz#1065887 * Thu Nov 28 2013 Vít Ondruch - 0.11.0-0.7.beta5 - Depend on v8 scl. * Thu Aug 01 2013 Tomas Hrcka - 0.11.0-0.6.beta5 - rebuild against new v8 * Thu May 02 2013 Vít Ondruch - 0.11.0-0.5.beta5 - Fix compatibility with v8-3.14.5.8. * Thu Jul 26 2012 Bohuslav Kabrda - 0.11.0-0.4.beta5 - Rebuilt for SCL. * Sat Jul 21 2012 Fedora Release Engineering - 0.11.0-0.3.beta5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Mon Jul 16 2012 Bohuslav Kabrda - 0.11.0-0.2.beta5 - Fixed minor issues according to review comments (RHBZ #838870). * Fri Jun 15 2012 Bohuslav Kabrda - 0.11.0-0.1.beta5 - Initial package