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