wok view mysql/receipt @ rev 4308

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