MySQL Forums
Forum List  »  Install & Repo

Re: 8.0.16-2debian9 ?
Posted by: Terje Røsten
Date: May 12, 2019 10:28AM

hi!

to see the changes in the RPMS download srpm and have look, something like this:


$ wget http://repo.mysql.com/yum/mysql-8.0-community/el/7/SRPMS/mysql-community-8.0.16-2.el7.src.rpm
$ mkdir srpm && cd srpm
$ rpm2cpio ../mysql-community-8.0.16-2.el7.src.rpm | cpio -dim
$ cat mysql-8.0.16-mysql_upgrade_info.patch

diff --git a/packaging/rpm-fedora/mysql.spec.in b/packaging/rpm-fedora/mysql.spec.in
index 9c6ec73c7ca..1475069109e 100644
--- a/packaging/rpm-fedora/mysql.spec.in
+++ b/packaging/rpm-fedora/mysql.spec.in
@@ -64,10 +64,11 @@ Name: mysql-%{product_suffix}
Summary: A very fast and reliable SQL database server
Group: Applications/Databases
Version: @MYSQL_NO_DASH_VERSION@
-Release: 1@MYSQL_VERSION_EXTRA_DOT@%{?dist}
+Release: 2@MYSQL_VERSION_EXTRA_DOT@%{?dist}
License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{?license_type} license as shown in the Description field.
Source0: https://cdn.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz
Source1: https://downloads.sourceforge.net/boost/@BOOST_PACKAGE_NAME@.tar.bz2
+Patch01: mysql-8.0.16-mysql_upgrade_info.patch
URL: http://www.mysql.com/
Packager: MySQL Release Engineering <mysql-build@oss.oracle.com>
Vendor: %{mysql_vendor}
@@ -373,6 +374,8 @@ necessary to develop MySQL Router applications.

%prep
%setup -q -T -a 0 -a 1 -c -n %{src_dir}
+pushd %{src_dir}
+%patch01 -p1

%build
# Fail quickly and obviously if user tries to build as root
diff --git a/packaging/rpm-oel/mysql.init b/packaging/rpm-oel/mysql.init
index 65b0da2e203..b20ed08bd0c 100644
--- a/packaging/rpm-oel/mysql.init
+++ b/packaging/rpm-oel/mysql.init
@@ -73,6 +73,15 @@ install_validate_password_sql_file () {
echo "$initfile"
}

