wok rev 13054

Add: mariadb
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Wed Jun 20 15:35:34 2012 +0200 (2012-06-20)
parents 855f42b596c0
children f32d3ba00836
files libmariadbclient/receipt mariadb-client/receipt mariadb-dev/receipt mariadb-test/receipt mariadb/receipt mariadb/stuff/etc/init.d/mysql mariadb/stuff/etc/logrotate.d/mysql mariadb/stuff/mariadb-client.files-list mariadb/stuff/mariadb-dev.files-list mariadb/stuff/mariadb-test.files-list
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libmariadbclient/receipt	Wed Jun 20 15:35:34 2012 +0200
     1.3 @@ -0,0 +1,24 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="libmariadbclient"
     1.7 +VERSION="5.5.24"
     1.8 +CATEGORY="misc"
     1.9 +SHORT_DESC="SQL database system client libraries."
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +WEB_SITE="http://mariadb.org/"
    1.12 +DEPENDS="zlib"
    1.13 +WANTED="mariadb"
    1.14 +
    1.15 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.16 +genpkg_rules()
    1.17 +{
    1.18 +	mkdir -p $fs/usr/lib/mysql
    1.19 +	cp -a $_pkg/usr/lib/mysql/libmysqlclient*so* $fs/usr/lib/mysql
    1.20 +	cd $fs/usr/lib
    1.21 +	ln -s mysql/libmysqlclient.so .
    1.22 +    ln -s mysql/libmysqlclient.so.16 .
    1.23 +	ln -s mysql/libmysqlclient.so.16.0.0 .
    1.24 +	ln -s mysql/libmysqlclient_r.so .
    1.25 +    ln -s mysql/libmysqlclient_r.so.16 .
    1.26 +	ln -s mysql/libmysqlclient_r.so.16.0.0 .
    1.27 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/mariadb-client/receipt	Wed Jun 20 15:35:34 2012 +0200
     2.3 @@ -0,0 +1,22 @@
     2.4 +# SliTaz package receipt.
     2.5 +
     2.6 +PACKAGE="mariadb-client"
     2.7 +VERSION="5.5.24"
     2.8 +CATEGORY="office"
     2.9 +SHORT_DESC="SQL database system client files."
    2.10 +MAINTAINER="erjo@slitaz.org"
    2.11 +WEB_SITE="http://mariadb.org/"
    2.12 +WANTED="mariadb"
    2.13 +DEPENDS="libmariadbclient zlib ncurses gcc-lib-base ncursesw"
    2.14 +PROVIDE="mysql_or_postgresql"
    2.15 +
    2.16 +
    2.17 +# Rules to gen a SliTaz package suitable for Tazpkg.
    2.18 +genpkg_rules()
    2.19 +{
    2.20 +	while read file; do
    2.21 +		dir=$(dirname $file)
    2.22 +		[ -d $fs$dir ] || mkdir -p $fs$dir
    2.23 +		cp -a $_pkg$file $fs$file
    2.24 +	done < $wanted_stuff/$PACKAGE.files-list
    2.25 +}
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/mariadb-dev/receipt	Wed Jun 20 15:35:34 2012 +0200
     3.3 @@ -0,0 +1,25 @@
     3.4 +# SliTaz package receipt.
     3.5 +
     3.6 +PACKAGE="mariadb-dev"
     3.7 +VERSION="5.5.24"
     3.8 +CATEGORY="development"
     3.9 +SHORT_DESC="SQL database system devel files."
    3.10 +MAINTAINER="erjo@slitaz.org"
    3.11 +DEPENDS="zlib"
    3.12 +WEB_SITE="http://mariadb.org/"
    3.13 +WANTED="mariadb"
    3.14 +
    3.15 +# Rules to gen a SliTaz package suitable for Tazpkg.
    3.16 +genpkg_rules()
    3.17 +{
    3.18 +	mkdir -p $fs/usr/lib/mysql/plugin $fs/usr/share
    3.19 +	cp -a $_pkg/usr/include $fs/usr
    3.20 +	cp -a $_pkg/usr/share/aclocal $fs/usr/share
    3.21 +	cp -a $_pkg/usr/lib/mysql/*.*a $fs/usr/lib/mysql
    3.22 +	cp -a $_pkg/usr/lib/mysql/plugin/*.*a $fs/usr/lib/mysql/plugin
    3.23 +	while read file; do
    3.24 +		dir=$(dirname $file)
    3.25 +		[ -d $fs$dir ] || mkdir -p $fs$dir
    3.26 +		cp -a $_pkg$file $fs$file
    3.27 +	done < $wanted_stuff/$PACKAGE.files-list
    3.28 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/mariadb-test/receipt	Wed Jun 20 15:35:34 2012 +0200
     4.3 @@ -0,0 +1,26 @@
     4.4 +# SliTaz package receipt.
     4.5 +
     4.6 +PACKAGE="mariadb-test"
     4.7 +VERSION="5.5.24"
     4.8 +CATEGORY="misc"
     4.9 +SHORT_DESC="SQL database system tests and benchs."
    4.10 +MAINTAINER="erjo@slitaz.org"
    4.11 +WEB_SITE="http://www.mysql.com/"
    4.12 +WANTED="mariadb"
    4.13 +DEPENDS="mariadb perl"
    4.14 +
    4.15 +# Rules to gen a SliTaz package suitable for Tazpkg.
    4.16 +genpkg_rules()
    4.17 +{
    4.18 +	mkdir -p $fs/usr/share
    4.19 +	cp -a $_pkg/usr/mysql-test $fs/usr
    4.20 +	cp -a $_pkg/usr/sql-bench $fs/usr
    4.21 +	find $fs/usr/mysql-test $fs/usr/sql-bench -type d -exec chmod 2777 {} \;
    4.22 +	while read file; do
    4.23 +		dir=$(dirname $file)
    4.24 +		[ -d $fs$dir ] || mkdir -p $fs$dir
    4.25 +		cp -a $_pkg$file $fs$file
    4.26 +	done < $wanted_stuff/$PACKAGE.files-list
    4.27 +	mv $fs/usr/mysql-test $fs/usr/share/mysql-test
    4.28 +	mv $fs/usr/sql-bench $fs/usr/share/sql-bench
    4.29 +}
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/mariadb/receipt	Wed Jun 20 15:35:34 2012 +0200
     5.3 @@ -0,0 +1,116 @@
     5.4 +# SliTaz package receipt.
     5.5 +
     5.6 +PACKAGE="mariadb"
     5.7 +VERSION="5.5.24"
     5.8 +CATEGORY="office"
     5.9 +SHORT_DESC="SQL database system."
    5.10 +MAINTAINER="erjo@slitaz.org"
    5.11 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    5.12 +WEB_SITE="http://mariadb.org/en/"
    5.13 +WGET_URL="http://mirrors.sunsite.dk/mysql/Downloads/MySQL-5.1/$TARBALL"
    5.14 +PROVIDE="mysql"
    5.15 +
    5.16 +CONFIG_FILES="/etc/mysql/my.cnf"
    5.17 +DATABASE_FILES="/var/lib/mysql"
    5.18 +CROSS="bug: can not run test programm"
    5.19 +
    5.20 +DEPENDS="busybox libmariadbclient mariadb-client zlib slitaz-base-files \
    5.21 +gcc-lib-base"
    5.22 +BUILD_DEPENDS="cmake"
    5.23 +
    5.24 +# Rules to configure and make the package.
    5.25 +compile_rules()
    5.26 +{
    5.27 +	
    5.28 +	cd $src
    5.29 +	cmake  . -DCMAKE_INSTALL_PREFIX=/usr \
    5.30 +	-DINSTALL-DOCREADMEDIR=/usr/share/doc \
    5.31 +	-DINSTALL_MYSQLDATADIR=/var/lib/mysql \
    5.32 +	-DINSTALL_SYSCONFDIR=/etc \
    5.33 +	-DINSTALL_LIBDIR=lib/mysql \
    5.34 +	-DINSTALL_INFODIR=share/doc/mysql \
    5.35 +	-DINSTALL_MANDIR=share/man \
    5.36 +	-DINSTALL_PLUGINDIR=lib/mysql/plugin \
    5.37 +	-DINSTALL_SHAREDIR=share \
    5.38 +	-DINSTALL_MYSQLSHAREDIR=share/mysql \
    5.39 +	-DINSTALL_UNIX_ADDRDIR=/var/run/mysqld/mysqld.sock 
    5.40 +	make $MAKEFLAGS &&
    5.41 +	make install 
    5.42 +}
    5.43 +
    5.44 +# Rules to gen a SliTaz package suitable for Tazpkg.
    5.45 +genpkg_rules()
    5.46 +{
    5.47 +	mkdir -p \
    5.48 +		$fs/usr/share \
    5.49 +		$fs/usr/lib/mysql/plugin \
    5.50 +		$fs/etc/mysql \
    5.51 +		$fs/etc/mysql.d \
    5.52 +		$fs/var/lib/mysql \
    5.53 +		$fs/var/run/mysqld
    5.54 +
    5.55 +	cp -a $install/usr/bin $fs/usr
    5.56 +	cp -a $install/usr/scripts/* $fs/usr/bin
    5.57 +	cp -a $install/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin
    5.58 +	cp -a $install/usr/share/mysql $fs/usr/share
    5.59 +
    5.60 +	# Configuration file
    5.61 +	cp -a $stuff/etc/init.d $fs/etc
    5.62 +	cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf
    5.63 +	cp -a $src/support-files/my-small.cnf $fs/etc/mysql
    5.64 +	grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \
    5.65 +		's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \
    5.66 +		$fs/etc/mysql/my.cnf
    5.67 +
    5.68 +	# Permissions
    5.69 +	chmod 600 $fs/etc/mysql/my.cnf
    5.70 +
    5.71 +	cat $stuff/*.files-list | while read file; do
    5.72 +		[ -f $fs$file ] && rm -f $fs$file
    5.73 +	done
    5.74 +
    5.75 +}
    5.76 +
    5.77 +# Pre and post install commands for Tazpkg.
    5.78 +post_install()
    5.79 +{
    5.80 +	
    5.81 +	local user
    5.82 +	local group
    5.83 +	
    5.84 +	user=mysql
    5.85 +	group=mysql
    5.86 +	
    5.87 +	if ! grep -q $user $1/etc/passwd; then
    5.88 +		echo -n "Adding user/group $user..."
    5.89 +		chroot $1/ addgroup -S $group
    5.90 +		chroot $1/ adduser -s /bin/false -S -D -H -G $group $user
    5.91 +		status
    5.92 +	fi
    5.93 +
    5.94 +	chroot $1/ chown -R ${user}.${group} /var/lib/mysql /var/run/mysqld
    5.95 +	
    5.96 +	cat <<EOF
    5.97 +----
    5.98 +To start $PACKAGE server you can run :
    5.99 +
   5.100 +    /etc/init.d/$PACKAGE start
   5.101 +
   5.102 +Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
   5.103 +----
   5.104 +EOF
   5.105 +}
   5.106 +
   5.107 +pre_install()
   5.108 +{
   5.109 +	# Cleanup old files
   5.110 +	rm -f $1/usr/libexec/mysql*
   5.111 +	# Mv config
   5.112 +	[ -f $1/etc/my.cnf ] && mv -f $1/etc/my.cnf $1/etc/mysql/my.cnf
   5.113 +}
   5.114 +
   5.115 +post_remove()
   5.116 +{
   5.117 +	echo "Removing user/group mysl"
   5.118 +	deluser mysql
   5.119 +}
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/mariadb/stuff/etc/init.d/mysql	Wed Jun 20 15:35:34 2012 +0200
     6.3 @@ -0,0 +1,70 @@
     6.4 +#!/bin/sh
     6.5 +# /etc/init.d/mysql : Start, stop and restart MySQL server on SliTaz, at 
     6.6 +# boot time or with the command line.
     6.7 +#
     6.8 +# To start MySQL server at boot time, just put mysql in the $RUN_DAEMONS
     6.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf
    6.10 +#
    6.11 +. /etc/init.d/rc.functions
    6.12 +. /etc/daemons.conf
    6.13 +
    6.14 +NAME=Mysql
    6.15 +DESC="MySQL server"
    6.16 +DAEMON=/usr/bin/mysqld_safe
    6.17 +OPTIONS=$MYSQL_OPTIONS
    6.18 +PIDFILE=/var/run/mysqld/mysql.pid
    6.19 +[ -n "$OPTIONS" ] || OPTIONS="--pid-file=$PIDFILE --datadir=/var/lib/mysql --user=mysql --socket=/var/run/mysqld/mysqld.sock"
    6.20 +
    6.21 +case "$1" in
    6.22 +  start)
    6.23 +    if active_pidfile $PIDFILE mysqld ; then
    6.24 +      echo "$NAME already running."
    6.25 +      exit 1
    6.26 +    fi
    6.27 +    if [ ! -d /var/lib/mysql/mysql ]; then
    6.28 +      echo "Initializing $DESC: "
    6.29 +      rm -rf /var/lib/mysql/* 2> /dev/null
    6.30 +      mysql_install_db --user=mysql --datadir=/var/lib/mysql
    6.31 +    fi
    6.32 +    echo -n "Starting $DESC: $NAME... "
    6.33 +    $DAEMON $OPTIONS  > /dev/null &
    6.34 +    status
    6.35 +    sleep 2
    6.36 +    for i in /etc/mysql.d/* ; do
    6.37 +    	[ -x $i ] || continue
    6.38 +	echo -n "Running $i..."
    6.39 +	$i
    6.40 +	status
    6.41 +    done
    6.42 +    ;;
    6.43 +  stop)
    6.44 +    if ! active_pidfile $PIDFILE mysqld ; then
    6.45 +      echo "$NAME is not running."
    6.46 +      exit 1
    6.47 +    fi
    6.48 +    echo -n "Stopping $DESC: $NAME... "
    6.49 +    kill `cat $PIDFILE`> /dev/null
    6.50 +    status
    6.51 +    sleep 2
    6.52 +    ;;
    6.53 +  restart)
    6.54 +    if ! active_pidfile $PIDFILE mysqld ; then
    6.55 +      echo "$NAME is not running."
    6.56 +      exit 1
    6.57 +    fi
    6.58 +    echo -n "Restarting $DESC: $NAME... "
    6.59 +    kill `cat $PIDFILE`
    6.60 +    sleep 2
    6.61 +    $DAEMON $OPTIONS &
    6.62 +    status
    6.63 +    sleep 2
    6.64 +    ;;
    6.65 +  *)
    6.66 +    echo ""
    6.67 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    6.68 +    echo ""
    6.69 +    exit 1
    6.70 +    ;;
    6.71 +esac
    6.72 +
    6.73 +exit 0
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/mariadb/stuff/etc/logrotate.d/mysql	Wed Jun 20 15:35:34 2012 +0200
     7.3 @@ -0,0 +1,36 @@
     7.4 +# This logname can be set in /etc/my.cnf
     7.5 +# by setting the variable "err-log"
     7.6 +# in the [safe_mysqld] section as follows:
     7.7 +#
     7.8 +# [safe_mysqld]
     7.9 +# err-log=/var/lib/mysql/mysqld.log
    7.10 +#
    7.11 +# If the root user has a password you have to create a
    7.12 +# /root/.my.cnf configuration file with the following
    7.13 +# content:
    7.14 +#
    7.15 +# [mysqladmin]
    7.16 +# password = <secret> 
    7.17 +# user= root
    7.18 +#
    7.19 +# where "<secret>" is the password. 
    7.20 +#
    7.21 +# ATTENTION: This /root/.my.cnf should be readable ONLY
    7.22 +# for root !
    7.23 +
    7.24 +/var/lib/mysql/mysqld.log {
    7.25 +        # create 600 mysql mysql
    7.26 +        notifempty
    7.27 +	daily
    7.28 +        rotate 3
    7.29 +        missingok
    7.30 +        compress
    7.31 +    postrotate
    7.32 +	# just if mysqld is really running
    7.33 +	if test -x /usr/bin/mysqladmin && \
    7.34 +	   /usr/bin/mysqladmin ping &>/dev/null
    7.35 +	then
    7.36 +	   /usr/bin/mysqladmin flush-logs
    7.37 +	fi
    7.38 +    endscript
    7.39 +}
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/mariadb/stuff/mariadb-client.files-list	Wed Jun 20 15:35:34 2012 +0200
     8.3 @@ -0,0 +1,11 @@
     8.4 +/usr/bin/msql2mysql
     8.5 +/usr/bin/mysql
     8.6 +/usr/bin/mysql_find_rows
     8.7 +/usr/bin/mysql_waitpid
     8.8 +/usr/bin/mysqlaccess
     8.9 +/usr/bin/mysqladmin
    8.10 +/usr/bin/mysqlbinlog
    8.11 +/usr/bin/mysqlcheck
    8.12 +/usr/bin/mysqldump
    8.13 +/usr/bin/mysqlimport
    8.14 +/usr/bin/mysqlshow
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/mariadb/stuff/mariadb-dev.files-list	Wed Jun 20 15:35:34 2012 +0200
     9.3 @@ -0,0 +1,1 @@
     9.4 +/usr/bin/mysql_config
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/mariadb/stuff/mariadb-test.files-list	Wed Jun 20 15:35:34 2012 +0200
    10.3 @@ -0,0 +1,2 @@
    10.4 +/usr/bin/mysql_client_test
    10.5 +/usr/bin/mysqltest