wok annotate mariadb/receipt @ rev 17764

epdf: hide false positive
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Mar 12 09:36:28 2015 +0100 (2015-03-12)
parents 82d9aa0126d9
children 9e01bc6321ea
rev   line source
erjo@13054 1 # SliTaz package receipt.
erjo@13054 2
erjo@13054 3 PACKAGE="mariadb"
erjo@16730 4 VERSION="10.0.11"
erjo@13054 5 CATEGORY="office"
erjo@13054 6 SHORT_DESC="SQL database system."
erjo@13054 7 MAINTAINER="erjo@slitaz.org"
pascal@15001 8 LICENSE="GPL2"
erjo@13054 9 TARBALL="$PACKAGE-$VERSION.tar.gz"
erjo@13054 10 WEB_SITE="http://mariadb.org/en/"
erjo@13058 11 WGET_URL="http://pangolin.slitaz.org/downloads/sources/$TARBALL"
pascal@14772 12 CONFIG_FILES="/etc/mysql"
pascal@14772 13 TAZPANEL_DAEMON="man|edit::/etc/mysql/my.cnf|options|web::$WEB_SITE"
erjo@13054 14 PROVIDE="mysql"
erjo@13054 15
erjo@13054 16 CONFIG_FILES="/etc/mysql/my.cnf"
erjo@13054 17 DATABASE_FILES="/var/lib/mysql"
erjo@13054 18 CROSS="bug: can not run test programm"
erjo@13054 19
erjo@13054 20 DEPENDS="busybox libmariadbclient mariadb-client zlib slitaz-base-files \
erjo@13054 21 gcc-lib-base"
pascal@16735 22 BUILD_DEPENDS="cmake ncurses-dev bison openssl-dev"
erjo@13054 23
erjo@13054 24 # Rules to configure and make the package.
erjo@13054 25 compile_rules()
erjo@13054 26 {
erjo@13054 27
erjo@13054 28 cd $src
erjo@13054 29 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
erjo@13054 30 -DINSTALL-DOCREADMEDIR=/usr/share/doc \
erjo@13054 31 -DINSTALL_MYSQLDATADIR=/var/lib/mysql \
erjo@13054 32 -DINSTALL_SYSCONFDIR=/etc \
erjo@13054 33 -DINSTALL_LIBDIR=lib/mysql \
erjo@13054 34 -DINSTALL_INFODIR=share/doc/mysql \
erjo@13054 35 -DINSTALL_MANDIR=share/man \
erjo@13054 36 -DINSTALL_PLUGINDIR=lib/mysql/plugin \
erjo@13054 37 -DINSTALL_SHAREDIR=share \
erjo@13054 38 -DINSTALL_MYSQLSHAREDIR=share/mysql \
pascal@15265 39 -DINSTALL_UNIX_ADDRDIR=/var/run/mysqld/mysqld.sock &&
erjo@13054 40 make $MAKEFLAGS &&
erjo@13054 41 make install
erjo@13054 42 }
erjo@13054 43
erjo@13054 44 # Rules to gen a SliTaz package suitable for Tazpkg.
erjo@13054 45 genpkg_rules()
erjo@13054 46 {
erjo@13054 47 mkdir -p \
erjo@13054 48 $fs/usr/share \
erjo@13054 49 $fs/usr/lib/mysql/plugin \
erjo@13054 50 $fs/etc/mysql \
erjo@13054 51 $fs/etc/mysql.d \
erjo@14808 52 $fs/var/lib/mysql
erjo@13054 53
erjo@13054 54 cp -a $install/usr/bin $fs/usr
erjo@13054 55 cp -a $install/usr/scripts/* $fs/usr/bin
erjo@13054 56 cp -a $install/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin
erjo@13054 57 cp -a $install/usr/share/mysql $fs/usr/share
erjo@13054 58
erjo@13054 59 # Configuration file
erjo@13054 60 cp -a $stuff/etc/init.d $fs/etc
erjo@13054 61 cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf
erjo@13054 62 cp -a $src/support-files/my-small.cnf $fs/etc/mysql
erjo@13054 63 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \
erjo@13054 64 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \
erjo@13054 65 $fs/etc/mysql/my.cnf
erjo@13054 66
erjo@13054 67 # Permissions
erjo@13054 68 chmod 600 $fs/etc/mysql/my.cnf
erjo@13054 69
erjo@13054 70 cat $stuff/*.files-list | while read file; do
erjo@13054 71 [ -f $fs$file ] && rm -f $fs$file
erjo@13054 72 done
erjo@13054 73
erjo@13054 74 }
erjo@13054 75
erjo@13054 76 # Pre and post install commands for Tazpkg.
erjo@13054 77 post_install()
erjo@13054 78 {
erjo@13054 79
erjo@13054 80 local user
erjo@13054 81 local group
erjo@13054 82
erjo@13054 83 user=mysql
erjo@13054 84 group=mysql
erjo@13054 85
erjo@13054 86 if ! grep -q $user $1/etc/passwd; then
erjo@13054 87 echo -n "Adding user/group $user..."
erjo@13054 88 chroot $1/ addgroup -S $group
erjo@13054 89 chroot $1/ adduser -s /bin/false -S -D -H -G $group $user
erjo@13054 90 status
erjo@13054 91 fi
erjo@13054 92
erjo@13054 93 cat <<EOF
erjo@13054 94 ----
erjo@13054 95 To start $PACKAGE server you can run :
erjo@13054 96
erjo@13054 97 /etc/init.d/$PACKAGE start
erjo@13054 98
erjo@13054 99 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
erjo@13054 100 ----
erjo@13054 101 EOF
erjo@13054 102 }
erjo@13054 103
erjo@13054 104 pre_install()
erjo@13054 105 {
erjo@13054 106 # Cleanup old files
erjo@13054 107 rm -f $1/usr/libexec/mysql*
erjo@13054 108 # Mv config
erjo@13054 109 [ -f $1/etc/my.cnf ] && mv -f $1/etc/my.cnf $1/etc/mysql/my.cnf
erjo@13054 110 }
erjo@13054 111
erjo@13054 112 post_remove()
erjo@13054 113 {
erjo@13054 114 echo "Removing user/group mysl"
erjo@13054 115 deluser mysql
erjo@13054 116 }