Navigation Menu

Skip to content

Commit

Permalink
percona-server fixes
Browse files Browse the repository at this point in the history
Use mysql data directory if no previous percona data directory exists.
Remove std_cmake_path and restore CMAKE_INSTALL_PREFIX.
Use share.basename/mysql for INSTALL_MYSQLSHAREDIR.

Closes Homebrew#16070.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
  • Loading branch information
Stefan authored and jacknagel committed Nov 15, 2012
1 parent 8589d76 commit 844919f
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions Library/Formula/percona-server.rb
Expand Up @@ -29,22 +29,30 @@ class PerconaServer < Formula
cause "https://github.com/mxcl/homebrew/issues/issue/144"
end

# Where the database files should be located. Existing installs have them
# under var/percona, but going forward they will be under var/msyql to be
# shared with the mysql and mariadb formulae.
def destination
@destination ||= (var/'percona').directory? ? 'percona' : 'mysql'
end

def install
# Build without compiler or CPU specific optimization flags to facilitate
# compilation of gems and other software that queries `mysql-config`.
ENV.minimal_optimization

# Make sure the var/percona directory exists
(var+"percona").mkpath
# Make sure that data directory exists
(var/destination).mkpath

args = std_cmake_args + [
args = [
".",
"-DMYSQL_DATADIR=#{var}/percona",
"-DCMAKE_INSTALL_PREFIX=#{prefix}",
"-DMYSQL_DATADIR=#{var}/#{destination}",
"-DINSTALL_MANDIR=#{man}",
"-DINSTALL_DOCDIR=#{doc}",
"-DINSTALL_INFODIR=#{info}",
# CMake prepends prefix, so use share.basename
"-DINSTALL_MYSQLSHAREDIR=#{share.basename}/percona",
"-DINSTALL_MYSQLSHAREDIR=#{share.basename}/mysql",
"-DWITH_SSL=yes",
"-DDEFAULT_CHARSET=utf8",
"-DDEFAULT_COLLATION=utf8_general_ci",
Expand Down Expand Up @@ -97,7 +105,7 @@ def install
def caveats; <<-EOS.undent
Set up databases to run AS YOUR USER ACCOUNT with:
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix percona-server)" --datadir=#{var}/percona --tmpdir=/tmp
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix percona-server)" --datadir=#{var}/#{destination} --tmpdir=/tmp
To set up base tables in another folder, or use a different user to run
mysqld, view the help for mysqld_install_db:
Expand Down

0 comments on commit 844919f

Please sign in to comment.