wok-current annotate mysql/receipt @ rev 14418

new: python-edbus
author Dominique Corbex <domcox@slitaz.org>
date Tue Apr 23 19:21:08 2013 +0200 (2013-04-23)
parents d2ea785a98d7
children e9130cce9043
rev   line source
pascal@1140 1 # SliTaz package receipt.
pascal@1140 2
pascal@1140 3 PACKAGE="mysql"
slaxemulator@13187 4 VERSION="5.5.27"
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/"
slaxemulator@13187 10 WGET_URL="ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-5.5/$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 \
slaxemulator@13187 16 gcc-lib-base openssl readline"
slaxemulator@13187 17 BUILD_DEPENDS="cmake openssl-dev zlib-dev ncurses-dev readline-dev"
erjo@12033 18
pascal@1140 19 # Rules to configure and make the package.
pascal@1140 20 compile_rules()
pascal@1140 21 {
slaxemulator@13187 22 mkdir -p $WOK/$PACKAGE/source/build
slaxemulator@13187 23 cd $WOK/$PACKAGE/source/build
slaxemulator@13187 24 # CFLAGS/CXXFLAGS as suggested upstream
slaxemulator@13187 25 CFLAGS="-fPIC ${CFLAGS} -fno-strict-aliasing -DBIG_JOINS=1 -fomit-frame-pointer" \
slaxemulator@13187 26 CXXFLAGS="-fPIC ${CXXFLAGS} -fno-strict-aliasing -DBIG_JOINS=1 -felide-constructors -fno-rtti" \
slaxemulator@13187 27 cmake ../$PACKAGE-$VERSION \
slaxemulator@13187 28 -DCMAKE_BUILD_TYPE=Release \
slaxemulator@13187 29 -DCMAKE_INSTALL_PREFIX=/usr \
slaxemulator@13187 30 -DSYSCONFDIR=/etc/mysql \
slaxemulator@13187 31 -DMYSQL_DATADIR=/var/lib/mysql \
slaxemulator@13187 32 -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
slaxemulator@13187 33 -DDEFAULT_CHARSET=utf8 \
slaxemulator@13187 34 -DDEFAULT_COLLATION=utf8_general_ci \
slaxemulator@13187 35 -DENABLED_LOCAL_INFILE=ON \
slaxemulator@13187 36 -DINSTALL_INFODIR=share/mysql/docs \
slaxemulator@13187 37 -DINSTALL_MANDIR=share/man \
slaxemulator@13187 38 -DINSTALL_PLUGINDIR=/usr/lib/mysql/plugin \
slaxemulator@13187 39 -DINSTALL_SCRIPTDIR=bin \
slaxemulator@13187 40 -DINSTALL_INCLUDEDIR=include/mysql \
slaxemulator@13187 41 -DINSTALL_DOCREADMEDIR=share/mysql \
slaxemulator@13187 42 -DINSTALL_SUPPORTFILESDIR=share/mysql \
slaxemulator@13187 43 -DINSTALL_MYSQLSHAREDIR=share/mysql \
slaxemulator@13187 44 -DINSTALL_DOCDIR=share/mysql/docs \
slaxemulator@13187 45 -DINSTALL_SHAREDIR=share/mysql \
slaxemulator@13187 46 -DWITH_READLINE=ON \
slaxemulator@13187 47 -DWITH_ZLIB=system \
slaxemulator@13187 48 -DWITH_SSL=system \
slaxemulator@13187 49 -DWITH_LIBWRAP=OFF \
slaxemulator@13187 50 -DWITH_MYSQLD_LDFLAGS="${LDFLAGS}" \
slaxemulator@13187 51 -DWITH_EXTRA_CHARSETS=complex \
slaxemulator@13187 52 -DWITH_EMBEDDED_SERVER=ON \
slaxemulator@13187 53 -DWITH_INNOBASE_STORAGE_ENGINE=1 \
slaxemulator@13187 54 -DWITH_PARTITION_STORAGE_ENGINE=1 \
slaxemulator@13187 55 -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
slaxemulator@13187 56 -DWITHOUT_ARCHIVE_STORAGE_ENGINE=1 \
slaxemulator@13187 57 -DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1 \
slaxemulator@13187 58 -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 &&
slaxemulator@13187 59 make && make DESTDIR=$DESTDIR install
pascal@1140 60 }
pascal@1140 61
pascal@1140 62 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1140 63 genpkg_rules()
pascal@1140 64 {
pankso@3359 65 mkdir -p \
pankso@3359 66 $fs/usr/share \
pankso@3359 67 $fs/usr/lib/mysql/plugin \
pankso@3359 68 $fs/etc/mysql \
pankso@3359 69 $fs/etc/mysql.d \
pankso@3359 70 $fs/var/lib/mysql \
pankso@3359 71 $fs/var/run/mysqld
pankso@4171 72
erjo@12033 73 cp -a $install/usr/bin $fs/usr
erjo@12033 74 cp -a $install/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin
erjo@12033 75 cp -a $install/usr/share/mysql $fs/usr/share
pankso@4171 76
pankso@3359 77 # Configuration file
erjo@12033 78 cp -a $stuff/etc/init.d $fs/etc
slaxemulator@13187 79 cp -a $stuff/etc/mysql $fs/etc
pankso@3359 80 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \
pankso@3359 81 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \
pankso@3359 82 $fs/etc/mysql/my.cnf
pankso@4171 83
pankso@3359 84 # Permissions
pankso@3359 85 chmod 600 $fs/etc/mysql/my.cnf
pankso@4171 86
slaxemulator@9701 87 cat $stuff/*.files-list | while read file; do
pascal@1140 88 [ -f $fs$file ] && rm -f $fs$file
pascal@1140 89 done
pankso@4171 90
pascal@1140 91 }
pascal@1140 92
pascal@1140 93 # Pre and post install commands for Tazpkg.
pascal@1140 94 post_install()
pascal@1140 95 {
erjo@12033 96
erjo@12033 97 local user
erjo@12033 98 local group
erjo@12033 99
erjo@12033 100 user=mysql
erjo@12033 101 group=mysql
erjo@12033 102
erjo@12033 103 if ! grep -q $user $1/etc/passwd; then
erjo@12033 104 echo -n "Adding user/group $user..."
erjo@12033 105 chroot $1/ addgroup -S $group
erjo@12033 106 chroot $1/ adduser -s /bin/false -S -D -H -G $group $user
erjo@7889 107 status
erjo@7889 108 fi
slaxemulator@13187 109 # adduser mysql if needed
slaxemulator@13187 110 if ! grep -q ${user} $1/etc/passwd; then
slaxemulator@13187 111 echo -n "Adding user MySQL..."
slaxemulator@13187 112 chroot $1/ /bin/adduser -s /bin/false -h /dev/null \
slaxemulator@13187 113 -g "MySQL Daemon user" -u 27 -H -D -S -G ${group} ${user}
slaxemulator@13187 114 status
slaxemulator@13187 115 fi
slaxemulator@13187 116 #chroot $1/ /bin/chown ${user}.${group} $(cat $1/$INSTALLED/$PACKAGE/files.list)
slaxemulator@13187 117 chroot "$1/" /bin/chown -R ${user}.${group} /var/lib/mysql /var/run/mysqld
slaxemulator@13187 118 chroot "$1/" mysql_install_db --user=${user} --basedir=/usr
pascal@1147 119 cat <<EOF
pascal@1147 120 ----
pascal@1147 121 To start $PACKAGE server you can run :
pascal@1147 122
pascal@1147 123 /etc/init.d/$PACKAGE start
pascal@1147 124
pascal@1147 125 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
pascal@1147 126 ----
pascal@1147 127 EOF
pascal@1140 128 }
pascal@1140 129
pankso@3359 130 pre_install()
pankso@3359 131 {
pankso@3359 132 # Cleanup old files
pankso@3359 133 rm -f $1/usr/libexec/mysql*
pankso@3359 134 # Mv config
pankso@4171 135 [ -f $1/etc/my.cnf ] && mv -f $1/etc/my.cnf $1/etc/mysql/my.cnf
pankso@3359 136 }
pankso@3359 137
pascal@1140 138 post_remove()
pascal@1140 139 {
slaxemulator@13187 140 echo "Removing user/group mysql"
slaxemulator@13187 141 chroot "$1/" deluser mysql
pascal@1140 142 }