Commit d579d300 authored by Łukasz Nowak's avatar Łukasz Nowak

- really separate software from data

 - rename templates and output files to be consistent with original (mysqld -> mysqld_safe)
 - reuse buildout automatic dependency
 - put binaries into var/bin and reuse from there

Sometimes software is in "data" directory - especially those binaries which
are controlling software configuration.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32486 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3b9044ae
...@@ -3,7 +3,6 @@ extends = official.cfg ...@@ -3,7 +3,6 @@ extends = official.cfg
parts += parts +=
create-directories create-directories
mysql-binaries
mysql-cnf mysql-cnf
mysql-instance mysql-instance
start-mysql-instance start-mysql-instance
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
[buildout] [buildout]
parts = parts =
mycnf
mysql-instance mysql-instance
[configuration] [configuration]
...@@ -19,17 +18,17 @@ mysql_cnf_file = ${buildout:etc-directory}/my.cnf ...@@ -19,17 +18,17 @@ mysql_cnf_file = ${buildout:etc-directory}/my.cnf
[mysql-bin] [mysql-bin]
recipe = collective.recipe.template recipe = collective.recipe.template
input = ${buildout:directory}/mysql-instance/templates/mysql.in input = ${buildout:directory}/mysql-instance/templates/mysql.in
output = ${buildout:directory}/bin/mysql output = ${buildout:data-bin-directory}/mysql
[mysql-admin] [mysql-admin]
recipe = collective.recipe.template recipe = collective.recipe.template
input = ${buildout:directory}/mysql-instance/templates/mysqladmin.in input = ${buildout:directory}/mysql-instance/templates/mysqladmin.in
output = ${buildout:directory}/bin/mysqladmin output = ${buildout:data-bin-directory}/mysqladmin
[mysqld-bin] [mysqld_safe-bin]
recipe = collective.recipe.template recipe = collective.recipe.template
input = ${buildout:directory}/mysql-instance/templates/mysqld.in input = ${buildout:directory}/mysql-instance/templates/mysqld_safe.in
output = ${buildout:directory}/bin/mysqld output = ${buildout:data-bin-directory}/mysqld_safe
[mysql-cnf] [mysql-cnf]
recipe = collective.recipe.template recipe = collective.recipe.template
...@@ -37,6 +36,13 @@ input = ${buildout:directory}/mysql-instance/templates/my.cnf.in ...@@ -37,6 +36,13 @@ input = ${buildout:directory}/mysql-instance/templates/my.cnf.in
output = ${configuration:mysql_cnf_file} output = ${configuration:mysql_cnf_file}
[mysql-instance] [mysql-instance]
depends =
${create-directories:command}
${mysql-cnf:output}
${mysql-bin:output}
${mysql-admin:output}
${mysqld_safe-bin:output}
recipe = plone.recipe.command recipe = plone.recipe.command
command = command =
mkdir -p ${configuration:mysql_datadir} mkdir -p ${configuration:mysql_datadir}
...@@ -44,7 +50,7 @@ command = ...@@ -44,7 +50,7 @@ command =
[start-mysql-instance] [start-mysql-instance]
recipe = plone.recipe.command recipe = plone.recipe.command
command = ${software_definition:software_home}/bin/mysqld_safe --defaults-file=${configuration:mysql_cnf_file} & command = ${buildout:data-bin-directory}/bin/mysqld_safe &
update-command = ${:command} update-command = ${:command}
[stop-mysql-instance] [stop-mysql-instance]
......
#!/bin/sh #!/bin/sh
${software_definition:mysql_software}/bin/mysql --no-defaults --protocol=tcp --host=${configuration:mysql_host} --port=${configuration:mysql_port} $@ ${software_definition:mysql_software}/bin/mysql --defaults-file=${configuration:mysql_cnf_file} $@
#!/bin/sh #!/bin/sh
${software_definition:mysql_software}/bin/mysqladmin --no-defaults --protocol=tcp --host=${configuration:mysql_host} --port=${configuration:mysql_port} $@ ${software_definition:mysql_software}/bin/mysqladmin --defaults-file=${configuration:mysql_cnf_file} $@
#!/bin/sh
${software_definition:mysql_software}/bin/mysqld_safe --no-defaults --port=${configuration:mysql_port} --pid-file=${configuration:mysql_pid} --log-error=${configuration:mysql_error_log} --basedir=${software_definition:mysql_software} --datadir=${configuration:mysql_datadir} --socket=${configuration:mysql_sock}
#!/bin/sh
${software_definition:mysql_software}/bin/mysqld_safe --defaults-file=${configuration:mysql_cnf_file} $@
...@@ -42,15 +42,6 @@ environment = ...@@ -42,15 +42,6 @@ environment =
CXXFLAGS =-I${senna:location}/include CXXFLAGS =-I${senna:location}/include
LDLAGS =-L${senna:location}/lib LDLAGS =-L${senna:location}/lib
[mysql-binaries]
# another approach - software buildout provides easily accessible binaries
recipe = plone.recipe.command
command =
ln -sf ${software_definition:mysql_software}/bin/mysql ${buildout:directory}/bin/mysql
ln -sf ${software_definition:mysql_software}/bin/mysqladmin ${buildout:directory}/bin/mysqladmin
ln -sf ${software_definition:mysql_software}/bin/mysqld_safe ${buildout:directory}/bin/mysqld_safe
ln -sf ${software_definition:mysql_software}/bin/mysql_install_db ${buildout:directory}/bin/mysql_install_db
[requirements] [requirements]
binary = flex bison patch gcc g++ binary = flex bison patch gcc g++
development = /usr/include/termcap.h /usr/include/curses.h development = /usr/include/termcap.h /usr/include/curses.h
...@@ -17,6 +17,7 @@ extends = ...@@ -17,6 +17,7 @@ extends =
var-directory = ${:directory}/var var-directory = ${:directory}/var
etc-directory = ${:var-directory}/etc etc-directory = ${:var-directory}/etc
log-directory = ${:var-directory}/log log-directory = ${:var-directory}/log
data-bin-directory = ${:var-directory}/bin
versions = versions versions = versions
find-links = find-links =
...@@ -63,6 +64,7 @@ command = ...@@ -63,6 +64,7 @@ command =
mkdir -p ${buildout:etc-directory} mkdir -p ${buildout:etc-directory}
mkdir -p ${buildout:var-directory} mkdir -p ${buildout:var-directory}
mkdir -p ${buildout:log-directory} mkdir -p ${buildout:log-directory}
mkdir -p ${buildout:data-bin-directory}
[software_definition] [software_definition]
software_home = ${buildout:directory} software_home = ${buildout:directory}
......
...@@ -40,7 +40,7 @@ products = ...@@ -40,7 +40,7 @@ products =
# XXX: This have to be converted into recipe # XXX: This have to be converted into recipe
recipe = plone.recipe.command recipe = plone.recipe.command
command = command =
echo "CREATE DATABASE IF NOT EXISTS ${create_erp5_site:mysql_database_name} DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci" | ${software_definition:software_home}/bin/mysql --defaults-file=${configuration:mysql_cnf_file} -u root echo "CREATE DATABASE IF NOT EXISTS ${create_erp5_site:mysql_database_name} DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci" | ${buildout:data-bin-directory}/mysql -u root
[create_erp5_site] [create_erp5_site]
depends = ${create_mysql_database:command} depends = ${create_mysql_database:command}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment