wok-next annotate mariadb/receipt @ rev 20833
prosody: what I see missing when I start the old prosody 0.9.4
author | Erkan Yilmaz <erkan@slitaz.org> |
---|---|
date | Sun Jun 17 19:03:23 2018 +0000 (2018-06-17) |
parents | bca48f3b8bb3 |
children | d5aab818505e |
rev | line source |
---|---|
pascal@20137 | 1 # SliTaz package receipt v2. |
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" |
erjo@13054 | 12 |
pascal@16735 | 13 BUILD_DEPENDS="cmake ncurses-dev bison openssl-dev" |
pascal@20137 | 14 SPLIT="mariadb libmariadbclient mariadb-client mariadb-dev mariadb-test" |
erjo@13054 | 15 |
erjo@13054 | 16 # Rules to configure and make the package. |
erjo@13054 | 17 compile_rules() |
erjo@13054 | 18 { |
erjo@13054 | 19 |
erjo@13054 | 20 cd $src |
erjo@13054 | 21 cmake . -DCMAKE_INSTALL_PREFIX=/usr \ |
erjo@13054 | 22 -DINSTALL-DOCREADMEDIR=/usr/share/doc \ |
erjo@13054 | 23 -DINSTALL_MYSQLDATADIR=/var/lib/mysql \ |
erjo@13054 | 24 -DINSTALL_SYSCONFDIR=/etc \ |
erjo@13054 | 25 -DINSTALL_LIBDIR=lib/mysql \ |
erjo@13054 | 26 -DINSTALL_INFODIR=share/doc/mysql \ |
erjo@13054 | 27 -DINSTALL_MANDIR=share/man \ |
erjo@13054 | 28 -DINSTALL_PLUGINDIR=lib/mysql/plugin \ |
erjo@13054 | 29 -DINSTALL_SHAREDIR=share \ |
erjo@13054 | 30 -DINSTALL_MYSQLSHAREDIR=share/mysql \ |
pascal@15265 | 31 -DINSTALL_UNIX_ADDRDIR=/var/run/mysqld/mysqld.sock && |
erjo@13054 | 32 make $MAKEFLAGS && |
erjo@13054 | 33 make install |
erjo@13054 | 34 } |
erjo@13054 | 35 |
erjo@13054 | 36 # Rules to gen a SliTaz package suitable for Tazpkg. |
erjo@13054 | 37 genpkg_rules() |
erjo@13054 | 38 { |
pascal@20137 | 39 case $PACKAGE in |
pascal@20137 | 40 mariadb) |
pascal@20137 | 41 CONFIG_FILES="/etc/mysql" |
pascal@20137 | 42 TAZPANEL_DAEMON="man|edit::/etc/mysql/my.cnf|options|web::$WEB_SITE" |
pascal@20137 | 43 PROVIDE="mysql" |
pascal@20137 | 44 CONFIG_FILES="/etc/mysql/my.cnf" |
pascal@20137 | 45 DATABASE_FILES="/var/lib/mysql" |
pascal@20137 | 46 CROSS="bug: can not run test programm" |
pascal@20137 | 47 DEPENDS="busybox libmariadbclient mariadb-client zlib \ |
pascal@20137 | 48 slitaz-base-files gcc-lib-base" |
pascal@20137 | 49 mkdir -p \ |
pascal@20137 | 50 $fs/usr/share \ |
pascal@20137 | 51 $fs/usr/lib/mysql/plugin \ |
pascal@20137 | 52 $fs/etc/mysql \ |
pascal@20137 | 53 $fs/etc/mysql.d \ |
pascal@20137 | 54 $fs/var/lib/mysql |
erjo@13054 | 55 |
pascal@20137 | 56 cp -a $install/usr/bin $fs/usr |
pascal@20137 | 57 cp -a $install/usr/scripts/* $fs/usr/bin |
pascal@20137 | 58 cp -a $install/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin |
pascal@20137 | 59 cp -a $install/usr/share/mysql $fs/usr/share |
erjo@13054 | 60 |
pascal@20137 | 61 # Configuration file |
pascal@20137 | 62 cp -a $stuff/etc/init.d $fs/etc |
pascal@20137 | 63 cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf |
pascal@20137 | 64 cp -a $src/support-files/my-small.cnf $fs/etc/mysql |
pascal@20137 | 65 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \ |
pascal@20137 | 66 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \ |
pascal@20137 | 67 $fs/etc/mysql/my.cnf |
erjo@13054 | 68 |
pascal@20137 | 69 # Permissions |
pascal@20137 | 70 chmod 600 $fs/etc/mysql/my.cnf |
erjo@13054 | 71 |
pascal@20137 | 72 cat $stuff/*.files-list | while read file; do |
pascal@20137 | 73 [ -f $fs$file ] && rm -f $fs$file |
pascal@20137 | 74 done |
pascal@20137 | 75 ;; |
pascal@20137 | 76 libmariadbclient) |
pascal@20137 | 77 CAT="misc|SQL database system client libraries." |
pascal@20137 | 78 PROVIDE="libmysqlclient" |
al@20453 | 79 DEPENDS="zlib openssl" |
pascal@20137 | 80 mkdir -p $fs/usr/lib/mysql |
pascal@20137 | 81 cp -a $install/usr/lib/mysql/libmysqlclient*so* $fs/usr/lib/mysql |
pascal@20137 | 82 cd $fs/usr/lib |
pascal@20137 | 83 ln -s mysql/libmysqlclient.so . |
pascal@20137 | 84 ln -s mysql/libmysqlclient.so.18 . |
pascal@20137 | 85 ln -s mysql/libmysqlclient.so.18.0.0 . |
pascal@20137 | 86 ln -s mysql/libmysqlclient_r.so . |
pascal@20137 | 87 ln -s mysql/libmysqlclient_r.so.18 . |
pascal@20137 | 88 ln -s mysql/libmysqlclient_r.so.18.0.0 . |
pascal@20137 | 89 ;; |
pascal@20137 | 90 mariadb-client) |
pascal@20137 | 91 CAT="office|SQL database system client files." |
pascal@20137 | 92 PROVIDE="mysql_or_postgresql mysql-client" |
pascal@20137 | 93 DEPENDS="libmariadbclient zlib ncurses gcc-lib-base ncurses" |
pascal@20137 | 94 while read file; do |
pascal@20137 | 95 dir=$(dirname $file) |
pascal@20137 | 96 [ -d $fs$dir ] || mkdir -p $fs$dir |
pascal@20137 | 97 cp -a $install$file $fs$file |
pascal@20137 | 98 done < $wanted_stuff/$PACKAGE.files-list |
pascal@20137 | 99 ;; |
pascal@20137 | 100 mariadb-dev) |
pascal@20137 | 101 CAT="development|SQL database system devel files." |
pascal@20137 | 102 PROVIDE="mysql-dev" |
pascal@20137 | 103 DEPENDS="zlib" |
pascal@20137 | 104 mkdir -p $fs/usr/lib/mysql/plugin $fs/usr/share |
pascal@20137 | 105 cp -a $install/usr/include $fs/usr |
pascal@20137 | 106 cp -a $install/usr/share/aclocal $fs/usr/share |
pascal@20137 | 107 cp -a $install/usr/lib/mysql/*.*a $fs/usr/lib/mysql |
pascal@20137 | 108 #~ cp -a $install/usr/lib/mysql/plugin/*.*a $fs/usr/lib/mysql/plugin |
pascal@20137 | 109 while read file; do |
pascal@20137 | 110 dir=$(dirname $file) |
pascal@20137 | 111 [ -d $fs$dir ] || mkdir -p $fs$dir |
pascal@20137 | 112 cp -a $install$file $fs$file |
pascal@20137 | 113 done < $wanted_stuff/$PACKAGE.files-list |
pascal@20137 | 114 ;; |
pascal@20137 | 115 mariadb-test) |
pascal@20137 | 116 CAT="misc|SQL database system tests and benchs." |
al@20453 | 117 DEPENDS="mariadb perl openssl" |
pascal@20137 | 118 mkdir -p $fs/usr/share |
pascal@20137 | 119 cp -a $install/usr/mysql-test $fs/usr |
pascal@20137 | 120 cp -a $install/usr/sql-bench $fs/usr |
pascal@20137 | 121 find $fs/usr/mysql-test $fs/usr/sql-bench -type d -exec chmod 2777 {} \; |
pascal@20137 | 122 while read file; do |
pascal@20137 | 123 dir=$(dirname $file) |
pascal@20137 | 124 [ -d $fs$dir ] || mkdir -p $fs$dir |
pascal@20137 | 125 cp -a $install$file $fs$file |
pascal@20137 | 126 done < $wanted_stuff/$PACKAGE.files-list |
pascal@20137 | 127 mv $fs/usr/mysql-test $fs/usr/share/mysql-test |
pascal@20137 | 128 mv $fs/usr/sql-bench $fs/usr/share/sql-bench |
pascal@20137 | 129 ;; |
pascal@20137 | 130 esac |
erjo@13054 | 131 } |
erjo@13054 | 132 |
erjo@13054 | 133 # Pre and post install commands for Tazpkg. |
pascal@20137 | 134 post_install_mariadb() |
erjo@13054 | 135 { |
erjo@13054 | 136 |
erjo@13054 | 137 local user |
erjo@13054 | 138 local group |
erjo@13054 | 139 |
erjo@13054 | 140 user=mysql |
erjo@13054 | 141 group=mysql |
erjo@13054 | 142 |
pascal@18730 | 143 if ! grep -q $user "$1/etc/passwd"; then |
erjo@13054 | 144 echo -n "Adding user/group $user..." |
pascal@18730 | 145 chroot "$1/" addgroup -S $group |
pascal@18730 | 146 chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user |
erjo@13054 | 147 status |
erjo@13054 | 148 fi |
erjo@13054 | 149 |
erjo@13054 | 150 cat <<EOF |
erjo@13054 | 151 ---- |
erjo@13054 | 152 To start $PACKAGE server you can run : |
erjo@13054 | 153 |
erjo@13054 | 154 /etc/init.d/$PACKAGE start |
erjo@13054 | 155 |
erjo@13054 | 156 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf |
erjo@13054 | 157 ---- |
erjo@13054 | 158 EOF |
erjo@13054 | 159 } |
erjo@13054 | 160 |
pascal@20137 | 161 pre_install_mariadb() |
erjo@13054 | 162 { |
erjo@13054 | 163 # Cleanup old files |
pascal@18730 | 164 rm -f "$1/usr/libexec/mysql"* |
erjo@13054 | 165 # Mv config |
pascal@18730 | 166 [ -f "$1/etc/my.cnf" ] && mv -f "$1/etc/my.cnf" "$1/etc/mysql/my.cnf" |
erjo@13054 | 167 } |
erjo@13054 | 168 |
pascal@20137 | 169 post_remove_mariadb() |
erjo@13054 | 170 { |
pascal@20137 | 171 echo "Removing user/group mysql" |
erjo@13054 | 172 deluser mysql |
erjo@13054 | 173 } |