summaryrefslogtreecommitdiffstats
path: root/rubygem-mysql2.spec
diff options
context:
space:
mode:
Diffstat (limited to 'rubygem-mysql2.spec')
-rw-r--r--rubygem-mysql2.spec19
1 files changed, 17 insertions, 2 deletions
diff --git a/rubygem-mysql2.spec b/rubygem-mysql2.spec
index 963e17f..0232983 100644
--- a/rubygem-mysql2.spec
+++ b/rubygem-mysql2.spec
@@ -9,7 +9,7 @@
Summary: A simple, fast Mysql library for Ruby, binding to libmysql
Name: rubygem-%{gem_name}
Version: 0.3.11
-Release: 2%{?dist}
+Release: 3%{?dist}
Group: Development/Languages
License: MIT
URL: http://github.com/brianmario/mysql2
@@ -37,6 +37,7 @@ Provides: rubygem(%{gem_name}) = %{version}
%{!?gem_spec: %global gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec}
%{!?gem_docdir: %global gem_docdir %{gem_dir}/doc/%{gem_name}-%{version}}
%{!?gem_extdir: %global gem_extdir %{_libdir}/gems/exts/%{gem_name}-%{version}}
+%{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"]')}
%description
The Mysql2 gem is meant to serve the extremely common use-case of
@@ -78,9 +79,16 @@ mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
+%if 0%{?el6}
+# gem_extdir doesn't really work on EL 6
+mkdir -p %{buildroot}%{ruby_sitearch}/mysql2
+# move the extension to ruby_sitearch
+mv %{buildroot}%{gem_instdir}/lib/mysql2/mysql2.so %{buildroot}%{ruby_sitearch}/mysql2
+%else
mkdir -p %{buildroot}%{gem_extdir}/lib/mysql2
-# move the extension
+# move the extension to gem_extdir
mv %{buildroot}%{gem_instdir}/lib/mysql2/mysql2.so %{buildroot}%{gem_extdir}/lib/mysql2
+%endif
# Remove the binary extension sources and build leftovers.
rm -rf %{buildroot}%{gem_instdir}/ext
@@ -101,7 +109,11 @@ popd
%files
%dir %{gem_instdir}
%{gem_libdir}
+%if 0%{?el6}
+%{ruby_sitearch}/%{gem_name}
+%else
%{gem_extdir}
+%endif
%exclude %{gem_cache}
%{gem_spec}
@@ -118,6 +130,9 @@ popd
%{gem_instdir}/tasks
%changelog
+* Fri Feb 15 2013 Ken Dreyer <ktdreyer@ktdreyer.com> - 0.3.11-3
+- Binary extension moved into ruby_sitearch dir
+
* Thu Feb 14 2013 Ken Dreyer <ktdreyer@ktdreyer.com> - 0.3.11-2
- RHEL 6 compatibility