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 1 |
%define release 7 |
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 |
12 |
|
|
13 |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
14 |
BuildArchitectures: noarch |
BuildArchitectures: noarch |
15 |
Requires: mariadb-server |
Requires: mariadb-server |
16 |
|
# mariadb after 5.5 /in Centos 8 will package mysql_upgrade in mariadb-server-utils |
17 |
|
# Requires: /usr/bin/mysql_upgrade |
18 |
Requires: mariadb |
Requires: mariadb |
19 |
Requires: e-smith-base |
Requires: e-smith-base |
20 |
Requires: e-smith-lib >= 1.15.1-19 |
Requires: e-smith-lib >= 1.15.1-19 |
30 |
|
|
31 |
%prep |
%prep |
32 |
%setup |
%setup |
33 |
|
%patch0 -p1 |
34 |
|
|
35 |
%build |
%build |
36 |
for ver in 101 102 103 105 |
for ver in 101 102 103 105 |
52 |
# 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 |
53 |
basedir="/opt/rh/rh-mariadb$ver/root/usr" |
basedir="/opt/rh/rh-mariadb$ver/root/usr" |
54 |
datadir="/var/opt/rh/rh-mariadb$ver/lib/mysql" |
datadir="/var/opt/rh/rh-mariadb$ver/lib/mysql" |
55 |
socket="/var/lib/mysql/maradb$ver.sock" |
socket="/var/lib/mysql/mariadb$ver.sock" |
56 |
logerror="/var//log/mariadb$ver/mariadb.log" |
logerror="/var//log/mariadb$ver/mariadb.log" |
57 |
#"/var/opt/rh/rh-mariadb$ver/log/mariadb/mariadb.log" |
#"/var/opt/rh/rh-mariadb$ver/log/mariadb/mariadb.log" |
58 |
pidfile="/var/run/rh-mariadb$ver-mariadb/mariadb.pid" |
pidfile="/var/run/rh-mariadb$ver-mariadb/mariadb.pid" |
162 |
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 \ |
163 |
-i root$ver/sbin/e-smith/mariadb${ver}-preload \ |
-i root$ver/sbin/e-smith/mariadb${ver}-preload \ |
164 |
-e "s_!!!VER!!!_${ver}_g" \ |
-e "s_!!!VER!!!_${ver}_g" \ |
165 |
-e "s_!!!SOCKET!!!_$socket _g" |
-e "s_!!!SOCKET!!!_${socket}_g" |
166 |
|
if [ $ver -ge 104 ] |
167 |
|
then |
168 |
|
cp rootscl/sbin/e-smith/systemd/mariadb_VER_-post root$ver/sbin/e-smith/systemd/mariadb${ver}-post |
169 |
|
sed -i root$ver/sbin/e-smith/systemd/mariadb${ver}-post -e "s_!!!VER!!!_${ver}_g" -e "s_!!!SOCKET!!!_${socket}_g" |
170 |
|
fi |
171 |
|
|
172 |
|
|
173 |
## logrotate |
## logrotate |
174 |
mkdir -p root$ver/etc/logrotate.d/ |
mkdir -p root$ver/etc/logrotate.d/ |
175 |
sed rootscl/etc/logrotate.d/mariadb_VER_ -e "s_!!!VER!!!_${ver}_g" > root$ver/etc/logrotate.d/mariadb${ver} |
sed rootscl/etc/logrotate.d/mariadb_VER_ -e "s_!!!VER!!!_${ver}_g" \ |
176 |
#cp -a root/etc/e-smith/templates/etc/logrotate.d/mariadb root$ver/etc/e-smith/templates/etc/logrotate.d/mariadb$ver |
-e "s_!!!SOCKET!!!_${socket}_g" > root$ver/etc/logrotate.d/mariadb${ver} |
|
# TODO sed -i add --socket= and change path |
|
177 |
|
|
178 |
|
|
179 |
#systemd service |
#systemd service |
184 |
cp rootscl/usr/lib/systemd/system/mariadb_VER_-mysql.init.service root$ver/usr/lib/systemd/system/mariadb${ver}-mysql.init.service |
cp rootscl/usr/lib/systemd/system/mariadb_VER_-mysql.init.service root$ver/usr/lib/systemd/system/mariadb${ver}-mysql.init.service |
185 |
sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service -i root$ver/usr/lib/systemd/system/mariadb${ver}-mysql.init.service \ |
sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service -i root$ver/usr/lib/systemd/system/mariadb${ver}-mysql.init.service \ |
186 |
-e "s_!!!VER!!!_${ver}_g" |
-e "s_!!!VER!!!_${ver}_g" |
187 |
|
if [ $ver -ge 102 ] |
188 |
|
then |
189 |
|
sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \ |
190 |
|
-e "s/_safe//"; |
191 |
|
fi |
192 |
|
if [ $ver -ge 104 ] |
193 |
|
then |
194 |
|
sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \ |
195 |
|
-e 's_set.password$_set.password2_' |
196 |
|
sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \ |
197 |
|
-e "/^#ExecStartPost=/ i ExecStartPost=\/sbin\/e-smith\/systemd\/mariadb${ver}-post" |
198 |
|
|
199 |
|
fi |
200 |
|
|
201 |
#### TODO check it is similar to rh one and functional ! |
#### TODO check it is similar to rh one and functional ! |
202 |
|
|
203 |
#/usb/bin to ease user |
#/usr/bin to ease user |
204 |
mkdir root$ver/usr/bin |
mkdir root$ver/usr/bin |
205 |
for i in mysql mysqlshow mysqladmin mysqldump mysqlimport mysqlbinlog |
for i in mysql mysqlshow mysqladmin mysqldump mysqlimport mysqlbinlog |
206 |
do |
do |
207 |
echo "/opt/rh/rh-mariadb${ver}/root/usr/bin/$i --socket=/var/lib/mysql/maradb${ver}.sock \"\$\@\" $i" >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} |
208 |
done |
done |
209 |
|
|
210 |
|
#phpMyAdmin template |
211 |
|
mkdir -p root$ver/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/ |
212 |
|
sed rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_ \ |
213 |
|
-e "s_!!!SOCKET!!!_${socket}_g" \ |
214 |
|
-e "s_!!!VER!!!_${ver}_g" > root$ver/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql${ver} |
215 |
|
|
216 |
done |
done |
217 |
|
|
218 |
################################################### |
################################################### |
238 |
/sbin/e-smith/genfilelist root$ver/ \ |
/sbin/e-smith/genfilelist root$ver/ \ |
239 |
--file "/sbin/e-smith/systemd/mariadb$ver-initialize" 'attr(0554,root,root)' \ |
--file "/sbin/e-smith/systemd/mariadb$ver-initialize" 'attr(0554,root,root)' \ |
240 |
--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)' \ |
241 |
|
--file "/sbin/e-smith/systemd/mariadb$ver-post" 'attr(0554,root,root)' \ |
242 |
--dir "/home/e-smith/db/mariadb$ver" 'attr(0750,root,root)' \ |
--dir "/home/e-smith/db/mariadb$ver" 'attr(0750,root,root)' \ |
243 |
--dir "/var/log/mariadb$ver" 'attr(0750,mysql,mysql)' \ |
--dir "/var/log/mariadb$ver" 'attr(0750,mysql,mysql)' \ |
244 |
|
--file "/usr/bin/mysql$ver" 'attr(0554,root,root)' \ |
245 |
|
--file "/usr/bin/mysqladmin$ver" 'attr(0554,root,root)' \ |
246 |
|
--file "/usr/bin/mysqlbinlog$ver" 'attr(0554,root,root)' \ |
247 |
|
--file "/usr/bin/mysqldump$ver" 'attr(0554,root,root)' \ |
248 |
|
--file "/usr/bin/mysqlimport$ver" 'attr(0554,root,root)' \ |
249 |
|
--file "/usr/bin/mysqlshow$ver" 'attr(0554,root,root)' \ |
250 |
| grep -vE '/home/e-smith/db/mysql$' \ |
| grep -vE '/home/e-smith/db/mysql$' \ |
251 |
> %{name}-%{version}-filelist-mariadb$ver |
> %{name}-%{version}-filelist-mariadb$ver |
252 |
echo "%doc COPYING" >> %{name}-%{version}-filelist-mariadb$ver |
echo "%doc COPYING" >> %{name}-%{version}-filelist-mariadb$ver |
308 |
Requires: rh-mariadb103 |
Requires: rh-mariadb103 |
309 |
Requires: rh-mariadb103-mariadb |
Requires: rh-mariadb103-mariadb |
310 |
Requires: rh-mariadb103-mariadb-server |
Requires: rh-mariadb103-mariadb-server |
311 |
|
Requires: rh-mariadb103-mariadb-server-utils |
312 |
BuildRequires: e-smith-devtools >= 1.13.1-03 |
BuildRequires: e-smith-devtools >= 1.13.1-03 |
313 |
|
|
314 |
%description -n smeserver-mariadb103 |
%description -n smeserver-mariadb103 |
324 |
Requires: rh-mariadb105 |
Requires: rh-mariadb105 |
325 |
Requires: rh-mariadb105-mariadb |
Requires: rh-mariadb105-mariadb |
326 |
Requires: rh-mariadb105-mariadb-server |
Requires: rh-mariadb105-mariadb-server |
327 |
|
Requires: rh-mariadb105-mariadb-server-utils |
328 |
BuildRequires: e-smith-devtools >= 1.13.1-03 |
BuildRequires: e-smith-devtools >= 1.13.1-03 |
329 |
|
Requires: smeserver-mysql >= 2.7.0-5 |
330 |
%description -n smeserver-mariadb105 |
%description -n smeserver-mariadb105 |
331 |
Koozali SME Server configuration package for mariadb105 RH SCLo |
Koozali SME Server configuration package for mariadb105 RH SCLo |
332 |
|
|
338 |
|
|
339 |
|
|
340 |
%changelog |
%changelog |
341 |
|
* Mon Mar 14 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-7.sme |
342 |
|
- adding requirement for mariadb-server-utils (105 and 103) [SME: 11899] |
343 |
|
|
344 |
|
* Mon Mar 14 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-6.sme |
345 |
|
- fix password for mariadb 105 [SME: 11899] |
346 |
|
|
347 |
|
* Sun Mar 13 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-5.sme |
348 |
|
- fix typo in socket, seen with phpmyadmin [SME: 11899] |
349 |
|
- fix permissions for mariadb105 [SME: 11899] |
350 |
|
create a dedicated set.password for mariadb>103 |
351 |
|
|
352 |
|
* Sun Mar 13 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-3.sme |
353 |
|
- missing phpMyAdmin fragments [SME: 11899] |
354 |
|
|
355 |
|
* Sun Mar 13 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-2.sme |
356 |
|
- fix few sclo issues [SME: 11899] |
357 |
|
missing +x for binaries shortcut |
358 |
|
mariadb105 passwordless root access |
359 |
|
mysqld_safe-scl-helper vs mysqld-scl-helper |
360 |
|
|
361 |
* Fri Mar 11 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-1.sme |
* Fri Mar 11 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-1.sme |
362 |
- prepare spec for multiple version support [SME: 11899] |
- prepare spec for multiple version support [SME: 11899] |
363 |
- package renamed from e-smith-mysql to smeserver-mysql [SME: 11897] |
- package renamed from e-smith-mysql to smeserver-mysql [SME: 11897] |