| |
@@ -6,7 +6,7 @@
|
| |
|
| |
Name: rubygem-%{gem_name}
|
| |
Version: 0.5.4
|
| |
- Release: 2%{?dist}
|
| |
+ Release: 3%{?dist}
|
| |
Summary: A simple, fast Mysql library for Ruby, binding to libmysql
|
| |
License: MIT
|
| |
URL: https://github.com/brianmario/mysql2
|
| |
@@ -14,6 +14,9 @@
|
| |
# git clone --no-checkout https://github.com/brianmario/mysql2.git
|
| |
# cd mysql2 && git archive -v -o mysql2-0.5.3-tests.txz 0.5.3 spec/
|
| |
Source1: %{gem_name}-%{version}-tests.txz
|
| |
+ # Use the SSL pem files in the upstream repositry for the SSL tests.
|
| |
+ # https://github.com/brianmario/mysql2/pull/1293
|
| |
+ Patch0: rubygem-mysql2-0.5.4-use-ssl-pem-files-in-repo.patch
|
| |
|
| |
# Required in lib/mysql2.rb
|
| |
Requires: rubygem(bigdecimal)
|
| |
@@ -30,6 +33,8 @@
|
| |
BuildRequires: rubygem(bigdecimal)
|
| |
# Used in spec/em/em_spec.rb
|
| |
BuildRequires: rubygem(eventmachine)
|
| |
+ # Used in spec/ssl/gen_certs.sh
|
| |
+ BuildRequires: %{_bindir}/openssl
|
| |
%endif
|
| |
|
| |
%description
|
| |
@@ -50,6 +55,10 @@
|
| |
%prep
|
| |
%setup -q -n %{gem_name}-%{version} -b 1
|
| |
|
| |
+ pushd %{_builddir}/spec
|
| |
+ %patch0 -p2
|
| |
+ popd
|
| |
+
|
| |
%build
|
| |
gem build ../%{gem_name}-%{version}.gemspec
|
| |
%gem_install
|
| |
@@ -75,6 +84,24 @@
|
| |
ln -s %{_builddir}/spec spec
|
| |
|
| |
TOP_DIR=$(pwd)
|
| |
+
|
| |
+ # Regenerate the SSL certification files from the localhost, as we cannot set
|
| |
+ # the host mysql2gem.example.com required for the SSL tests.
|
| |
+ # https://github.com/brianmario/mysql2/pull/1296
|
| |
+ sed -i '/host/ s/mysql2gem\.example\.com/localhost/' spec/mysql2/client_spec.rb
|
| |
+ sed -i '/commonName_default/ s/mysql2gem\.example\.com/localhost/' spec/ssl/gen_certs.sh
|
| |
+ pushd spec/ssl
|
| |
+ bash gen_certs.sh
|
| |
+ popd
|
| |
+
|
| |
+ # See https://github.com/brianmario/mysql2/blob/master/ci/ssl.sh
|
| |
+ echo "
|
| |
+ [mysqld]
|
| |
+ ssl-ca=${TOP_DIR}/spec/ssl/ca-cert.pem
|
| |
+ ssl-cert=${TOP_DIR}/spec/ssl/server-cert.pem
|
| |
+ ssl-key=${TOP_DIR}/spec/ssl/server-key.pem
|
| |
+ " > ~/.my.cnf
|
| |
+
|
| |
# Use testing port because the standard mysqld port 3306 is occupied.
|
| |
# 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
|
| |
@@ -168,6 +195,10 @@
|
| |
|
| |
|
| |
%changelog
|
| |
+ * Fri Dec 16 2022 Jun Aruga <jaruga@redhat.com> - 0.5.4-3
|
| |
+ - Fix the broken SSL tests with MariaDB 10.5.18.
|
| |
+ Resolves: rhbz#2144488
|
| |
+
|
| |
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.4-2
|
| |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
| |
|
| |
This PR fixes the BZ ticket: https://bugzilla.redhat.com/show_bug.cgi?id=2144488.
Based on the mschorm's investigation and the https://src.fedoraproject.org/rpms/rubygem-mysql2/pull-request/13#. I was able to reproduce and fix the issue on the upstream tests.
https://github.com/brianmario/mysql2/pull/1290
Thanks for that!
The commit message
This commit fixes the broken SSL tests below.
The rubygem-mysql2 build started to fail with the error below by the
mysql
that can't connect to the MariaDB server, when a dependency mariadb was upgraded
from the version 3:10.5.16-3.fc37 to 3:10.5.18-1.fc38.
https://koschei.fedoraproject.org/build/14086115
build.log
After Michal Schorm mschorm@redhat.com's investigation (thanks!), we found
the error comes from the not appropriate SSL configurations.
It was reported that in Fedora, the MariaDB 10.5.16 used downstream OpenSSL 3
patch, and the MariaDB 10.5.18 started to use upstream OpenSSL 3 patch.
And there are some differences between these two patch files. And the difference
triggered this issue.
See also https://github.com/brianmario/mysql2/pull/1290.
Resolves: rhbz#2144488
Note
Note that the
ci/ssl.sh
is creating the/etc/my.cnf
on the upstream PR to fix this issue.https://github.com/brianmario/mysql2/pull/1290
https://github.com/brianmario/mysql2/blob/ba4d46551d132492b34205cdb8fa224c92765bef/ci/ssl.sh#L12
However, as we don't have the permission to edit the
/etc/my.conf
with the mockbuild user in the mock build, the~/.my.cnf
is created in this PR.According to the current MariaDB setting, we can use the following configuration files.
I wrote the details in the commit message with the upstream PR link.
Tests
I confirmed the scratch build passing.
https://koji.fedoraproject.org/koji/taskinfo?taskID=95450973