wok-stable diff mysql/receipt @ rev 1140
Add mysql
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Jul 24 13:32:43 2008 +0000 (2008-07-24) |
parents | |
children | 6c71fe9f8fd5 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mysql/receipt Thu Jul 24 13:32:43 2008 +0000 1.3 @@ -0,0 +1,71 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="mysql" 1.7 +VERSION="5.0.51b" 1.8 +CATEGORY="system" 1.9 +SHORT_DESC="SQL database system." 1.10 +MAINTAINER="pascal.bellard@slitaz.org" 1.11 +TARBALL="$PACKAGE-$VERSION.tar.gz" 1.12 +WEB_SITE="http://www.mysql.com/" 1.13 +WGET_URL="http://mirrors.sunsite.dk/mysql/Downloads/MySQL-5.0/$TARBALL" 1.14 +DEPENDS="libmysqlclient mysql-client zlib" 1.15 + 1.16 +# Rules to configure and make the package. 1.17 +compile_rules() 1.18 +{ 1.19 + 1.20 + cd $src 1.21 +# --with-big-tables ? 1.22 + ./configure --prefix=/usr --infodir=/usr/share/info \ 1.23 + --datadir=/usr/share --localstatedir=/var/lib/mysql \ 1.24 + --with-unix-socket-path=/var/run/mysqld/mysqld.sock \ 1.25 + --with-mysqld-user=mysql \ 1.26 + --mandir=/usr/share/man $CONFIGURE_ARGS 1.27 + make 1.28 + make DESTDIR=$PWD/_pkg install 1.29 + cp ../stuff/*.files-list . 1.30 +} 1.31 + 1.32 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.33 +genpkg_rules() 1.34 +{ 1.35 + mkdir -p $fs/usr/share $fs/etc $fs/var/lib/mysql $fs/var/run/mysqld 1.36 + cp -a $_pkg/usr/bin $fs/usr 1.37 + cp -a $_pkg/usr/libexec $fs/usr 1.38 + cp -a $_pkg/usr/share/mysql $fs/usr/share 1.39 + cp -a $src/support-files/my-medium.cnf $fs/etc/my.cnf 1.40 + cp -a stuff/etc/init.d $fs/etc 1.41 + cat $src/*.files-list | while read file; do 1.42 + [ -f $fs$file ] && rm -f $fs$file 1.43 + done 1.44 + # Package all mysql pkgs 1.45 + for i in $(cd $WOK; ls -d mysql-* libmysql*) 1.46 + do 1.47 + tazwok genpkg $i 1.48 + done 1.49 +} 1.50 + 1.51 +# Pre and post install commands for Tazpkg. 1.52 +post_install() 1.53 +{ 1.54 + # adduser mysql if needed 1.55 + if ! grep -q mysql $1/etc/passwd; then 1.56 + echo -n "Adding user mysql..." 1.57 + chroot $1/ adduser mysql -s /bin/false -H -D -S 1.58 + status 1.59 + fi 1.60 + # addgroup mysql if needed 1.61 + if ! grep -q mysql $1/etc/group; then 1.62 + echo -n "Adding group mysql..." 1.63 + chroot $1/ addgroup mysql && addgroup mysql mysql 1.64 + status 1.65 + fi 1.66 + chroot $1/ chown mysql.mysql $(cat $INSTALLED/$PACKAGE/files.list) 1.67 + chroot $1/ mysql_install_db --user=mysql --datadir=/var/lib/mysql 1.68 +} 1.69 + 1.70 +post_remove() 1.71 +{ 1.72 + deluser mysql 1.73 + delgroup mysql 1.74 +}