2013-09-12 00:34:39 +00:00
|
|
|
%global gem_name mysql2
|
|
|
|
|
|
|
|
Name: rubygem-%{gem_name}
|
2014-02-11 08:02:42 +00:00
|
|
|
Version: 0.3.15
|
2013-09-12 00:34:39 +00:00
|
|
|
Release: 1%{?dist}
|
|
|
|
Summary: A simple, fast Mysql library for Ruby, binding to libmysql
|
|
|
|
Group: Development/Languages
|
|
|
|
License: MIT
|
|
|
|
URL: http://github.com/brianmario/mysql2
|
|
|
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
|
|
|
Requires: ruby(release)
|
2014-02-11 08:02:42 +00:00
|
|
|
Requires: ruby(rubygems)
|
|
|
|
Requires: mysql
|
2013-09-12 00:34:39 +00:00
|
|
|
BuildRequires: ruby(release)
|
2014-02-11 08:02:42 +00:00
|
|
|
BuildRequires: rubygems-devel
|
|
|
|
BuildRequires: ruby ruby-devel
|
|
|
|
BuildRequires: mysql mysql-devel
|
2013-09-12 00:34:39 +00:00
|
|
|
Provides: rubygem(%{gem_name}) = %{version}
|
|
|
|
|
|
|
|
%description
|
2014-02-11 08:02:42 +00:00
|
|
|
The Mysql2 gem is meant to serve the extremely common use-case of connecting,
|
|
|
|
querying and iterating on results. Some database libraries out there serve as
|
|
|
|
direct 1:1 mappings of the already complex C API's available. This one is not.
|
2013-09-12 00:34:39 +00:00
|
|
|
|
2014-02-11 08:02:42 +00:00
|
|
|
It also forces the use of UTF-8 [or binary] for the connection [and all strings
|
|
|
|
in 1.9, unless Encoding.default_internal is set then it'll convert from UTF-8
|
|
|
|
to that encoding] and uses encoding-aware MySQL API calls where it can.
|
|
|
|
|
|
|
|
The API consists of two classes:
|
|
|
|
|
|
|
|
Mysql2::Client - your connection to the database
|
|
|
|
|
|
|
|
Mysql2::Result - returned from issuing a #query on the connection. It includes
|
|
|
|
Enumerable.
|
2013-09-12 00:34:39 +00:00
|
|
|
|
|
|
|
%package doc
|
|
|
|
Summary: Documentation for %{name}
|
|
|
|
Group: Documentation
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description doc
|
2014-02-11 08:02:42 +00:00
|
|
|
Documentation for %{name}.
|
2013-09-12 00:34:39 +00:00
|
|
|
|
|
|
|
%prep
|
|
|
|
gem unpack %{SOURCE0}
|
|
|
|
|
|
|
|
%setup -q -D -T -n %{gem_name}-%{version}
|
|
|
|
|
|
|
|
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
|
|
|
|
|
|
|
|
%build
|
|
|
|
# Create the gem as gem install only works on a gem file
|
|
|
|
gem build %{gem_name}.gemspec
|
|
|
|
|
2014-02-11 08:02:42 +00:00
|
|
|
# %%gem_install compiles any C extensions and installs the gem into ./%gem_dir
|
2013-09-12 00:34:39 +00:00
|
|
|
# by default, so that we can move it into the buildroot in %%install
|
|
|
|
%gem_install
|
|
|
|
|
|
|
|
%install
|
|
|
|
mkdir -p %{buildroot}%{gem_dir}
|
|
|
|
cp -pa .%{gem_dir}/* \
|
|
|
|
%{buildroot}%{gem_dir}/
|
|
|
|
|
|
|
|
mkdir -p %{buildroot}%{gem_extdir_mri}/lib/mysql2
|
2014-02-11 08:02:42 +00:00
|
|
|
mv %{buildroot}%{gem_instdir}/lib/mysql2/mysql2.so %{buildroot}%{gem_extdir_mri}/lib/mysql2/
|
2013-09-12 00:34:39 +00:00
|
|
|
|
2014-02-11 08:02:42 +00:00
|
|
|
# Remove the binary extension sources and build leftovers.
|
|
|
|
rm -rf %{buildroot}%{geminstdir}/ext
|
2013-09-12 00:34:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
%dir %{gem_instdir}
|
|
|
|
%{gem_libdir}
|
|
|
|
%exclude %{gem_instdir}/ext
|
|
|
|
%{gem_extdir_mri}
|
|
|
|
%exclude %{gem_cache}
|
|
|
|
%{gem_spec}
|
2014-02-11 08:02:42 +00:00
|
|
|
%{gem_instdir}/support/
|
|
|
|
%doc %{gem_instdir}/README.md
|
2013-09-12 00:34:39 +00:00
|
|
|
%doc %{gem_instdir}/MIT-LICENSE
|
|
|
|
|
2014-02-11 08:02:42 +00:00
|
|
|
|
2013-09-12 00:34:39 +00:00
|
|
|
%files doc
|
|
|
|
%doc %{gem_docdir}
|
2014-02-11 08:02:42 +00:00
|
|
|
%{gem_instdir}/spec/
|
|
|
|
%{gem_instdir}/examples/
|
2013-09-12 00:34:39 +00:00
|
|
|
|
|
|
|
%changelog
|
2014-02-11 08:02:42 +00:00
|
|
|
* Tue Feb 11 2014 Miroslav Suchý <msuchy@redhat.com> 0.3.15-1
|
|
|
|
- rebase to mysql2-0.3.15
|
|
|
|
|
|
|
|
* Mon Jul 29 2013 Miroslav Suchý <msuchy@redhat.com> 0.3.13-3
|
|
|
|
- fix files section
|
|
|
|
- move extension
|
|
|
|
|
|
|
|
* Fri Jul 26 2013 Miroslav Suchý <msuchy@redhat.com> 0.3.13-2
|
|
|
|
- initial package
|
|
|
|
|