wok diff mysql/receipt @ rev 3950

Update: Rocrail (TOOLPREFIX)
author Matthew Sheets <rcx@zoominternet.net>
date Mon Aug 24 13:40:38 2009 +0000 (2009-08-24)
parents bf73355db5de
children 41efe35c6d3b
line diff
     1.1 --- a/mysql/receipt	Mon Jun 08 10:27:16 2009 +0200
     1.2 +++ b/mysql/receipt	Mon Aug 24 13:40:38 2009 +0000
     1.3 @@ -1,15 +1,15 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="mysql"
     1.7 -VERSION="5.0.77"
     1.8 +VERSION="5.1.35"
     1.9  CATEGORY="misc"
    1.10  SHORT_DESC="SQL database system."
    1.11  MAINTAINER="pascal.bellard@slitaz.org"
    1.12  TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.13  WEB_SITE="http://www.mysql.com/"
    1.14 -WGET_URL="http://mirrors.sunsite.dk/mysql/Downloads/MySQL-5.0/$TARBALL"
    1.15 +WGET_URL="http://mirrors.sunsite.dk/mysql/Downloads/MySQL-5.1/$TARBALL"
    1.16  DEPENDS="busybox libmysqlclient mysql-client zlib slitaz-base-files"
    1.17 -CONFIG_FILES="/etc/my.cnf"
    1.18 +CONFIG_FILES="/etc/mysql/my.cnf"
    1.19  DATABASE_FILES="/var/lib/mysql"
    1.20  
    1.21  # Rules to configure and make the package.
    1.22 @@ -17,9 +17,9 @@
    1.23  {
    1.24  
    1.25  	cd $src
    1.26 -	cp ../stuff/*.files-list .
    1.27  	./configure --prefix=/usr --infodir=/usr/share/info \
    1.28  		--datadir=/usr/share --localstatedir=/var/lib/mysql \
    1.29 +		--sysconfdir=/etc/mysql --libexecdir=/usr/sbin \
    1.30  		--with-unix-socket-path=/var/run/mysqld/mysqld.sock \
    1.31  		--with-mysqld-user=mysql \
    1.32  		--enable-thread-safe-client \
    1.33 @@ -31,21 +31,36 @@
    1.34  # Rules to gen a SliTaz package suitable for Tazpkg.
    1.35  genpkg_rules()
    1.36  {
    1.37 -	mkdir -p $fs/usr/share $fs/etc/mysql.d $fs/var/lib/mysql $fs/var/run/mysqld
    1.38 +	mkdir -p \
    1.39 +		$fs/usr/share \
    1.40 +		$fs/usr/lib/mysql/plugin \
    1.41 +		$fs/etc/mysql \
    1.42 +		$fs/etc/mysql.d \
    1.43 +		$fs/var/lib/mysql \
    1.44 +		$fs/var/run/mysqld
    1.45 +	
    1.46  	cp -a $_pkg/usr/bin $fs/usr
    1.47 -	cp -a $_pkg/usr/libexec $fs/usr
    1.48 +	cp -a $_pkg/usr/sbin $fs/usr
    1.49 +	cp -a $_pkg/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin
    1.50  	cp -a $_pkg/usr/share/mysql $fs/usr/share
    1.51 -	cp -a $src/support-files/my-medium.cnf $fs/etc/my.cnf
    1.52 -	grep -q "bind-address" $fs/etc/my.cnf || sed -i \
    1.53 -		's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' $fs/etc/my.cnf
    1.54 -	chmod 600 $fs/etc/my.cnf
    1.55 +	
    1.56 +	# Configuration file
    1.57  	cp -a stuff/etc/init.d $fs/etc
    1.58 -	cat $src/*.files-list | while read file; do
    1.59 +	cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf
    1.60 +	cp -a $src/support-files/my-small.cnf $fs/etc/mysql
    1.61 +	grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \
    1.62 +		's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \
    1.63 +		$fs/etc/mysql/my.cnf
    1.64 +	
    1.65 +	# Permissions
    1.66 +	chmod 600 $fs/etc/mysql/my.cnf
    1.67 +	
    1.68 +	cat $WOK/$PACKAGE/stuff/*.files-list | while read file; do
    1.69  		[ -f $fs$file ] && rm -f $fs$file
    1.70  	done
    1.71 -	strip -s $fs/usr/libexec/*
    1.72 +	
    1.73  	# Package all mysql pkgs
    1.74 -	for i in $(cd $WOK; ls -d *bmysql*)
    1.75 +	for i in $(cd $WOK; ls -d *bmysql* mysql-*)
    1.76  	do
    1.77  		grep -q 'WANTED="mysql"' $WOK/$i/receipt && tazwok genpkg $i
    1.78  	done
    1.79 @@ -56,14 +71,9 @@
    1.80  {
    1.81  	# adduser mysql if needed
    1.82  	if ! grep -q mysql $1/etc/passwd; then
    1.83 -		echo -n "Adding user mysql..."
    1.84 -		chroot $1/ /bin/adduser mysql -s /bin/false -H -D -S
    1.85 -		status
    1.86 -	fi
    1.87 -	# addgroup mysql if needed
    1.88 -	if ! grep -q mysql $1/etc/group; then
    1.89 -		echo -n "Adding group mysql..."
    1.90 -		chroot $1/ sh -c '/bin/addgroup mysql && /bin/addgroup mysql mysql'
    1.91 +		echo -n "Adding user MySQL..."
    1.92 +		chroot $1/ /bin/adduser -s /bin/false -h /dev/null \
    1.93 +			-g "MySQL Daemon user" -H -D -S mysql
    1.94  		status
    1.95  	fi
    1.96  	chroot $1/ /bin/chown mysql.mysql $(cat $1/$INSTALLED/$PACKAGE/files.list)
    1.97 @@ -78,8 +88,15 @@
    1.98  EOF
    1.99  }
   1.100  
   1.101 +pre_install()
   1.102 +{
   1.103 +	# Cleanup old files
   1.104 +	rm -f $1/usr/libexec/mysql*
   1.105 +	# Mv config
   1.106 +	[ -f $1/etc/my.cnf ] && mv -f $1/etc/my.cnf $1/etc/mysql/my.cnf 
   1.107 +}
   1.108 +
   1.109  post_remove()
   1.110  {
   1.111  	deluser mysql
   1.112 -	delgroup mysql
   1.113  }