+fix_mysql_upgrade_info () {
+ if [ -d "$datadir" ] && [ -O "$datadir/mysql_upgrade_info" ]; then
+ chown --reference="$datadir" "$datadir/mysql_upgrade_info"
+ if [ -x /usr/bin/chcon ]; then
+ /usr/bin/chcon --reference="$datadir" "$datadir/mysql_upgrade_info"
+ fi
+ fi
+}
+
start(){
[ -x $exec ] || exit 5
# check to see if it's already running
@@ -92,6 +101,10 @@ start(){
install /dev/null -m0640 -omysql -gmysql "$errlogfile"
fi
[ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile"
+
+ # mysql_upgrade_info file should be owned by mysql user since MySQL 8.0.16
+ fix_mysql_upgrade_info
+
if [ ! -d "$datadir/mysql" ] ; then
# First, make sure $datadir is there with correct permissions
if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then
diff --git a/packaging/rpm-oel/mysql.spec.in b/packaging/rpm-oel/mysql.spec.in
index 41a3ee47615..814a6cc7995 100644
--- a/packaging/rpm-oel/mysql.spec.in
+++ b/packaging/rpm-oel/mysql.spec.in
@@ -101,7 +101,7 @@ Name: mysql%{?cluster:-cluster}-%{product_suffix}
Summary: A very fast and reliable SQL database server
Group: Applications/Databases
Version: @MYSQL_NO_DASH_VERSION@
-Release: %{?cluster:0.}1@MYSQL_VERSION_EXTRA_DOT@%{?commercial:.1}%{?dist}
+Release: %{?cluster:0.}2@MYSQL_VERSION_EXTRA_DOT@%{?commercial:.1}%{?dist}
License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{?license_type} license as shown in the Description field.
Source0: https://cdn.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz
URL: http://www.mysql.com/
@@ -113,6 +113,7 @@ Source7: %{compatsrc}
Source10: https://downloads.sourceforge.net/boost/@BOOST_PACKAGE_NAME@.tar.bz2
Source90: filter-provides.sh
Source91: filter-requires.sh
+Patch01: mysql-8.0.16-mysql_upgrade_info.patch
%if 0%{?rhel} >= 8
BuildRequires: cmake >= 3.6.1
BuildRequires: gcc
@@ -664,6 +665,8 @@ trademark of %{mysql_vendor}
%else
%setup -q -T -a 0 -a 10 -c -n %{src_dir}
%endif # 0%{?compatlib}
+pushd %{src_dir}
+%patch01 -p1

%build
# Fail quickly and obviously if user tries to build as root
diff --git a/packaging/rpm-sles/mysql.init b/packaging/rpm-sles/mysql.init
index fc1dc320476..d342583e4c1 100644
--- a/packaging/rpm-sles/mysql.init
+++ b/packaging/rpm-sles/mysql.init
@@ -85,6 +85,15 @@ install_validate_password_sql_file () {
echo $initfile
}

+fix_mysql_upgrade_info () {
+ if [ -d "$datadir" ] && [ -O "$datadir/mysql_upgrade_info" ]; then
+ chown --reference="$datadir" "$datadir/mysql_upgrade_info"
+ if [ -x /usr/bin/chcon ]; then
+ /usr/bin/chcon --reference="$datadir" "$datadir/mysql_upgrade_info" > /dev/null 2>&1
+ fi
+ fi
+}
+
install_db () {
# Note: something different than datadir=/var/lib/mysql requires
# SELinux policy changes (in enforcing mode)
@@ -104,6 +113,9 @@ install_db () {
/usr/sbin/restorecon "$logfile"
fi

+ # mysql_upgrade_info file should be owned by mysql user since MySQL 8.0.16
+ fix_mysql_upgrade_info
+
# If special mysql dir is in place, skip db install
[ -d "$datadir/mysql" ] && return 0

diff --git a/packaging/rpm-sles/mysql.spec.in b/packaging/rpm-sles/mysql.spec.in
index 2380a60c39d..5eef0d40219 100644
--- a/packaging/rpm-sles/mysql.spec.in
+++ b/packaging/rpm-sles/mysql.spec.in
@@ -105,7 +105,7 @@ Name: mysql%{?cluster:-cluster}-%{product_suffix}
Summary: A very fast and reliable SQL database server
Group: Applications/Databases
Version: @MYSQL_NO_DASH_VERSION@
-Release: %{?cluster:0.}1@MYSQL_VERSION_EXTRA_DOT@%{?commercial:.1}%{?dist}
+Release: %{?cluster:0.}2@MYSQL_VERSION_EXTRA_DOT@%{?commercial:.1}%{?dist}
License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{?license_type} license as shown in the Description field.
Source0: https://cdn.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz
URL: http://www.mysql.com/
@@ -114,6 +114,7 @@ Vendor: %{mysql_vendor}
Source10: https://downloads.sourceforge.net/boost/@BOOST_PACKAGE_NAME@.tar.bz2
Source90: filter-provides.sh
Source91: filter-requires.sh
+Patch01: mysql-8.0.16-mysql_upgrade_info.patch
BuildRequires: cmake >= 2.8.2
BuildRequires: perl
BuildRequires: perl(Config)
@@ -574,6 +575,7 @@ necessary to develop MySQL Router applications.
%prep
%setup -q -T -a 0 -a 10 -c -n %{src_dir}
pushd %{src_dir}
+%patch01 -p1

%build
# Fail quickly and obviously if user tries to build as root
diff --git a/scripts/systemd/mysqld_pre_systemd.in b/scripts/systemd/mysqld_pre_systemd.in
index 72623504d04..a066f9ec1fb 100644
--- a/scripts/systemd/mysqld_pre_systemd.in
+++ b/scripts/systemd/mysqld_pre_systemd.in
@@ -45,9 +45,22 @@ install_validate_password_sql_file () {
echo $initfile
}

+fix_mysql_upgrade_info () {
+ datadir=$(get_option mysqld datadir "/var/lib/mysql${instance:+-$instance}" $instance)
+ if [ -d "$datadir" ] && [ -O "$datadir/mysql_upgrade_info" ]; then
+ chown --reference="$datadir" "$datadir/mysql_upgrade_info"
+ if [ -x /usr/bin/chcon ]; then
+ /usr/bin/chcon --reference="$datadir" "$datadir/mysql_upgrade_info" > /dev/null 2>&1
+ fi
+ fi
+}
+
install_db () {
# Note: something different than datadir=/var/lib/mysql requires SELinux policy changes (in enforcing mode)

+ # mysql_upgrade_info file should be owned by mysql user since MySQL 8.0.16
+ fix_mysql_upgrade_info
+
# No automatic init wanted
[ -e /etc/sysconfig/mysql ] && . /etc/sysconfig/mysql
[ -n "$NO_INIT" ] && exit 0

Options: ReplyQuote


Subject
Written By
Posted
May 10, 2019 08:40AM
May 10, 2019 03:57PM
Re: 8.0.16-2debian9 ?
May 12, 2019 10:28AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.