wok-current annotate mariadb/receipt @ rev 13064
mariadb: update bdeps
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jun 22 12:51:57 2012 +0200 (2012-06-22) |
parents | dd085711d6a2 |
children | e9130cce9043 |
rev | line source |
---|---|
erjo@13054 | 1 # SliTaz package receipt. |
erjo@13054 | 2 |
erjo@13054 | 3 PACKAGE="mariadb" |
erjo@13054 | 4 VERSION="5.5.24" |
erjo@13054 | 5 CATEGORY="office" |
erjo@13054 | 6 SHORT_DESC="SQL database system." |
erjo@13054 | 7 MAINTAINER="erjo@slitaz.org" |
erjo@13054 | 8 TARBALL="$PACKAGE-$VERSION.tar.gz" |
erjo@13054 | 9 WEB_SITE="http://mariadb.org/en/" |
erjo@13058 | 10 WGET_URL="http://pangolin.slitaz.org/downloads/sources/$TARBALL" |
erjo@13054 | 11 PROVIDE="mysql" |
erjo@13054 | 12 |
erjo@13054 | 13 CONFIG_FILES="/etc/mysql/my.cnf" |
erjo@13054 | 14 DATABASE_FILES="/var/lib/mysql" |
erjo@13054 | 15 CROSS="bug: can not run test programm" |
erjo@13054 | 16 |
erjo@13054 | 17 DEPENDS="busybox libmariadbclient mariadb-client zlib slitaz-base-files \ |
erjo@13054 | 18 gcc-lib-base" |
pascal@13064 | 19 BUILD_DEPENDS="cmake ncurses-dev" |
erjo@13054 | 20 |
erjo@13054 | 21 # Rules to configure and make the package. |
erjo@13054 | 22 compile_rules() |
erjo@13054 | 23 { |
erjo@13054 | 24 |
erjo@13054 | 25 cd $src |
erjo@13054 | 26 cmake . -DCMAKE_INSTALL_PREFIX=/usr \ |
erjo@13054 | 27 -DINSTALL-DOCREADMEDIR=/usr/share/doc \ |
erjo@13054 | 28 -DINSTALL_MYSQLDATADIR=/var/lib/mysql \ |
erjo@13054 | 29 -DINSTALL_SYSCONFDIR=/etc \ |
erjo@13054 | 30 -DINSTALL_LIBDIR=lib/mysql \ |
erjo@13054 | 31 -DINSTALL_INFODIR=share/doc/mysql \ |
erjo@13054 | 32 -DINSTALL_MANDIR=share/man \ |
erjo@13054 | 33 -DINSTALL_PLUGINDIR=lib/mysql/plugin \ |
erjo@13054 | 34 -DINSTALL_SHAREDIR=share \ |
erjo@13054 | 35 -DINSTALL_MYSQLSHAREDIR=share/mysql \ |
erjo@13054 | 36 -DINSTALL_UNIX_ADDRDIR=/var/run/mysqld/mysqld.sock |
erjo@13054 | 37 make $MAKEFLAGS && |
erjo@13054 | 38 make install |
erjo@13054 | 39 } |
erjo@13054 | 40 |
erjo@13054 | 41 # Rules to gen a SliTaz package suitable for Tazpkg. |
erjo@13054 | 42 genpkg_rules() |
erjo@13054 | 43 { |
erjo@13054 | 44 mkdir -p \ |
erjo@13054 | 45 $fs/usr/share \ |
erjo@13054 | 46 $fs/usr/lib/mysql/plugin \ |
erjo@13054 | 47 $fs/etc/mysql \ |
erjo@13054 | 48 $fs/etc/mysql.d \ |
erjo@13054 | 49 $fs/var/lib/mysql \ |
erjo@13054 | 50 $fs/var/run/mysqld |
erjo@13054 | 51 |
erjo@13054 | 52 cp -a $install/usr/bin $fs/usr |
erjo@13054 | 53 cp -a $install/usr/scripts/* $fs/usr/bin |
erjo@13054 | 54 cp -a $install/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin |
erjo@13054 | 55 cp -a $install/usr/share/mysql $fs/usr/share |
erjo@13054 | 56 |
erjo@13054 | 57 # Configuration file |
erjo@13054 | 58 cp -a $stuff/etc/init.d $fs/etc |
erjo@13054 | 59 cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf |
erjo@13054 | 60 cp -a $src/support-files/my-small.cnf $fs/etc/mysql |
erjo@13054 | 61 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \ |
erjo@13054 | 62 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \ |
erjo@13054 | 63 $fs/etc/mysql/my.cnf |
erjo@13054 | 64 |
erjo@13054 | 65 # Permissions |
erjo@13054 | 66 chmod 600 $fs/etc/mysql/my.cnf |
erjo@13054 | 67 |
erjo@13054 | 68 cat $stuff/*.files-list | while read file; do |
erjo@13054 | 69 [ -f $fs$file ] && rm -f $fs$file |
erjo@13054 | 70 done |
erjo@13054 | 71 |
erjo@13054 | 72 } |
erjo@13054 | 73 |
erjo@13054 | 74 # Pre and post install commands for Tazpkg. |
erjo@13054 | 75 post_install() |
erjo@13054 | 76 { |
erjo@13054 | 77 |
erjo@13054 | 78 local user |
erjo@13054 | 79 local group |
erjo@13054 | 80 |
erjo@13054 | 81 user=mysql |
erjo@13054 | 82 group=mysql |
erjo@13054 | 83 |
erjo@13054 | 84 if ! grep -q $user $1/etc/passwd; then |
erjo@13054 | 85 echo -n "Adding user/group $user..." |
erjo@13054 | 86 chroot $1/ addgroup -S $group |
erjo@13054 | 87 chroot $1/ adduser -s /bin/false -S -D -H -G $group $user |
erjo@13054 | 88 status |
erjo@13054 | 89 fi |
erjo@13054 | 90 |
erjo@13054 | 91 chroot $1/ chown -R ${user}.${group} /var/lib/mysql /var/run/mysqld |
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 } |