summaryrefslogtreecommitdiff
path: root/dev-db
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2005-05-17 09:08:46 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2005-05-17 09:08:46 +0000
commit23b20dab0d8772aedf574a793a687bd36dd66e85 (patch)
treebcd73e17632c3eeb2016a8b0be8d1c8fb8f24ab8 /dev-db
parentAdded Vietnamese description (diff)
downloadhistorical-23b20dab0d8772aedf574a793a687bd36dd66e85.tar.gz
historical-23b20dab0d8772aedf574a793a687bd36dd66e85.tar.bz2
historical-23b20dab0d8772aedf574a793a687bd36dd66e85.zip
Bug #83011, finally a new mysql-4.1, that is suitable for the main tree. Many thanks to Francesco Riosa <BastianBalthazarBux@pnpitalia.it> for his work on this. These are hardmasked for final testing still.
Diffstat (limited to 'dev-db')
-rw-r--r--dev-db/mysql/ChangeLog15
-rw-r--r--dev-db/mysql/Manifest22
-rw-r--r--dev-db/mysql/files/digest-mysql-4.0.24-r21
-rw-r--r--dev-db/mysql/files/digest-mysql-4.1.121
-rw-r--r--dev-db/mysql/files/my.cnf-4.1125
-rw-r--r--dev-db/mysql/files/mysql-4.0.24-asm-pic-fixes.patch102
-rw-r--r--dev-db/mysql/files/mysql-4.0.24-r2.rc671
-rw-r--r--dev-db/mysql/files/mysql-4.1.12-asm-pic-fixes.patch104
-rw-r--r--dev-db/mysql/files/mysql-4.1.9-thrssl.patch22
-rw-r--r--dev-db/mysql/files/mysql-test-myisam-geometry.patch22
-rw-r--r--dev-db/mysql/mysql-4.0.24-r2.ebuild447
-rw-r--r--dev-db/mysql/mysql-4.1.12.ebuild490
12 files changed, 1410 insertions, 12 deletions
diff --git a/dev-db/mysql/ChangeLog b/dev-db/mysql/ChangeLog
index 9f75366aacd7..05d6c1c7492f 100644
--- a/dev-db/mysql/ChangeLog
+++ b/dev-db/mysql/ChangeLog
@@ -1,6 +1,19 @@
# ChangeLog for dev-db/mysql
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/ChangeLog,v 1.196 2005/05/06 09:48:14 swegener Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/ChangeLog,v 1.197 2005/05/17 09:08:46 robbat2 Exp $
+
+*mysql-4.1.12 (17 May 2005)
+*mysql-4.0.24-r2 (17 May 2005)
+
+ 17 May 2005; Robin H. Johnson <robbat2@gentoo.org>
+ +files/mysql-4.0.24-asm-pic-fixes.patch, +files/mysql-4.0.24-r2.rc6,
+ +files/my.cnf-4.1, +files/mysql-4.1.9-thrssl.patch,
+ +files/mysql-4.1.12-asm-pic-fixes.patch,
+ +files/mysql-test-myisam-geometry.patch, +mysql-4.0.24-r2.ebuild,
+ +mysql-4.1.12.ebuild:
+ Bug #83011, finally a new mysql-4.1, that is suitable for the main tree.
+ Many thanks to Francesco Riosa <BastianBalthazarBux@pnpitalia.it> for his
+ work on this. These are hardmasked for final testing still.
06 May 2005; Sven Wegener <swegener@gentoo.org> mysql-4.1.8.ebuild,
mysql-4.1.8-r1.ebuild:
diff --git a/dev-db/mysql/Manifest b/dev-db/mysql/Manifest
index 736caf361ed8..c471c82ebd4a 100644
--- a/dev-db/mysql/Manifest
+++ b/dev-db/mysql/Manifest
@@ -1,7 +1,5 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
MD5 a088b749386760cae4d09caf14f39c84 mysql-4.0.22-r1.ebuild 9269
+MD5 5fbcfef88204488f93362e1b1ae57029 mysql-4.0.24-r2.ebuild 13729
MD5 ca4242e577d3b1b6f69cfa80142c320f mysql-3.23.58.ebuild 6640
MD5 a4e6b738e389c33c3c9e19b8fb5b8fa3 mysql-4.0.23.ebuild 9040
MD5 80c210f51c3c19afc810c5fb9fc67c7b mysql-4.0.23-r2.ebuild 9407
@@ -12,11 +10,13 @@ MD5 9bb11a2e8c8e579009cb712fd7a8bf66 mysql-4.0.22-r2.ebuild 9602
MD5 d436e793baae2f71669b96381ce2959b mysql-3.23.58-r1.ebuild 6759
MD5 135c8d82ff80aa2d7d3b1df75719dd00 mysql-4.1.8.ebuild 9087
MD5 be85068e1f8dd9340882814ae10e1763 mysql-4.0.23-r1.ebuild 9160
+MD5 0a0412a107c07afc2ed85fdc3d2a3f46 mysql-4.1.12.ebuild 15513
MD5 f26f6906248f45f5f0d23248a39c03a4 mysql-4.0.24.ebuild 9816
-MD5 248de0c0febbec77b4cdff527d14e5cb ChangeLog 30693
+MD5 657360967f775e8a44e49d9083ddc47c ChangeLog 31279
MD5 a5dda17df0286cd82cae42d117784903 metadata.xml 163
MD5 4541e130a1b0fa90db8612973b0adb75 files/mysql-4.0-mysqld-safe-sh.diff 1477
MD5 36aa23522b241aafdb833ac4f11c4fd1 files/mysql-4.0.4-install-db-sh.diff 1439
+MD5 a755fb5a3ed724046a4f83fafd819c77 files/mysql-test-myisam-geometry.patch 1217
MD5 e37e03b4ce894ff87fda12ce6f7b31a6 files/mysql-4.0.21-install-db-sh.diff 585
MD5 3e399acddc48f209b53e260eec64938c files/mysql-4.0.rc6 933
MD5 625b4007f035e3da9a4f1eeee1db6b9c files/mysql-4.0.15.rc6 1187
@@ -26,9 +26,11 @@ MD5 d3830060b3f74d6c0916ed85a6bbf02d files/mysql-3.23-install-db-sh.diff 1368
MD5 58c4d09c5c2712254b1881a6fcc7abff files/mysql-4.0.18-gentoo-nptl.diff 587
MD5 7d92ba9c74a73bf3c852a5c078c16d29 files/rebuilder.sh 1557
MD5 087f3fbbe8e3385f5408d91cb661aace files/mysql-4.0-mysqlhotcopy-security.patch 1394
+MD5 28b79a92729c506943a4f9c6d9abf1fb files/mysql-4.0.24-asm-pic-fixes.patch 2634
MD5 04fa914460358170e2865d20b22d2171 files/digest-mysql-4.0.22 66
MD5 5c65bc30646d669193798324a56b002a files/digest-mysql-4.0.23 66
MD5 547fab43da8e59a03a5f3e4a500cca45 files/digest-mysql-4.0.24 66
+MD5 ee67067f786849424c4591e278819bbc files/digest-mysql-4.1.12 66
MD5 ee578e3021841ef9dba4175403564136 files/mysql-4.0-db-3.2.1.diff 1047
MD5 f2905bbcc3f148a2ad689792917bd78d files/mysql-4.0.16-install-db-sh.diff 1429
MD5 ff80a5d8d87212046e89f2f8ae779af4 files/mysql-4.0-nisam.h.diff 452
@@ -51,11 +53,15 @@ MD5 f49e58771365cb075ece153403811872 files/mysql-3.23.51-tcpd.patch 601
MD5 5701dee85af16e5d7aa821853ec8cda5 files/digest-mysql-4.1.8-r1 65
MD5 8af497943e1a29aa0a0c6b17af54b116 files/mysql-4.0.21-thrssl.patch 318
MD5 f599e8b3eb4636bb61721525dc15f5f5 files/mysql-4.0.18-thrssl.patch 723
+MD5 c4785801e45235c28d7a4139bfbd73af files/my.cnf-4.1 3667
MD5 8d51cbf3afa8349839380aa0986704c0 files/mysql-3.23-safe-mysqld-sh.diff 1557
MD5 7a5badec9c28c2f4d434d6aed0a5103b files/mysql-3.23-my-print-defaults.diff 218
MD5 a76ec36b83c2f0dbfba65c993f75d135 files/mysql-4.0.18-mysqlbugsecurity.diff 672
+MD5 66b1e90f93ae0adc106e7b62a2c4043b files/mysql-4.1.9-thrssl.patch 905
MD5 6e0ae36e30287df25336d8bd71c0e764 files/digest-mysql-3.23.58 67
MD5 d0fbdf4e41f2b52210eef6cb3a53e128 files/mysql-4.0.24-r1.rc6 1662
+MD5 08f1246e8107e4140378d429ff9773af files/mysql-4.0.24-r2.rc6 2123
+MD5 598859c685b18094178639620cb4ba89 files/mysql-4.1.12-asm-pic-fixes.patch 2655
MD5 977be6c68f6231cbcf1febd3305ade5d files/mysql-4.0.14-r1-tcpd-vars-fix.diff 465
MD5 57531ccd19e17ccca95e0e3bf833cd67 files/mysql-3.23-db-3.2.3.diff 1105
MD5 c6ff193b0612040bab879d2085b6edea files/mysql-4.0.24-manual.texi.patch 603
@@ -67,12 +73,6 @@ MD5 04fa914460358170e2865d20b22d2171 files/digest-mysql-4.0.22-r2 66
MD5 5c65bc30646d669193798324a56b002a files/digest-mysql-4.0.23-r1 66
MD5 ce711c0d8387720dbb85de1d756daa75 files/digest-mysql-4.0.23-r2 67
MD5 547fab43da8e59a03a5f3e4a500cca45 files/digest-mysql-4.0.24-r1 66
+MD5 547fab43da8e59a03a5f3e4a500cca45 files/digest-mysql-4.0.24-r2 66
MD5 152b9a8feef16df47b56c316c5c0601e files/mysql-4.0.13-thrssl.patch 813
MD5 ad5636b398982a23f6fc58f18a2114fc files/mysql-4.0.18-mysqldmultisecurity.diff 3863
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.1 (GNU/Linux)
-
-iD8DBQFCez1tI1lqEGTUzyQRApCcAJwOUXwuaJPkUBa8eTxybQvUhjfOwQCg2HPf
-3jGHyBHZ6r1qEyMze21mCaY=
-=JzKx
------END PGP SIGNATURE-----
diff --git a/dev-db/mysql/files/digest-mysql-4.0.24-r2 b/dev-db/mysql/files/digest-mysql-4.0.24-r2
new file mode 100644
index 000000000000..c6d7e25405e2
--- /dev/null
+++ b/dev-db/mysql/files/digest-mysql-4.0.24-r2
@@ -0,0 +1 @@
+MD5 408d3001ed715ddc90009c247e548638 mysql-4.0.24.tar.gz 16885399
diff --git a/dev-db/mysql/files/digest-mysql-4.1.12 b/dev-db/mysql/files/digest-mysql-4.1.12
new file mode 100644
index 000000000000..d9e377ccf07b
--- /dev/null
+++ b/dev-db/mysql/files/digest-mysql-4.1.12
@@ -0,0 +1 @@
+MD5 56a6f5cacd97ae290e07bbe19f279af1 mysql-4.1.12.tar.gz 17069350
diff --git a/dev-db/mysql/files/my.cnf-4.1 b/dev-db/mysql/files/my.cnf-4.1
new file mode 100644
index 000000000000..f08e49263bf4
--- /dev/null
+++ b/dev-db/mysql/files/my.cnf-4.1
@@ -0,0 +1,125 @@
+# /etc/mysql/my.cnf: The global mysql configuration file.
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/files/my.cnf-4.1,v 1.1 2005/05/17 09:08:46 robbat2 Exp $
+
+# The following options will be passed to all MySQL clients
+[client]
+character_set = utf8
+default-character-set = utf8
+
+#password = your_password
+port = 3306
+socket = /var/run/mysqld/mysqld.sock
+
+# 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 = /var/lib/mysql
+skip-locking
+#skip-innodb
+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 use 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 debug use flag enabled to use this ones.
+# if needed uncomment them, start the server and issue
+# #tail -f /tmp/mysqld.sql /tmp/mysqld.trace
+# this will show you *exactly* what's appening in your server ;)
+
+#log = /tmp/mysqld.sql
+#gdb
+#debug = d:t:i:o,/tmp/mysqld.trace
+#one-thread
+
+# Uncomment the following 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 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
+# 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 if you have very large transactions.
+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]
+# Remove the next comment character 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
+
+#vim: set tabstop=4 :
+#vim: set shiftwidth=4 :
+
diff --git a/dev-db/mysql/files/mysql-4.0.24-asm-pic-fixes.patch b/dev-db/mysql/files/mysql-4.0.24-asm-pic-fixes.patch
new file mode 100644
index 000000000000..ff6e128fe246
--- /dev/null
+++ b/dev-db/mysql/files/mysql-4.0.24-asm-pic-fixes.patch
@@ -0,0 +1,102 @@
+PIC fixes for MySQL. Makes the ASM PIC-compatible, so that it works with PaX.
+See http://bugs.gentoo.org/show_bug.cgi?id=42968 This patch authored by
+pageexec AT freemail.hu.
+
+--- mysql-4.0.24/strings/longlong2str-x86.s 2005-03-05 00:38:14.000000000 +0000
++++ mysql-4.0.24-fixed/strings/longlong2str-x86.s 2005-05-17 01:37:52.000000000 +0100
+@@ -19,6 +19,13 @@
+ .file "longlong2str.s"
+ .version "1.01"
+
++ .section rodata
++ .align 32
++ .type _dig_vec, @object
++ .size _dig_vec, 37
++_dig_vec:
++ .string "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
++
+ .text
+ .align 4
+
+@@ -31,11 +38,14 @@ longlong2str:
+ pushl %esi
+ pushl %edi
+ pushl %ebx
++
++ call __i686.get_pc_thunk.bx
++ addl $_GLOBAL_OFFSET_TABLE_,%ebx
++
+ movl 100(%esp),%esi # Lower part of val
+ movl 104(%esp),%ebp # Higher part of val
+ movl 108(%esp),%edi # get dst
+- movl 112(%esp),%ebx # Radix
+- movl %ebx,%eax
++ movl 112(%esp),%eax # Radix
+ testl %eax,%eax
+ jge .L144
+
+@@ -50,7 +60,7 @@ longlong2str:
+ adcl $0,%ebp
+ negl %ebp
+ .L146:
+- negl %ebx # Change radix to positive
++ negl 112(%esp) # Change radix to positive
+ jmp .L148
+ .align 4
+ .L144:
+@@ -77,12 +87,12 @@ longlong2str:
+
+ movl %ebp,%eax # High part of value
+ xorl %edx,%edx
+- divl %ebx
++ divl 112(%esp)
+ movl %eax,%ebp
+ movl %esi,%eax
+- divl %ebx
++ divl 112(%esp)
+ movl %eax,%esi # quotent in ebp:esi
+- movb _dig_vec(%edx),%al # al is faster than dl
++ movb _dig_vec@GOTOFF(%ebx,%edx),%al # al is faster than dl
+ decl %ecx
+ movb %al,(%ecx) # store value in buff
+ .align 4
+@@ -93,14 +103,13 @@ longlong2str:
+ jl .L153
+ je .L160 # Ready
+ movl %esi,%eax
+- movl $_dig_vec,%ebp
+ .align 4
+
+ .L154: # Do rest with integer precision
+ cltd
+- divl %ebx
++ divl 112(%esp)
+ decl %ecx
+- movb (%edx,%ebp),%dl # bh is always zero as ebx=radix < 36
++ movb _dig_vec@GOTOFF(%ebx,%edx),%dl
+ testl %eax,%eax
+ movb %dl,(%ecx)
+ jne .L154
+@@ -138,3 +147,13 @@ longlong10_to_str:
+
+ .L10end:
+ .size longlong10_to_str,.L10end-longlong10_to_str
++
++ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
++.globl __i686.get_pc_thunk.bx
++ .hidden __i686.get_pc_thunk.bx
++ .type __i686.get_pc_thunk.bx, @function
++__i686.get_pc_thunk.bx:
++ movl (%esp), %ebx
++ ret
++
++ .section .note.GNU-stack,"",@progbits
+diff -Nurp mysql-4.0.24/strings/strings-x86.s mysql-4.0.24-fixed/strings/strings-x86.s
+--- mysql-4.0.24/strings/strings-x86.s 2005-03-05 00:38:15.000000000 +0000
++++ mysql-4.0.24-fixed/strings/strings-x86.s 2005-05-17 01:37:47.000000000 +0100
+@@ -403,3 +403,5 @@ next_str:
+ ret
+ .strxmov_end:
+ .size strxmov,.strxmov_end-strxmov
++
++ .section .note.GNU-stack,"",@progbits
diff --git a/dev-db/mysql/files/mysql-4.0.24-r2.rc6 b/dev-db/mysql/files/mysql-4.0.24-r2.rc6
new file mode 100644
index 000000000000..ec221775d6ef
--- /dev/null
+++ b/dev-db/mysql/files/mysql-4.0.24-r2.rc6
@@ -0,0 +1,71 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/files/mysql-4.0.24-r2.rc6,v 1.1 2005/05/17 09:08:46 robbat2 Exp $
+
+depend() {
+ use dns net
+}
+
+getconfig() {
+ MY_CNF=${MY_CNF=/etc/mysql/my.cnf}
+ if [ ! -f ${MY_CNF} ]; then
+ eerror "No ${MY_CNF} file exists! Using automatic defaults!"
+ fi
+
+ #dir=`my_print_defaults mysqld | grep -- '^--datadir' | tail -n1 | sed -e 's|^--datadir=||'`
+ #dir=`my_print_defaults mysqld | sed -ne '/datadir/s|^--datadir=||p' | tail -n1`
+ local mysqld_cnf="`my_print_defaults --config-file=${MY_CNF} mysqld`"
+ datadir=`echo "${mysqld_cnf}" | sed -ne '/datadir/s|^--datadir=||p' | tail -n1`
+ pidfile=`echo "${mysqld_cnf}" | sed -ne '/pid-file/s|^--pid-file=||p' | tail -n1`
+ basedir=`echo "${mysqld_cnf}" | sed -ne '/basedir/s|^--basedir=||p' | tail -n1`
+ socket=`echo "${mysqld_cnf}" | sed -ne '/socket/s|^--socket=||p' | tail -n1`
+
+ # push these out to the script
+ export MY_CNF
+ export pidfile
+ export datadir
+ export basedir
+ export socket
+}
+
+checkconfig() {
+ getconfig
+ if [ -z "${datadir}" ]; then
+ eerror "Your mysql doesn't have any datadir setting, default or specific"
+ eerror "Please check your my.cnf : ${MY_CNF}"
+ return 1
+ fi
+
+ if [ ! -d "$datadir/mysql" ]; then
+ eerror "You don't appear to have the mysql database installed yet."
+ eerror "Please run /usr/bin/mysql_install_db to have this done..."
+ return 1
+ fi
+}
+
+start() {
+ local retstatus=1
+ local maxtry=5
+ getconfig
+ checkconfig || return 1
+ ebegin "Starting mysqld (${MY_CNF})"
+ start-stop-daemon --start --quiet --background \
+ --exec "${basedir}/bin/mysqld_safe" \
+ -- --defaults-file=${MY_CNF} >/dev/null 2>&1
+ retstatus=$?
+ while ! [[ -S "${socket}" || "${maxtry}" -lt "1" || "${retstatus}" -gt "0" ]] ; do
+ maxtry=$(($maxtry-1))
+ echo -n "."
+ sleep 1
+ done
+ ! [[ -S "${socket}" ]] && eerror "MySQL NOT started, proceding anyway"
+ eend $retstatus
+}
+
+stop () {
+ getconfig
+ ebegin "Stopping mysqld (${MY_CNF})"
+ start-stop-daemon --stop --retry 5 --quiet --pidfile=${pidfile}
+ eend $?
+}
diff --git a/dev-db/mysql/files/mysql-4.1.12-asm-pic-fixes.patch b/dev-db/mysql/files/mysql-4.1.12-asm-pic-fixes.patch
new file mode 100644
index 000000000000..fb1ba1f851d6
--- /dev/null
+++ b/dev-db/mysql/files/mysql-4.1.12-asm-pic-fixes.patch
@@ -0,0 +1,104 @@
+PIC fixes for MySQL. Makes the ASM PIC-compatible, so that it works with PaX.
+See http://bugs.gentoo.org/show_bug.cgi?id=42968 This patch authored by
+pageexec AT freemail.hu. Ported to 4.1.12 by robbat2@gentoo.org.
+
+diff -NuarwbB mysql.orig/strings/longlong2str-x86.s mysql/strings/longlong2str-x86.s
+--- mysql.orig/strings/longlong2str-x86.s 2005-05-13 04:32:11.000000000 -0700
++++ mysql/strings/longlong2str-x86.s 2005-05-17 00:13:25.000000000 -0700
+@@ -19,6 +19,13 @@
+ .file "longlong2str.s"
+ .version "1.01"
+
++ .section rodata
++ .align 32
++ .type _dig_vec, @object
++ .size _dig_vec, 37
++_dig_vec:
++ .string "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
++
+ .text
+ .align 4
+
+@@ -31,11 +38,14 @@
+ pushl %esi
+ pushl %edi
+ pushl %ebx
++
++ call __i686.get_pc_thunk.bx
++ addl $_GLOBAL_OFFSET_TABLE_,%ebx
++
+ movl 100(%esp),%esi # Lower part of val
+ movl 104(%esp),%ebp # Higher part of val
+ movl 108(%esp),%edi # get dst
+- movl 112(%esp),%ebx # Radix
+- movl %ebx,%eax
++ movl 112(%esp),%eax # Radix
+ testl %eax,%eax
+ jge .L144
+
+@@ -50,7 +60,7 @@
+ adcl $0,%ebp
+ negl %ebp
+ .L146:
+- negl %ebx # Change radix to positive
++ negl 112(%esp) # Change radix to positive
+ jmp .L148
+ .align 4
+ .L144:
+@@ -77,13 +87,13 @@
+
+ movl %ebp,%eax # High part of value
+ xorl %edx,%edx
+- divl %ebx
++ divl 112(%esp)
+ movl %eax,%ebp
+ movl %esi,%eax
+- divl %ebx
++ divl 112(%esp)
+ decl %ecx
+ movl %eax,%esi # quotent in ebp:esi
+- movb _dig_vec_upper(%edx),%al # al is faster than dl
++ movb _dig_vec@GOTOFF(%ebx,%edx),%al # al is faster than dl
+ movb %al,(%ecx) # store value in buff
+ .align 4
+ .L155:
+@@ -93,14 +103,13 @@
+ jl .L153
+ je .L10_mov # Ready
+ movl %esi,%eax
+- movl $_dig_vec_upper,%ebp
+ .align 4
+
+ .L154: # Do rest with integer precision
+ cltd
+- divl %ebx
++ divl 112(%esp)
+ decl %ecx
+- movb (%edx,%ebp),%dl # bh is always zero as ebx=radix < 36
++ movb _dig_vec@GOTOFF(%ebx,%edx),%dl
+ testl %eax,%eax
+ movb %dl,(%ecx)
+ jne .L154
+@@ -221,3 +230,13 @@
+
+ .L10end:
+ .size longlong10_to_str,.L10end-longlong10_to_str
++
++ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
++.globl __i686.get_pc_thunk.bx
++ .hidden __i686.get_pc_thunk.bx
++ .type __i686.get_pc_thunk.bx, @function
++__i686.get_pc_thunk.bx:
++ movl (%esp), %ebx
++ ret
++
++ .section .note.GNU-stack,"",@progbits
+diff -NuarwbB mysql.orig/strings/strings-x86.s mysql/strings/strings-x86.s
+--- mysql.orig/strings/strings-x86.s 2005-05-13 04:32:40.000000000 -0700
++++ mysql/strings/strings-x86.s 2005-05-17 00:11:56.000000000 -0700
+@@ -415,3 +415,5 @@
+ ret
+ .strxmov_end:
+ .size strxmov,.strxmov_end-strxmov
++
++ .section .note.GNU-stack,"",@progbits
diff --git a/dev-db/mysql/files/mysql-4.1.9-thrssl.patch b/dev-db/mysql/files/mysql-4.1.9-thrssl.patch
new file mode 100644
index 000000000000..d50325e8085d
--- /dev/null
+++ b/dev-db/mysql/files/mysql-4.1.9-thrssl.patch
@@ -0,0 +1,22 @@
+--- mysql-4.1.10.orig/libmysql_r/Makefile.in 2005-02-12 21:38:04.000000000 +0100
++++ mysql-4.1.10/libmysql_r/Makefile.in 2005-02-19 01:41:11.000000000 +0100
+@@ -242,7 +242,7 @@
+ LIBDL = @LIBDL@
+ LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
+ LIBOBJS = @LIBOBJS@
+-LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@
++LIBS = @CLIENT_LIBS@ @ZLIB_LIBS@ @openssl_libs@ @LIBS@
+ LIBTOOL = @LIBTOOL@
+ LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
+ LM_CFLAGS = @LM_CFLAGS@
+--- mysql-4.1.10.orig/libmysql_r/Makefile.am 2005-02-12 21:37:33.000000000 +0100
++++ mysql-4.1.10/libmysql_r/Makefile.am 2005-02-19 01:43:49.000000000 +0100
+@@ -22,7 +22,7 @@
+
+ target = libmysqlclient_r.la
+ target_defs = -DDONT_USE_RAID -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@
+-LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@
++LIBS = @CLIENT_LIBS@ @ZLIB_LIBS@ @openssl_libs@ @LIBS@
+
+ INCLUDES = @MT_INCLUDES@ \
+ -I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@
diff --git a/dev-db/mysql/files/mysql-test-myisam-geometry.patch b/dev-db/mysql/files/mysql-test-myisam-geometry.patch
new file mode 100644
index 000000000000..54a4a939e7e4
--- /dev/null
+++ b/dev-db/mysql/files/mysql-test-myisam-geometry.patch
@@ -0,0 +1,22 @@
+--- mysql.orig/mysql-test/t/myisam.test 2005-03-27 16:07:37.000000000 +0200
++++ mysql/mysql-test/t/myisam.test 2005-03-27 16:17:33.000000000 +0200
+@@ -476,7 +476,7 @@
+ #
+ # Test RTREE index
+ #
+---error 1235
++--error 1289
+ CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM;
+ # INSERT INTO t1 VALUES (1,1),(1,1);
+ # DELETE FROM rt WHERE a<1;
+--- mysql.orig/mysql-test/r/myisam.result 2005-03-27 16:08:20.000000000 +0200
++++ mysql/mysql-test/r/myisam.result 2005-03-27 16:12:18.000000000 +0200
+@@ -499,7 +499,7 @@
+ 1 SIMPLE t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct
+ drop table t1,t2;
+ CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM;
+-ERROR 42000: This version of MySQL doesn't yet support 'RTREE INDEX'
++ERROR HY000: The 'RTree keys' feature is disabled; you need MySQL built with 'HAVE_RTREE_KEYS' to have it working
+ create table t1 (a int, b varchar(200), c text not null) checksum=1;
+ create table t2 (a int, b varchar(200), c text not null) checksum=0;
+ insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
diff --git a/dev-db/mysql/mysql-4.0.24-r2.ebuild b/dev-db/mysql/mysql-4.0.24-r2.ebuild
new file mode 100644
index 000000000000..0d39cab8b6df
--- /dev/null
+++ b/dev-db/mysql/mysql-4.0.24-r2.ebuild
@@ -0,0 +1,447 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/mysql-4.0.24-r2.ebuild,v 1.1 2005/05/17 09:08:46 robbat2 Exp $
+
+inherit eutils gnuconfig flag-o-matic versionator
+
+SVER=${PV%.*}
+PLV=""
+NEWP="${PN}-${SVER}.$( get_version_component_range 3-3 )${PLV}"
+
+# shorten the path because the socket path length must be shorter than 107 chars
+# and we will run a mysql server during test phase
+S="${WORKDIR}/${PN}"
+
+DESCRIPTION="A fast, multi-threaded, multi-user SQL database server"
+HOMEPAGE="http://www.mysql.com/"
+SRC_URI="mirror://mysql/Downloads/MySQL-${SVER}/${NEWP}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE="berkdb debug doc minimal perl readline selinux ssl static tcpd"
+RESTRICT="primaryuri"
+
+DEPEND="readline? ( >=sys-libs/readline-4.1 )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6-r6 )
+ ssl? ( >=dev-libs/openssl-0.9.6d )
+ perl? ( dev-lang/perl )
+ >=sys-libs/zlib-1.1.3
+ >=sys-apps/texinfo-4.7-r1
+ sys-process/procps
+ >=sys-apps/sed-4"
+RDEPEND="${DEPEND}
+ selinux? ( sec-policy/selinux-mysql )"
+# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
+PDEPEND="perl? ( dev-perl/DBD-mysql )"
+
+mysql_get_datadir() {
+ DATADIR=""
+ if [ -f '/etc/mysql/my.cnf' ] ; then
+ #DATADIR=`grep ^datadir /etc/mysql/my.cnf | sed -e 's/.*= //'`
+ #DATADIR=`/usr/sbin/mysqld --help |grep '^datadir' | awk '{print $2}'`
+ #DATADIR=`my_print_defaults mysqld | grep -- '^--datadir' | tail -n1 | sed -e 's|^--datadir=||'`
+ DATADIR=`my_print_defaults mysqld 2>/dev/null | sed -ne '/datadir/s|^--datadir=||p' | tail -n1`
+ fi
+ if [ -z "${DATADIR}" ]; then
+ DATADIR="/var/lib/mysql/"
+ einfo "Using default DATADIR"
+ fi
+ einfo "MySQL DATADIR is ${DATADIR}"
+ export DATADIR
+}
+
+mysql_upgrade_warning() {
+ ewarn
+ ewarn "If you're upgrading from MySQL-3.x to 4.0, or 4.0.x to 4.1.x, you"
+ ewarn "must recompile the other packages on your system that link with"
+ ewarn "libmysqlclient after the upgrade completes. To obtain such a list"
+ ewarn "of packages for your system, you may use 'revdep-rebuild' from"
+ ewarn "app-portage/gentoolkit."
+ ewarn
+ epause 5
+}
+
+pkg_setup() {
+ mysql_upgrade_warning
+ mysql_get_datadir
+}
+
+src_unpack() {
+ if use static && use ssl; then
+ local msg="MySQL does not support building statically with SSL support"
+ eerror "${msg}"
+ die "${msg}"
+ fi
+
+ unpack ${A} || die
+
+ mv "${WORKDIR}/${NEWP}" "${S}"
+ cd "${S}"
+
+ #zap startup script messages
+ EPATCH_OPTS="-p1 -d ${S}" \
+ epatch ${FILESDIR}/${PN}-4.0.23-install-db-sh.diff || die
+ #zap binary distribution stuff
+ EPATCH_OPTS="-p1 -d ${S}" \
+ epatch ${FILESDIR}/${PN}-4.0.18-mysqld-safe-sh.diff || die
+ #required for qmail-mysql
+ EPATCH_OPTS="-p0 -d ${S}" \
+ epatch ${FILESDIR}/${PN}-4.0-nisam.h.diff || die
+ #for correct hardcoded sysconf directory
+ EPATCH_OPTS="-p1 -d ${S}" \
+ epatch ${FILESDIR}/${PN}-4.0-my-print-defaults.diff || die
+ # NPTL support
+ EPATCH_OPTS="-p1 -d ${S}" \
+ epatch ${FILESDIR}/${PN}-4.0.18-gentoo-nptl.diff || die
+ # Merged upstream as of 4.0.24
+ # bad tmpfiles in mysqlaccess, see bug 77805
+ #EPATCH_OPTS="-p1 -d ${S}" \
+ #epatch ${FILESDIR}/mysql-accesstmp.patch
+
+ EPATCH_OPTS="-p1 -d ${S}" \
+ epatch ${FILESDIR}/${PN}-4.0.24-manual.texi.patch || die
+
+ # attempt to get libmysqlclient_r linked against ssl if USE="ssl" enabled
+ # i would really prefer to fix this at the Makefile.am level, but can't
+ # get the software to autoreconf as distributed - too many missing files
+ EPATCH_OPTS="-p1 -d ${S}" \
+ epatch ${FILESDIR}/${PN}-4.0.21-thrssl.patch || die
+
+ # PIC fixes
+ # bug #42968
+ #EPATCH_OPTS="-p1 -d ${S}" \
+ #epatch ${FILESDIR}/${PN}-4.0.24-asm-pic-fixes.patch || die
+
+ if use tcpd; then
+ EPATCH_OPTS="-p1 -d ${S}" \
+ epatch ${FILESDIR}/${PN}-4.0.14-r1-tcpd-vars-fix.diff || die
+ fi
+
+ for d in ${S} ${S}/innobase; do
+ cd ${d}
+ # WARNING, plain autoconf breaks it!
+ #autoconf
+ # must use this instead
+ WANT_AUTOCONF=2.59 autoreconf --force
+ # Fix the evil "libtool.m4 and ltmain.sh have a version mismatch!"
+ libtoolize --copy --force
+ # Saving this for a rainy day, in case we need it again
+ #WANT_AUTOMAKE=1.7 automake
+ gnuconfig_update
+ done
+
+ # upstream bug http://bugs.mysql.com/bug.php?id=7971
+ # names conflict with stuff in 2.6.10 kernel headers
+ echo ${S}/client/mysqltest.c ${S}/extra/replace.c | xargs -n1 \
+ sed -i \
+ -e "s/\<set_bit\>/my__set_bit/g" \
+ -e "s/\<clear_bit\>/my__clear_bit/g" \
+ || die "Failed to fix bitops"
+}
+
+src_compile() {
+ local myconf
+
+ # readline pair reads backwards on purpose, DONT change it around, Ok?
+ # this is because it refers to the building of a bundled readline
+ # versus the system copy
+ use readline && myconf="${myconf} --without-readline"
+ use readline || myconf="${myconf} --with-readline"
+
+ use static \
+ && myconf="${myconf} --with-mysqld-ldflags=-all-static --disable-shared" \
+ || myconf="${myconf} --enable-shared --enable-static"
+
+ myconf="${myconf} `use_with tcpd libwrap`"
+
+ use ssl \
+ && myconf="${myconf} --with-vio --with-openssl" \
+ || myconf="${myconf} --without-openssl"
+
+ myconf="${myconf} `use_with debug`"
+
+ # benchmarking stuff needs perl
+ # and shouldn't be bothered with on minimal builds
+ if useq perl && ! useq minimal; then
+ myconf="${myconf} --with-bench"
+ else
+ myconf="${myconf} --without-bench"
+ fi
+
+ # these are things we exclude from a minimal build
+ # note that the server actually does get built and installed
+ # but we then delete it before packaging.
+ local minimal_exclude_list="server embedded-server extra-tools innodb raid"
+ if ! useq minimal; then
+ for i in ${minimal_exclude_list}; do
+ myconf="${myconf} --with-${i}"
+ done
+
+ # lots of chars
+ myconf="${myconf} --with-extra-charsets=all"
+
+ #The following fix is due to a bug with bdb on sparc's. See:
+ #http://www.geocrawler.com/mail/msg.php3?msg_id=4754814&list=8
+ # it boils down to non-64 bit safety.
+ if useq sparc || useq alpha || useq hppa || useq mips || useq amd64
+ then
+ myconf="${myconf} --without-berkeley-db"
+ else
+ use berkdb \
+ && myconf="${myconf} --with-berkeley-db=./bdb" \
+ || myconf="${myconf} --without-berkeley-db"
+ fi
+
+ else
+ for i in ${minimal_exclude_list}; do
+ myconf="${myconf} --without-${i}"
+ done
+ myconf="${myconf} --without-berkeley-db"
+ myconf="${myconf} --with-extra-charsets=none"
+ fi
+
+ # documentation
+ myconf="${myconf} `use_with doc docs`"
+
+ # glibc-2.3.2_pre fix; bug #16496
+ append-flags "-DHAVE_ERRNO_AS_DEFINE=1"
+
+ #bug fix for #15099, should make this api backward compatible
+ append-flags "-DUSE_OLD_FUNCTIONS"
+
+ #the compiler flags are as per their "official" spec ;)
+ #CFLAGS="${CFLAGS/-O?/} -O3" \
+ export CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-exceptions -fno-rtti"
+
+ econf \
+ -C \
+ --libexecdir=/usr/sbin \
+ --sysconfdir=/etc/mysql \
+ --localstatedir=/var/lib/mysql \
+ --with-low-memory \
+ --enable-assembler \
+ --with-charset=latin1 \
+ --enable-local-infile \
+ --with-mysqld-user=mysql \
+ --with-client-ldflags=-lstdc++ \
+ --enable-thread-safe-client \
+ --with-comment="Gentoo Linux ${PF}" \
+ --with-unix-socket-path=/var/run/mysqld/mysqld.sock \
+ ${myconf} || die "bad ./configure"
+
+ emake || die "compile problem"
+}
+
+src_install() {
+ make install DESTDIR="${D}" benchdir_root="/usr/share/mysql" || die
+
+ diropts "-m0750"
+
+ dodir "${DATADIR}" /var/run/mysqld /var/log/mysql
+ keepdir "${DATADIR}" /var/run/mysqld /var/log/mysql
+ chown -R mysql:mysql ${D}/var/lib/mysql \
+ ${D}/var/run/mysqld \
+ ${D}/var/log/mysql
+
+ diropts "-m0755"
+
+ # move client libs, install a couple of missing headers
+ local lib=$(get_libdir)
+ mv ${D}/usr/${lib}/mysql/libmysqlclient*.so* ${D}/usr/${lib}
+ dosym ../libmysqlclient.so /usr/${lib}/mysql/libmysqlclient.so
+ dosym ../libmysqlclient_r.so /usr/${lib}/mysql/libmysqlclient_r.so
+ insinto /usr/include/mysql ; doins include/{my_config.h,my_dir.h}
+
+ # convenience links
+ dosym /usr/bin/mysqlcheck /usr/bin/mysqlanalyze
+ dosym /usr/bin/mysqlcheck /usr/bin/mysqlrepair
+ dosym /usr/bin/mysqlcheck /usr/bin/mysqloptimize
+
+ # various junk
+ rm -f ${D}/usr/bin/make*distribution
+ rm -f ${D}/usr/share/mysql/make_*_distribution
+ rm -f ${D}/usr/share/mysql/mysql.server
+ rm -f ${D}/usr/share/mysql/binary-configure
+ rm -f ${D}/usr/share/mysql/mysql-log-rotate
+ rm -f ${D}/usr/share/mysql/{post,pre}install
+ rm -f ${D}/usr/share/mysql/mi_test*
+ rm -f ${D}/usr/share/mysql/*.spec # Redhat gunk
+ rm -f ${D}/usr/share/mysql/*.plist # Apple gunk
+ rm -f ${D}/usr/share/mysql/my-*.cnf # Put them elsewhere
+
+ # All of these (ab)use Perl.
+ if ! use perl; then
+ rm -f ${D}/usr/bin/{mysqlhotcopy,mysql_find_rows,mysql_convert_table_format,mysqld_multi,mysqlaccess,mysql_fix_extensions,mysqldumpslow,mysql_zap,mysql_explain_log,mysql_tableinfo,mysql_setpermission}
+ rm -f ${D}/usr/bin/mysqlhotcopy
+ rm -rf ${D}/usr/share/mysql/sql-bench
+ fi
+
+ # clean up stuff for a minimal build
+ # this is anything server-specific
+ if useq minimal; then
+ rm -rf ${D}/usr/share/mysql/{mysql-test,sql-bench}
+ rm -f ${D}/usr/bin/{mysql_install_db,mysqlmanager*,mysql_secure_installation,mysql_fix_privilege_tables,mysqlhotcopy,mysql_convert_table_format,mysqld_multi,mysql_fix_extensions,mysql_zap,mysql_explain_log,mysql_tableinfo,mysqld_safe,myisam*,isam*,mysql_install,mysql_waitpid,mysqlbinlog,mysqltest,pack_isam}
+ rm -f ${D}/usr/sbin/mysqld
+ rm -f ${D}/usr/lib/mysql/lib{heap,merge,nisam,mysys,mystrings,mysqld,myisammrg,vio,dbug,myisam}.a
+ fi
+
+ # config stuff
+ insinto /etc/mysql
+ doins scripts/mysqlaccess.conf
+ newins ${FILESDIR}/my.cnf-4.0.24-r1 my.cnf
+
+ # minimal builds don't have the server
+ if ! useq minimal; then
+ exeinto /etc/init.d
+ newexe "${FILESDIR}/mysql-4.0.24-r2.rc6" mysql
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/logrotate.mysql" mysql
+ fi
+
+ # docs
+ dodoc README COPYING ChangeLog EXCEPTIONS-CLIENT INSTALL-SOURCE
+ # minimal builds don't have the server
+ if useq doc && ! useq minimal; then
+ dohtml Docs/*.html
+ dodoc Docs/manual.{txt,ps}
+ docinto conf-samples
+ dodoc support-files/my-*.cnf
+ fi
+
+}
+
+src_test() {
+ cd ${S}
+ einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
+ make check || die "make check failed"
+ if ! useq minimal; then
+ local retstatus
+ einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+ addpredict /this-dir-does-not-exist/t9.MYI
+ make test
+ retstatus=$?
+
+ # to be sure ;)
+ pkill -9 -f ${S}/ndb/src/kernel/ndbd 2>/dev/null
+ pkill -9 -f ${S}/ndb/src/mgmsrv/ndb_mgmd 2>/dev/null
+ pkill -9 -f ${S}/ndb/src/mgmclient/ndb_mgm 2>/dev/null
+ pkill -9 -f ${S}/sql/mysqld 2>/dev/null
+ [[ $retstatus == 0 ]] || die "make test failed"
+
+ else
+ einfo "Skipping server tests due to minimal build."
+ fi
+}
+
+pkg_config() {
+ mysql_get_datadir
+
+ if built_with_use dev-db/mysql minimal; then
+ die "Minimal builds do NOT include the MySQL server"
+ fi
+
+ if [[ "$(pgrep mysqld)" != "" ]] ; then
+ die "Oops you already have a mysql daemon running!"
+ fi
+
+ local pwd1="a"
+ local pwd2="b"
+ local maxtry=5
+
+ if [[ -d "${DATADIR}/mysql" ]] ; then
+ ewarn "You have already a MySQL database in place."
+ ewarn "Please rename it or delete it if you wish to replace it."
+ die "MySQL database already exists!"
+ fi
+
+ einfo "Creating the mysql database and setting proper"
+ einfo "permissions on it..."
+
+ einfo "Insert a password for the mysql 'root' user"
+ ewarn "the password will be visible on the screen"
+
+ echo -n " >" && read -r pwd1
+ einfo "Repeat the password"
+ echo -n " >" && read -r pwd2
+
+ if (( "x$pwd1" != "x$pwd2" )) ; then
+ die "Passwords are not the same"
+ fi
+
+ ${ROOT}/usr/bin/mysql_install_db || die "MySQL databases not installed"
+
+ # MySQL 5.0 don't ned this
+ chown -R mysql:mysql ${DATADIR}
+ chmod 0750 ${ROOT}/${DATADIR}
+
+ # now we can set the password
+ local socket=${ROOT}/var/run/mysqld/mysqld.sock
+ local mysqld="${ROOT}/usr/sbin/mysqld \
+ --skip-grant-tables \
+ --basedir=${ROOT}/usr \
+ --datadir=${ROOT}/var/lib/mysql \
+ --skip-innodb \
+ --skip-bdb \
+ --max_allowed_packet=8M \
+ --net_buffer_length=16K \
+ --socket=${socket} \
+ --pid-file=${ROOT}/var/run/mysqld/mysqld.pid"
+
+ $mysqld &
+
+ while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]]
+ do
+ maxtry=$(($maxtry-1))
+ echo -n "."
+ sleep 1
+ done
+
+ # do this from memory we don't want clear text password in temp files
+ local sql="UPDATE mysql.user SET Password = PASSWORD('${pwd1}') WHERE USER='root'"
+ ${ROOT}/usr/bin/mysql \
+ --socket=${socket} \
+ -hlocalhost \
+ -e "${sql}"
+ local retstatus=$?
+
+ kill $( cat ${ROOT}/var/run/mysqld/mysqld.pid )
+
+ [[ $retstatus == 0 ]] || die "Failed to communicate with MySQL server"
+
+ einfo "done"
+}
+
+pkg_preinst() {
+ enewgroup mysql 60 || die "problem adding group mysql"
+ enewuser mysql 60 /bin/false /var/lib/mysql mysql \
+ || die "problem adding user mysql"
+}
+
+pkg_postinst() {
+ mysql_get_datadir
+
+ if ! useq minimal; then
+ #empty dirs...
+ [ -d "${ROOT}/${DATADIR}" ] || install -d -m0750 -o mysql -g mysql ${ROOT}/var/lib/mysql
+ [ -d "${ROOT}/var/run/mysqld" ] || install -d -m0755 -o mysql -g mysql ${ROOT}/var/run/mysqld
+ [ -d "${ROOT}/var/log/mysql" ] || install -d -m0755 -o mysql -g mysql ${ROOT}/var/log/mysql
+
+ # secure the logfiles... does this bother anybody?
+ touch ${ROOT}/var/log/mysql/mysql.{log,err}
+ chown mysql:mysql ${ROOT}/var/log/mysql/mysql*
+ chmod 0660 ${ROOT}/var/log/mysql/mysql*
+ # secure some directories
+ chmod 0750 ${ROOT}/var/log/mysql ${ROOT}/${DATADIR}
+
+ # your friendly public service announcement...
+ einfo
+ einfo "You might want to run:"
+ einfo "\"ebuild /var/db/pkg/dev-db/${PF}/${PF}.ebuild config\""
+ einfo "if this is a new install."
+ einfo
+ fi
+
+ mysql_upgrade_warning
+ einfo "InnoDB is not optional as of MySQL-4.0.24, at the request of upstream."
+}
diff --git a/dev-db/mysql/mysql-4.1.12.ebuild b/dev-db/mysql/mysql-4.1.12.ebuild
new file mode 100644
index 000000000000..cf134171f203
--- /dev/null
+++ b/dev-db/mysql/mysql-4.1.12.ebuild
@@ -0,0 +1,490 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/mysql-4.1.12.ebuild,v 1.1 2005/05/17 09:08:46 robbat2 Exp $
+
+inherit eutils gnuconfig flag-o-matic versionator
+
+SVER=${PV%.*}
+PLV=""
+NEWP="${PN}-${SVER}.$( get_version_component_range 3-3 )${PLV}"
+
+# shorten the path because the socket path length must be shorter than 107 chars
+# and we will run a mysql server during test phase
+S="${WORKDIR}/${PN}"
+
+DESCRIPTION="A fast, multi-threaded, multi-user SQL database server"
+HOMEPAGE="http://www.mysql.com/"
+SRC_URI="mirror://mysql/Downloads/MySQL-${SVER}/${NEWP}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE="berkdb debug doc minimal perl readline selinux ssl static tcpd cluster utf8 geometry extraengine"
+RESTRICT="primaryuri"
+
+DEPEND="readline? ( >=sys-libs/readline-4.1 )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6-r6 )
+ ssl? ( >=dev-libs/openssl-0.9.6d )
+ perl? ( dev-lang/perl )
+ >=sys-libs/zlib-1.1.3
+ >=sys-apps/texinfo-4.7-r1
+ sys-process/procps
+ >=sys-apps/sed-4"
+RDEPEND="${DEPEND} selinux? ( sec-policy/selinux-mysql )"
+# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
+PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
+
+mysql_upgrade_error() {
+ mysql_get_datadir
+ ewarn "Sorry plain upgrade from version of MySQL before 4.1.4 is NOT supported."
+ ewarn "Be sure to read \"Upgrading from version 4.0 to 4.1\" section"
+ ewarn "http://dev.mysql.com/doc/mysql/en/upgrading-from-4-0.html"
+ ewarn "then unmerge previous version of MySQL with"
+ ewarn "#emerge -C dev-db/mysql"
+ ewarn "move your data out of \"${DATADIR}\""
+ ewarn "#emerge =dev-db/${P}"
+ ewarn "reload data you dumped with \"mysqldump\" Because you have read "
+ ewarn "the documentation on how to upgrade"
+ ewarn ""
+ ewarn "You can also choose to preview some new MySQL 4.1 behaviour"
+ ewarn "adding a section \"[mysqld-4.0]\" followed by the word \"new\""
+ ewarn "into /etc/mysql/my.cnf (you need a recent MySQL version)"
+}
+
+mysql_upgrade_warning() {
+ ewarn "If you're upgrading from MySQL-3.x to 4.0, or 4.0.x to 4.1.x, you"
+ ewarn "must recompile the other packages on your system that link with"
+ ewarn "libmysqlclient after the upgrade completes. To obtain such a list"
+ ewarn "of packages for your system, you may use 'revdep-rebuild' from"
+ ewarn "app-portage/gentoolkit."
+}
+
+mysql_get_datadir() {
+ DATADIR=""
+ if [ -f '/etc/mysql/my.cnf' ] ; then
+ #DATADIR=`grep ^datadir /etc/mysql/my.cnf | sed -e 's/.*= //'`
+ #DATADIR=`/usr/sbin/mysqld --help |grep '^datadir' | awk '{print $2}'`
+ #DATADIR=`my_print_defaults mysqld | grep -- '^--datadir' | tail -n1 | sed -e 's|^--datadir=||'`
+ DATADIR=`my_print_defaults mysqld 2>/dev/null | sed -ne '/datadir/s|^--datadir=||p' | tail -n1`
+ fi
+ if [ -z "${DATADIR}" ]; then
+ DATADIR="/var/lib/mysql/"
+ einfo "Using default DATADIR"
+ fi
+ einfo "MySQL DATADIR is ${DATADIR}"
+ export DATADIR
+}
+
+pkg_setup() {
+ if ! useq minimal ; then
+ if has_version "<=dev-db/mysql-4.1.4" \
+ && ! built_with_use dev-db/mysql minimal ; then
+ mysql_upgrade_error
+ #die
+ fi
+ fi
+ mysql_upgrade_warning
+ mysql_get_datadir
+}
+
+src_unpack() {
+ if use static && use ssl; then
+ local msg="MySQL does not support building statically with SSL support"
+ eerror "${msg}"
+ die "${msg}"
+ fi
+
+ if useq cluster || useq geometry || useq extraengine && useq minimal; then
+ die "USEs cluster, geometry, extraengine conflicts with \"minimal\""
+ fi
+
+ unpack ${A} || die
+
+ mv "${WORKDIR}/${NEWP}" "${S}"
+ cd "${S}"
+
+ # for correct hardcoded sysconf directory
+ epatch "${FILESDIR}/${PN}-4.0-my-print-defaults.diff"
+
+ # attempt to get libmysqlclient_r linked against ssl if USE="ssl" enabled
+ # i would really prefer to fix this at the Makefile.am level, but can't
+ # get the software to autoreconf as distributed - too many missing files
+ epatch "${FILESDIR}/${PN}-4.1.9-thrssl.patch"
+
+ # PIC fixes
+ # bug #42968
+ #EPATCH_OPTS="-p1 -d ${S}" \
+ #epatch ${FILESDIR}/${PN}-4.1.12-asm-pic-fixes.patch || die
+
+ if use tcpd; then
+ epatch "${FILESDIR}/${PN}-4.0.14-r1-tcpd-vars-fix.diff"
+ fi
+
+ # avoid error running src_test and not enabling geometry USE flag
+ useq geometry || epatch "${FILESDIR}/${PN}-test-myisam-geometry.patch"
+
+ for d in ${S} ${S}/innobase; do
+ cd ${d}
+ # WARNING, plain autoconf breaks it!
+ #autoconf
+ # must use this instead
+ WANT_AUTOCONF="2.59" autoreconf --force
+ # Fix the evil "libtool.m4 and ltmain.sh have a version mismatch!"
+ libtoolize --copy --force
+ # Saving this for a rainy day, in case we need it again
+ #WANT_AUTOMAKE=1.7 automake
+ gnuconfig_update
+ done
+
+ ## Should be fixed in 4.1.12
+ # upstream bug http://bugs.mysql.com/bug.php?id=7971
+ # names conflict with stuff in 2.6.10 kernel headers
+ #sed -i.orig \
+ # -e "s/\<set_bit\>/my__set_bit/g" \
+ # -e "s/\<clear_bit\>/my__clear_bit/g" \
+ # ${S}/client/mysqltest.c || die "Failed to fix bitops"
+
+}
+
+src_compile() {
+ local myconf
+
+ # readline pair reads backwards on purpose, DONT change it around, Ok?
+ # this is because it refers to the building of a bundled readline
+ # versus the system copy
+ use readline && myconf="${myconf} --without-readline"
+ use readline || myconf="${myconf} --with-readline"
+
+ use static \
+ && myconf="${myconf} --with-mysqld-ldflags=-all-static --disable-shared" \
+ || myconf="${myconf} --enable-shared --enable-static"
+
+ myconf="${myconf} `use_with tcpd libwrap`"
+
+ use ssl \
+ && myconf="${myconf} --with-vio --with-openssl" \
+ || myconf="${myconf} --without-openssl"
+
+ if use debug; then
+ myconf="${myconf} --with-debug=full"
+ else
+ myconf="${myconf} --without-debug"
+ use cluster && myconf="${myconf} --without-ndb-debug"
+ fi
+
+ # benchmarking stuff needs perl
+ # and shouldn't be bothered with on minimal builds
+ if useq perl && ! useq minimal; then
+ myconf="${myconf} --with-bench"
+ else
+ myconf="${myconf} --without-bench"
+ fi
+
+ # these are things we exclude from a minimal build
+ # note that the server actually does get built and installed
+ # but we then delete it before packaging.
+ local minimal_exclude_list="server embedded-server extra-tools innodb raid"
+ if ! useq minimal; then
+ for i in ${minimal_exclude_list}; do
+ myconf="${myconf} --with-${i}"
+ done
+
+ if useq utf8; then
+ myconf="${myconf} --with-charset=utf8 --with-collation=utf8_general_ci"
+ else
+ myconf="${myconf} --with-charset=latin1 --with-collation=latin1_swedish_ci"
+ fi
+
+ # lots of chars
+ myconf="${myconf} --with-extra-charsets=all"
+
+ #The following fix is due to a bug with bdb on sparc's. See:
+ #http://www.geocrawler.com/mail/msg.php3?msg_id=4754814&list=8
+ # it comes down to non-64-bit safety problems
+ if useq sparc || useq alpha || useq hppa || useq mips || useq amd64
+ then
+ myconf="${myconf} --without-berkeley-db"
+ else
+ use berkdb \
+ && myconf="${myconf} --with-berkeley-db=./bdb" \
+ || myconf="${myconf} --without-berkeley-db"
+ fi
+ myconf="${myconf} $(use_with geometry) $(use_with cluster ndbcluster)"
+ myconf="${myconf} --with-big-tables"
+ else
+ for i in ${minimal_exclude_list}; do
+ myconf="${myconf} --without-${i}"
+ done
+ myconf="${myconf} --without-berkeley-db"
+ myconf="${myconf} --with-extra-charsets=none"
+ fi
+
+ # documentation
+ myconf="${myconf} `use_with doc docs`"
+
+ if useq extraengine; then
+ # http://dev.mysql.com/doc/mysql/en/archive-storage-engine.html
+ myconf="${myconf} --with-archive-storage-engine"
+ # http://dev.mysql.com/doc/mysql/en/csv-storage-engine.html
+ myconf="${myconf} --with-csv-storage-engine"
+ # http://dev.mysql.com/doc/mysql/en/federated-description.html
+ # http://dev.mysql.com/doc/mysql/en/federated-limitations.html
+ #if version_is_at_least "5.1.3" ; then
+ # einfo "before to use federated engine be sure to read"
+ # einfo "http://dev.mysql.com/doc/mysql/en/federated-limitations.html"
+ # myconf="${myconf} --with-federated-storage-engine"
+ #fi
+ myconf="${myconf} --with-blackhole-storage-engine"
+ fi
+
+ #glibc-2.3.2_pre fix; bug #16496
+ append-flags "-DHAVE_ERRNO_AS_DEFINE=1"
+
+ #the compiler flags are as per their "official" spec ;)
+ #CFLAGS="${CFLAGS/-O?/} -O3" \
+ export CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-exceptions -fno-rtti"
+
+ econf \
+ --libexecdir=/usr/sbin \
+ --sysconfdir=/etc/mysql \
+ --localstatedir=/var/lib/mysql \
+ --with-low-memory \
+ --enable-assembler \
+ --enable-local-infile \
+ --with-mysqld-user=mysql \
+ --with-client-ldflags=-lstdc++ \
+ --enable-thread-safe-client \
+ --with-comment="Gentoo Linux ${PF}" \
+ --with-unix-socket-path=/var/run/mysqld/mysqld.sock \
+ --with-zlib-dir=/usr \
+ --with-lib-ccflags="-fPIC" \
+ ${myconf} || die "bad ./configure"
+
+ emake || die "compile problem"
+}
+
+src_install() {
+ make install DESTDIR="${D}" benchdir_root="/usr/share/mysql" || die
+
+ diropts "-m0750"
+
+ dodir "${DATADIR}" /var/run/mysqld /var/log/mysql
+ keepdir "${DATADIR}" /var/run/mysqld /var/log/mysql
+ chown -R mysql:mysql ${D}/var/lib/mysql \
+ ${D}/var/run/mysqld \
+ ${D}/var/log/mysql
+
+ diropts "-m0755"
+
+ # move client libs, install a couple of missing headers
+ local lib=$(get_libdir)
+ mv ${D}/usr/${lib}/mysql/libmysqlclient*.so* ${D}/usr/${lib}
+ dosym ../libmysqlclient.so /usr/${lib}/mysql/libmysqlclient.so
+ dosym ../libmysqlclient_r.so /usr/${lib}/mysql/libmysqlclient_r.so
+ insinto /usr/include/mysql ; doins include/{my_config.h,my_dir.h}
+
+ # convenience links
+ dosym /usr/bin/mysqlcheck /usr/bin/mysqlanalyze
+ dosym /usr/bin/mysqlcheck /usr/bin/mysqlrepair
+ dosym /usr/bin/mysqlcheck /usr/bin/mysqloptimize
+
+ # various junk
+ rm -f ${D}/usr/bin/make*distribution
+ rm -f ${D}/usr/share/mysql/make_*_distribution
+ rm -f ${D}/usr/share/mysql/mysql.server
+ rm -f ${D}/usr/share/mysql/binary-configure
+ rm -f ${D}/usr/share/mysql/mysql-log-rotate
+ rm -f ${D}/usr/share/mysql/{post,pre}install
+ rm -f ${D}/usr/share/mysql/mi_test*
+ rm -f ${D}/usr/share/mysql/*.spec # Redhat gunk
+ rm -f ${D}/usr/share/mysql/*.plist # Apple gunk
+ rm -f ${D}/usr/share/mysql/my-*.cnf # Put them elsewhere
+
+ # All of these (ab)use Perl.
+ if ! use perl; then
+ rm -f ${D}/usr/bin/{mysqlhotcopy,mysql_find_rows,mysql_convert_table_format,mysqld_multi,mysqlaccess,mysql_fix_extensions,mysqldumpslow,mysql_zap,mysql_explain_log,mysql_tableinfo,mysql_setpermission}
+ rm -f ${D}/usr/bin/mysqlhotcopy
+ rm -rf ${D}/usr/share/mysql/sql-bench
+ fi
+
+ # clean up stuff for a minimal build
+ # this is anything server-specific
+ if useq minimal; then
+ rm -rf ${D}/usr/share/mysql/{mysql-test,sql-bench}
+ rm -f ${D}/usr/bin/{mysql_install_db,mysqlmanager*,mysql_secure_installation,mysql_fix_privilege_tables,mysqlhotcopy,mysql_convert_table_format,mysqld_multi,mysql_fix_extensions,mysql_zap,mysql_explain_log,mysql_tableinfo,mysqld_safe,myisam*,isam*,mysql_install,mysql_waitpid,mysqlbinlog,mysqltest,pack_isam}
+ rm -f ${D}/usr/sbin/mysqld
+ rm -f ${D}/usr/lib/mysql/lib{heap,merge,nisam,mysys,mystrings,mysqld,myisammrg,vio,dbug,myisam}.a
+ fi
+
+ # config stuff
+ insinto /etc/mysql
+ doins scripts/mysqlaccess.conf
+
+ newins "${FILESDIR}/my.cnf-4.1" my.cnf
+
+ if ! use utf8; then
+ sed -i -e "s/utf8/latin1/" ${D}/etc/mysql/my.cnf
+ fi
+
+ # minimal builds don't have the server
+ if ! useq minimal; then
+ exeinto /etc/init.d
+ newexe "${FILESDIR}/mysql-4.0.24-r2.rc6" mysql
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/logrotate.mysql" mysql
+ fi
+
+ # docs
+ dodoc README COPYING ChangeLog EXCEPTIONS-CLIENT INSTALL-SOURCE
+ # minimal builds don't have the server
+ if useq doc && ! useq minimal; then
+ dohtml Docs/*.html
+ dodoc Docs/manual.{txt,ps}
+ docinto conf-samples
+ dodoc support-files/my-*.cnf
+ fi
+}
+
+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
+ make test
+ retstatus=$?
+
+ # to be sure ;)
+ pkill -9 -f ${S}/ndb/src/kernel/ndbd 2>/dev/null
+ pkill -9 -f ${S}/ndb/src/mgmsrv/ndb_mgmd 2>/dev/null
+ pkill -9 -f ${S}/ndb/src/mgmclient/ndb_mgm 2>/dev/null
+ pkill -9 -f ${S}/sql/mysqld 2>/dev/null
+ [[ $retstatus == 0 ]] || die "make test failed"
+ else
+ einfo "Skipping server tests due to minimal build."
+ fi
+}
+
+pkg_config() {
+ mysql_get_datadir
+
+ if built_with_use dev-db/mysql minimal; then
+ die "Minimal builds do NOT include the MySQL server"
+ fi
+
+ if [[ "$(pgrep mysqld)" != "" ]] ; then
+ die "Oops you already have a mysql daemon running!"
+ fi
+
+ local pwd1="a"
+ local pwd2="b"
+ local maxtry=5
+
+ if [[ -d "${DATADIR}/mysql" ]] ; then
+ ewarn "You have already a MySQL database in place."
+ ewarn "Please rename it or delete it if you wish to replace it."
+ die "MySQL database already exists!"
+ fi
+
+ einfo "Creating the mysql database and setting proper"
+ einfo "permissions on it..."
+
+ einfo "Insert a password for the mysql 'root' user"
+ ewarn "the password will be visible on the screen"
+
+ echo -n " >" && read -r pwd1
+ einfo "Check the password"
+ echo -n " >" && read -r pwd2
+
+ if (( pwd1 != pwd2 )) ; then
+ die "Passwords are not the same"
+ fi
+
+ ${ROOT}/usr/bin/mysql_install_db || die "MySQL databases not installed"
+
+ # MySQL 5.0 don't ned this
+ chown -R mysql:mysql ${DATADIR}
+ chmod 0750 ${ROOT}/${DATADIR}
+
+ local sqltmp="$(emktemp)"
+ # Filling timezones, see
+ # http://dev.mysql.com/doc/mysql/en/time-zone-support.html
+ ${ROOT}/usr/bin/mysql_tzinfo_to_sql ${ROOT}/usr/share/zoneinfo > "${sqltmp}"
+
+ local socket=${ROOT}/var/run/mysqld/mysqld.sock
+ local mysqld="${ROOT}/usr/sbin/mysqld \
+ --skip-grant-tables \
+ --basedir=${ROOT}/usr \
+ --datadir=${ROOT}/var/lib/mysql \
+ --skip-innodb \
+ --skip-bdb \
+ --skip-ndbcluster \
+ --max_allowed_packet=8M \
+ --net_buffer_length=16K \
+ --socket=${socket} \
+ --pid-file=${ROOT}/var/run/mysqld/mysqld.pid"
+
+ $mysqld &
+ while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]]
+ do
+ maxtry=$(($maxtry-1))
+ echo -n "."
+ sleep 1
+ done
+
+ # do this from memory we don't want clear text password in temp files
+ local sql="UPDATE mysql.user SET Password = PASSWORD('${pwd1}') WHERE USER='root'"
+ ${ROOT}/usr/bin/mysql \
+ --socket=${ROOT}/var/run/mysqld/mysqld.sock \
+ -hlocalhost \
+ -e "${sql}"
+
+ einfo "Loading \"zoneinfo\" this step may require few seconds"
+
+ ${ROOT}/usr/bin/mysql \
+ --socket=${socket} \
+ -hlocalhost \
+ -uroot \
+ -p"${pwd1}" \
+ mysql < "${sqltmp}"
+
+ kill $( cat ${ROOT}/var/run/mysqld/mysqld.pid )
+ rm "${sqltmp}"
+ einfo "done"
+}
+
+pkg_preinst() {
+ enewgroup mysql 60 || die "problem adding group mysql"
+ enewuser mysql 60 /bin/false /var/lib/mysql mysql \
+ || die "problem adding user mysql"
+}
+
+pkg_postinst() {
+ mysql_get_datadir
+
+ if ! useq minimal; then
+ #empty dirs...
+ [ -d "${ROOT}/${DATADIR}" ] || install -d -m0750 -o mysql -g mysql ${ROOT}/var/lib/mysql
+ [ -d "${ROOT}/var/run/mysqld" ] || install -d -m0755 -o mysql -g mysql ${ROOT}/var/run/mysqld
+ [ -d "${ROOT}/var/log/mysql" ] || install -d -m0755 -o mysql -g mysql ${ROOT}/var/log/mysql
+
+ # secure the logfiles... does this bother anybody?
+ touch ${ROOT}/var/log/mysql/mysql.{log,err}
+ chown mysql:mysql ${ROOT}/var/log/mysql/mysql*
+ chmod 0660 ${ROOT}/var/log/mysql/mysql*
+ # secure some directories
+ chmod 0750 ${ROOT}/var/log/mysql ${ROOT}/${DATADIR}
+
+ # your friendly public service announcement...
+ einfo
+ einfo "You might want to run:"
+ einfo "\"ebuild /var/db/pkg/dev-db/${PF}/${PF}.ebuild config\""
+ einfo "if this is a new install."
+ einfo
+ fi
+
+ mysql_upgrade_warning
+ einfo "InnoDB is not optional as of MySQL-4.0.24, at the request of upstream."
+}