Correct permission set, database initialization, dependency, doc path,

Fri, 21 Sep 2012 22:38:55 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 21 Sep 2012 22:38:55 +0200
changeset 698
31b10e374497
parent 697
86fbe197f71a
child 699
da76d565ccd3

Correct permission set, database initialization, dependency, doc path,
and port 5.1 configuration keyword to 5.5.

mysql/my.cnf file | annotate | diff | comparison | revisions
mysql/mysql.spec file | annotate | diff | comparison | revisions
     1.1 --- a/mysql/my.cnf	Mon Sep 17 19:49:40 2012 +0200
     1.2 +++ b/mysql/my.cnf	Fri Sep 21 22:38:55 2012 +0200
     1.3 @@ -27,7 +27,7 @@
     1.4  max_heap_table_size              = 16777216
     1.5  max_sort_length                  = 1024
     1.6  max_user_connections             = 1000
     1.7 -record_buffer                    = 131072
     1.8 +read_buffer_size                 = 131072
     1.9  sort_buffer                      = 4M
    1.10  key_buffer                       = 1M
    1.11  tmp_table_size                   = 32M
     2.1 --- a/mysql/mysql.spec	Mon Sep 17 19:49:40 2012 +0200
     2.2 +++ b/mysql/mysql.spec	Fri Sep 21 22:38:55 2012 +0200
     2.3 @@ -71,7 +71,7 @@
     2.4  Patch0:       mysql.patch
     2.5  
     2.6  #   build information
     2.7 -BuildPreReq:  OpenPKG, openpkg >= 20100101, perl, make, gcc, gcc::with_cxx = yes
     2.8 +BuildPreReq:  OpenPKG, openpkg >= 20100101, perl, make, cmake, gcc, gcc::with_cxx = yes
     2.9  PreReq:       OpenPKG, openpkg >= 20100101, perl
    2.10  BuildPreReq:  zlib, readline, ncurses
    2.11  PreReq:       zlib, readline, ncurses
    2.12 @@ -283,7 +283,7 @@
    2.13  
    2.14      #   mitigate complex buildconf
    2.15      %{l_shtool} install -c -m 644 \
    2.16 -        INSTALL-SOURCE $RPM_BUILD_ROOT%{l_prefix}/share/mysql/doc/
    2.17 +        ../INSTALL-SOURCE $RPM_BUILD_ROOT%{l_prefix}/share/mysql/doc/
    2.18  
    2.19      #   make sure the database directory exists
    2.20      %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/mysql
    2.21 @@ -324,12 +324,14 @@
    2.22      #   determine the package files
    2.23      %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
    2.24  %if "%{with_server}" == "yes"
    2.25 +        %{l_files_std} \
    2.26          '%config %attr(644,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/mysql/my.cnf' \
    2.27          '%config %attr(600,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/mysql/my.pwd' \
    2.28          '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql' \
    2.29 -        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql/tmp' \
    2.30 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql/tmp'
    2.31 +%else
    2.32 +        %{l_files_std}
    2.33  %endif
    2.34 -        %{l_files_std}
    2.35  
    2.36  %files -f objbld/files
    2.37  
    2.38 @@ -348,9 +350,11 @@
    2.39  %if "%{with_server}" == "yes"
    2.40      if [ $1 -eq 1 ]; then
    2.41          #   after install, create initial database
    2.42 -        $RPM_INSTALL_PREFIX/bin/mysql_install_db \
    2.43 -            --defaults-file=$RPM_INSTALL_PREFIX/etc/mysql/my.cnf >/dev/null 2>&1
    2.44 -        chown -R %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/var/mysql/*
    2.45 +        cd $RPM_INSTALL_PREFIX && $RPM_INSTALL_PREFIX/bin/mysql_install_db \
    2.46 +            --defaults-file=$RPM_INSTALL_PREFIX/etc/mysql/my.cnf \
    2.47 +            --ldata=$RPM_INSTALL_PREFIX/var/mysql \
    2.48 +            --user=%{l_rusr} >/dev/null 2>&1
    2.49 +        chgrp %{l_rgrp} $RPM_INSTALL_PREFIX/var/mysql/mysql
    2.50          ( echo "An initial MySQL DB was created. The owner of the database"
    2.51            echo "is the DB user 'root'. Its initial password is empty."
    2.52            echo "After starting MySQL with..."
    2.53 @@ -362,6 +366,10 @@
    2.54            echo "  \$ $RPM_INSTALL_PREFIX/bin/mysqladmin \\ "
    2.55            echo "    -u root password '<new-password>'"
    2.56            echo ""
    2.57 +          echo "...or alternatively, even better secure the database with:"
    2.58 +          echo ""
    2.59 +          echo "  \$ $RPM_INSTALL_PREFIX/bin/mysql_secure_installation"
    2.60 +          echo ""
    2.61            echo "Additionally, because the MySQL package includes automated"
    2.62            echo "maintenance procedures that require administrator access to"
    2.63            echo "the database, you must maintain a (plain text) copy of the"

mercurial