wok view mysql/receipt @ rev 5288

gc: built also libatomic_ops
author Christophe Lincoln <pankso@slitaz.org>
date Sun Apr 18 14:25:40 2010 +0200 (2010-04-18)
parents 63cc70f33130
children 88732eec82fc
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 ./configure --prefix=/usr --infodir=/usr/share/info \
22 --datadir=/usr/share --localstatedir=/var/lib/mysql \
23 --sysconfdir=/etc/mysql --libexecdir=/usr/sbin \
24 --with-unix-socket-path=/var/run/mysqld/mysqld.sock \
25 --with-mysqld-user=mysql \
26 --enable-thread-safe-client \
27 --mandir=/usr/share/man $CONFIGURE_ARGS &&
28 make &&
29 make DESTDIR=$PWD/_pkg install
30 }
32 # Rules to gen a SliTaz package suitable for Tazpkg.
33 genpkg_rules()
34 {
35 mkdir -p \
36 $fs/usr/share \
37 $fs/usr/lib/mysql/plugin \
38 $fs/etc/mysql \
39 $fs/etc/mysql.d \
40 $fs/var/lib/mysql \
41 $fs/var/run/mysqld
43 cp -a $_pkg/usr/bin $fs/usr
44 cp -a $_pkg/usr/sbin $fs/usr
45 cp -a $_pkg/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin
46 cp -a $_pkg/usr/share/mysql $fs/usr/share
48 # Configuration file
49 cp -a stuff/etc/init.d $fs/etc
50 cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf
51 cp -a $src/support-files/my-small.cnf $fs/etc/mysql
52 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \
53 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \
54 $fs/etc/mysql/my.cnf
56 # Permissions
57 chmod 600 $fs/etc/mysql/my.cnf
59 cat $WOK/$PACKAGE/stuff/*.files-list | while read file; do
60 [ -f $fs$file ] && rm -f $fs$file
61 done
63 # Package all mysql pkgs
64 for i in $(cd $WOK; ls -d *bmysql* mysql-*)
65 do
66 grep -q 'WANTED="mysql"' $WOK/$i/receipt && tazwok genpkg $i
67 done
68 }
70 # Pre and post install commands for Tazpkg.
71 post_install()
72 {
73 # adduser mysql if needed
74 if ! grep -q mysql $1/etc/passwd; then
75 echo -n "Adding user MySQL..."
76 chroot $1/ /bin/adduser -s /bin/false -h /dev/null \
77 -g "MySQL Daemon user" -H -D -S mysql
78 status
79 fi
80 chroot $1/ /bin/chown mysql.mysql $(cat $1/$INSTALLED/$PACKAGE/files.list)
81 cat <<EOF
82 ----
83 To start $PACKAGE server you can run :
85 /etc/init.d/$PACKAGE start
87 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
88 ----
89 EOF
90 }
92 pre_install()
93 {
94 # Cleanup old files
95 rm -f $1/usr/libexec/mysql*
96 # Mv config
97 [ -f $1/etc/my.cnf ] && mv -f $1/etc/my.cnf $1/etc/mysql/my.cnf
98 }
100 post_remove()
101 {
102 deluser mysql
103 }