From a35e17b2cb95e0494c6a9e06192288174c561852 Mon Sep 17 00:00:00 2001 From: Michal Schorm Date: Fri, 11 Sep 2020 09:35:04 +0200 Subject: [PATCH] Rebase to 10.5.1 - Beta Update to build against PCRE2 --- mariadb-10.5.0-libsql_builtins.patch | 14 ------- mariadb-auth_pam_tool_dir.patch | 35 ++++++++--------- mariadb-ownsetup.patch | 28 +++++++------- mariadb-pcdir.patch | 20 ++++++++++ mariadb.spec | 57 ++++++++++++++++------------ sources | 2 +- 6 files changed, 82 insertions(+), 74 deletions(-) delete mode 100644 mariadb-10.5.0-libsql_builtins.patch create mode 100644 mariadb-pcdir.patch diff --git a/mariadb-10.5.0-libsql_builtins.patch b/mariadb-10.5.0-libsql_builtins.patch deleted file mode 100644 index b29ddba..0000000 --- a/mariadb-10.5.0-libsql_builtins.patch +++ /dev/null @@ -1,14 +0,0 @@ -Based on this upstream commit: -https://github.com/MariaDB/server/commit/92d6c13206b199f24384ed2504ed479b0f59c314 - ---- mariadb-10.5.0/sql/CMakeLists.txt 2019-11-28 16:19:01.000000000 +0100 -+++ mariadb-10.5.0/sql/CMakeLists.txt_patched 2020-01-22 00:52:28.858844312 +0100 -@@ -277,7 +277,7 @@ IF(MSVC AND NOT WITHOUT_DYNAMIC_PLUGINS) - SET_TARGET_PROPERTIES(mysqld_import_lib PROPERTIES IMPORTED_LOCATION ${MYSQLD_LIB}) - ENDIF() - --ADD_LIBRARY( sql_builtins ${CMAKE_CURRENT_BINARY_DIR}/sql_builtin.cc) -+ADD_LIBRARY(sql_builtins STATIC ${CMAKE_CURRENT_BINARY_DIR}/sql_builtin.cc) - TARGET_LINK_LIBRARIES(sql_builtins ${MYSQLD_STATIC_PLUGIN_LIBS}) - - MYSQL_ADD_EXECUTABLE(mysqld ${MYSQLD_SOURCE} DESTINATION ${INSTALL_SBINDIR} COMPONENT Server) diff --git a/mariadb-auth_pam_tool_dir.patch b/mariadb-auth_pam_tool_dir.patch index 9ac9407..6334812 100644 --- a/mariadb-auth_pam_tool_dir.patch +++ b/mariadb-auth_pam_tool_dir.patch @@ -5,30 +5,25 @@ Thus "chown 0" will always fail Never parse 'ls' output! http://mywiki.wooledge.org/BashFAQ/087 -diff -Nau mariadb-10.5.0/scripts/mysql_install_db.sh.old mariadb-10.5.0/scripts/mysql_install_db.sh ---- mariadb-10.5.0/scripts/mysql_install_db.sh.old 2020-09-08 15:20:02.075081944 +0200 -+++ mariadb-10.5.0/scripts/mysql_install_db.sh 2020-09-08 15:21:36.251043330 +0200 -@@ -490,13 +490,16 @@ - fi - if test -z "$srcdir" +--- mariadb-10.4.12/scripts/mysql_install_db.sh 2020-01-26 21:43:53.000000000 +0100 ++++ mariadb-10.4.12/scripts/mysql_install_db.sh_patched 2020-01-29 11:11:09.448812331 +0100 +@@ -482,13 +482,16 @@ if test -n "$user" + then + if test -z "$srcdir" -a "$in_rpm" -eq 0 then - chown 0 "$pamtooldir/auth_pam_tool_dir/auth_pam_tool" && \ - chmod 04755 "$pamtooldir/auth_pam_tool_dir/auth_pam_tool" - if test $? -ne 0 + if [ `stat "$pamtooldir/auth_pam_tool_dir/auth_pam_tool" -c %u` -ne 0 ] then -- echo "Couldn't set an owner to '$pamtooldir/auth_pam_tool_dir/auth_pam_tool'." -- echo " It must be root, the PAM authentication plugin doesn't work otherwise.." -- echo -+ chown 0 "$pamtooldir/auth_pam_tool_dir/auth_pam_tool" && \ -+ chmod 04755 "$pamtooldir/auth_pam_tool_dir/auth_pam_tool" -+ if test $? -ne 0 -+ then -+ echo "Couldn't set an owner to '$pamtooldir/auth_pam_tool_dir/auth_pam_tool'." -+ echo " It must be root, the PAM authentication plugin doesn't work otherwise.." -+ echo -+ fi ++ chown 0 "$pamtooldir/auth_pam_tool_dir/auth_pam_tool" && \ ++ chmod 04755 "$pamtooldir/auth_pam_tool_dir/auth_pam_tool" ++ if test $? -ne 0 ++ then + echo "Couldn't set an owner to '$pamtooldir/auth_pam_tool_dir/auth_pam_tool'." + echo "It must be root, the PAM authentication plugin doesn't work otherwise.." + echo ++ fi fi - fi - args="$args --user=$user" - + chown $user "$pamtooldir/auth_pam_tool_dir" && \ + chmod 0700 "$pamtooldir/auth_pam_tool_dir" diff --git a/mariadb-ownsetup.patch b/mariadb-ownsetup.patch index 7728cf1..23dcba8 100644 --- a/mariadb-ownsetup.patch +++ b/mariadb-ownsetup.patch @@ -1,17 +1,17 @@ ---- mariadb-10.4.14/support-files/CMakeLists.txt 2020-08-06 17:28:28.000000000 +0200 -+++ mariadb-10.4.14/support-files/CMakeLists.txt_patched 2020-09-03 13:21:07.826658279 +0200 -@@ -187,6 +187,7 @@ IF(UNIX) - COMPONENT SharedLibraries) - INSTALL(FILES rpm/mysql-clients.cnf DESTINATION ${INSTALL_SYSCONF2DIR} - COMPONENT Client) -+ CONFIGURE_FILE(rpm/server.cnf ${CMAKE_CURRENT_SOURCE_DIR}/rpm/server.cnf @ONLY) - INSTALL(FILES rpm/server.cnf DESTINATION ${INSTALL_SYSCONF2DIR} - COMPONENT IniFiles) - INSTALL(FILES rpm/enable_encryption.preset DESTINATION ${INSTALL_SYSCONF2DIR} - -diff -up mariadb-10.0.15/support-files/rpm/server.cnf.ownsetup mariadb-10.0.15/support-files/rpm/server.cnf ---- mariadb-10.0.15/support-files/rpm/server.cnf.ownsetup 2015-01-24 23:55:55.110063592 +0100 -+++ mariadb-10.0.15/support-files/rpm/server.cnf 2015-01-24 23:57:42.308114387 +0100 +diff -up mariadb-10.1.8/support-files/CMakeLists.txt.p9 mariadb-10.1.8/support-files/CMakeLists.txt +--- mariadb-10.1.8/support-files/CMakeLists.txt.p9 2015-11-03 11:38:46.029139464 +0100 ++++ mariadb-10.1.8/support-files/CMakeLists.txt 2015-11-03 11:41:07.107605055 +0100 +@@ -62,6 +62,7 @@ IF(UNIX) + ENDIF() + + CONFIGURE_FILE(mariadb.pc.in ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc @ONLY) ++ CONFIGURE_FILE(rpm/server.cnf ${CMAKE_CURRENT_BINARY_DIR}/rpm/server.cnf @ONLY) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc DESTINATION ${INSTALL_SHAREDIR}/pkgconfig COMPONENT Development) + + INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development) +diff -up mariadb-10.1.8/support-files/rpm/server.cnf.p9 mariadb-10.1.8/support-files/rpm/server.cnf +--- mariadb-10.1.8/support-files/rpm/server.cnf.p9 2015-10-15 17:44:19.000000000 +0200 ++++ mariadb-10.1.8/support-files/rpm/server.cnf 2015-11-03 11:38:25.228070808 +0100 @@ -9,7 +9,16 @@ [server] diff --git a/mariadb-pcdir.patch b/mariadb-pcdir.patch new file mode 100644 index 0000000..d9a8a78 --- /dev/null +++ b/mariadb-pcdir.patch @@ -0,0 +1,20 @@ +Use PCDIR CMake option, if configured + +Upstream install the server pkgconfig file into arch-independent directory +Reported to upstream as: https://jira.mariadb.org/browse/MDEV-14340 + +--- mariadb-10.3.12/support-files/CMakeLists.txt 2019-03-20 15:25:53.423283135 +0100 ++++ mariadb-10.3.12/support-files/CMakeLists.txt_patched 2019-03-20 15:38:56.372819958 +0100 +@@ -82,7 +82,12 @@ IF(UNIX) + + CONFIGURE_FILE(mariadb.pc.in ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc @ONLY) + CONFIGURE_FILE(rpm/server.cnf ${CMAKE_CURRENT_BINARY_DIR}/rpm/server.cnf @ONLY) ++IF(INSTALL_PCDIR) ++ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc DESTINATION ${INSTALL_PCDIR} COMPONENT Development) ++ELSE() + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc DESTINATION ${INSTALL_SHAREDIR}/pkgconfig COMPONENT Development) ++ENDIF() ++ + + INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development) + diff --git a/mariadb.spec b/mariadb.spec index aabc7f9..252d57b 100644 --- a/mariadb.spec +++ b/mariadb.spec @@ -15,7 +15,7 @@ # The last version on which the full testsuite has been run # In case of further rebuilds of that version, don't require full testsuite to be run # run only "main" suite -%global last_tested_version 10.4.14 +%global last_tested_version 10.5.1 # Set to 1 to force run the testsuite even if it was already tested in current version %global force_run_testsuite 0 @@ -104,14 +104,14 @@ -# MariaDB 10.1.39 and later requires pcre >= 8.43, otherwise we need to use +# MariaDB 10.0 and later requires pcre >= 10.34, otherwise we need to use # the bundled library, since the package cannot be build with older version # https://mariadb.com/kb/en/pcre/ %if 0%{?fedora} || 0%{?rhel} > 7 %bcond_without unbundled_pcre %else %bcond_with unbundled_pcre -%global pcre_bundled_version 8.43 +%global pcre_bundled_version 10.34 %endif # Use main python interpretter version @@ -151,7 +151,7 @@ %global sameevr %{epoch}:%{version}-%{release} Name: mariadb -Version: 10.5.0 +Version: 10.5.1 Release: 1%{?with_debug:.debug}%{?dist} Epoch: 3 @@ -194,14 +194,14 @@ Patch7: %{pkgnamepatch}-scripts.patch Patch9: %{pkgnamepatch}-ownsetup.patch # Patch10: Fix cipher name in the SSL Cipher name test Patch10: %{pkgnamepatch}-ssl-cipher-tests.patch +# Patch11: Use PCDIR CMake option, if configured +Patch11: %{pkgnamepatch}-pcdir.patch # Patch13: Fix Spider code on armv7hl; https://jira.mariadb.org/browse/MDEV-18737 Patch13: %{pkgnamepatch}-spider_on_armv7hl.patch # Patch15: Add option to edit groonga's and groonga-normalizer-mysql install path Patch15: %{pkgnamepatch}-groonga.patch # Patch16: Workaround for "chown 0" with priviledges dropped to "mysql" user Patch16: %{pkgnamepatch}-auth_pam_tool_dir.patch -# Patch17: Fix of an upstream bug. Fixed in the next (10.5.1) version. -Patch17: %{pkgnamepatch}-10.5.0-libsql_builtins.patch BuildRequires: cmake gcc-c++ BuildRequires: multilib-rpm-config @@ -227,9 +227,9 @@ BuildRequires: bison bison-devel # auth_pam.so plugin will be build if pam-devel is installed BuildRequires: pam-devel -# use either new enough version of pcre or provide bundles(pcre) -%{?with_unbundled_pcre:BuildRequires: pcre-devel >= 8.43 pkgconf} -%{!?with_unbundled_pcre:Provides: bundled(pcre) = %{pcre_bundled_version}} +# use either new enough version of pcre2 or provide bundles(pcre2) +%{?with_unbundled_pcre:BuildRequires: pcre2-devel >= 10.34 pkgconf} +%{!?with_unbundled_pcre:Provides: bundled(pcre2) = %{pcre_bundled_version}} # Few utilities needs Perl %if 0%{?fedora} || 0%{?rhel} > 7 BuildRequires: perl-interpreter @@ -711,10 +711,10 @@ rm -r storage/rocksdb/ %patch7 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 #%patch13 -p1 %patch15 -p1 %patch16 -p1 -%patch17 -p1 # workaround for upstream bug #56342 #rm mysql-test/t/ssl_8k_key-master.opt @@ -746,22 +746,20 @@ sed 's/mariadb-server-galera/%{name}-server-galera/' %{SOURCE72} > selinux/%{nam # Get version of PCRE, that upstream use -pcre_maj=`grep '^m4_define(pcre_major' pcre/configure.ac | sed -r 's/^m4_define\(pcre_major, \[([0-9]+)\]\)/\1/'` -pcre_min=`grep '^m4_define(pcre_minor' pcre/configure.ac | sed -r 's/^m4_define\(pcre_minor, \[([0-9]+)\]\)/\1/'` +pcre_version=`grep -e "ftp.pcre.org/pub/pcre/pcre2" cmake/pcre.cmake | sed -r "s;[^0123456789]*2-([[:digit:]]+\.[[:digit:]]+)\.[^0123456789]*;\1;"` -%if %{without unbundled_pcre} # Check if the PCRE version in macro 'pcre_bundled_version', used in Provides: bundled(...), is the same version as upstream actually bundles -if [ %{pcre_bundled_version} != "$pcre_maj.$pcre_min" ] -then - echo "\n Error: Bundled PCRE version is not correct. \n\tBundled version number:%{pcre_bundled_version} \n\tUpstream version number: $pcre_maj.$pcre_min\n" +%if %{without unbundled_pcre} +if [ %{pcre_bundled_version} != "$pcre_version" ] ; then + echo "\n Error: Bundled PCRE version is not correct. \n\tBundled version number:%{pcre_bundled_version} \n\tUpstream version number: $pcre_version\n" exit 1 fi %else # Check if the PCRE version that upstream use, is the same as the one present in system -pcre_system_version=`pkgconf %{_libdir}/pkgconfig/libpcre.pc --modversion 2>/dev/null ` -if [ "$pcre_system_version" != "$pcre_maj.$pcre_min" ] -then - echo "\n Warning: Error: Bundled PCRE version is not correct. \n\tSystem version number:$pcre_system_version \n\tUpstream version number: $pcre_maj.$pcre_min\n" +pcre_system_version=`pkgconf %{_libdir}/pkgconfig/libpcre2-*.pc --modversion 2>/dev/null | head -n 1` + +if [ "$pcre_system_version" != "$pcre_version" ] ; then + echo "\n Warning: Error: Bundled PCRE version is not correct. \n\tSystem version number:$pcre_system_version \n\tUpstream version number: $pcre_version\n" fi %endif @@ -941,9 +939,8 @@ rm %{buildroot}%{_libexecdir}/rcmysql # install systemd unit files and scripts for handling server startup install -D -p -m 644 %{_vpath_builddir}/scripts/mysql.service %{buildroot}%{_unitdir}/%{daemon_name}.service install -D -p -m 644 %{_vpath_builddir}/scripts/mysql@.service %{buildroot}%{_unitdir}/%{daemon_name}@.service -# Remove the upstream version -rm %{buildroot}%{_tmpfilesdir}/mariadb.conf -# Install downstream version + +# Install downstream version of tmpfiles install -D -p -m 0644 %{_vpath_builddir}/scripts/mysql.tmpfiles.d %{buildroot}%{_tmpfilesdir}/%{name}.conf %if 0%{?mysqld_pid_dir:1} echo "d %{pidfiledir} 0755 mysql mysql -" >>%{buildroot}%{_tmpfilesdir}/%{name}.conf @@ -1020,7 +1017,12 @@ rm %{buildroot}%{logrotateddir}/mysql # Remove AppArmor files rm -r %{buildroot}%{_datadir}/%{pkg_name}/policy/apparmor -mv %{buildroot}/%{_lib}/security %{buildroot}%{_libdir} +# Buildroot does not have symlink /lib64 --> /usr/lib64 +%if %{__isa_bits} == 64 && 0%{?fedora} +mv %{buildroot}/lib64/security %{buildroot}%{_libdir} +%else +mv %{buildroot}/lib/security %{buildroot}%{_libdir} +%endif # Disable plugins %if %{with gssapi} @@ -1344,6 +1346,8 @@ fi %{_bindir}/myisampack %{_bindir}/my_print_defaults +%{_bindir}/mariadb-conv + %{_bindir}/mysql_{install_db,secure_installation,tzinfo_to_sql} %{_bindir}/mariadb-{install-db,secure-installation,tzinfo-to-sql} %{_bindir}/{mysqld_,mariadbd-}safe @@ -1583,7 +1587,10 @@ fi %endif %changelog -* Tue Sep 08 2020 Michal Schorm - 10.5.0-1 +* Thu Apr 09 2020 Michal Schorm - 10.5.1-1 +- Test rebase to 10.5.1 - Beta + +* Thu Apr 09 2020 Michal Schorm - 10.5.0-1 - Test rebase to 10.5.0 - Alpha * Sun Sep 06 2020 Michal Schorm - 10.4.14-3 diff --git a/sources b/sources index 96ad160..59c9f1f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (mariadb-10.5.0.tar.gz) = ed7226a0e0b8d0aa435691a43f457bf338b484fc2dd893b8490c65bf99915a089e6c91a86687ef2eaa3728d83a91f5c0dfd7b8ddbefec79f9ad4cd7074bda4c5 +SHA512 (mariadb-10.5.1.tar.gz) = eef4986fa0ff70b77d9d083ccbe6738d7bfda4236e3098bf37cd41034732cc8a8150a25be19ffb67849d9b29c5f1126c5b38e10e6a1afd9eb8d6d266b3638fb2