wok view mysql/receipt @ rev 5735

mysql: fix for gcc 4.5.0
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Jun 26 12:16:15 2010 +0200 (2010-06-26)
parents 5b44af8c1257
children e11c1f49a04b
line source
1 # SliTaz package receipt.
3 PACKAGE="mysql"
4 VERSION="5.1.38"
5 CATEGORY="office"
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.1/$TARBALL"
11 DEPENDS="busybox libmysqlclient mysql-client zlib slitaz-base-files \
12 gcc-lib-base"
13 CONFIG_FILES="/etc/mysql/my.cnf"
14 DATABASE_FILES="/var/lib/mysql"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
20 cd $src
21 grep -q skip_do_abi_check Makefile.am ||
22 sed -i 's/^do_abi_check/&:\n\techo "Skipping &"\n\nreally_&/' Makefile.*
23 ./configure --prefix=/usr --infodir=/usr/share/info \
24 --datadir=/usr/share --localstatedir=/var/lib/mysql \
25 --sysconfdir=/etc/mysql --libexecdir=/usr/sbin \
26 --with-unix-socket-path=/var/run/mysqld/mysqld.sock \
27 --with-mysqld-user=mysql \
28 --enable-thread-safe-client \
29 --mandir=/usr/share/man $CONFIGURE_ARGS &&
30 make -j 4 &&
31 make DESTDIR=$PWD/_pkg install
32 }
34 # Rules to gen a SliTaz package suitable for Tazpkg.
35 genpkg_rules()
36 {
37 mkdir -p \
38 $fs/usr/share \
39 $fs/usr/lib/mysql/plugin \
40 $fs/etc/mysql \
41 $fs/etc/mysql.d \
42 $fs/var/lib/mysql \
43 $fs/var/run/mysqld
45 cp -a $_pkg/usr/bin $fs/usr
46 cp -a $_pkg/usr/sbin $fs/usr
47 cp -a $_pkg/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin
48 cp -a $_pkg/usr/share/mysql $fs/usr/share
50 # Configuration file
51 cp -a stuff/etc/init.d $fs/etc
52 cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf
53 cp -a $src/support-files/my-small.cnf $fs/etc/mysql
54 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \
55 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \
56 $fs/etc/mysql/my.cnf
58 # Permissions
59 chmod 600 $fs/etc/mysql/my.cnf
61 cat $WOK/$PACKAGE/stuff/*.files-list | while read file; do
62 [ -f $fs$file ] && rm -f $fs$file
63 done
65 # Package all mysql pkgs
66 for i in $(cd $WOK; ls -d *bmysql* mysql-*)
67 do
68 grep -q 'WANTED="mysql"' $WOK/$i/receipt && tazwok genpkg $i
69 done
70 }
72 # Pre and post install commands for Tazpkg.
73 post_install()
74 {
75 # adduser mysql if needed
76 if ! grep -q mysql $1/etc/passwd; then
77 echo -n "Adding user MySQL..."
78 chroot $1/ /bin/adduser -s /bin/false -h /dev/null \
79 -g "MySQL Daemon user" -H -D -S mysql
80 status
81 fi
82 chroot $1/ /bin/chown mysql.mysql $(cat $1/$INSTALLED/$PACKAGE/files.list)
83 cat <<EOF
84 ----
85 To start $PACKAGE server you can run :
87 /etc/init.d/$PACKAGE start
89 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
90 ----
91 EOF
92 }
94 pre_install()
95 {
96 # Cleanup old files
97 rm -f $1/usr/libexec/mysql*
98 # Mv config
99 [ -f $1/etc/my.cnf ] && mv -f $1/etc/my.cnf $1/etc/mysql/my.cnf
100 }
102 post_remove()
103 {
104 deluser mysql
105 }