init
authorFrancesco Riosa <vivo@gentoo.org>
Thu, 23 Nov 2006 13:58:06 +0000 (13:58 +0000)
committerFrancesco Riosa <vivo@gentoo.org>
Thu, 23 Nov 2006 13:58:06 +0000 (13:58 +0000)
Package-Manager: portage-2.1.1-r1

dev-db/mysql-community/ChangeLog [new file with mode: 0644]
dev-db/mysql-community/Manifest [new file with mode: 0644]
dev-db/mysql-community/files/digest-mysql-community-5.0.27 [new file with mode: 0644]
dev-db/mysql-community/files/digest-mysql-community-5.1.13_alpha20061018 [new file with mode: 0644]
dev-db/mysql-community/files/my.cnf-4.1 [new file with mode: 0644]
dev-db/mysql-community/files/mysql.conf.d [new file with mode: 0644]
dev-db/mysql-community/files/mysqlmanager.conf.d [new file with mode: 0644]
dev-db/mysql-community/files/mysqlmanager.rc6 [new file with mode: 0644]
dev-db/mysql-community/metadata.xml [new file with mode: 0644]
dev-db/mysql-community/mysql-community-5.0.27.ebuild [new file with mode: 0644]
dev-db/mysql-community/mysql-community-5.1.13_alpha20061018.ebuild [new file with mode: 0644]

