wok annotate mysql/receipt @ rev 11480
libgnome: add openssl to depends; add intltool to build_depends
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Sun Dec 18 03:01:59 2011 +0100 (2011-12-18) |
parents | bce457eab527 |
children | 8e4c74abdf74 |
rev | line source |
---|---|
pascal@1140 | 1 # SliTaz package receipt. |
pascal@1140 | 2 |
pascal@1140 | 3 PACKAGE="mysql" |
slaxemulator@7658 | 4 VERSION="5.1.54" |
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@5004 | 11 DEPENDS="busybox libmysqlclient mysql-client zlib slitaz-base-files \ |
pascal@5004 | 12 gcc-lib-base" |
pankso@3359 | 13 CONFIG_FILES="/etc/mysql/my.cnf" |
pascal@2347 | 14 DATABASE_FILES="/var/lib/mysql" |
pankso@10379 | 15 CROSS="bug: can not run test programm" |
pascal@1140 | 16 |
pascal@1140 | 17 # Rules to configure and make the package. |
pascal@1140 | 18 compile_rules() |
pascal@1140 | 19 { |
pascal@1140 | 20 |
pascal@1140 | 21 cd $src |
pascal@5735 | 22 grep -q skip_do_abi_check Makefile.am || |
pascal@5735 | 23 sed -i 's/^do_abi_check/&:\n\techo "Skipping &"\n\nreally_&/' Makefile.* |
pankso@10379 | 24 ./configure \ |
pankso@10379 | 25 --prefix=/usr \ |
pankso@10379 | 26 --infodir=/usr/share/info \ |
pankso@10379 | 27 --datadir=/usr/share \ |
pankso@10379 | 28 --localstatedir=/var/lib/mysql \ |
pankso@10379 | 29 --sysconfdir=/etc/mysql \ |
pankso@10379 | 30 --libexecdir=/usr/sbin \ |
pascal@1140 | 31 --with-unix-socket-path=/var/run/mysqld/mysqld.sock \ |
pascal@1140 | 32 --with-mysqld-user=mysql \ |
pascal@3318 | 33 --enable-thread-safe-client \ |
erjo@5772 | 34 --with-plugins=innobase,innodb_plugin \ |
pankso@10379 | 35 --mandir=/usr/share/man \ |
pankso@10380 | 36 --build=$HOST_SYSTEM \ |
pankso@10379 | 37 --host=$HOST_SYSTEM && |
pascal@5735 | 38 make -j 4 && |
pankso@10379 | 39 make DESTDIR=$DESTDIR install |
pascal@1140 | 40 } |
pascal@1140 | 41 |
pascal@1140 | 42 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@1140 | 43 genpkg_rules() |
pascal@1140 | 44 { |
pankso@3359 | 45 mkdir -p \ |
pankso@3359 | 46 $fs/usr/share \ |
pankso@3359 | 47 $fs/usr/lib/mysql/plugin \ |
pankso@3359 | 48 $fs/etc/mysql \ |
pankso@3359 | 49 $fs/etc/mysql.d \ |
pankso@3359 | 50 $fs/var/lib/mysql \ |
pankso@3359 | 51 $fs/var/run/mysqld |
pankso@4171 | 52 |
pascal@1140 | 53 cp -a $_pkg/usr/bin $fs/usr |
pankso@3359 | 54 cp -a $_pkg/usr/sbin $fs/usr |
pankso@3359 | 55 cp -a $_pkg/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin |
pascal@1140 | 56 cp -a $_pkg/usr/share/mysql $fs/usr/share |
pankso@4171 | 57 |
pankso@3359 | 58 # Configuration file |
pascal@1140 | 59 cp -a stuff/etc/init.d $fs/etc |
pankso@3359 | 60 cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf |
pankso@3359 | 61 cp -a $src/support-files/my-small.cnf $fs/etc/mysql |
pankso@3359 | 62 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \ |
pankso@3359 | 63 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \ |
pankso@3359 | 64 $fs/etc/mysql/my.cnf |
pankso@4171 | 65 |
pankso@3359 | 66 # Permissions |
pankso@3359 | 67 chmod 600 $fs/etc/mysql/my.cnf |
pankso@4171 | 68 |
slaxemulator@9701 | 69 cat $stuff/*.files-list | while read file; do |
pascal@1140 | 70 [ -f $fs$file ] && rm -f $fs$file |
pascal@1140 | 71 done |
pankso@4171 | 72 |
pascal@1140 | 73 } |
pascal@1140 | 74 |
pascal@1140 | 75 # Pre and post install commands for Tazpkg. |
pascal@1140 | 76 post_install() |
pascal@1140 | 77 { |
erjo@7889 | 78 # addgroup mysql if needed |
erjo@7889 | 79 if ! grep -q mysql $1/etc/group; then |
erjo@7889 | 80 echo -n "Adding group MySQL..." |
slaxemulator@7961 | 81 chroot $1/ /bin/addgroup -g 27 mysql |
erjo@7889 | 82 status |
erjo@7889 | 83 fi |
pascal@1140 | 84 # adduser mysql if needed |
pascal@1140 | 85 if ! grep -q mysql $1/etc/passwd; then |
pankso@3359 | 86 echo -n "Adding user MySQL..." |
pankso@3359 | 87 chroot $1/ /bin/adduser -s /bin/false -h /dev/null \ |
slaxemulator@7961 | 88 -g "MySQL Daemon user" -u 27 -H -D -S -G mysql mysql |
pascal@1140 | 89 status |
pascal@1140 | 90 fi |
erjo@10813 | 91 #chroot $1/ /bin/chown mysql.mysql $(cat $1/$INSTALLED/$PACKAGE/files.list) |
erjo@10813 | 92 chroot $1/ /bin/chown -R mysql.mysql $1/var/lib/mysql $1/var/run/mysqld |
pascal@1147 | 93 cat <<EOF |
pascal@1147 | 94 ---- |
pascal@1147 | 95 To start $PACKAGE server you can run : |
pascal@1147 | 96 |
pascal@1147 | 97 /etc/init.d/$PACKAGE start |
pascal@1147 | 98 |
pascal@1147 | 99 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf |
pascal@1147 | 100 ---- |
pascal@1147 | 101 EOF |
pascal@1140 | 102 } |
pascal@1140 | 103 |
pankso@3359 | 104 pre_install() |
pankso@3359 | 105 { |
pankso@3359 | 106 # Cleanup old files |
pankso@3359 | 107 rm -f $1/usr/libexec/mysql* |
pankso@3359 | 108 # Mv config |
pankso@4171 | 109 [ -f $1/etc/my.cnf ] && mv -f $1/etc/my.cnf $1/etc/mysql/my.cnf |
pankso@3359 | 110 } |
pankso@3359 | 111 |
pascal@1140 | 112 post_remove() |
pascal@1140 | 113 { |
pascal@1140 | 114 deluser mysql |
pascal@1140 | 115 } |