wok-6.x view mysql/receipt @ rev 6043

Up: firefox (3.6.8)
author Alexander Medvedev <devl547@gmail.com>
date Tue Aug 17 10:25:30 2010 +0000 (2010-08-17)
parents 88732eec82fc
children 0d38e6b0c9a7
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 --with-plugins=innobase,innodb_plugin \
30 --mandir=/usr/share/man $CONFIGURE_ARGS &&
31 make -j 4 &&
32 make DESTDIR=$PWD/_pkg install
33 }
35 # Rules to gen a SliTaz package suitable for Tazpkg.
36 genpkg_rules()
37 {
38 mkdir -p \
39 $fs/usr/share \
40 $fs/usr/lib/mysql/plugin \
41 $fs/etc/mysql \
42 $fs/etc/mysql.d \
43 $fs/var/lib/mysql \
44 $fs/var/run/mysqld
46 cp -a $_pkg/usr/bin $fs/usr
47 cp -a $_pkg/usr/sbin $fs/usr
48 cp -a $_pkg/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin
49 cp -a $_pkg/usr/share/mysql $fs/usr/share
51 # Configuration file
52 cp -a stuff/etc/init.d $fs/etc
53 cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf
54 cp -a $src/support-files/my-small.cnf $fs/etc/mysql
55 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \
56 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \
57 $fs/etc/mysql/my.cnf
59 # Permissions
60 chmod 600 $fs/etc/mysql/my.cnf
62 cat $WOK/$PACKAGE/stuff/*.files-list | while read file; do
63 [ -f $fs$file ] && rm -f $fs$file
64 done
66 # Package all mysql pkgs
67 for i in $(cd $WOK; ls -d *bmysql* mysql-*)
68 do
69 grep -q 'WANTED="mysql"' $WOK/$i/receipt && tazwok genpkg $i
70 done
71 }
73 # Pre and post install commands for Tazpkg.
74 post_install()
75 {
76 # adduser mysql if needed
77 if ! grep -q mysql $1/etc/passwd; then
78 echo -n "Adding user MySQL..."
79 chroot $1/ /bin/adduser -s /bin/false -h /dev/null \
80 -g "MySQL Daemon user" -H -D -S mysql
81 status
82 fi
83 chroot $1/ /bin/chown mysql.mysql $(cat $1/$INSTALLED/$PACKAGE/files.list)
84 cat <<EOF
85 ----
86 To start $PACKAGE server you can run :
88 /etc/init.d/$PACKAGE start
90 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
91 ----
92 EOF
93 }
95 pre_install()
96 {
97 # Cleanup old files
98 rm -f $1/usr/libexec/mysql*
99 # Mv config
100 [ -f $1/etc/my.cnf ] && mv -f $1/etc/my.cnf $1/etc/mysql/my.cnf
101 }
103 post_remove()
104 {
105 deluser mysql
106 }