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 3 |
%define release 16 |
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 |
|
Patch3: smeserver-mysql-2.7.0-bz11953-mysql.init-logging.patch |
15 |
|
|
16 |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
17 |
BuildArchitectures: noarch |
BuildArchitectures: noarch |
18 |
Requires: mariadb-server |
Requires: mariadb-server |
19 |
|
# mariadb after 5.5 /in Centos 8 will package mysql_upgrade in mariadb-server-utils |
20 |
|
# Requires: /usr/bin/mysql_upgrade |
21 |
Requires: mariadb |
Requires: mariadb |
22 |
Requires: e-smith-base |
Requires: e-smith-base |
23 |
Requires: e-smith-lib >= 1.15.1-19 |
Requires: e-smith-lib >= 1.15.1-19 |
34 |
%prep |
%prep |
35 |
%setup |
%setup |
36 |
%patch0 -p1 |
%patch0 -p1 |
37 |
|
%patch1 -p1 |
38 |
|
%patch2 -p1 |
39 |
|
%patch3 -p1 |
40 |
|
|
41 |
%build |
%build |
42 |
for ver in 101 102 103 105 |
for ver in 101 102 103 105 |
58 |
# default values from /etc/opt/rh/rh-mariadb101/my.cnf.d/mariadb-server.cnf |
# default values from /etc/opt/rh/rh-mariadb101/my.cnf.d/mariadb-server.cnf |
59 |
basedir="/opt/rh/rh-mariadb$ver/root/usr" |
basedir="/opt/rh/rh-mariadb$ver/root/usr" |
60 |
datadir="/var/opt/rh/rh-mariadb$ver/lib/mysql" |
datadir="/var/opt/rh/rh-mariadb$ver/lib/mysql" |
61 |
socket="/var/lib/mysql/maradb$ver.sock" |
socket="/var/lib/mysql/mariadb$ver.sock" |
62 |
logerror="/var//log/mariadb$ver/mariadb.log" |
logerror="/var//log/mariadb$ver/mariadb.log" |
63 |
#"/var/opt/rh/rh-mariadb$ver/log/mariadb/mariadb.log" |
#"/var/opt/rh/rh-mariadb$ver/log/mariadb/mariadb.log" |
64 |
pidfile="/var/run/rh-mariadb$ver-mariadb/mariadb.pid" |
pidfile="/var/run/rh-mariadb$ver-mariadb/mariadb.pid" |
120 |
-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 \ |
121 |
-i root$ver/etc/e-smith/events/actions/mariadb${ver}-dump-tables \ |
-i root$ver/etc/e-smith/events/actions/mariadb${ver}-dump-tables \ |
122 |
-i root$ver/etc/e-smith/events/actions/mariadb${ver}-load-tables \ |
-i root$ver/etc/e-smith/events/actions/mariadb${ver}-load-tables \ |
123 |
-e "s_!!!VER!!!_${ver}_g" |
-e "s_!!!VER!!!_${ver}_g" \ |
124 |
|
-e "s_!!!SOCKET!!!_${socket}_g" |
125 |
|
|
126 |
##metadata |
##metadata |
127 |
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 |
128 |
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 |
129 |
|
|
130 |
|
|
131 |
##templates |
##templates |
134 |
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 \ |
135 |
-e "s_e-smith/db/mysql_e-smith/db/mariadb${ver}_g" \ |
-e "s_e-smith/db/mysql_e-smith/db/mariadb${ver}_g" \ |
136 |
-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" \ |
137 |
-e "s_mariadb.service_rh-mariadb$ver-mariadb.service_" \ |
-e "s_mariadb.service_mariadb$ver-mariadb.service_" \ |
138 |
-e "s_/var/run/mariadb/mariadb.pid_${pidfile}_g" \ |
-e "s_/var/run/mariadb/mariadb.pid_${pidfile}_g" \ |
139 |
-e "s_mysqld_rh-mariadb$ver-mariadb_g" \ |
-e "s_mysqld_mariadb$ver-mariadb_g" \ |
140 |
-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" \ |
141 |
-e "s_mysql\_upgrade_mysql\_upgrade --socket=$socket _g" |
-e "s_mysql\_upgrade_mysql\_upgrade --socket=$socket _g" |
142 |
mkdir -p root$ver/etc/e-smith/templates/etc/my.cnf |
mkdir -p root$ver/etc/e-smith/templates/etc/my.cnf |
169 |
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 \ |
170 |
-i root$ver/sbin/e-smith/mariadb${ver}-preload \ |
-i root$ver/sbin/e-smith/mariadb${ver}-preload \ |
171 |
-e "s_!!!VER!!!_${ver}_g" \ |
-e "s_!!!VER!!!_${ver}_g" \ |
172 |
-e "s_!!!SOCKET!!!_$socket _g" |
-e "s_!!!SOCKET!!!_${socket}_g" |
173 |
|
if [ $ver -ge 104 ] |
174 |
|
then |
175 |
|
cp rootscl/sbin/e-smith/systemd/mariadb_VER_-post root$ver/sbin/e-smith/systemd/mariadb${ver}-post |
176 |
|
sed -i root$ver/sbin/e-smith/systemd/mariadb${ver}-post -e "s_!!!VER!!!_${ver}_g" -e "s_!!!SOCKET!!!_${socket}_g" |
177 |
|
fi |
178 |
|
|
179 |
|
|
180 |
## logrotate |
## logrotate |
181 |
mkdir -p root$ver/etc/logrotate.d/ |
mkdir -p root$ver/etc/logrotate.d/ |
194 |
if [ $ver -ge 102 ] |
if [ $ver -ge 102 ] |
195 |
then |
then |
196 |
sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \ |
sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \ |
197 |
-e "s/_safe//"; |
-e "s/_safe//" \ |
198 |
|
-e "s/^ExecStopPost.*//"; |
199 |
|
fi |
200 |
|
if [ $ver -ge 104 ] |
201 |
|
then |
202 |
|
sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \ |
203 |
|
-e 's_set.password$_set.password2_' |
204 |
|
sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \ |
205 |
|
-e "/^#ExecStartPost=/ i ExecStartPost=\/sbin\/e-smith\/systemd\/mariadb${ver}-post" |
206 |
|
|
207 |
fi |
fi |
208 |
|
|
209 |
#### TODO check it is similar to rh one and functional ! |
#### TODO check it is similar to rh one and functional ! |
210 |
|
|
211 |
#/usb/bin to ease user |
#/usr/bin to ease user |
212 |
mkdir root$ver/usr/bin |
mkdir root$ver/usr/bin |
213 |
for i in mysql mysqlshow mysqladmin mysqldump mysqlimport mysqlbinlog |
for i in mysql mysqlshow mysqladmin mysqldump mysqlimport mysqlbinlog |
214 |
do |
do |
215 |
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} |
216 |
done |
done |
217 |
|
|
218 |
#phpMyAdmin template |
#phpMyAdmin template |
219 |
|
mkdir -p root$ver/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/ |
220 |
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_ \ |
221 |
-e "s_!!!VER!!!_${ver}_g" > rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql${ver} |
-e "s_!!!SOCKET!!!_${socket}_g" \ |
222 |
|
-e "s_!!!VER!!!_${ver}_g" > root$ver/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql${ver} |
223 |
|
|
224 |
done |
done |
225 |
|
|
236 |
--file "/sbin/e-smith/systemd/mysql.init" 'attr(0554,root,root)' \ |
--file "/sbin/e-smith/systemd/mysql.init" 'attr(0554,root,root)' \ |
237 |
--dir '/home/e-smith/db/mysql' 'attr(0750,root,root)' \ |
--dir '/home/e-smith/db/mysql' 'attr(0750,root,root)' \ |
238 |
--dir "/var/log/mariadb" 'attr(0750,mysql,mysql)' \ |
--dir "/var/log/mariadb" 'attr(0750,mysql,mysql)' \ |
239 |
|
--dir "/var/log/mysql.init" 'attr(0750,root,root)' \ |
240 |
> %{name}-%{version}-filelist |
> %{name}-%{version}-filelist |
241 |
echo "%doc COPYING" >> %{name}-%{version}-filelist |
echo "%doc COPYING" >> %{name}-%{version}-filelist |
242 |
|
|
247 |
/sbin/e-smith/genfilelist root$ver/ \ |
/sbin/e-smith/genfilelist root$ver/ \ |
248 |
--file "/sbin/e-smith/systemd/mariadb$ver-initialize" 'attr(0554,root,root)' \ |
--file "/sbin/e-smith/systemd/mariadb$ver-initialize" 'attr(0554,root,root)' \ |
249 |
--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)' \ |
250 |
|
--file "/sbin/e-smith/systemd/mariadb$ver-post" 'attr(0554,root,root)' \ |
251 |
--dir "/home/e-smith/db/mariadb$ver" 'attr(0750,root,root)' \ |
--dir "/home/e-smith/db/mariadb$ver" 'attr(0750,root,root)' \ |
252 |
--dir "/var/log/mariadb$ver" 'attr(0750,mysql,mysql)' \ |
--dir "/var/log/mariadb$ver" 'attr(0750,mysql,mysql)' \ |
253 |
--file "/usr/bin/mysql$ver" 'attr(0554,root,root)' \ |
--file "/usr/bin/mysql$ver" 'attr(0554,root,root)' \ |
317 |
Requires: rh-mariadb103 |
Requires: rh-mariadb103 |
318 |
Requires: rh-mariadb103-mariadb |
Requires: rh-mariadb103-mariadb |
319 |
Requires: rh-mariadb103-mariadb-server |
Requires: rh-mariadb103-mariadb-server |
320 |
|
Requires: rh-mariadb103-mariadb-server-utils |
321 |
BuildRequires: e-smith-devtools >= 1.13.1-03 |
BuildRequires: e-smith-devtools >= 1.13.1-03 |
322 |
|
|
323 |
%description -n smeserver-mariadb103 |
%description -n smeserver-mariadb103 |
333 |
Requires: rh-mariadb105 |
Requires: rh-mariadb105 |
334 |
Requires: rh-mariadb105-mariadb |
Requires: rh-mariadb105-mariadb |
335 |
Requires: rh-mariadb105-mariadb-server |
Requires: rh-mariadb105-mariadb-server |
336 |
|
Requires: rh-mariadb105-mariadb-server-utils |
337 |
BuildRequires: e-smith-devtools >= 1.13.1-03 |
BuildRequires: e-smith-devtools >= 1.13.1-03 |
338 |
|
Requires: smeserver-mysql >= 2.7.0-5 |
339 |
%description -n smeserver-mariadb105 |
%description -n smeserver-mariadb105 |
340 |
Koozali SME Server configuration package for mariadb105 RH SCLo |
Koozali SME Server configuration package for mariadb105 RH SCLo |
341 |
|
|
347 |
|
|
348 |
|
|
349 |
%changelog |
%changelog |
350 |
|
* Mon Jul 11 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-16.sme |
351 |
|
- use dedicated log file for *mysql.init [SME: 11953] |
352 |
|
|
353 |
|
* Tue Jun 07 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 2.7.0-15.sme |
354 |
|
- Fix init for MariaDB 104+ [SME:11991] |
355 |
|
|
356 |
|
* Sun Apr 10 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-14.sme |
357 |
|
- /usr/libexec/mysql-wait-stop not used after mariadb101 [SME: 11936] |
358 |
|
|
359 |
|
* Sat Apr 09 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-13.sme |
360 |
|
- fix few typos [SME: 11936] |
361 |
|
|
362 |
|
* Sat Apr 02 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-12.sme |
363 |
|
- remove SourcePath from mysql-init service file [SME: 11922] |
364 |
|
|
365 |
|
* Wed Mar 16 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-11.sme |
366 |
|
- fix mariadb*-mysql.init path in service file [SME: 11899] |
367 |
|
|
368 |
|
* Wed Mar 16 2022 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-10.sme |
369 |
|
- fix sclo metadata path for sql/init templated scripts [SME: 11899] |
370 |
|
|
371 |
|
* Wed Mar 16 2022 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-8.sme |
372 |
|
- missing sockets for backup of db [SME: 11899] |
373 |
|
|
374 |
|
* Mon Mar 14 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-7.sme |
375 |
|
- adding requirement for mariadb-server-utils (105 and 103) [SME: 11899] |
376 |
|
|
377 |
|
* Mon Mar 14 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-6.sme |
378 |
|
- fix password for mariadb 105 [SME: 11899] |
379 |
|
|
380 |
|
* Sun Mar 13 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-5.sme |
381 |
|
- fix typo in socket, seen with phpmyadmin [SME: 11899] |
382 |
|
- fix permissions for mariadb105 [SME: 11899] |
383 |
|
create a dedicated set.password for mariadb>103 |
384 |
|
|
385 |
* 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 |
386 |
- fix [SME: ] |
- missing phpMyAdmin fragments [SME: 11899] |
387 |
|
|
388 |
* Sun Mar 13 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-2.sme |
* Sun Mar 13 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-2.sme |
389 |
- fix few sclo issues [SME: 11899] |
- fix few sclo issues [SME: 11899] |