wok-current view mysql/receipt @ rev 1210
Add cyrus-imapd
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Aug 09 14:25:01 2008 +0000 (2008-08-09) |
parents | 2311495e3c1a |
children | 534023d6e005 |
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"
13 # Rules to configure and make the package.
14 compile_rules()
15 {
17 cd $src
18 # --with-big-tables ?
19 ./configure --prefix=/usr --infodir=/usr/share/info \
20 --datadir=/usr/share --localstatedir=/var/lib/mysql \
21 --with-unix-socket-path=/var/run/mysqld/mysqld.sock \
22 --with-mysqld-user=mysql \
23 --mandir=/usr/share/man $CONFIGURE_ARGS
24 make
25 make DESTDIR=$PWD/_pkg install
26 cp ../stuff/*.files-list .
27 }
29 # Rules to gen a SliTaz package suitable for Tazpkg.
30 genpkg_rules()
31 {
32 mkdir -p $fs/usr/share $fs/etc $fs/var/lib/mysql $fs/var/run/mysqld
33 cp -a $_pkg/usr/bin $fs/usr
34 cp -a $_pkg/usr/libexec $fs/usr
35 cp -a $_pkg/usr/share/mysql $fs/usr/share
36 cp -a $src/support-files/my-medium.cnf $fs/etc/my.cnf
37 grep -q "bind-address" $fs/etc/my.cnf || sed -i \
38 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' $fs/etc/my.cnf
39 chmod 600 $fs/etc/my.cnf
40 cp -a stuff/etc/init.d $fs/etc
41 cat $src/*.files-list | while read file; do
42 [ -f $fs$file ] && rm -f $fs$file
43 done
44 # Package all mysql pkgs
45 for i in $(cd $WOK; ls -d mysql-* libmysql*)
46 do
47 tazwok genpkg $i
48 done
49 }
51 # Pre and post install commands for Tazpkg.
52 post_install()
53 {
54 ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \
55 $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT
56 etc/my.cnf
57 EOT
58 # adduser mysql if needed
59 if ! grep -q mysql $1/etc/passwd; then
60 echo -n "Adding user mysql..."
61 chroot $1/ adduser mysql -s /bin/false -H -D -S
62 status
63 fi
64 # addgroup mysql if needed
65 if ! grep -q mysql $1/etc/group; then
66 echo -n "Adding group mysql..."
67 chroot $1/ addgroup mysql && addgroup mysql mysql
68 status
69 fi
70 chroot $1/ chown mysql.mysql $(cat $1/$INSTALLED/$PACKAGE/files.list)
71 cat <<EOF
72 ----
73 To start $PACKAGE server you can run :
75 /etc/init.d/$PACKAGE start
77 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
78 ----
79 EOF
80 }
82 post_remove()
83 {
84 deluser mysql
85 delgroup mysql
86 }
88 repack_cleanup()
89 {
90 zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id )
91 }