wok view mysql/receipt @ rev 3318

mysql: set enable-thread-safe-client for spine
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Jun 08 10:27:16 2009 +0200 (2009-06-08)
parents 4aa363a445f7
children 81ee74ea8ff4
line source
1 # SliTaz package receipt.
3 PACKAGE="mysql"
4 VERSION="5.0.77"
5 CATEGORY="misc"
6 SHORT_DESC="SQL database system."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.gz"
9 WEB_SITE="http://www.mysql.com/"
10 WGET_URL="http://mirrors.sunsite.dk/mysql/Downloads/MySQL-5.0/$TARBALL"
11 DEPENDS="busybox libmysqlclient mysql-client zlib slitaz-base-files"
12 CONFIG_FILES="/etc/my.cnf"
13 DATABASE_FILES="/var/lib/mysql"
15 # Rules to configure and make the package.
16 compile_rules()
17 {
19 cd $src
20 cp ../stuff/*.files-list .
21 ./configure --prefix=/usr --infodir=/usr/share/info \
22 --datadir=/usr/share --localstatedir=/var/lib/mysql \
23 --with-unix-socket-path=/var/run/mysqld/mysqld.sock \
24 --with-mysqld-user=mysql \
25 --enable-thread-safe-client \
26 --mandir=/usr/share/man $CONFIGURE_ARGS &&
27 make &&
28 make DESTDIR=$PWD/_pkg install
29 }
31 # Rules to gen a SliTaz package suitable for Tazpkg.
32 genpkg_rules()
33 {
34 mkdir -p $fs/usr/share $fs/etc/mysql.d $fs/var/lib/mysql $fs/var/run/mysqld
35 cp -a $_pkg/usr/bin $fs/usr
36 cp -a $_pkg/usr/libexec $fs/usr
37 cp -a $_pkg/usr/share/mysql $fs/usr/share
38 cp -a $src/support-files/my-medium.cnf $fs/etc/my.cnf
39 grep -q "bind-address" $fs/etc/my.cnf || sed -i \
40 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' $fs/etc/my.cnf
41 chmod 600 $fs/etc/my.cnf
42 cp -a stuff/etc/init.d $fs/etc
43 cat $src/*.files-list | while read file; do
44 [ -f $fs$file ] && rm -f $fs$file
45 done
46 strip -s $fs/usr/libexec/*
47 # Package all mysql pkgs
48 for i in $(cd $WOK; ls -d *bmysql*)
49 do
50 grep -q 'WANTED="mysql"' $WOK/$i/receipt && tazwok genpkg $i
51 done
52 }
54 # Pre and post install commands for Tazpkg.
55 post_install()
56 {
57 # adduser mysql if needed
58 if ! grep -q mysql $1/etc/passwd; then
59 echo -n "Adding user mysql..."
60 chroot $1/ /bin/adduser mysql -s /bin/false -H -D -S
61 status
62 fi
63 # addgroup mysql if needed
64 if ! grep -q mysql $1/etc/group; then
65 echo -n "Adding group mysql..."
66 chroot $1/ sh -c '/bin/addgroup mysql && /bin/addgroup mysql mysql'
67 status
68 fi
69 chroot $1/ /bin/chown mysql.mysql $(cat $1/$INSTALLED/$PACKAGE/files.list)
70 cat <<EOF
71 ----
72 To start $PACKAGE server you can run :
74 /etc/init.d/$PACKAGE start
76 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
77 ----
78 EOF
79 }
81 post_remove()
82 {
83 deluser mysql
84 delgroup mysql
85 }