%global gem_name therubyracer %global rubyabi 1.9.1 %global majorver 0.11.0 %global fedorarel 1 %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: rubygem-%{gem_name} Version: %{majorver} Release: %{?preminorver:0.}%{fedorarel}%{?preminorver:.%{preminorver}}%{?dist} Group: Development/Languages License: MIT URL: http://github.com/cowboyd/therubyracer Source0: http://rubygems.org/gems/%{gem_name}-%{version}%{?preminorver}.gem Requires: ruby(abi) = %{rubyabi} Requires: rubygem(ref) Requires: ruby(rubygems) Requires: ruby Requires: v8 BuildRequires: ruby(abi) = %{rubyabi} BuildRequires: rubygem(ref) BuildRequires: rubygem(rspec) BuildRequires: rubygems-devel BuildRequires: ruby-devel BuildRequires: v8-devel # some specs run "ps aux" BuildRequires: /usr/bin/ps Provides: 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 %{name} Group: Documentation Requires: %{name} = %{version}-%{release} BuildArch: noarch %description doc Documentation for %{name} %prep %setup -q -c -T mkdir -p .%{gem_dir} export CONFIGURE_ARGS="--with-cflags='%{optflags}'" gem install --local --install-dir .%{gem_dir} \ -V \ --force %{SOURCE0} %build %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 # Rakefile shouldn't be executable 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 V8_VERSION=`d8 -e "print(version())"` sed -i "s|V8::C::V8::GetVersion().*|V8::C::V8::GetVersion().should match /^${V8_VERSION}/|" spec/c/constants_spec.rb rspec spec 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 * Fri Jun 15 2012 Bohuslav Kabrda - 0.11.0-0.1.beta5 - Initial package