wok annotate mysql/receipt @ rev 1141
mysql: fix post_install
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Jul 24 13:46:31 2008 +0000 (2008-07-24) |
parents | 91e8a40cf500 |
children | 42f40e9e6a2f |
rev | line source |
---|---|
pascal@1140 | 1 # SliTaz package receipt. |
pascal@1140 | 2 |
pascal@1140 | 3 PACKAGE="mysql" |
pascal@1140 | 4 VERSION="5.0.51b" |
pascal@1140 | 5 CATEGORY="system" |
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/" |
pascal@1140 | 10 WGET_URL="http://mirrors.sunsite.dk/mysql/Downloads/MySQL-5.0/$TARBALL" |
pascal@1140 | 11 DEPENDS="libmysqlclient mysql-client zlib" |
pascal@1140 | 12 |
pascal@1140 | 13 # Rules to configure and make the package. |
pascal@1140 | 14 compile_rules() |
pascal@1140 | 15 { |
pascal@1140 | 16 |
pascal@1140 | 17 cd $src |
pascal@1140 | 18 # --with-big-tables ? |
pascal@1140 | 19 ./configure --prefix=/usr --infodir=/usr/share/info \ |
pascal@1140 | 20 --datadir=/usr/share --localstatedir=/var/lib/mysql \ |
pascal@1140 | 21 --with-unix-socket-path=/var/run/mysqld/mysqld.sock \ |
pascal@1140 | 22 --with-mysqld-user=mysql \ |
pascal@1140 | 23 --mandir=/usr/share/man $CONFIGURE_ARGS |
pascal@1140 | 24 make |
pascal@1140 | 25 make DESTDIR=$PWD/_pkg install |
pascal@1140 | 26 cp ../stuff/*.files-list . |
pascal@1140 | 27 } |
pascal@1140 | 28 |
pascal@1140 | 29 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@1140 | 30 genpkg_rules() |
pascal@1140 | 31 { |
pascal@1140 | 32 mkdir -p $fs/usr/share $fs/etc $fs/var/lib/mysql $fs/var/run/mysqld |
pascal@1140 | 33 cp -a $_pkg/usr/bin $fs/usr |
pascal@1140 | 34 cp -a $_pkg/usr/libexec $fs/usr |
pascal@1140 | 35 cp -a $_pkg/usr/share/mysql $fs/usr/share |
pascal@1140 | 36 cp -a $src/support-files/my-medium.cnf $fs/etc/my.cnf |
pascal@1140 | 37 cp -a stuff/etc/init.d $fs/etc |
pascal@1140 | 38 cat $src/*.files-list | while read file; do |
pascal@1140 | 39 [ -f $fs$file ] && rm -f $fs$file |
pascal@1140 | 40 done |
pascal@1140 | 41 # Package all mysql pkgs |
pascal@1140 | 42 for i in $(cd $WOK; ls -d mysql-* libmysql*) |
pascal@1140 | 43 do |
pascal@1140 | 44 tazwok genpkg $i |
pascal@1140 | 45 done |
pascal@1140 | 46 } |
pascal@1140 | 47 |
pascal@1140 | 48 # Pre and post install commands for Tazpkg. |
pascal@1140 | 49 post_install() |
pascal@1140 | 50 { |
pascal@1140 | 51 # adduser mysql if needed |
pascal@1140 | 52 if ! grep -q mysql $1/etc/passwd; then |
pascal@1140 | 53 echo -n "Adding user mysql..." |
pascal@1140 | 54 chroot $1/ adduser mysql -s /bin/false -H -D -S |
pascal@1140 | 55 status |
pascal@1140 | 56 fi |
pascal@1140 | 57 # addgroup mysql if needed |
pascal@1140 | 58 if ! grep -q mysql $1/etc/group; then |
pascal@1140 | 59 echo -n "Adding group mysql..." |
pascal@1140 | 60 chroot $1/ addgroup mysql && addgroup mysql mysql |
pascal@1140 | 61 status |
pascal@1140 | 62 fi |
pascal@1141 | 63 chroot $1/ chown mysql.mysql $(cat $1/$INSTALLED/$PACKAGE/files.list) |
pascal@1140 | 64 chroot $1/ mysql_install_db --user=mysql --datadir=/var/lib/mysql |
pascal@1140 | 65 } |
pascal@1140 | 66 |
pascal@1140 | 67 post_remove() |
pascal@1140 | 68 { |
pascal@1140 | 69 deluser mysql |
pascal@1140 | 70 delgroup mysql |
pascal@1140 | 71 } |