wok-next view mysql/receipt @ rev 8542

Up: lvm2 to 2.02.84.
author Christopher Rogers <slaxemulator@gmail.com>
date Sun Feb 13 14:12:37 2011 +0000 (2011-02-13)
parents 08d062d6c6db
children d1768332cee0
line source
1 # SliTaz package receipt.
3 PACKAGE="mysql"
4 VERSION="5.1.54"
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 }
68 # Pre and post install commands for Tazpkg.
69 post_install()
70 {
71 # addgroup mysql if needed
72 if ! grep -q mysql $1/etc/group; then
73 echo -n "Adding group MySQL..."
74 chroot $1/ /bin/addgroup -g 27 mysql
75 status
76 fi
77 # adduser mysql if needed
78 if ! grep -q mysql $1/etc/passwd; then
79 echo -n "Adding user MySQL..."
80 chroot $1/ /bin/adduser -s /bin/false -h /dev/null \
81 -g "MySQL Daemon user" -u 27 -H -D -S -G mysql mysql
82 status
83 fi
84 chroot $1/ /bin/chown mysql.mysql $(cat $1/$INSTALLED/$PACKAGE/files.list)
85 cat <<EOF
86 ----
87 To start $PACKAGE server you can run :
89 /etc/init.d/$PACKAGE start
91 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
92 ----
93 EOF
94 }
96 pre_install()
97 {
98 # Cleanup old files
99 rm -f $1/usr/libexec/mysql*
100 # Mv config
101 [ -f $1/etc/my.cnf ] && mv -f $1/etc/my.cnf $1/etc/mysql/my.cnf
102 }
104 post_remove()
105 {
106 deluser mysql
107 }