wok annotate mariadb/receipt @ rev 20358

GnuPG: search suggests it may be due to older gcc, so let's try with LDFLAGS: -lrt
author Erkan Yilmaz <erkan@slitaz.org>
date Sat Jun 09 17:24:06 2018 +0000 (2018-06-09)
parents bf261b0db903
children 241fb98cab1c
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
pascal@18730 86 if ! grep -q $user "$1/etc/passwd"; then
pascal@20319 87 echo
erjo@13054 88 echo -n "Adding user/group $user..."
pascal@18730 89 chroot "$1/" addgroup -S $group
pascal@18730 90 chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user
erjo@13054 91 status
erjo@13054 92 fi
erjo@13054 93
erjo@13054 94 cat <<EOF
erjo@13054 95 ----
erjo@13054 96 To start $PACKAGE server you can run :
erjo@13054 97
erjo@13054 98 /etc/init.d/$PACKAGE start
erjo@13054 99
erjo@13054 100 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
erjo@13054 101 ----
erjo@13054 102 EOF
erjo@13054 103 }
erjo@13054 104
erjo@13054 105 pre_install()
erjo@13054 106 {
erjo@13054 107 # Cleanup old files
pascal@18730 108 rm -f "$1/usr/libexec/mysql"*
erjo@13054 109 # Mv config
pascal@19766 110 [ -f "$1/etc/my.cnf" ] &&
pascal@19766 111 mv -f "$1/etc/my.cnf" "$1/etc/mysql/my.cnf" || true
erjo@13054 112 }
erjo@13054 113
erjo@13054 114 post_remove()
erjo@13054 115 {
erjo@13054 116 echo "Removing user/group mysl"
erjo@13054 117 deluser mysql
erjo@13054 118 }