wok view mysql/receipt @ rev 1387

Fix: DEPENDS mpd
author Paul Issott <paul@slitaz.org>
date Wed Sep 17 20:03:35 2008 +0000 (2008-09-17)
parents f6a6d0028db1
children 03a799424aaa
line source
1 # SliTaz package receipt.
3 PACKAGE="mysql"
4 VERSION="5.0.51b"
5 CATEGORY="system"
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.0/$TARBALL"
11 DEPENDS="libmysqlclient mysql-client zlib"
12 CONFIG_FILES="/etc/my.cnf"
14 # Rules to configure and make the package.
15 compile_rules()
16 {
18 cd $src
19 # --with-big-tables ?
20 ./configure --prefix=/usr --infodir=/usr/share/info \
21 --datadir=/usr/share --localstatedir=/var/lib/mysql \
22 --with-unix-socket-path=/var/run/mysqld/mysqld.sock \
23 --with-mysqld-user=mysql \
24 --mandir=/usr/share/man $CONFIGURE_ARGS
25 make
26 make DESTDIR=$PWD/_pkg install
27 cp ../stuff/*.files-list .
28 }
30 # Rules to gen a SliTaz package suitable for Tazpkg.
31 genpkg_rules()
32 {
33 mkdir -p $fs/usr/share $fs/etc $fs/var/lib/mysql $fs/var/run/mysqld
34 cp -a $_pkg/usr/bin $fs/usr
35 cp -a $_pkg/usr/libexec $fs/usr
36 cp -a $_pkg/usr/share/mysql $fs/usr/share
37 cp -a $src/support-files/my-medium.cnf $fs/etc/my.cnf
38 grep -q "bind-address" $fs/etc/my.cnf || sed -i \
39 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' $fs/etc/my.cnf
40 chmod 600 $fs/etc/my.cnf
41 cp -a stuff/etc/init.d $fs/etc
42 cat $src/*.files-list | while read file; do
43 [ -f $fs$file ] && rm -f $fs$file
44 done
45 # Package all mysql pkgs
46 for i in $(cd $WOK; ls -d mysql-* libmysql*)
47 do
48 tazwok genpkg $i
49 done
50 }
52 # Pre and post install commands for Tazpkg.
53 post_install()
54 {
55 ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \
56 $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT
57 etc/my.cnf
58 EOT
59 # adduser mysql if needed
60 if ! grep -q mysql $1/etc/passwd; then
61 echo -n "Adding user mysql..."
62 chroot $1/ adduser mysql -s /bin/false -H -D -S
63 status
64 fi
65 # addgroup mysql if needed
66 if ! grep -q mysql $1/etc/group; then
67 echo -n "Adding group mysql..."
68 chroot $1/ addgroup mysql && addgroup mysql mysql
69 status
70 fi
71 chroot $1/ chown mysql.mysql $(cat $1/$INSTALLED/$PACKAGE/files.list)
72 cat <<EOF
73 ----
74 To start $PACKAGE server you can run :
76 /etc/init.d/$PACKAGE start
78 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
79 ----
80 EOF
81 }
83 post_remove()
84 {
85 deluser mysql
86 delgroup mysql
87 }
89 repack_cleanup()
90 {
91 zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id )
92 }