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

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