wok-6.x annotate mysql/receipt @ rev 4553

Add foomatic-db-nonfree
author Rohit Joshi <jozee@slitaz.org>
date Fri Dec 04 13:25:37 2009 +0000 (2009-12-04)
parents 41efe35c6d3b
children 5b44af8c1257
rev   line source
pascal@1140 1 # SliTaz package receipt.
pascal@1140 2
pascal@1140 3 PACKAGE="mysql"
pankso@4171 4 VERSION="5.1.38"
pankso@4171 5 CATEGORY="office"
pascal@1140 6 SHORT_DESC="SQL database system."
pascal@1140 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@1140 8 TARBALL="$PACKAGE-$VERSION.tar.gz"
pascal@1140 9 WEB_SITE="http://www.mysql.com/"
pankso@3359 10 WGET_URL="http://mirrors.sunsite.dk/mysql/Downloads/MySQL-5.1/$TARBALL"
pascal@2280 11 DEPENDS="busybox libmysqlclient mysql-client zlib slitaz-base-files"
pankso@3359 12 CONFIG_FILES="/etc/mysql/my.cnf"
pascal@2347 13 DATABASE_FILES="/var/lib/mysql"
pascal@1140 14
pascal@1140 15 # Rules to configure and make the package.
pascal@1140 16 compile_rules()
pascal@1140 17 {
pascal@1140 18
pascal@1140 19 cd $src
pascal@1140 20 ./configure --prefix=/usr --infodir=/usr/share/info \
pascal@1140 21 --datadir=/usr/share --localstatedir=/var/lib/mysql \
pankso@3359 22 --sysconfdir=/etc/mysql --libexecdir=/usr/sbin \
pascal@1140 23 --with-unix-socket-path=/var/run/mysqld/mysqld.sock \
pascal@1140 24 --with-mysqld-user=mysql \
pascal@3318 25 --enable-thread-safe-client \
pascal@2773 26 --mandir=/usr/share/man $CONFIGURE_ARGS &&
pascal@2773 27 make &&
pascal@1140 28 make DESTDIR=$PWD/_pkg install
pascal@1140 29 }
pascal@1140 30
pascal@1140 31 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1140 32 genpkg_rules()
pascal@1140 33 {
pankso@3359 34 mkdir -p \
pankso@3359 35 $fs/usr/share \
pankso@3359 36 $fs/usr/lib/mysql/plugin \
pankso@3359 37 $fs/etc/mysql \
pankso@3359 38 $fs/etc/mysql.d \
pankso@3359 39 $fs/var/lib/mysql \
pankso@3359 40 $fs/var/run/mysqld
pankso@4171 41
pascal@1140 42 cp -a $_pkg/usr/bin $fs/usr
pankso@3359 43 cp -a $_pkg/usr/sbin $fs/usr
pankso@3359 44 cp -a $_pkg/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin
pascal@1140 45 cp -a $_pkg/usr/share/mysql $fs/usr/share
pankso@4171 46
pankso@3359 47 # Configuration file
pascal@1140 48 cp -a stuff/etc/init.d $fs/etc
pankso@3359 49 cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf
pankso@3359 50 cp -a $src/support-files/my-small.cnf $fs/etc/mysql
pankso@3359 51 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \
pankso@3359 52 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \
pankso@3359 53 $fs/etc/mysql/my.cnf
pankso@4171 54
pankso@3359 55 # Permissions
pankso@3359 56 chmod 600 $fs/etc/mysql/my.cnf
pankso@4171 57
pankso@3359 58 cat $WOK/$PACKAGE/stuff/*.files-list | while read file; do
pascal@1140 59 [ -f $fs$file ] && rm -f $fs$file
pascal@1140 60 done
pankso@4171 61
pascal@1140 62 # Package all mysql pkgs
pankso@3359 63 for i in $(cd $WOK; ls -d *bmysql* mysql-*)
pascal@1140 64 do
pascal@3318 65 grep -q 'WANTED="mysql"' $WOK/$i/receipt && tazwok genpkg $i
pascal@1140 66 done
pascal@1140 67 }
pascal@1140 68
pascal@1140 69 # Pre and post install commands for Tazpkg.
pascal@1140 70 post_install()
pascal@1140 71 {
pascal@1140 72 # adduser mysql if needed
pascal@1140 73 if ! grep -q mysql $1/etc/passwd; then
pankso@3359 74 echo -n "Adding user MySQL..."
pankso@3359 75 chroot $1/ /bin/adduser -s /bin/false -h /dev/null \
pankso@3359 76 -g "MySQL Daemon user" -H -D -S mysql
pascal@1140 77 status
pascal@1140 78 fi
pascal@2279 79 chroot $1/ /bin/chown mysql.mysql $(cat $1/$INSTALLED/$PACKAGE/files.list)
pascal@1147 80 cat <<EOF
pascal@1147 81 ----
pascal@1147 82 To start $PACKAGE server you can run :
pascal@1147 83
pascal@1147 84 /etc/init.d/$PACKAGE start
pascal@1147 85
pascal@1147 86 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
pascal@1147 87 ----
pascal@1147 88 EOF
pascal@1140 89 }
pascal@1140 90
pankso@3359 91 pre_install()
pankso@3359 92 {
pankso@3359 93 # Cleanup old files
pankso@3359 94 rm -f $1/usr/libexec/mysql*
pankso@3359 95 # Mv config
pankso@4171 96 [ -f $1/etc/my.cnf ] && mv -f $1/etc/my.cnf $1/etc/mysql/my.cnf
pankso@3359 97 }
pankso@3359 98
pascal@1140 99 post_remove()
pascal@1140 100 {
pascal@1140 101 deluser mysql
pascal@1140 102 }