wok-current annotate mariadb/receipt @ rev 24973
Up zsh (5.8.1)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun May 01 15:03:44 2022 +0000 (2022-05-01) |
parents | 241fb98cab1c |
children | b56b38cfd475 |
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/" |
pascal@24973 | 11 WGET_URL="https://downloads.mariadb.com/MariaDB/$PACKAGE-$VERSION/source/$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 |
pascal@24453 | 24 # What is the latest version available today? |
pascal@24453 | 25 current_version() |
pascal@24453 | 26 { |
pascal@24453 | 27 wget -O - $WEB_SITE 2>/dev/null | \ |
pascal@24453 | 28 sed '/Latest M/!d;s|<a href|\n&|g' | sed '/rc/d;/rel=/!d;s|.*rel=||;s|\&.*||;q' |
pascal@24453 | 29 } |
pascal@24453 | 30 |
erjo@13054 | 31 # Rules to configure and make the package. |
erjo@13054 | 32 compile_rules() |
erjo@13054 | 33 { |
erjo@13054 | 34 |
erjo@13054 | 35 cd $src |
erjo@13054 | 36 cmake . -DCMAKE_INSTALL_PREFIX=/usr \ |
erjo@13054 | 37 -DINSTALL-DOCREADMEDIR=/usr/share/doc \ |
erjo@13054 | 38 -DINSTALL_MYSQLDATADIR=/var/lib/mysql \ |
erjo@13054 | 39 -DINSTALL_SYSCONFDIR=/etc \ |
erjo@13054 | 40 -DINSTALL_LIBDIR=lib/mysql \ |
erjo@13054 | 41 -DINSTALL_INFODIR=share/doc/mysql \ |
erjo@13054 | 42 -DINSTALL_MANDIR=share/man \ |
erjo@13054 | 43 -DINSTALL_PLUGINDIR=lib/mysql/plugin \ |
erjo@13054 | 44 -DINSTALL_SHAREDIR=share \ |
erjo@13054 | 45 -DINSTALL_MYSQLSHAREDIR=share/mysql \ |
pascal@15265 | 46 -DINSTALL_UNIX_ADDRDIR=/var/run/mysqld/mysqld.sock && |
erjo@13054 | 47 make $MAKEFLAGS && |
erjo@13054 | 48 make install |
erjo@13054 | 49 } |
erjo@13054 | 50 |
erjo@13054 | 51 # Rules to gen a SliTaz package suitable for Tazpkg. |
erjo@13054 | 52 genpkg_rules() |
erjo@13054 | 53 { |
erjo@13054 | 54 mkdir -p \ |
erjo@13054 | 55 $fs/usr/share \ |
erjo@13054 | 56 $fs/usr/lib/mysql/plugin \ |
erjo@13054 | 57 $fs/etc/mysql \ |
erjo@13054 | 58 $fs/etc/mysql.d \ |
erjo@14808 | 59 $fs/var/lib/mysql |
erjo@13054 | 60 |
erjo@13054 | 61 cp -a $install/usr/bin $fs/usr |
erjo@13054 | 62 cp -a $install/usr/scripts/* $fs/usr/bin |
erjo@13054 | 63 cp -a $install/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin |
erjo@13054 | 64 cp -a $install/usr/share/mysql $fs/usr/share |
erjo@13054 | 65 |
erjo@13054 | 66 # Configuration file |
erjo@13054 | 67 cp -a $stuff/etc/init.d $fs/etc |
erjo@13054 | 68 cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf |
erjo@13054 | 69 cp -a $src/support-files/my-small.cnf $fs/etc/mysql |
erjo@13054 | 70 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \ |
erjo@13054 | 71 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \ |
erjo@13054 | 72 $fs/etc/mysql/my.cnf |
erjo@13054 | 73 |
erjo@13054 | 74 # Permissions |
erjo@13054 | 75 chmod 600 $fs/etc/mysql/my.cnf |
erjo@13054 | 76 |
erjo@13054 | 77 cat $stuff/*.files-list | while read file; do |
erjo@13054 | 78 [ -f $fs$file ] && rm -f $fs$file |
erjo@13054 | 79 done |
erjo@13054 | 80 |
erjo@13054 | 81 } |
erjo@13054 | 82 |
erjo@13054 | 83 # Pre and post install commands for Tazpkg. |
erjo@13054 | 84 post_install() |
erjo@13054 | 85 { |
erjo@13054 | 86 |
erjo@13054 | 87 local user |
erjo@13054 | 88 local group |
erjo@13054 | 89 |
erjo@13054 | 90 user=mysql |
erjo@13054 | 91 group=mysql |
erjo@13054 | 92 |
pascal@18730 | 93 if ! grep -q $user "$1/etc/passwd"; then |
pascal@20319 | 94 echo |
erjo@13054 | 95 echo -n "Adding user/group $user..." |
pascal@18730 | 96 chroot "$1/" addgroup -S $group |
pascal@18730 | 97 chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user |
erjo@13054 | 98 status |
erjo@13054 | 99 fi |
erjo@13054 | 100 |
erjo@13054 | 101 cat <<EOF |
erjo@13054 | 102 ---- |
erjo@13054 | 103 To start $PACKAGE server you can run : |
erjo@13054 | 104 |
erjo@13054 | 105 /etc/init.d/$PACKAGE start |
erjo@13054 | 106 |
erjo@13054 | 107 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf |
erjo@13054 | 108 ---- |
erjo@13054 | 109 EOF |
erjo@13054 | 110 } |
erjo@13054 | 111 |
erjo@13054 | 112 pre_install() |
erjo@13054 | 113 { |
erjo@13054 | 114 # Cleanup old files |
pascal@18730 | 115 rm -f "$1/usr/libexec/mysql"* |
erjo@13054 | 116 # Mv config |
pascal@19766 | 117 [ -f "$1/etc/my.cnf" ] && |
pascal@19766 | 118 mv -f "$1/etc/my.cnf" "$1/etc/mysql/my.cnf" || true |
erjo@13054 | 119 } |
erjo@13054 | 120 |
erjo@13054 | 121 post_remove() |
erjo@13054 | 122 { |
erjo@13054 | 123 echo "Removing user/group mysl" |
erjo@13054 | 124 deluser mysql |
erjo@13054 | 125 } |