# HG changeset patch
# User Christophe Lincoln <pankso@slitaz.org>
# Date 1244743373 -7200
# Node ID 81ee74ea8ff4eb2e8932be61f8b56180ed336633
# Parent  0b10fe4a9b25c92b5a3fc24f51afac0cadcc9af1
Up: mysql (5.1.35) - Moved config+libexec and add plugin

diff -r 0b10fe4a9b25 -r 81ee74ea8ff4 libmysqlclient/receipt
--- a/libmysqlclient/receipt	Thu Jun 11 20:00:25 2009 +0200
+++ b/libmysqlclient/receipt	Thu Jun 11 20:02:53 2009 +0200
@@ -1,7 +1,7 @@
 # SliTaz package receipt.
 
 PACKAGE="libmysqlclient"
-VERSION="5.0.77"
+VERSION="5.1.35"
 CATEGORY="misc"
 SHORT_DESC="SQL database system client libraries."
 MAINTAINER="pascal.bellard@slitaz.org"
@@ -13,7 +13,13 @@
 # Rules to gen a SliTaz package suitable for Tazpkg.
 genpkg_rules()
 {
-	mkdir -p $fs/usr/lib/
-	cp -a $_pkg/usr/lib/mysql/libmysqlclient*so* $fs/usr/lib/
-	strip -s $fs/usr/lib/mysql/*
+	mkdir -p $fs/usr/lib/mysql
+	cp -a $_pkg/usr/lib/mysql/libmysqlclient*so* $fs/usr/lib/mysql
+	cd $fs/usr/lib
+	ln -s mysql/libmysqlclient.so .
+    ln -s mysql/libmysqlclient.so.16 .
+	ln -s mysql/libmysqlclient.so.16.0.0 .
+	ln -s mysql/libmysqlclient_r.so .
+    ln -s mysql/libmysqlclient_r.so.16 .
+	ln -s mysql/libmysqlclient_r.so.16.0.0 .
 }
diff -r 0b10fe4a9b25 -r 81ee74ea8ff4 mysql-client/receipt
--- a/mysql-client/receipt	Thu Jun 11 20:00:25 2009 +0200
+++ b/mysql-client/receipt	Thu Jun 11 20:02:53 2009 +0200
@@ -1,7 +1,7 @@
 # SliTaz package receipt.
 
 PACKAGE="mysql-client"
-VERSION="5.0.77"
+VERSION="5.1.35"
 CATEGORY="misc"
 SHORT_DESC="SQL database system client files."
 MAINTAINER="pascal.bellard@slitaz.org"
@@ -17,5 +17,5 @@
 		dir=$(dirname $file)
 		[ -d $fs$dir ] || mkdir -p $fs$dir
 		cp -a $_pkg$file $fs$file
-	done < $src/$PACKAGE.files-list
+	done < $WOK/$WANTED/stuff/$PACKAGE.files-list
 }
diff -r 0b10fe4a9b25 -r 81ee74ea8ff4 mysql-dev/receipt
--- a/mysql-dev/receipt	Thu Jun 11 20:00:25 2009 +0200
+++ b/mysql-dev/receipt	Thu Jun 11 20:02:53 2009 +0200
@@ -1,7 +1,7 @@
 # SliTaz package receipt.
 
 PACKAGE="mysql-dev"
-VERSION="5.0.77"
+VERSION="5.1.35"
 CATEGORY="development"
 SHORT_DESC="SQL database system devel files."
 MAINTAINER="pascal.bellard@slitaz.org"
@@ -12,12 +12,13 @@
 # Rules to gen a SliTaz package suitable for Tazpkg.
 genpkg_rules()
 {
-	mkdir -p $fs/usr/lib
+	mkdir -p $fs/usr/lib/mysql/plugin
 	cp -a $_pkg/usr/include $fs/usr
-	cp -a $_pkg/usr/lib/mysql/*a $fs/usr/lib
+	cp -a $_pkg/usr/lib/mysql/*.*a $fs/usr/lib/mysql
+	cp -a $_pkg/usr/lib/mysql/plugin/*.*a $fs/usr/lib/mysql/plugin
 	while read file; do
 		dir=$(dirname $file)
 		[ -d $fs$dir ] || mkdir -p $fs$dir
 		cp -a $_pkg$file $fs$file
-	done < $src/$PACKAGE.files-list
+	done < $WOK/$WANTED/stuff/$PACKAGE.files-list
 }
diff -r 0b10fe4a9b25 -r 81ee74ea8ff4 mysql-test/receipt
--- a/mysql-test/receipt	Thu Jun 11 20:00:25 2009 +0200
+++ b/mysql-test/receipt	Thu Jun 11 20:02:53 2009 +0200
@@ -1,7 +1,7 @@
 # SliTaz package receipt.
 
 PACKAGE="mysql-test"
-VERSION="5.0.77"
+VERSION="5.1.35"
 CATEGORY="misc"
 SHORT_DESC="SQL database system tests and benchs."
 MAINTAINER="pascal.bellard@slitaz.org"
@@ -13,13 +13,13 @@
 # Rules to gen a SliTaz package suitable for Tazpkg.
 genpkg_rules()
 {
-	mkdir -p $fs/usr/
-	cp -a $_pkg/usr/mysql-test $fs/usr/
-	cp -a $_pkg/usr/sql-bench $fs/usr/
+	mkdir -p $fs/usr
+	cp -a $_pkg/usr/mysql-test $fs/usr
+	cp -a $_pkg/usr/sql-bench $fs/usr
 	find $fs/usr/mysql-test $fs/usr/sql-bench -type d -exec chmod 2777 {} \;
 	while read file; do
 		dir=$(dirname $file)
 		[ -d $fs$dir ] || mkdir -p $fs$dir
 		cp -a $_pkg$file $fs$file
-	done < $src/$PACKAGE.files-list
+	done < $WOK/$WANTED/stuff/$PACKAGE.files-list
 }
diff -r 0b10fe4a9b25 -r 81ee74ea8ff4 mysql/receipt
--- a/mysql/receipt	Thu Jun 11 20:00:25 2009 +0200
+++ b/mysql/receipt	Thu Jun 11 20:02:53 2009 +0200
@@ -1,15 +1,15 @@
 # SliTaz package receipt.
 
 PACKAGE="mysql"
-VERSION="5.0.77"
+VERSION="5.1.35"
 CATEGORY="misc"
 SHORT_DESC="SQL database system."
 MAINTAINER="pascal.bellard@slitaz.org"
 TARBALL="$PACKAGE-$VERSION.tar.gz"
 WEB_SITE="http://www.mysql.com/"
-WGET_URL="http://mirrors.sunsite.dk/mysql/Downloads/MySQL-5.0/$TARBALL"
+WGET_URL="http://mirrors.sunsite.dk/mysql/Downloads/MySQL-5.1/$TARBALL"
 DEPENDS="busybox libmysqlclient mysql-client zlib slitaz-base-files"
-CONFIG_FILES="/etc/my.cnf"
+CONFIG_FILES="/etc/mysql/my.cnf"
 DATABASE_FILES="/var/lib/mysql"
 
 # Rules to configure and make the package.
@@ -17,9 +17,9 @@
 {
 
 	cd $src
-	cp ../stuff/*.files-list .
 	./configure --prefix=/usr --infodir=/usr/share/info \
 		--datadir=/usr/share --localstatedir=/var/lib/mysql \
+		--sysconfdir=/etc/mysql --libexecdir=/usr/sbin \
 		--with-unix-socket-path=/var/run/mysqld/mysqld.sock \
 		--with-mysqld-user=mysql \
 		--enable-thread-safe-client \
@@ -31,21 +31,36 @@
 # Rules to gen a SliTaz package suitable for Tazpkg.
 genpkg_rules()
 {
-	mkdir -p $fs/usr/share $fs/etc/mysql.d $fs/var/lib/mysql $fs/var/run/mysqld
+	mkdir -p \
+		$fs/usr/share \
+		$fs/usr/lib/mysql/plugin \
+		$fs/etc/mysql \
+		$fs/etc/mysql.d \
+		$fs/var/lib/mysql \
+		$fs/var/run/mysqld
+	
 	cp -a $_pkg/usr/bin $fs/usr
-	cp -a $_pkg/usr/libexec $fs/usr
+	cp -a $_pkg/usr/sbin $fs/usr
+	cp -a $_pkg/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin
 	cp -a $_pkg/usr/share/mysql $fs/usr/share
-	cp -a $src/support-files/my-medium.cnf $fs/etc/my.cnf
-	grep -q "bind-address" $fs/etc/my.cnf || sed -i \
-		's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' $fs/etc/my.cnf
-	chmod 600 $fs/etc/my.cnf
+	
+	# Configuration file
 	cp -a stuff/etc/init.d $fs/etc
-	cat $src/*.files-list | while read file; do
+	cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf
+	cp -a $src/support-files/my-small.cnf $fs/etc/mysql
+	grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \
+		's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \
+		$fs/etc/mysql/my.cnf
+	
+	# Permissions
+	chmod 600 $fs/etc/mysql/my.cnf
+	
+	cat $WOK/$PACKAGE/stuff/*.files-list | while read file; do
 		[ -f $fs$file ] && rm -f $fs$file
 	done
-	strip -s $fs/usr/libexec/*
+	
 	# Package all mysql pkgs
-	for i in $(cd $WOK; ls -d *bmysql*)
+	for i in $(cd $WOK; ls -d *bmysql* mysql-*)
 	do
 		grep -q 'WANTED="mysql"' $WOK/$i/receipt && tazwok genpkg $i
 	done
@@ -56,14 +71,9 @@
 {
 	# adduser mysql if needed
 	if ! grep -q mysql $1/etc/passwd; then
-		echo -n "Adding user mysql..."
-		chroot $1/ /bin/adduser mysql -s /bin/false -H -D -S
-		status
-	fi
-	# addgroup mysql if needed
-	if ! grep -q mysql $1/etc/group; then
-		echo -n "Adding group mysql..."
-		chroot $1/ sh -c '/bin/addgroup mysql && /bin/addgroup mysql mysql'
+		echo -n "Adding user MySQL..."
+		chroot $1/ /bin/adduser -s /bin/false -h /dev/null \
+			-g "MySQL Daemon user" -H -D -S mysql
 		status
 	fi
 	chroot $1/ /bin/chown mysql.mysql $(cat $1/$INSTALLED/$PACKAGE/files.list)
@@ -78,8 +88,15 @@
 EOF
 }
 
+pre_install()
+{
+	# Cleanup old files
+	rm -f $1/usr/libexec/mysql*
+	# Mv config
+	[ -f $1/etc/my.cnf ] && mv -f $1/etc/my.cnf $1/etc/mysql/my.cnf 
+}
+
 post_remove()
 {
 	deluser mysql
-	delgroup mysql
 }
diff -r 0b10fe4a9b25 -r 81ee74ea8ff4 mysql/stuff/mysql-client.files-list
--- a/mysql/stuff/mysql-client.files-list	Thu Jun 11 20:00:25 2009 +0200
+++ b/mysql/stuff/mysql-client.files-list	Thu Jun 11 20:02:53 2009 +0200
@@ -1,7 +1,6 @@
 /usr/bin/msql2mysql
 /usr/bin/mysql
 /usr/bin/mysql_find_rows
-/usr/bin/mysql_tableinfo
 /usr/bin/mysql_waitpid
 /usr/bin/mysqlaccess
 /usr/bin/mysqladmin
diff -r 0b10fe4a9b25 -r 81ee74ea8ff4 mysql/stuff/mysql-dev.files-list
--- a/mysql/stuff/mysql-dev.files-list	Thu Jun 11 20:00:25 2009 +0200
+++ b/mysql/stuff/mysql-dev.files-list	Thu Jun 11 20:02:53 2009 +0200
@@ -1,2 +1,1 @@
-/usr/bin/comp_err
 /usr/bin/mysql_config
diff -r 0b10fe4a9b25 -r 81ee74ea8ff4 mysql/stuff/mysql-test.files-list
--- a/mysql/stuff/mysql-test.files-list	Thu Jun 11 20:00:25 2009 +0200
+++ b/mysql/stuff/mysql-test.files-list	Thu Jun 11 20:02:53 2009 +0200
@@ -1,3 +1,2 @@
 /usr/bin/mysql_client_test
-/usr/bin/mysqltestmanager-pwgen
-/usr/bin/mysqltestmanagerc
+/usr/bin/mysqltest