/[smeserver]/rpms/smeserver-mysql/sme10/smeserver-mysql.spec
ViewVC logotype

Diff of /rpms/smeserver-mysql/sme10/smeserver-mysql.spec

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.1 by jpp, Sun Mar 13 02:38:23 2022 UTC Revision 1.31 by jpp, Sun Dec 11 05:23:03 2022 UTC
# Line 2  Summary: Koozali SME Server specific mys Line 2  Summary: Koozali SME Server specific mys
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 17
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    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
19  Requires: mariadb-server  Requires: mariadb-server
20    # mariadb after 5.5 /in Centos 8 will package mysql_upgrade in mariadb-server-utils
21    # Requires: /usr/bin/mysql_upgrade
22  Requires: mariadb  Requires: mariadb
23  Requires: e-smith-base  Requires: e-smith-base
24  Requires: e-smith-lib >= 1.15.1-19  Requires: e-smith-lib >= 1.15.1-19
# Line 27  mysql. Line 34  mysql.
34    
35  %prep  %prep
36  %setup  %setup
37    %patch0 -p1
38    %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
# Line 48  do Line 60  do
60  # 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
61  basedir="/opt/rh/rh-mariadb$ver/root/usr"  basedir="/opt/rh/rh-mariadb$ver/root/usr"
62  datadir="/var/opt/rh/rh-mariadb$ver/lib/mysql"  datadir="/var/opt/rh/rh-mariadb$ver/lib/mysql"
63  socket="/var/lib/mysql/maradb$ver.sock"  socket="/var/lib/mysql/mariadb$ver.sock"
64  logerror="/var//log/mariadb$ver/mariadb.log"  logerror="/var//log/mariadb$ver/mariadb.log"
65  #"/var/opt/rh/rh-mariadb$ver/log/mariadb/mariadb.log"  #"/var/opt/rh/rh-mariadb$ver/log/mariadb/mariadb.log"
66  pidfile="/var/run/rh-mariadb$ver-mariadb/mariadb.pid"  pidfile="/var/run/rh-mariadb$ver-mariadb/mariadb.pid"
# Line 110  sed -i root$ver/etc/e-smith/events/actio Line 122  sed -i root$ver/etc/e-smith/events/actio
122          -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 \
123          -i root$ver/etc/e-smith/events/actions/mariadb${ver}-dump-tables \          -i root$ver/etc/e-smith/events/actions/mariadb${ver}-dump-tables \
124          -i root$ver/etc/e-smith/events/actions/mariadb${ver}-load-tables \          -i root$ver/etc/e-smith/events/actions/mariadb${ver}-load-tables \
125          -e "s_!!!VER!!!_${ver}_g"          -e "s_!!!VER!!!_${ver}_g" \
126            -e "s_!!!SOCKET!!!_${socket}_g"
127    
128  ##metadata  ##metadata
129  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
130  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
131    
132    
133  ##templates  ##templates
# Line 123  cp   root/etc/e-smith/templates/etc/e-sm Line 136  cp   root/etc/e-smith/templates/etc/e-sm
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
# Line 133  echo " Line 146  echo "
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" \
# Line 158  cp rootscl/sbin/e-smith/mariadb_VER_-pre Line 175  cp rootscl/sbin/e-smith/mariadb_VER_-pre
175  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 \
176          -i root$ver/sbin/e-smith/mariadb${ver}-preload \          -i root$ver/sbin/e-smith/mariadb${ver}-preload \
177          -e "s_!!!VER!!!_${ver}_g" \          -e "s_!!!VER!!!_${ver}_g" \
178          -e "s_!!!SOCKET!!!_$socket _g"          -e "s_!!!SOCKET!!!_${socket}_g"
179    if [ $ver -ge  104 ]
180    then
181      cp rootscl/sbin/e-smith/systemd/mariadb_VER_-post root$ver/sbin/e-smith/systemd/mariadb${ver}-post
182      sed -i root$ver/sbin/e-smith/systemd/mariadb${ver}-post -e "s_!!!VER!!!_${ver}_g" -e "s_!!!SOCKET!!!_${socket}_g"
183    fi
184    
185    
186  ## logrotate  ## logrotate
187  mkdir -p root$ver/etc/logrotate.d/  mkdir -p root$ver/etc/logrotate.d/
188  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" \
189  #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  
190    
191    
192  #systemd service  #systemd service
# Line 175  cp rootscl/usr/lib/systemd/system/mariad Line 197  cp rootscl/usr/lib/systemd/system/mariad
197  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
198  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 \
199          -e "s_!!!VER!!!_${ver}_g"          -e "s_!!!VER!!!_${ver}_g"
200    if [ $ver -ge  102 ]
201    then
202      sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \
203            -e "s/_safe//" \
204            -e "s/^ExecStopPost.*//";
205    fi
206    if [ $ver -ge  104 ]
207    then
208      sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \
209            -e 's_set.password$_set.password2_'
210      sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \
211             -e "/^#ExecStartPost=/ i ExecStartPost=\/sbin\/e-smith\/systemd\/mariadb${ver}-post"
212    
213    fi
214    
215  #### TODO check it is similar to rh one and functional !  #### TODO check it is similar to rh one and functional !
216    
217  #/usb/bin to ease user  #/usr/bin to ease user
218  mkdir root$ver/usr/bin  mkdir root$ver/usr/bin
219  for i in  mysql mysqlshow mysqladmin mysqldump mysqlimport mysqlbinlog  for i in  mysql mysqlshow mysqladmin mysqldump mysqlimport mysqlbinlog
220  do  do
221    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}
222  done  done
223    
224    #phpMyAdmin template
225    mkdir -p root$ver/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/
226    sed rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_  \
227            -e "s_!!!SOCKET!!!_${socket}_g" \
228            -e "s_!!!VER!!!_${ver}_g" > root$ver/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql${ver}
229    
230  done  done
231    
232  ###################################################  ###################################################
# Line 198  rm -rf $RPM_BUILD_ROOT Line 242  rm -rf $RPM_BUILD_ROOT
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    
# Line 208  do Line 253  do
253  /sbin/e-smith/genfilelist root$ver/ \  /sbin/e-smith/genfilelist root$ver/ \
254      --file "/sbin/e-smith/systemd/mariadb$ver-initialize" 'attr(0554,root,root)' \      --file "/sbin/e-smith/systemd/mariadb$ver-initialize" 'attr(0554,root,root)' \
255      --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)' \
256        --file "/sbin/e-smith/systemd/mariadb$ver-post" 'attr(0554,root,root)' \
257      --dir "/home/e-smith/db/mariadb$ver" 'attr(0750,root,root)' \      --dir "/home/e-smith/db/mariadb$ver" 'attr(0750,root,root)' \
258      --dir "/var/log/mariadb$ver" 'attr(0750,mysql,mysql)' \      --dir "/var/log/mariadb$ver" 'attr(0750,mysql,mysql)' \
259        --file "/usr/bin/mysql$ver" 'attr(0554,root,root)' \
260        --file "/usr/bin/mysqladmin$ver" 'attr(0554,root,root)' \
261        --file "/usr/bin/mysqlbinlog$ver" 'attr(0554,root,root)' \
262        --file "/usr/bin/mysqldump$ver" 'attr(0554,root,root)' \
263        --file "/usr/bin/mysqlimport$ver" 'attr(0554,root,root)' \
264        --file "/usr/bin/mysqlshow$ver" 'attr(0554,root,root)' \
265  | grep -vE '/home/e-smith/db/mysql$' \  | grep -vE '/home/e-smith/db/mysql$' \
266      > %{name}-%{version}-filelist-mariadb$ver      > %{name}-%{version}-filelist-mariadb$ver
267  echo "%doc COPYING"          >> %{name}-%{version}-filelist-mariadb$ver  echo "%doc COPYING"          >> %{name}-%{version}-filelist-mariadb$ver
# Line 271  Group:          Database Line 323  Group:          Database
323  Requires:       rh-mariadb103  Requires:       rh-mariadb103
324  Requires:       rh-mariadb103-mariadb  Requires:       rh-mariadb103-mariadb
325  Requires:       rh-mariadb103-mariadb-server  Requires:       rh-mariadb103-mariadb-server
326    Requires:       rh-mariadb103-mariadb-server-utils
327  BuildRequires:  e-smith-devtools >= 1.13.1-03  BuildRequires:  e-smith-devtools >= 1.13.1-03
328    
329  %description    -n smeserver-mariadb103  %description    -n smeserver-mariadb103
# Line 286  Group:          Database Line 339  Group:          Database
339  Requires:       rh-mariadb105  Requires:       rh-mariadb105
340  Requires:       rh-mariadb105-mariadb  Requires:       rh-mariadb105-mariadb
341  Requires:       rh-mariadb105-mariadb-server  Requires:       rh-mariadb105-mariadb-server
342    Requires:       rh-mariadb105-mariadb-server-utils
343  BuildRequires:  e-smith-devtools >= 1.13.1-03  BuildRequires:  e-smith-devtools >= 1.13.1-03
344    Requires:       smeserver-mysql >= 2.7.0-5
345  %description    -n smeserver-mariadb105  %description    -n smeserver-mariadb105
346  Koozali SME Server configuration package for mariadb105 RH SCLo  Koozali SME Server configuration package for mariadb105 RH SCLo
347    
# Line 299  Koozali SME Server configuration package Line 353  Koozali SME Server configuration package
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
372    - remove SourcePath from mysql-init service file [SME: 11922]
373    
374    * Wed Mar 16 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-11.sme
375    - fix mariadb*-mysql.init path in service file [SME: 11899]
376    
377    * Wed Mar 16 2022 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-10.sme
378    - fix sclo metadata path for sql/init templated scripts [SME: 11899]
379    
380    * Wed Mar 16 2022 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-8.sme
381    - missing sockets for backup of db [SME: 11899]
382    
383    * Mon Mar 14 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-7.sme
384    - adding requirement for mariadb-server-utils (105 and 103) [SME: 11899]
385    
386    * Mon Mar 14 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-6.sme
387    - fix password for mariadb 105 [SME: 11899]
388    
389    * Sun Mar 13 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-5.sme
390    - fix typo in socket, seen with phpmyadmin [SME: 11899]
391    - fix permissions for mariadb105 [SME: 11899]
392      create a dedicated set.password for mariadb>103
393    
394    * Sun Mar 13 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-3.sme
395    - missing phpMyAdmin fragments [SME: 11899]
396    
397    * Sun Mar 13 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-2.sme
398    - fix few sclo issues [SME: 11899]
399      missing +x for binaries shortcut
400      mariadb105 passwordless root access
401      mysqld_safe-scl-helper vs mysqld-scl-helper
402    
403  * 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
404  - prepare spec for multiple version support [SME: 11899]  - prepare spec for multiple version support [SME: 11899]
405  - package renamed from e-smith-mysql to smeserver-mysql [SME: 11897]  - package renamed from e-smith-mysql to smeserver-mysql [SME: 11897]
406  - remove duplicate logrotate and remove unsused template [SME: 11467]  - remove duplicate logrotate and remove unsused template [SME: 11467]
407  - move scripts /etc/rc.d/init.d/mysql-init to /sbin/e-smith/systemd [SME: 11898]  - move scripts /etc/rc.d/init.d/mysql-init to /sbin/e-smith/systemd [SME: 11898]
408  - add rh-mariadb101 support [SME: ]  - add rh-mariadb101 support [SME: 11901]
409  - add rh-mariadb102 support [SME: ]  - add rh-mariadb102 support [SME: 11902]
410  - add rh-mariadb103 support [SME: ]  - add rh-mariadb103 support [SME: 11903]
411  - add rh-mariadb105 support [SME: ]  - add rh-mariadb105 support [SME: 11904]
412    
413  * Tue Aug 17 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 2.6.0-22.sme  * Tue Aug 17 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 2.6.0-22.sme
414  - Remove template and set default max_allowed_packet=16M  - Remove template and set default max_allowed_packet=16M


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed