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 4 |
%define release 14 |
6 |
Version: %{version} |
Version: %{version} |
7 |
Release: %{release}%{?dist} |
Release: %{release}%{?dist} |
8 |
License: GPL |
License: GPL |
9 |
Group: Networking/Daemons |
Group: Networking/Daemons |
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 |
13 |
|
Patch2: smeserver-mysql-2.7.0-bz11936.patch |
14 |
|
|
15 |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
16 |
BuildArchitectures: noarch |
BuildArchitectures: noarch |
17 |
Requires: mariadb-server |
Requires: mariadb-server |
18 |
|
# mariadb after 5.5 /in Centos 8 will package mysql_upgrade in mariadb-server-utils |
19 |
|
# Requires: /usr/bin/mysql_upgrade |
20 |
Requires: mariadb |
Requires: mariadb |
21 |
Requires: e-smith-base |
Requires: e-smith-base |
22 |
Requires: e-smith-lib >= 1.15.1-19 |
Requires: e-smith-lib >= 1.15.1-19 |
33 |
%prep |
%prep |
34 |
%setup |
%setup |
35 |
%patch0 -p1 |
%patch0 -p1 |
36 |
|
%patch1 -p1 |
37 |
|
%patch2 -p1 |
38 |
|
|
39 |
%build |
%build |
40 |
for ver in 101 102 103 105 |
for ver in 101 102 103 105 |
118 |
-i root$ver/etc/e-smith/events/actions/mariadb${ver}-delete-dumped-tables \ |
-i root$ver/etc/e-smith/events/actions/mariadb${ver}-delete-dumped-tables \ |
119 |
-i root$ver/etc/e-smith/events/actions/mariadb${ver}-dump-tables \ |
-i root$ver/etc/e-smith/events/actions/mariadb${ver}-dump-tables \ |
120 |
-i root$ver/etc/e-smith/events/actions/mariadb${ver}-load-tables \ |
-i root$ver/etc/e-smith/events/actions/mariadb${ver}-load-tables \ |
121 |
-e "s_!!!VER!!!_${ver}_g" |
-e "s_!!!VER!!!_${ver}_g" \ |
122 |
|
-e "s_!!!SOCKET!!!_${socket}_g" |
123 |
|
|
124 |
##metadata |
##metadata |
125 |
mkdir -p root$ver/etc/e-smith/templates.metadata/etc/e-smith/ |
mkdir -p root$ver/etc/e-smith/templates.metadata/etc/e-smith/sql |
126 |
cp -a root/etc/e-smith/templates.metadata/etc/e-smith/sql root$ver/etc/e-smith/templates.metadata/etc/e-smith/sql$ver |
cp -a root/etc/e-smith/templates.metadata/etc/e-smith/sql/init root$ver/etc/e-smith/templates.metadata/etc/e-smith/sql/init$ver |
127 |
|
|
128 |
|
|
129 |
##templates |
##templates |
132 |
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 \ |
133 |
-e "s_e-smith/db/mysql_e-smith/db/mariadb${ver}_g" \ |
-e "s_e-smith/db/mysql_e-smith/db/mariadb${ver}_g" \ |
134 |
-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" \ |
135 |
-e "s_mariadb.service_rh-mariadb$ver-mariadb.service_" \ |
-e "s_mariadb.service_mariadb$ver-mariadb.service_" \ |
136 |
-e "s_/var/run/mariadb/mariadb.pid_${pidfile}_g" \ |
-e "s_/var/run/mariadb/mariadb.pid_${pidfile}_g" \ |
137 |
-e "s_mysqld_rh-mariadb$ver-mariadb_g" \ |
-e "s_mysqld_mariadb$ver-mariadb_g" \ |
138 |
-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" \ |
139 |
-e "s_mysql\_upgrade_mysql\_upgrade --socket=$socket _g" |
-e "s_mysql\_upgrade_mysql\_upgrade --socket=$socket _g" |
140 |
mkdir -p root$ver/etc/e-smith/templates/etc/my.cnf |
mkdir -p root$ver/etc/e-smith/templates/etc/my.cnf |
167 |
sed -i root$ver/sbin/e-smith/systemd/mariadb${ver}-initialize -i root$ver/sbin/e-smith/systemd/mariadb${ver}-mysql.init \ |
sed -i root$ver/sbin/e-smith/systemd/mariadb${ver}-initialize -i root$ver/sbin/e-smith/systemd/mariadb${ver}-mysql.init \ |
168 |
-i root$ver/sbin/e-smith/mariadb${ver}-preload \ |
-i root$ver/sbin/e-smith/mariadb${ver}-preload \ |
169 |
-e "s_!!!VER!!!_${ver}_g" \ |
-e "s_!!!VER!!!_${ver}_g" \ |
170 |
-e "s_!!!SOCKET!!!_$socket _g" |
-e "s_!!!SOCKET!!!_${socket}_g" |
171 |
|
if [ $ver -ge 104 ] |
172 |
|
then |
173 |
|
cp rootscl/sbin/e-smith/systemd/mariadb_VER_-post root$ver/sbin/e-smith/systemd/mariadb${ver}-post |
174 |
|
sed -i root$ver/sbin/e-smith/systemd/mariadb${ver}-post -e "s_!!!VER!!!_${ver}_g" -e "s_!!!SOCKET!!!_${socket}_g" |
175 |
|
fi |
176 |
|
|
177 |
|
|
178 |
## logrotate |
## logrotate |
179 |
mkdir -p root$ver/etc/logrotate.d/ |
mkdir -p root$ver/etc/logrotate.d/ |
192 |
if [ $ver -ge 102 ] |
if [ $ver -ge 102 ] |
193 |
then |
then |
194 |
sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \ |
sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \ |
195 |
-e "s/_safe//"; |
-e "s/_safe//" \ |
196 |
|
-e "s/^ExecStopPost.*//"; |
197 |
|
fi |
198 |
|
if [ $ver -ge 104 ] |
199 |
|
then |
200 |
|
sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \ |
201 |
|
-e 's_set.password$_set.password2_' |
202 |
|
sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \ |
203 |
|
-e "/^#ExecStartPost=/ i ExecStartPost=\/sbin\/e-smith\/systemd\/mariadb${ver}-post" |
204 |
|
|
205 |
fi |
fi |
206 |
|
|
207 |
#### TODO check it is similar to rh one and functional ! |
#### TODO check it is similar to rh one and functional ! |
208 |
|
|
209 |
#/usb/bin to ease user |
#/usr/bin to ease user |
210 |
mkdir root$ver/usr/bin |
mkdir root$ver/usr/bin |
211 |
for i in mysql mysqlshow mysqladmin mysqldump mysqlimport mysqlbinlog |
for i in mysql mysqlshow mysqladmin mysqldump mysqlimport mysqlbinlog |
212 |
do |
do |
213 |
echo "/opt/rh/rh-mariadb${ver}/root/usr/bin/$i --socket=/var/lib/mysql/maradb${ver}.sock \"\$@\"" >root$ver/usr/bin/$i${ver} |
echo "/opt/rh/rh-mariadb${ver}/root/usr/bin/$i --socket=/var/lib/mysql/mariadb${ver}.sock \"\$@\"" >root$ver/usr/bin/$i${ver} |
214 |
done |
done |
215 |
|
|
216 |
#phpMyAdmin template |
#phpMyAdmin template |
217 |
mkdir -p root$ver/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/ |
mkdir -p root$ver/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/ |
218 |
sed rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_ \ |
sed rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_ \ |
219 |
-e "s_!!!SOCKET!!!_$socket _g" \ |
-e "s_!!!SOCKET!!!_${socket}_g" \ |
220 |
-e "s_!!!VER!!!_${ver}_g" > root$ver/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql${ver} |
-e "s_!!!VER!!!_${ver}_g" > root$ver/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql${ver} |
221 |
|
|
222 |
done |
done |
244 |
/sbin/e-smith/genfilelist root$ver/ \ |
/sbin/e-smith/genfilelist root$ver/ \ |
245 |
--file "/sbin/e-smith/systemd/mariadb$ver-initialize" 'attr(0554,root,root)' \ |
--file "/sbin/e-smith/systemd/mariadb$ver-initialize" 'attr(0554,root,root)' \ |
246 |
--file "/sbin/e-smith/systemd/mariadb$ver-mysql.init" 'attr(0554,root,root)' \ |
--file "/sbin/e-smith/systemd/mariadb$ver-mysql.init" 'attr(0554,root,root)' \ |
247 |
|
--file "/sbin/e-smith/systemd/mariadb$ver-post" 'attr(0554,root,root)' \ |
248 |
--dir "/home/e-smith/db/mariadb$ver" 'attr(0750,root,root)' \ |
--dir "/home/e-smith/db/mariadb$ver" 'attr(0750,root,root)' \ |
249 |
--dir "/var/log/mariadb$ver" 'attr(0750,mysql,mysql)' \ |
--dir "/var/log/mariadb$ver" 'attr(0750,mysql,mysql)' \ |
250 |
--file "/usr/bin/mysql$ver" 'attr(0554,root,root)' \ |
--file "/usr/bin/mysql$ver" 'attr(0554,root,root)' \ |
314 |
Requires: rh-mariadb103 |
Requires: rh-mariadb103 |
315 |
Requires: rh-mariadb103-mariadb |
Requires: rh-mariadb103-mariadb |
316 |
Requires: rh-mariadb103-mariadb-server |
Requires: rh-mariadb103-mariadb-server |
317 |
|
Requires: rh-mariadb103-mariadb-server-utils |
318 |
BuildRequires: e-smith-devtools >= 1.13.1-03 |
BuildRequires: e-smith-devtools >= 1.13.1-03 |
319 |
|
|
320 |
%description -n smeserver-mariadb103 |
%description -n smeserver-mariadb103 |
330 |
Requires: rh-mariadb105 |
Requires: rh-mariadb105 |
331 |
Requires: rh-mariadb105-mariadb |
Requires: rh-mariadb105-mariadb |
332 |
Requires: rh-mariadb105-mariadb-server |
Requires: rh-mariadb105-mariadb-server |
333 |
|
Requires: rh-mariadb105-mariadb-server-utils |
334 |
BuildRequires: e-smith-devtools >= 1.13.1-03 |
BuildRequires: e-smith-devtools >= 1.13.1-03 |
335 |
Requires: smeserver-mysql >= 2.7.0-4 |
Requires: smeserver-mysql >= 2.7.0-5 |
336 |
%description -n smeserver-mariadb105 |
%description -n smeserver-mariadb105 |
337 |
Koozali SME Server configuration package for mariadb105 RH SCLo |
Koozali SME Server configuration package for mariadb105 RH SCLo |
338 |
|
|
344 |
|
|
345 |
|
|
346 |
%changelog |
%changelog |
347 |
* Sun Mar 13 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-4.sme |
* Sun Apr 10 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-14.sme |
348 |
|
- /usr/libexec/mysql-wait-stop not used after mariadb101 [SME: 11936] |
349 |
|
|
350 |
|
* Sat Apr 09 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-13.sme |
351 |
|
- fix few typos [SME: 11936] |
352 |
|
|
353 |
|
* Sat Apr 02 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-12.sme |
354 |
|
- remove SourcePath from mysql-init service file [SME: 11922] |
355 |
|
|
356 |
|
* Wed Mar 16 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-11.sme |
357 |
|
- fix mariadb*-mysql.init path in service file [SME: 11899] |
358 |
|
|
359 |
|
* Wed Mar 16 2022 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-10.sme |
360 |
|
- fix sclo metadata path for sql/init templated scripts [SME: 11899] |
361 |
|
|
362 |
|
* Wed Mar 16 2022 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-8.sme |
363 |
|
- missing sockets for backup of db [SME: 11899] |
364 |
|
|
365 |
|
* Mon Mar 14 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-7.sme |
366 |
|
- adding requirement for mariadb-server-utils (105 and 103) [SME: 11899] |
367 |
|
|
368 |
|
* Mon Mar 14 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-6.sme |
369 |
|
- fix password for mariadb 105 [SME: 11899] |
370 |
|
|
371 |
|
* Sun Mar 13 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-5.sme |
372 |
- fix typo in socket, seen with phpmyadmin [SME: 11899] |
- fix typo in socket, seen with phpmyadmin [SME: 11899] |
373 |
- fix permissions for mariadb105 [SME: 11899] |
- fix permissions for mariadb105 [SME: 11899] |
374 |
|
create a dedicated set.password for mariadb>103 |
375 |
|
|
376 |
* Sun Mar 13 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-3.sme |
* Sun Mar 13 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-3.sme |
377 |
- missing phpMyAdmin fragments [SME: 11899] |
- missing phpMyAdmin fragments [SME: 11899] |