2 |
%define name smeserver-mysql |
%define name smeserver-mysql |
3 |
Name: %{name} |
Name: %{name} |
4 |
%define version 2.7.0 |
%define version 2.7.0 |
5 |
%define release 12 |
%define release 17 |
6 |
Version: %{version} |
Version: %{version} |
7 |
Release: %{release}%{?dist} |
Release: %{release}%{?dist} |
8 |
License: GPL |
License: GPL |
10 |
Source: %{name}-%{version}.tar.xz |
Source: %{name}-%{version}.tar.xz |
11 |
Patch0: smeserver-mysql-2.7.0-bz11899-sclo.patch |
Patch0: smeserver-mysql-2.7.0-bz11899-sclo.patch |
12 |
Patch1: smeserver-mysql-2.7.0-bz11922-mysqlinit.patch |
Patch1: smeserver-mysql-2.7.0-bz11922-mysqlinit.patch |
13 |
|
Patch2: smeserver-mysql-2.7.0-bz11936.patch |
14 |
|
Patch3: smeserver-mysql-2.7.0-bz11953-mysql.init-logging.patch |
15 |
|
Patch4: smeserver-mysql-2.7.0-bz12262-skipnetworking.patch |
16 |
|
|
17 |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
18 |
BuildArchitectures: noarch |
BuildArchitectures: noarch |
36 |
%setup |
%setup |
37 |
%patch0 -p1 |
%patch0 -p1 |
38 |
%patch1 -p1 |
%patch1 -p1 |
39 |
|
%patch2 -p1 |
40 |
|
%patch3 -p1 |
41 |
|
%patch4 -p1 |
42 |
|
|
43 |
%build |
%build |
44 |
for ver in 101 102 103 105 |
for ver in 101 102 103 105 |
136 |
sed -i root$ver/etc/e-smith/templates/etc/e-smith/sql/init$ver/00_restore_dumped_dbs -i root$ver/etc/e-smith/templates/etc/e-smith/sql/init$ver/10mysql_upgrade \ |
sed -i root$ver/etc/e-smith/templates/etc/e-smith/sql/init$ver/00_restore_dumped_dbs -i root$ver/etc/e-smith/templates/etc/e-smith/sql/init$ver/10mysql_upgrade \ |
137 |
-e "s_e-smith/db/mysql_e-smith/db/mariadb${ver}_g" \ |
-e "s_e-smith/db/mysql_e-smith/db/mariadb${ver}_g" \ |
138 |
-e "s_/usr/bin/mysql_/opt/rh/rh-mariadb${ver}/root/usr/bin/mysql_g" \ |
-e "s_/usr/bin/mysql_/opt/rh/rh-mariadb${ver}/root/usr/bin/mysql_g" \ |
139 |
-e "s_mariadb.service_rh-mariadb$ver-mariadb.service_" \ |
-e "s_mariadb.service_mariadb$ver-mariadb.service_" \ |
140 |
-e "s_/var/run/mariadb/mariadb.pid_${pidfile}_g" \ |
-e "s_/var/run/mariadb/mariadb.pid_${pidfile}_g" \ |
141 |
-e "s_mysqld_rh-mariadb$ver-mariadb_g" \ |
-e "s_mysqld_mariadb$ver-mariadb_g" \ |
142 |
-e "s_| mysql |_| /opt/rh/rh-mariadb${ver}/root/usr/bin/mysql --socket=$socket |_g" \ |
-e "s_| mysql |_| /opt/rh/rh-mariadb${ver}/root/usr/bin/mysql --socket=$socket |_g" \ |
143 |
-e "s_mysql\_upgrade_mysql\_upgrade --socket=$socket _g" |
-e "s_mysql\_upgrade_mysql\_upgrade --socket=$socket _g" |
144 |
mkdir -p root$ver/etc/e-smith/templates/etc/my.cnf |
mkdir -p root$ver/etc/e-smith/templates/etc/my.cnf |
146 |
[mariadb-$vers]" > root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-05mariadb |
[mariadb-$vers]" > root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-05mariadb |
147 |
echo "basedir=$basedir" > root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-07basedir |
echo "basedir=$basedir" > root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-07basedir |
148 |
echo "datadir=$datadir" > root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-08datadir |
echo "datadir=$datadir" > root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-08datadir |
149 |
cp -a root/etc/e-smith/templates/etc/my.cnf/009socket root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-09socket |
#cp -a root/etc/e-smith/templates/etc/my.cnf/009socket root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-09socket |
150 |
sed -i root$ver/etc/e-smith/templates/etc/my.cnf/$ver-09socket \ |
#sed -i root$ver/etc/e-smith/templates/etc/my.cnf/$ver-09socket \ |
151 |
-e "s_mariadb_{'mariadb${ver}\-mariadb'}_" \ |
# -e "s_mariadb_{'mariadb${ver}\-mariadb'}_" \ |
152 |
-e "s_^socket.*_socket=${socket}_" |
# -e "s_^socket.*_socket=${socket}_" |
153 |
|
cp rootscl/etc/e-smith/templates/etc/my.conf/_VER_-09socket root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-09socket |
154 |
|
sed -i root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-09socket \ |
155 |
|
-e "s_!!!VER!!!_${ver}_g" \ |
156 |
|
-e "s_!!!PORT!!!_${port}_g" |
157 |
cp rootscl/etc/e-smith/templates/etc/my.conf/_VER_-10port root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-10port |
cp rootscl/etc/e-smith/templates/etc/my.conf/_VER_-10port root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-10port |
158 |
sed -i root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-10port \ |
sed -i root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-10port \ |
159 |
-e "s_!!!VER!!!_${ver}_g" \ |
-e "s_!!!VER!!!_${ver}_g" \ |
200 |
if [ $ver -ge 102 ] |
if [ $ver -ge 102 ] |
201 |
then |
then |
202 |
sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \ |
sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \ |
203 |
-e "s/_safe//"; |
-e "s/_safe//" \ |
204 |
|
-e "s/^ExecStopPost.*//"; |
205 |
fi |
fi |
206 |
if [ $ver -ge 104 ] |
if [ $ver -ge 104 ] |
207 |
then |
then |
242 |
--file "/sbin/e-smith/systemd/mysql.init" 'attr(0554,root,root)' \ |
--file "/sbin/e-smith/systemd/mysql.init" 'attr(0554,root,root)' \ |
243 |
--dir '/home/e-smith/db/mysql' 'attr(0750,root,root)' \ |
--dir '/home/e-smith/db/mysql' 'attr(0750,root,root)' \ |
244 |
--dir "/var/log/mariadb" 'attr(0750,mysql,mysql)' \ |
--dir "/var/log/mariadb" 'attr(0750,mysql,mysql)' \ |
245 |
|
--dir "/var/log/mysql.init" 'attr(0750,root,root)' \ |
246 |
> %{name}-%{version}-filelist |
> %{name}-%{version}-filelist |
247 |
echo "%doc COPYING" >> %{name}-%{version}-filelist |
echo "%doc COPYING" >> %{name}-%{version}-filelist |
248 |
|
|
353 |
|
|
354 |
|
|
355 |
%changelog |
%changelog |
356 |
|
* Sun Dec 11 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-17.sme |
357 |
|
- fix mariadb overriding skip-networking for other versions [SME: 12262] |
358 |
|
|
359 |
|
* Mon Jul 11 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-16.sme |
360 |
|
- use dedicated log file for *mysql.init [SME: 11953] |
361 |
|
|
362 |
|
* Tue Jun 07 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 2.7.0-15.sme |
363 |
|
- Fix init for MariaDB 104+ [SME:11991] |
364 |
|
|
365 |
|
* Sun Apr 10 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-14.sme |
366 |
|
- /usr/libexec/mysql-wait-stop not used after mariadb101 [SME: 11936] |
367 |
|
|
368 |
|
* Sat Apr 09 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-13.sme |
369 |
|
- fix few typos [SME: 11936] |
370 |
|
|
371 |
* Sat Apr 02 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-12.sme |
* Sat Apr 02 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-12.sme |
372 |
- remove SourcePath from mysql-init service file [SME: 11922] |
- remove SourcePath from mysql-init service file [SME: 11922] |
373 |
|
|