2017-11-23 18:07:08 +00:00
|
|
|
# build with tests?
|
|
|
|
%bcond_without tests
|
|
|
|
|
2014-02-11 10:06:20 +00:00
|
|
|
# Generated from mysql2-0.3.11.gem by gem2rpm -*- rpm-spec -*-
|
2013-09-12 00:34:39 +00:00
|
|
|
%global gem_name mysql2
|
|
|
|
|
|
|
|
Name: rubygem-%{gem_name}
|
2018-04-23 16:07:04 +00:00
|
|
|
Version: 0.5.2
|
2019-07-26 19:43:35 +00:00
|
|
|
Release: 4%{?dist}
|
2013-09-12 00:34:39 +00:00
|
|
|
Summary: A simple, fast Mysql library for Ruby, binding to libmysql
|
|
|
|
License: MIT
|
2018-04-23 16:07:04 +00:00
|
|
|
URL: https://github.com/brianmario/mysql2
|
2013-09-12 00:34:39 +00:00
|
|
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
2017-11-23 18:07:08 +00:00
|
|
|
# Fix a client option local_infile not enabled
|
2018-04-23 16:07:04 +00:00
|
|
|
# with mariadb-connector-c on big endian environment.
|
|
|
|
# We still needs this patch.
|
2017-11-23 18:07:08 +00:00
|
|
|
# https://github.com/brianmario/mysql2/pull/914
|
|
|
|
# https://github.com/MariaDB/mariadb-connector-c/commit/434b67e
|
|
|
|
Patch0: rubygem-mysql2-0.4.10-mariadb-connector-c-3.0.2-fix-wrong-local-infile-on-big-endian.patch
|
|
|
|
|
|
|
|
# Required in lib/mysql2.rb
|
|
|
|
Requires: rubygem(bigdecimal)
|
2013-09-12 00:34:39 +00:00
|
|
|
BuildRequires: ruby(release)
|
2014-02-11 10:06:20 +00:00
|
|
|
BuildRequires: rubygems-devel
|
|
|
|
BuildRequires: ruby-devel
|
2018-04-23 16:07:04 +00:00
|
|
|
BuildRequires: gcc
|
2017-11-23 18:07:08 +00:00
|
|
|
BuildRequires: mariadb-connector-c-devel
|
|
|
|
%if %{with tests}
|
2014-02-11 10:06:20 +00:00
|
|
|
BuildRequires: mariadb-server
|
2017-11-23 18:07:08 +00:00
|
|
|
BuildRequires: rubygem(rspec)
|
|
|
|
# Used in mysql_install_db
|
|
|
|
BuildRequires: %{_bindir}/hostname
|
|
|
|
BuildRequires: rubygem(bigdecimal)
|
|
|
|
# Used in spec/em/em_spec.rb
|
|
|
|
BuildRequires: rubygem(eventmachine)
|
|
|
|
%endif
|
2013-09-12 00:34:39 +00:00
|
|
|
|
|
|
|
%description
|
2014-02-11 10:06:20 +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
|
|
|
|
|
|
|
|
|
|
|
%package doc
|
|
|
|
Summary: Documentation for %{name}
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description doc
|
2014-02-11 10:06:20 +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}
|
|
|
|
|
2017-11-23 18:07:08 +00:00
|
|
|
%patch0 -p1
|
|
|
|
|
2013-09-12 00:34:39 +00:00
|
|
|
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 10:06:20 +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
|
|
|
|
|
2014-02-11 10:06:20 +00:00
|
|
|
|
2013-09-12 00:34:39 +00:00
|
|
|
%install
|
|
|
|
mkdir -p %{buildroot}%{gem_dir}
|
|
|
|
cp -pa .%{gem_dir}/* \
|
|
|
|
%{buildroot}%{gem_dir}/
|
|
|
|
|
2014-04-15 07:40:22 +00:00
|
|
|
mkdir -p %{buildroot}%{gem_extdir_mri}
|
|
|
|
cp -a .%{gem_extdir_mri}/* %{buildroot}%{gem_extdir_mri}/
|
|
|
|
|
|
|
|
# Prevent dangling symlink in -debuginfo.
|
|
|
|
rm -rf %{buildroot}%{gem_instdir}/ext
|
|
|
|
|
2014-02-11 10:06:20 +00:00
|
|
|
|
2017-11-23 18:07:08 +00:00
|
|
|
%if %{with tests}
|
2014-02-11 10:06:20 +00:00
|
|
|
%check
|
2017-11-23 18:07:08 +00:00
|
|
|
pushd .%{gem_instdir}
|
|
|
|
|
|
|
|
TOP_DIR=$(pwd)
|
|
|
|
# Use testing port because the standard mysqld port 3306 is occupied.
|
2019-05-21 17:39:12 +00:00
|
|
|
# Assign a random port to consider a case of multi builds in parallel in a host.
|
|
|
|
# https://src.fedoraproject.org/rpms/rubygem-pg/pull-request/3
|
|
|
|
MYSQL_TEST_PORT="$((13306 + ${RANDOM} % 1000))"
|
2017-11-23 18:07:08 +00:00
|
|
|
MYSQL_TEST_USER=$(id -un)
|
|
|
|
MYSQL_TEST_DATA_DIR="${TOP_DIR}/data"
|
|
|
|
MYSQL_TEST_SOCKET="${TOP_DIR}/mysql.sock"
|
|
|
|
MYSQL_TEST_LOG="${TOP_DIR}/mysql.log"
|
|
|
|
MYSQL_TEST_PID_FILE="${TOP_DIR}/mysql.pid"
|
|
|
|
|
|
|
|
mkdir "${MYSQL_TEST_DATA_DIR}"
|
|
|
|
mysql_install_db \
|
|
|
|
--datadir="${MYSQL_TEST_DATA_DIR}" \
|
|
|
|
--log-error="${MYSQL_TEST_LOG}"
|
|
|
|
|
|
|
|
%{_libexecdir}/mysqld \
|
|
|
|
--datadir="${MYSQL_TEST_DATA_DIR}" \
|
|
|
|
--log-error="${MYSQL_TEST_LOG}" \
|
|
|
|
--socket="${MYSQL_TEST_SOCKET}" \
|
|
|
|
--pid-file="${MYSQL_TEST_PID_FILE}" \
|
|
|
|
--port="${MYSQL_TEST_PORT}" \
|
|
|
|
--ssl &
|
|
|
|
|
|
|
|
for i in $(seq 10); do
|
|
|
|
sleep 1
|
|
|
|
if grep -q 'ready for connections.' "${MYSQL_TEST_LOG}"; then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
echo "Waiting connections... ${i}"
|
|
|
|
done
|
|
|
|
|
|
|
|
# See https://github.com/brianmario/mysql2/blob/master/.travis_setup.sh
|
|
|
|
mysql -u root \
|
|
|
|
-e 'CREATE DATABASE /*M!50701 IF NOT EXISTS */ test' \
|
|
|
|
-S "${MYSQL_TEST_SOCKET}" \
|
|
|
|
-P "${MYSQL_TEST_PORT}"
|
|
|
|
|
|
|
|
# See https://github.com/brianmario/mysql2/blob/master/tasks/rspec.rake
|
|
|
|
cat <<EOF > spec/configuration.yml
|
|
|
|
root:
|
|
|
|
host: localhost
|
|
|
|
username: root
|
|
|
|
password:
|
|
|
|
database: test
|
|
|
|
port: ${MYSQL_TEST_PORT}
|
|
|
|
socket: ${MYSQL_TEST_SOCKET}
|
|
|
|
|
|
|
|
user:
|
|
|
|
host: localhost
|
|
|
|
username: ${MYSQL_TEST_USER}
|
|
|
|
password:
|
|
|
|
database: mysql2_test
|
|
|
|
port: ${MYSQL_TEST_PORT}
|
|
|
|
socket: ${MYSQL_TEST_SOCKET}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# This test would require changes in host configuration.
|
|
|
|
sed -i '/^ it "should be able to connect via SSL options" do$/,/^ end$/ s/^/#/' \
|
|
|
|
spec/mysql2/client_spec.rb
|
|
|
|
|
2018-04-23 16:07:04 +00:00
|
|
|
# performance_schema.session_account_connect_attrs is unexpectedly empty.
|
|
|
|
# https://github.com/brianmario/mysql2/issues/965
|
|
|
|
sed -i '/^ it "should set default program_name in connect_attrs" do$/,/^ end$/ s/^/#/' \
|
|
|
|
spec/mysql2/client_spec.rb
|
|
|
|
sed -i '/^ it "should set custom connect_attrs" do$/,/^ end$/ s/^/#/' \
|
|
|
|
spec/mysql2/client_spec.rb
|
|
|
|
|
2017-11-23 18:07:08 +00:00
|
|
|
rspec -Ilib:%{buildroot}%{gem_extdir_mri} -f d spec
|
|
|
|
popd
|
|
|
|
|
|
|
|
# Clean up
|
|
|
|
kill "$(cat "${MYSQL_TEST_PID_FILE}")"
|
|
|
|
|
|
|
|
%endif
|
2013-09-12 00:34:39 +00:00
|
|
|
|
|
|
|
%files
|
|
|
|
%dir %{gem_instdir}
|
|
|
|
%{gem_libdir}
|
|
|
|
%{gem_extdir_mri}
|
|
|
|
%exclude %{gem_cache}
|
|
|
|
%{gem_spec}
|
2014-02-11 10:06:20 +00:00
|
|
|
%exclude %{gem_instdir}/support
|
2015-09-08 13:06:06 +00:00
|
|
|
%license %{gem_instdir}/LICENSE
|
2013-09-12 00:34:39 +00:00
|
|
|
|
|
|
|
%files doc
|
|
|
|
%doc %{gem_docdir}
|
2014-02-11 10:06:20 +00:00
|
|
|
%doc %{gem_instdir}/README.md
|
2015-09-08 13:06:06 +00:00
|
|
|
%doc %{gem_instdir}/CHANGELOG.md
|
2014-02-11 10:06:20 +00:00
|
|
|
%{gem_instdir}/examples
|
2017-11-23 18:07:08 +00:00
|
|
|
%{gem_instdir}/spec
|
2014-02-11 08:02:42 +00:00
|
|
|
|
|
|
|
|
2014-02-11 10:06:20 +00:00
|
|
|
%changelog
|
2019-07-26 19:43:35 +00:00
|
|
|
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.2-4
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
|
|
|
|
2019-02-02 12:37:04 +00:00
|
|
|
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.2-3
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
|
|
|
|
2019-01-21 14:05:22 +00:00
|
|
|
* Mon Jan 21 2019 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.5.2-2
|
|
|
|
- F-30: rebuild against ruby26
|
|
|
|
|
2018-04-23 16:07:04 +00:00
|
|
|
* Thu Jul 19 2018 Jun Aruga <jaruga@redhat.com> - 0.5.2-1
|
|
|
|
- New upstream release 0.5.2
|
|
|
|
|
2018-07-14 04:28:42 +00:00
|
|
|
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.10-5
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
|
|
|
|
2018-02-09 14:24:29 +00:00
|
|
|
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.10-4
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
|
|
|
|
2018-01-20 22:08:05 +00:00
|
|
|
* Sat Jan 20 2018 Björn Esser <besser82@fedoraproject.org> - 0.4.10-3
|
|
|
|
- Rebuilt for switch to libxcrypt
|
|
|
|
|
2018-01-04 15:47:56 +00:00
|
|
|
* Thu Jan 04 2018 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.4.10-2
|
|
|
|
- F-28: rebuild for ruby25
|
|
|
|
|
2017-11-23 18:07:08 +00:00
|
|
|
* Thu Nov 23 2017 Jun Aruga <jaruga@redhat.com> - 0.4.10-1
|
|
|
|
- New upstream release 0.4.10
|
|
|
|
|
2017-08-03 07:56:54 +00:00
|
|
|
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.8-3
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
|
|
|
|
2017-07-27 17:28:13 +00:00
|
|
|
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.8-2
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
|
|
|
|
2017-07-14 01:56:47 +00:00
|
|
|
* Thu Jul 13 2017 Adam Williamson <awilliam@redhat.com> - 0.4.8-1
|
|
|
|
- New upstream release 0.4.8 (builds against MariaDB 10.2)
|
|
|
|
|
2017-02-11 12:31:01 +00:00
|
|
|
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.4-3
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
|
|
|
|
2017-01-11 11:08:38 +00:00
|
|
|
* Wed Jan 11 2017 Vít Ondruch <vondruch@redhat.com> - 0.4.4-2
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.4
|
|
|
|
|
2016-06-09 08:08:38 +00:00
|
|
|
* Thu Jun 09 2016 Miroslav Suchý <msuchy@redhat.com> - 0.4.4-1
|
|
|
|
- New upstream release 0.4.4
|
|
|
|
|
2016-02-04 23:00:28 +00:00
|
|
|
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-3
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
|
|
|
|
2016-01-11 14:52:35 +00:00
|
|
|
* Mon Jan 11 2016 Vít Ondruch <vondruch@redhat.com> - 0.4.0-2
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.3
|
|
|
|
|
2015-09-08 13:06:06 +00:00
|
|
|
* Tue Sep 8 2015 Miroslav Suchý <msuchy@redhat.com> 0.4.0-1
|
|
|
|
- rebase to mysql2-0.4.0
|
|
|
|
|
2015-06-18 23:29:59 +00:00
|
|
|
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.16-5
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
|
|
|
|
2015-01-16 12:27:55 +00:00
|
|
|
* Fri Jan 16 2015 Vít Ondruch <vondruch@redhat.com> - 0.3.16-4
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.2
|
|
|
|
|
2014-08-18 00:49:09 +00:00
|
|
|
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.16-3
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
|
|
|
|
2014-06-08 04:44:49 +00:00
|
|
|
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.16-2
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
|
|
|
|
2014-05-26 11:00:45 +00:00
|
|
|
* Mon May 26 2014 Miroslav Suchý <msuchy@redhat.com> 0.3.16-1
|
|
|
|
- rebase to mysql2-0.3.16
|
|
|
|
|
2014-04-15 07:40:22 +00:00
|
|
|
* Tue Apr 15 2014 Vít Ondruch <vondruch@redhat.com> - 0.3.15-3
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.1
|
|
|
|
|
2014-02-11 10:10:17 +00:00
|
|
|
* Tue Feb 11 2014 Miroslav Suchý <msuchy@redhat.com> 0.3.15-2
|
|
|
|
- rebase to mysql2-0.3.15
|
|
|
|
|
2014-02-11 10:06:20 +00:00
|
|
|
* Wed Sep 11 2013 Alexander Chernyakhovsky <achernya@mit.edu> - 0.3.13-1
|
|
|
|
- Initial package
|