diff --git a/dev-db/mysql-community/ChangeLog b/dev-db/mysql-community/ChangeLog
new file mode 100644 (file)
index 0000000..137d43a
--- /dev/null
@@ -0,0 +1,13 @@
+# ChangeLog for dev-db/mysql
+# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-community/ChangeLog,v 1.1 2006/11/23 13:58:06 vivo Exp $
+
+*mysql-community-5.1.13_alpha20061018 (23 Nov 2006)
+*mysql-community-5.0.27 (23 Nov 2006)
+
+  23 Nov 2006; Francesco Riosa <vivo@gentoo.org> +files/my.cnf-4.1,
+  +files/mysql.conf.d, +files/mysqlmanager.conf.d, +files/mysqlmanager.rc6,
+  +metadata.xml, +mysql-community-5.0.27.ebuild,
+  +mysql-community-5.1.13_alpha20061018.ebuild:
+  Starting with mysql-5.0.27 MySQL is splitted in enterprise and community
+
diff --git a/dev-db/mysql-community/Manifest b/dev-db/mysql-community/Manifest
new file mode 100644 (file)
index 0000000..b1d2216
--- /dev/null
@@ -0,0 +1,51 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+AUX my.cnf-4.1 4220 RMD160 fd98c93f199b631164b1623965751cc3b367d04a SHA1 53eda46daed88bf450bb75e0cce08bc5b3f9b268 SHA256 e07909810868e75410c26b0e9b9d00a61c8d303f8a912b4b1232dbdbb168aac1
+MD5 06cafc559c9f18d2b215e62df55ee038 files/my.cnf-4.1 4220
+RMD160 fd98c93f199b631164b1623965751cc3b367d04a files/my.cnf-4.1 4220
+SHA256 e07909810868e75410c26b0e9b9d00a61c8d303f8a912b4b1232dbdbb168aac1 files/my.cnf-4.1 4220
+AUX mysql.conf.d 3273 RMD160 a2661c832c1091b2d05e599fc58cce6f686c7f31 SHA1 64e9bb80099bf6e14a07764fcb69bb02682aee0b SHA256 ee049781a3885305ce9999371198ff54f97fee4d2ad0814ba3aa3a03abc2724c
+MD5 092bb6cad90a875da8899e104304c969 files/mysql.conf.d 3273
+RMD160 a2661c832c1091b2d05e599fc58cce6f686c7f31 files/mysql.conf.d 3273
+SHA256 ee049781a3885305ce9999371198ff54f97fee4d2ad0814ba3aa3a03abc2724c files/mysql.conf.d 3273
+AUX mysqlmanager.conf.d 1009 RMD160 b443dc0cd1cb7fb054fe7229a52b8d093e634652 SHA1 0d82531df24ba4f0d957176b6fa0076a1cae0356 SHA256 35353f585cc9d3f97bbcfe77224d183e0fedcf4134377b8bff4c278462577cc7
+MD5 c94178cadec3be56c4e6c7ec9812cfcf files/mysqlmanager.conf.d 1009
+RMD160 b443dc0cd1cb7fb054fe7229a52b8d093e634652 files/mysqlmanager.conf.d 1009
+SHA256 35353f585cc9d3f97bbcfe77224d183e0fedcf4134377b8bff4c278462577cc7 files/mysqlmanager.conf.d 1009
+AUX mysqlmanager.rc6 6627 RMD160 e980a5f09570e528c0a3b57cdc7d3fa2bff78502 SHA1 18179e0665116c1cb3ace712368b2cf6bb5e06a6 SHA256 19f876f17e193ecaf4382ae0dda6e8a77b431443aff9310d3687696b60a1c0f5
+MD5 042db86d50b38de7573c7346084cc081 files/mysqlmanager.rc6 6627
+RMD160 e980a5f09570e528c0a3b57cdc7d3fa2bff78502 files/mysqlmanager.rc6 6627
+SHA256 19f876f17e193ecaf4382ae0dda6e8a77b431443aff9310d3687696b60a1c0f5 files/mysqlmanager.rc6 6627
+DIST mysql-5.0.27.tar.gz 25867740 RMD160 3de75b959d04e002b2e4cfe322abdb48bf2f80fd SHA1 656de9c03f07c2371f40277076ec2fc6eac51ec8 SHA256 08dc9a7b4adb766b2fb8390804147822f1772aa4bd2e06ca7764bc85010c73a7
+DIST mysql-5.1.13-bk-20061018.tar.gz 15866253 RMD160 707f1636d5e58f4c0e34809adfe19d04bf510530 SHA1 b265bcbd7a2c95976fb60142f819f7f136238eef SHA256 2dd77660688fec0bec3bb812fa85de059c983296d69f0e1e51f3669dca118770
+DIST mysql-community-patchset-5.0.27-r1.tar.bz2 1748 RMD160 74198d990e7a627841aac6ef7ff866704d82e601 SHA1 865bab210a89eea97b2b79e7bb007440ab33b482 SHA256 1279a343a15a0b601cdc4b0c34502ff924528a12f7c4ff83a506b5050e19ce1c
+EBUILD mysql-community-5.0.27.ebuild 1144 RMD160 ea5b38b77083957af46e0fa17ea8d9a3c84176db SHA1 4f10f6583f1306fffa6f13c2482e8c2b7eadf20d SHA256 86363b75abc9543f4b2a9598e433c67f22d5374077bfa9f542b92c7dd2bd2563
+MD5 0fdbb0271ad6965bf286b9b352e0187e mysql-community-5.0.27.ebuild 1144
+RMD160 ea5b38b77083957af46e0fa17ea8d9a3c84176db mysql-community-5.0.27.ebuild 1144
+SHA256 86363b75abc9543f4b2a9598e433c67f22d5374077bfa9f542b92c7dd2bd2563 mysql-community-5.0.27.ebuild 1144
+EBUILD mysql-community-5.1.13_alpha20061018.ebuild 570 RMD160 f81fac0ee2956d26263c9ff7e9af3e045dd65191 SHA1 8597b278ca9b922c2b99aa850ba6bcd576134738 SHA256 e384bf3b2f13fc341bcba252efa2abb49e2c1991460174bbeff52bc78b31f3a2
+MD5 ee027fb4186d073d7d3c48b83ba48439 mysql-community-5.1.13_alpha20061018.ebuild 570
+RMD160 f81fac0ee2956d26263c9ff7e9af3e045dd65191 mysql-community-5.1.13_alpha20061018.ebuild 570
+SHA256 e384bf3b2f13fc341bcba252efa2abb49e2c1991460174bbeff52bc78b31f3a2 mysql-community-5.1.13_alpha20061018.ebuild 570
+MISC ChangeLog 613 RMD160 7d631c49fc24ea834178fc398cab72518e7c7b75 SHA1 76bc8d77e249e29ad87aa2a89ed49200dd0a959c SHA256 3f6ba1bd316e620f1878e8ac80a7242eed22e56d49db91460f70da248bc20276
+MD5 8b439eccb492c881c5908f3068cf1876 ChangeLog 613
+RMD160 7d631c49fc24ea834178fc398cab72518e7c7b75 ChangeLog 613
+SHA256 3f6ba1bd316e620f1878e8ac80a7242eed22e56d49db91460f70da248bc20276 ChangeLog 613
+MISC metadata.xml 159 RMD160 a50a94af7706288c46f81d6c3da9b5f888050eee SHA1 5eb253a678d6faa0f1c6b3c5720a804ed8923566 SHA256 5cfd5aa0e8104c0326b5f4c9205a6449a94e0f6f6abfd2626f1e7a8fe77b98b7
+MD5 f1c86d989c7ea2451931e7e2c3530f8c metadata.xml 159
+RMD160 a50a94af7706288c46f81d6c3da9b5f888050eee metadata.xml 159
+SHA256 5cfd5aa0e8104c0326b5f4c9205a6449a94e0f6f6abfd2626f1e7a8fe77b98b7 metadata.xml 159
+MD5 4e1d7cda95f2b8d9c0c93330adb4a6c7 files/digest-mysql-community-5.0.27 545
+RMD160 21d1b132eafb0ecd34645c925d90ea4ff24ed7e7 files/digest-mysql-community-5.0.27 545
+SHA256 573b6c9a15e487d36967fd8faeeea83c9ac49d9cf8fa6efc6ccb6a982f85bfa1 files/digest-mysql-community-5.0.27 545
+MD5 5b1a20d6a4cc2b82b91161be043099ad files/digest-mysql-community-5.1.13_alpha20061018 280
+RMD160 6647bb65ed37800a236b1cf6f0873ee129ba0758 files/digest-mysql-community-5.1.13_alpha20061018 280
+SHA256 a3b9a24c9133b65ba097615211ac40a0f7f466456ccf9b39920956866eed4bee files/digest-mysql-community-5.1.13_alpha20061018 280
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.5 (GNU/Linux)
+
+iD8DBQFFZavBKolR564NvWYRAsOjAKC43F97h2UD6G9I6eEIO63YLI3b2wCeMDHr
+Hygj/CON7fp7Tw42yx5UwfA=
+=jTzi
+-----END PGP SIGNATURE-----
diff --git a/dev-db/mysql-community/files/digest-mysql-community-5.0.27 b/dev-db/mysql-community/files/digest-mysql-community-5.0.27
new file mode 100644 (file)
index 0000000..93f2852
--- /dev/null
@@ -0,0 +1,6 @@
+MD5 584d423440a9d9c859678e3d4f2690b3 mysql-5.0.27.tar.gz 25867740
+RMD160 3de75b959d04e002b2e4cfe322abdb48bf2f80fd mysql-5.0.27.tar.gz 25867740
+SHA256 08dc9a7b4adb766b2fb8390804147822f1772aa4bd2e06ca7764bc85010c73a7 mysql-5.0.27.tar.gz 25867740
+MD5 6bbe6a711efc1455c0d210a477d2af0e mysql-community-patchset-5.0.27-r1.tar.bz2 1748
+RMD160 74198d990e7a627841aac6ef7ff866704d82e601 mysql-community-patchset-5.0.27-r1.tar.bz2 1748
+SHA256 1279a343a15a0b601cdc4b0c34502ff924528a12f7c4ff83a506b5050e19ce1c mysql-community-patchset-5.0.27-r1.tar.bz2 1748
diff --git a/dev-db/mysql-community/files/digest-mysql-community-5.1.13_alpha20061018 b/dev-db/mysql-community/files/digest-mysql-community-5.1.13_alpha20061018
new file mode 100644 (file)
index 0000000..d973906
--- /dev/null
@@ -0,0 +1,3 @@
+MD5 d9608acdc725950078e06106ed2e4c29 mysql-5.1.13-bk-20061018.tar.gz 15866253
+RMD160 707f1636d5e58f4c0e34809adfe19d04bf510530 mysql-5.1.13-bk-20061018.tar.gz 15866253
+SHA256 2dd77660688fec0bec3bb812fa85de059c983296d69f0e1e51f3669dca118770 mysql-5.1.13-bk-20061018.tar.gz 15866253
diff --git a/dev-db/mysql-community/files/my.cnf-4.1 b/dev-db/mysql-community/files/my.cnf-4.1
new file mode 100644 (file)
index 0000000..b29d23b
--- /dev/null
@@ -0,0 +1,146 @@
+# /etc/mysql/my.cnf: The global mysql configuration file.
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-community/files/my.cnf-4.1,v 1.1 2006/11/23 13:58:06 vivo Exp $
+
+# The following options will be passed to all MySQL clients
+[client]
+#password                                      = your_password
+port                                           = 3306
+socket                                         = /var/run/mysqld/mysqld.sock
+
+[mysql]
+character-sets-dir=/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqladmin]
+character-sets-dir=/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlcheck]
+character-sets-dir=/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqldump]
+character-sets-dir=/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlimport]
+character-sets-dir=/usr/share/mysql/charsets
+default-character-set=utf8
+
+[mysqlshow]
+character-sets-dir=/usr/share/mysql/charsets
+default-character-set=utf8
+
+[myisamchk]
+character-sets-dir=/usr/share/mysql/charsets
+
+[myisampack]
+character-sets-dir=/usr/share/mysql/charsets
+
+# use [safe_mysqld] with mysql-3
+[mysqld_safe]
+err-log                                                = /var/log/mysql/mysql.err
+
+# add a section [mysqld-4.1] or [mysqld-5.0] for specific configurations
+[mysqld]
+character-set-server           = utf8
+default-character-set          = utf8
+user                                           = mysql
+port                                           = 3306
+socket                                                 = /var/run/mysqld/mysqld.sock
+pid-file                                       = /var/run/mysqld/mysqld.pid
+log-error                                      = /var/log/mysql/mysqld.err
+basedir                                        = /usr
+datadir                                        = @DATADIR@
+skip-locking
+key_buffer                                     = 16M
+max_allowed_packet                     = 1M
+table_cache                            = 64
+sort_buffer_size                       = 512K
+net_buffer_length                      = 8K
+read_buffer_size                       = 256K
+read_rnd_buffer_size           = 512K
+myisam_sort_buffer_size        = 8M
+language                                       = /usr/share/mysql/english
+
+# security:
+# using "localhost" in connects uses sockets by default
+# skip-networking
+bind-address                           = 127.0.0.1
+
+log-bin
+server-id                                      = 1
+
+# point the following paths to different dedicated disks
+tmpdir                                                 = /tmp/
+#log-update                            = /path-to-dedicated-directory/hostname
+
+# you need the debug USE flag enabled to use the following directives,
+# if needed, uncomment them, start the server and issue 
+# #tail -f /tmp/mysqld.sql /tmp/mysqld.trace
+# this will show you *exactly* what's happening in your server ;)
+
+#log                                           = /tmp/mysqld.sql
+#gdb
+#debug                                         = d:t:i:o,/tmp/mysqld.trace
+#one-thread
+
+# uncomment the following directives if you are using BDB tables
+#bdb_cache_size                                = 4M
+#bdb_max_lock                          = 10000
+
+# the following is the InnoDB configuration
+# if you wish to disable innodb instead
+# uncomment just the next line
+#skip-innodb
+#
+# the rest of the innodb config follows:
+# don't eat too much memory, we're trying to be safe on 64Mb boxes
+# you might want to bump this up a bit on boxes with more RAM
+innodb_buffer_pool_size = 16M
+# this is the default, increase it if you have lots of tables
+innodb_additional_mem_pool_size = 2M
+#
+# i'd like to use /var/lib/mysql/innodb, but that is seen as a database :-(
+# and upstream wants things to be under /var/lib/mysql/, so that's the route
+# we have to take for the moment
+#innodb_data_home_dir          = /var/lib/mysql/
+#innodb_log_arch_dir           = /var/lib/mysql/
+#innodb_log_group_home_dir     = /var/lib/mysql/
+# you may wish to change this size to be more suitable for your system
+# the max is there to avoid run-away growth on your machine
+innodb_data_file_path = ibdata1:10M:autoextend:max:128M
+# we keep this at around 25% of of innodb_buffer_pool_size
+# sensible values range from 1MB to (1/innodb_log_files_in_group*innodb_buffer_pool_size)
+innodb_log_file_size = 5M
+# this is the default, increase it if you have very large transactions going on
+innodb_log_buffer_size = 8M
+# this is the default and won't hurt you
+# you shouldn't need to tweak it
+set-variable = innodb_log_files_in_group=2
+# see the innodb config docs, the other options are not always safe
+innodb_flush_log_at_trx_commit = 1
+innodb_lock_wait_timeout = 50
+
+[mysqldump]
+quick
+max_allowed_packet                     = 16M
+
+[mysql]
+# uncomment the next directive if you are not familiar with SQL
+#safe-updates
+
+[isamchk]
+key_buffer                                     = 20M
+sort_buffer_size                       = 20M
+read_buffer                            = 2M
+write_buffer                           = 2M
+
+[myisamchk]
+key_buffer                                     = 20M
+sort_buffer_size                       = 20M
+read_buffer                            = 2M
+write_buffer                           = 2M
+
+[mysqlhotcopy]
+interactive-timeout
diff --git a/dev-db/mysql-community/files/mysql.conf.d b/dev-db/mysql-community/files/mysql.conf.d
new file mode 100644 (file)
index 0000000..15ff170
--- /dev/null
@@ -0,0 +1,80 @@
+#  Here is where we define which server(s) to start.
+#  Additional parameters to be passed to mysqld at startup may be added here,
+#  which will override the ones in "my.cnf".
+#
+#  Below are described some suggested parameters to use.
+#  The parameters not recognized will be passed through to the mysqld daemon
+#  directly!
+#  To avoid starting a server just comment it's definition.
+#
+#  Last but not least, SPACES are NOT allowed inside the parameters!
+#
+#  Parameter      : description
+# ----------------+-----------------------------------------------------------
+# nice            : integer [-20 .. 19 ] default 0
+#                 : change the priority of the server -20 (high) to 19 (low)
+#                 : see "man nice 1" for description
+# ----------------+-----------------------------------------------------------
+# mycnf           : string [full path to my.cnf]
+#                 : specify the path to my.cnf file to be used
+# ----------------+-----------------------------------------------------------
+# startup_timeout : integer [seconds] default 15
+#                 : time to wait for mysqld up and running, after this it's
+#                 : marked as failed
+# ----------------+-----------------------------------------------------------
+#
+#  Additional parameters
+#  Parameter      : description
+# ----------------+-----------------------------------------------------------
+# server-id       : integer [1 .. 255]
+#                 : Uniquely identifies the server instance in the community
+#                 : of replication partners.
+# ----------------+-----------------------------------------------------------
+# port            : integer [1025 .. 65535] default 3306
+#                 : Port number to use for connection.
+#                 : Looses any meaning if skip-networking is set.
+# ----------------+-----------------------------------------------------------
+# skip-networking : NULL
+#                 : Don't allow connection through TCP/IP.
+# ----------------+-----------------------------------------------------------
+# log-bin         : string [name of the binlog files]
+#                 : Log update queries in binary format. Optional (but
+#                 : strongly recommended to avoid replication problems if
+#                 : server's hostname changes) argument should be the chosen
+#                 : location for the binary log files.
+# ----------------+-----------------------------------------------------------
+# Additionally the following variables are recognized:
+#
+# Be more verbose, accepts values from 1 to 4
+#DEBUG=4
+#
+# The default location for the "master" pid file
+#MYSQL_GLOB_PID_FILE="/var/run/svc-started-mysqld"
+#
+# The timeout for a failed attempt to stop a server
+#STOPTIMEOUT=120
+#
+
+# The parameters are passed in a bash array variable,
+# the variable name is mysql_slot_0_[server-num]
+# "server-num" is an optional number used to start multiple servers
+#
+# Examples:
+#
+# start a default server with default options:
+#mysql_slot_0=()
+#
+# start MySQL reniced, overriding some start parameters
+#mysql_slot_0=(
+#   "nice=-5"
+#   "server-id=123"
+#   "log-bin="myhost"
+#   "port=3307"
+#)
+#
+# start another server, different my.cnf
+#mysql_slot_0_1=(
+#   "mycnf=/home/test/my.cnf"
+#   "server-id=124"
+#)
+#
diff --git a/dev-db/mysql-community/files/mysqlmanager.conf.d b/dev-db/mysql-community/files/mysqlmanager.conf.d
new file mode 100644 (file)
index 0000000..8666f71
--- /dev/null
@@ -0,0 +1,28 @@
+#  Here is where we define which server(s) to start.
+#  Additional parameters to be passed to mysqlmanager at startup may be added here,
+#  which will override the ones in "my.cnf".
+#
+#  To avoid starting a server just comment it's definition
+#  here or it will rant (no default start).
+#  Last but not least, spaces are NOT allowed inside the parameters!
+#
+#  Below are described some suggested parameters to use.
+#  The parameters not recognized will be passed through to the mysqlmanager directly.
+#
+#  Parameter      : description
+
+# ----------------+-----------------------------------------------------------
+# mycnf           : string [full path to my.cnf]
+#                 : specify the path to my.cnf file to be used
+#                 : may contain a [manager] section
+# ----------------+-----------------------------------------------------------
+#
+# Basic default
+#
+#mysqlmanager_slot_0=()
+#
+# Start MySQL 5.0.X overriding the my.cnf path
+#mysqlmanager_slot_500=(
+#      "mycnf=/home/test/my.cnf"
+#)
+#
diff --git a/dev-db/mysql-community/files/mysqlmanager.rc6 b/dev-db/mysql-community/files/mysqlmanager.rc6
new file mode 100644 (file)
index 0000000..894fc0b
--- /dev/null
@@ -0,0 +1,230 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-community/files/mysqlmanager.rc6,v 1.1 2006/11/23 13:58:06 vivo Exp $
+
+# external binaries used: which, sed, tac
+
+depend() {
+       use dns net localmount netmount nfsmount
+       #provide mysql
+}
+
+# int in_list(char * elem, char * list)
+function in_list() {
+       local elem=${1:-"none"}
+       local list=${2:-","}
+
+       [[ "${list}" == "${list/,${elem},/}" ]] \
+       && return 1 \
+       || return 0
+}
+
+do_escape() {
+       # Ihatethisreallyverymuch
+       #echo "$1" | sed -e "s|'| |" -e "s|=|='|" -e "s|$|'|"
+       echo "$1"
+}
+
+# int get_slot_config(srv_slot=0, srv_num)
+get_slot_config() {
+       [[ ${DEBUG} -ge 4 ]] && einfo ">>> get_slot_config(\"${1}\", \"${2}\")"
+
+       srv_slot="${1:-"0"}"
+       srv_num="${2}"
+       MY_SUFFIX="-${srv_slot}"
+       [[ "${MY_SUFFIX}" == '-0' ]] && MY_SUFFIX=''
+
+       basedir="" pidfile="" socket=""
+
+       local tmp_eval="mysqlmanager_slot_${srv_slot}${srv_num:+"_"}${srv_num}[@]"
+       local conf_d_parameters="${!tmp_eval}"
+       [[ ${conf_d_parameters[*]} == '()' ]] && conf_d_parameters=''
+
+       MY_CNF="/etc/mysql${MY_SUFFIX}/my.cnf"
+       # summa of unmanaged parameters
+       # some parameters may be present multiple times
+       unmanagedparams=""
+
+       # grab the parameters from conf.d/mysql definition
+       for my_default in ${conf_d_parameters[*]} ; do
+               case "${my_default}" in
+                       mycnf=*) MY_CNF="${my_default#mycnf=}" ;;
+                       basedir=*) basedir="${my_default#basedir=}" ;;
+                       pid-file=*) pidfile="${my_default#pid-file=}" ;;
+                       socket=*) socket="${my_default#socket=}" ;;
+                       *=*)
+                               # list of parameters we already have
+                               # prepend "--" because my_print_defaults do it
+                               unmanagedparams="${unmanagedparams} --$( do_escape "${my_default}" )"
+                               ;;
+                       *)
+                               unmanagedparams="${unmanagedparams} --${my_default}"
+                               ;;
+               esac
+       done
+
+       if [[ ! -r "${MY_CNF}" ]] ; then
+               ewarn "Cannot access ${MY_CNF} !"
+               MY_CNF=""
+               my_defaults=""
+       else
+               local my_print_defaults="$(which my_print_defaults${MY_SUFFIX} 2>/dev/null)"
+               if [[ ! -x "${my_print_defaults}" ]] ; then
+                       eerror "my_print_defaults NOT found or not executable"
+                       my_defaults=""
+               else
+                       my_defaults=$( ${my_print_defaults} \
+                       --loose-verbose \
+                       --config-file="${MY_CNF}" \
+                       manager )
+               fi
+       fi
+
+       # grab needed parameters from my.cnf, don't override the ones from
+       # conf.d/mysql
+       for my_default in ${my_defaults} ; do
+               case "${my_default}" in
+                       --pid-file=*)
+                               [[ -z "${pidfile}" ]] && pidfile="${my_default#--pid-file=}" ;;
+                       --socket=*)
+                               [[ -z "${socket}" ]] && socket="${my_default#--socket=}" ;;
+               esac
+       done
+
+       # still empty, I'm in doubt if assign a default or break, will see
+       basedir="${basedir:-"/usr"}"
+       pidfile="${pidfile:-"/var/run/mysqld/mysqlmanager${MY_SUFFIX}.pid"}"
+       socket="${socket:-"/var/run/mysqld/mysqlmanager${MY_SUFFIX}.sock"}"
+
+       if [[ ${DEBUG} -ge 3 ]] ; then
+               einfo "basedir    => ${basedir}"
+               einfo "pidfile    => ${pidfile}"
+               einfo "socket     => ${socket}"
+               einfo "Unamanged  => ${unmanagedparams}"
+       fi
+
+       # push these out to the script
+       export MY_SUFFIX MY_CNF pidfile basedir socket
+       export unmanagedparams
+       [[ ${DEBUG} -ge 4 ]] && einfo "<<< get_slot_config() ok"
+       return 0
+}
+
+start() {
+       [[ ${DEBUG} -ge 4 ]] && einfo ">>> start()"
+       MYSQL_GLOB_PID_FILE=${MYSQL_GLOB_PID_FILE:-"/var/run/svc-started-${SVCNAME}"}
+       # servers are defined in /etc/conf.d/mysql
+       local serverlist=${!mysqlmanager_slot_*}
+       # provide default for empty conf.d/mysql
+       if [[ -z "${serverlist}" ]] ; then
+               serverlist=0
+               export mysqlmanager_slot_0=()
+       fi
+       local retstatus timeout
+       local globretstatus=1
+       local srv_slot srv_num
+       # server MUST NOT share same location for these
+       local pidfilelist=',' socketlist=','
+
+       # additional security
+       rm -f "${MYSQL_GLOB_PID_FILE}" ; touch "${MYSQL_GLOB_PID_FILE}"
+       if [[ $? -ne 0 ]] ; then
+               eerror "cannot create MYSQL_GLOB_PID_FILE: ${MYSQL_GLOB_PID_FILE}"
+               [[ ${DEBUG} -ge 4 ]] && einfo "<<< start() KO"
+               return 1
+       fi
+
+       ebegin
+       # try to start each server
+       for srv in ${serverlist[*]} ; do
+               einfo "working on ${srv}"
+
+               srv_slot="${srv#mysqlmanager_slot_}"
+               if [[ "${srv_slot}" == "${srv_slot#*_}" ]] ; then
+                       srv_num=''
+               else
+                       srv_num="${srv_slot#*_}"
+               fi
+               srv_slot="${srv_slot%%_*}"
+
+               retstatus=0
+               get_slot_config "${srv_slot}" "${srv_num}" || retstatus=1
+
+               # timeout (seconds) before declaring the startup failed
+
+               # pre_run checks
+               if [[ "$retstatus" -eq 0 ]] ; then
+                       if in_list "${pidfile}" "${pidfilelist}" ; then
+                               retstatus=3
+                               eerror "Sorry, won't start with same pid-file: ${pidfile}"
+                       fi
+                       if in_list "${socket}" "${socketlist}" ; then
+                               retstatus=5
+                               eerror "Sorry, won't start with same socket: ${socket}"
+                       fi
+               fi
+
+               if [[ $retstatus -eq 0 ]] ; then
+                       # additional security
+                       rm -f ${pidfile} ${socket}
+                       einfo "Starting mysqlmanager${MY_SUFFIX:+"_"}${srv_slot}${srv_num:+"_"}${srv_num} (${MY_CNF})"
+
+                       [[ ${DEBUG} -ge 2 ]] && echo "starting mysqlmanager with: "${basedir}/sbin/mysqlmanager${MY_SUFFIX} ${unmanagedparams} --pid-file=${pidfile} --socket=${socket}
+
+                       start-stop-daemon --quiet --start --background \
+                               --pidfile "${pidfile}" \
+                               --exec ${basedir}/sbin/mysqlmanager${MY_SUFFIX} \
+                               -- \
+                                       ${MY_CNF:+"--defaults-file="}${MY_CNF} \
+                                       ${unmanagedparams} \
+                                       --pid-file=${pidfile} \
+                                       --socket=${socket}
+
+                       retstatus=$?
+
+                       if [[ "${retstatus}" -eq 0 ]] ; then
+                               pidfilelist="${pidfilelist}${pidfile},"
+                               socketlist="${socketlist}${socket},"
+                               globretstatus=0
+                               echo "${srv_slot}${srv_num:+"_"}${srv_num}=${pidfile}" >> "${MYSQL_GLOB_PID_FILE}"
+                       fi
+               fi
+       done
+       # successfull if at least one mysqlmanager started
+       [[ ${DEBUG} -ge 4 ]] && einfo "<<< start()"
+       eend $globretstatus
+}
+
+stop () {
+       MYSQL_GLOB_PID_FILE=${MYSQL_GLOB_PID_FILE:-"/var/run/svc-started-${SVCNAME}"}
+       local runwhat pidfile shutdown_elem
+       local PID cnt timeout
+       local retstatus=0
+       local shutdown_list="$(< "${MYSQL_GLOB_PID_FILE}" )"
+
+       # shutdown in reverse order
+       ebegin
+       for shutdown_elem in $shutdown_list; do
+               runwhat=${shutdown_elem%%=*}
+               pidfile=${shutdown_elem#*=}
+               timeout=${STOPTIMEOUT:-"10"}
+
+               einfo "Stopping mysqlmanager (${runwhat})"
+
+               PID=$(cat "${pidfile}" 2>/dev/null)
+               start-stop-daemon --stop --quiet --pidfile="${pidfile}"
+               [[ ${DEBUG} -ge 1 ]] && echo ""
+               while [[ -n "$PID" && $( kill -0 $PID 2>/dev/null ) && "${timeout}" -ge 1 ]] ; do
+                       timeout=$(($timeout - 1))
+                       [[ ${DEBUG} -ge 1 ]] && echo -n $(( $STOPTIMEOUT - $timeout ))
+                       sleep 1
+               done
+               if [[ "${timeout}" -lt 1 ]] ; then
+                       retstatus=$(( $retstatus + 1 ))
+               fi
+       done
+
+       [[ "$retstatus" -eq 0 ]] && rm -f "$MYSQL_GLOB_PID_FILE"
+       eend $retstatus
+}
diff --git a/dev-db/mysql-community/metadata.xml b/dev-db/mysql-community/metadata.xml
new file mode 100644 (file)
index 0000000..abf3529
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <herd>mysql</herd>
+</pkgmetadata>
diff --git a/dev-db/mysql-community/mysql-community-5.0.27.ebuild b/dev-db/mysql-community/mysql-community-5.0.27.ebuild
new file mode 100644 (file)
index 0000000..bdc5a68
--- /dev/null
@@ -0,0 +1,37 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-community/mysql-community-5.0.27.ebuild,v 1.1 2006/11/23 13:58:06 vivo Exp $
+
+# Leave this empty
+MYSQL_VERSION_ID=""
+MYSQL_RERELEASE=""
+# Set the patchset revision to use, must be either empty or a decimal number
+MYSQL_PATCHSET_REV="1"
+
+inherit mysql
+
+#REMEMBER!!!: update also eclass/mysql*.eclass prior to commit
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
+
+src_test() {
+       cd "${S}"
+       einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
+       make check || die "make check failed"
+       if ! useq "minimal" ; then
+               einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+               local retstatus
+               addpredict /this-dir-does-not-exist/t9.MYI
+
+               cd mysql-test
+               sed -i -e "s|PORT=3306|PORT=3307|g" mysql-test-run
+               ./mysql-test-run
+               retstatus=$?
+
+               # Just to be sure ;)
+               pkill -9 -f "${S}/ndb" 2>/dev/null
+               pkill -9 -f "${S}/sql" 2>/dev/null
+               [[ $retstatus -eq 0 ]] || die "make test failed"
+       else
+               einfo "Skipping server tests due to minimal build."
+       fi
+}
diff --git a/dev-db/mysql-community/mysql-community-5.1.13_alpha20061018.ebuild b/dev-db/mysql-community/mysql-community-5.1.13_alpha20061018.ebuild
new file mode 100644 (file)
index 0000000..8417d1b
--- /dev/null
@@ -0,0 +1,15 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-community/mysql-community-5.1.13_alpha20061018.ebuild,v 1.1 2006/11/23 13:58:06 vivo Exp $
+
+# Leave this empty
+MYSQL_VERSION_ID=""
+MYSQL_RERELEASE=""
+# Set the patchset revision to use, must be either empty or a decimal number
+MYSQL_PATCHSET_REV=""
+
+inherit mysql
+
+#REMEMBER!!!: update also eclass/mysql*.eclass prior to commit
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+