summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Dreyer <ktdreyer@ktdreyer.com>2014-11-07 09:15:33 -0700
committerKen Dreyer <ktdreyer@ktdreyer.com>2014-11-07 09:16:50 -0700
commitd27be81a025e2b1cb5178420ba8cfb4a49eb0b65 (patch)
treec1546525d0350b644f2b6dc500f8d3dbfd10eacb
parent40e3e04fa5fb421ffda3b2112eb0570257413fb5 (diff)
downloadrubygem-yajl-ruby-master.tar.gz
rubygem-yajl-ruby-master.tar.xz
rubygem-yajl-ruby-master.zip
Update for F22 Ruby guidelinesHEADmaster
- Drop EL6 compat when moving the binary yajl/yajl.so file in %install
-rw-r--r--rubygem-yajl-ruby.spec49
1 files changed, 28 insertions, 21 deletions
diff --git a/rubygem-yajl-ruby.spec b/rubygem-yajl-ruby.spec
index b0b3d97..86fe449 100644
--- a/rubygem-yajl-ruby.spec
+++ b/rubygem-yajl-ruby.spec
@@ -2,19 +2,13 @@
# EPEL6 lacks rubygems-devel package that provides these macros
%if %{?el6}0
-%global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
-%global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version}
-%global gem_docdir %{gem_dir}/doc/%{gem_name}-%{version}
-%global gem_libdir %{gem_instdir}/lib
-%global gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem
-%global gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec
%global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"]')
%endif
Summary: Ruby C bindings to the excellent Yajl JSON stream-based parser library
Name: rubygem-%{gem_name}
Version: 1.2.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Group: Development/Languages
License: MIT
URL: https://github.com/brianmario/yajl-ruby
@@ -82,18 +76,27 @@ rm .%{gem_instdir}/%{gem_name}.gemspec
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
-# Remove the binary extension sources and build leftovers.
-rm -rf %{buildroot}%{gem_instdir}/ext
-%if 0%{?el6}
- # %%{gem_extdir_mri} doesn't really work on EL 6
- mkdir -p %{buildroot}%{ruby_sitearch}/yajl
- # move the extension to ruby_sitearch
- mv %{buildroot}%{gem_libdir}/yajl/yajl.so %{buildroot}%{ruby_sitearch}/yajl
-%else
- install -d -m0755 %{buildroot}%{gem_extdir_mri}/lib/yajl
- # move the extension to gem_extdir_mri
- mv %{buildroot}%{gem_libdir}/yajl/yajl.so %{buildroot}%{gem_extdir_mri}/lib/yajl
-%endif
+
+# Remove deprecated "ext" directory
+rm -r %{buildroot}%{gem_instdir}/ext
+
+# Move the binary extension.
+# (NOTE: this is not compatible with EL6)
+# Get the minor version number of Ruby
+ruby_version_minor=$(ruby \
+ -e "puts RUBY_VERSION.split('.')[1]")
+# Move according to Ruby 2.1 or 2.0
+if [ $ruby_version_minor -gt 0 ]; then
+ # Ruby 2.1+ on Fedora 21 and above
+ mkdir -p %{buildroot}%{gem_extdir_mri}
+ cp -pa .%{gem_extdir_mri}/* %{buildroot}%{gem_extdir_mri}/
+else
+ # Ruby 2.0 on Fedora 20
+ mkdir -p %{buildroot}%{gem_extdir_mri}/lib
+ mv %{buildroot}%{gem_libdir}/yajl \
+ %{buildroot}%{gem_extdir_mri}/lib
+fi
+
# Fix permissions
# https://github.com/brianmario/yajl-ruby/issues/103
@@ -104,7 +107,7 @@ chmod -x %{buildroot}%{gem_instdir}/benchmark/subjects/unicode.json
# spec on EL6 is too old; need RSpec2
%else
pushd .%{gem_instdir}
-rspec
+ rspec -I%{buildroot}%{gem_extdir_mri} spec
popd
%endif
@@ -115,7 +118,7 @@ popd
%if 0%{?el6}
%{ruby_sitearch}/yajl/yajl.so
%else
-%{gem_extdir_mri}/*
+%{gem_extdir_mri}
%endif
%{gem_libdir}
%{gem_spec}
@@ -130,6 +133,10 @@ popd
%{gem_instdir}/tasks
%changelog
+* Fri Nov 07 2014 Ken Dreyer <ktdreyer@ktdreyer.com> - 1.2.0-2
+- Update for F22 Ruby guidelines
+- Drop EL6 compat when moving the binary yajl/yajl.so file in %%install
+
* Sat Feb 15 2014 Ken Dreyer <ktdreyer@ktdreyer.com> - 1.2.0-1
- Update to yajl-ruby 1.2.0