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

pcmciautils: Fixed WGET_URL.
author Christopher Rogers <slaxemulator@gmail.com>
date Mon Oct 17 00:27:48 2011 +0000 (2011-10-17)
parents bce457eab527
children 8e4c74abdf74
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"
15 CROSS="bug: can not run test programm"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
21 cd $src
22 grep -q skip_do_abi_check Makefile.am ||
23 sed -i 's/^do_abi_check/&:\n\techo "Skipping &"\n\nreally_&/' Makefile.*
24 ./configure \
25 --prefix=/usr \
26 --infodir=/usr/share/info \
27 --datadir=/usr/share \
28 --localstatedir=/var/lib/mysql \
29 --sysconfdir=/etc/mysql \
30 --libexecdir=/usr/sbin \
31 --with-unix-socket-path=/var/run/mysqld/mysqld.sock \
32 --with-mysqld-user=mysql \
33 --enable-thread-safe-client \
34 --with-plugins=innobase,innodb_plugin \
35 --mandir=/usr/share/man \
36 --build=$HOST_SYSTEM \
37 --host=$HOST_SYSTEM &&
38 make -j 4 &&
39 make DESTDIR=$DESTDIR install
40 }
42 # Rules to gen a SliTaz package suitable for Tazpkg.
43 genpkg_rules()
44 {
45 mkdir -p \
46 $fs/usr/share \
47 $fs/usr/lib/mysql/plugin \
48 $fs/etc/mysql \
49 $fs/etc/mysql.d \
50 $fs/var/lib/mysql \
51 $fs/var/run/mysqld
53 cp -a $_pkg/usr/bin $fs/usr
54 cp -a $_pkg/usr/sbin $fs/usr
55 cp -a $_pkg/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin
56 cp -a $_pkg/usr/share/mysql $fs/usr/share
58 # Configuration file
59 cp -a stuff/etc/init.d $fs/etc
60 cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf
61 cp -a $src/support-files/my-small.cnf $fs/etc/mysql
62 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \
63 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \
64 $fs/etc/mysql/my.cnf
66 # Permissions
67 chmod 600 $fs/etc/mysql/my.cnf
69 cat $stuff/*.files-list | while read file; do
70 [ -f $fs$file ] && rm -f $fs$file
71 done
73 }
75 # Pre and post install commands for Tazpkg.
76 post_install()
77 {
78 # addgroup mysql if needed
79 if ! grep -q mysql $1/etc/group; then
80 echo -n "Adding group MySQL..."
81 chroot $1/ /bin/addgroup -g 27 mysql
82 status
83 fi
84 # adduser mysql if needed
85 if ! grep -q mysql $1/etc/passwd; then
86 echo -n "Adding user MySQL..."
87 chroot $1/ /bin/adduser -s /bin/false -h /dev/null \
88 -g "MySQL Daemon user" -u 27 -H -D -S -G mysql mysql
89 status
90 fi
91 #chroot $1/ /bin/chown mysql.mysql $(cat $1/$INSTALLED/$PACKAGE/files.list)
92 chroot $1/ /bin/chown -R mysql.mysql $1/var/lib/mysql $1/var/run/mysqld
93 cat <<EOF
94 ----
95 To start $PACKAGE server you can run :
97 /etc/init.d/$PACKAGE start
99 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
100 ----
101 EOF
102 }
104 pre_install()
105 {
106 # Cleanup old files
107 rm -f $1/usr/libexec/mysql*
108 # Mv config
109 [ -f $1/etc/my.cnf ] && mv -f $1/etc/my.cnf $1/etc/mysql/my.cnf
110 }
112 post_remove()
113 {
114 deluser mysql
115 }