wok-backports rev 29

Add: mariadb
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Mon Jun 02 00:29:22 2014 +0200 (2014-06-02)
parents bbe208efc3ed
children dad7a1eb3b3d
files 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/mariadb-client/receipt	Mon Jun 02 00:29:22 2014 +0200
     1.3 @@ -0,0 +1,23 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="mariadb-client"
     1.7 +VERSION="10.0.11"
     1.8 +CATEGORY="office"
     1.9 +SHORT_DESC="SQL database system client files."
    1.10 +MAINTAINER="erjo@slitaz.org"
    1.11 +LICENSE="GPL2"
    1.12 +WEB_SITE="http://mariadb.org/"
    1.13 +WANTED="mariadb"
    1.14 +DEPENDS="libmariadbclient zlib ncurses gcc-lib-base ncursesw"
    1.15 +PROVIDE="mysql_or_postgresql mysql-client"
    1.16 +
    1.17 +
    1.18 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.19 +genpkg_rules()
    1.20 +{
    1.21 +	while read file; do
    1.22 +		dir=$(dirname $file)
    1.23 +		[ -d $fs$dir ] || mkdir -p $fs$dir
    1.24 +		cp -a $install$file $fs$file
    1.25 +	done < $wanted_stuff/$PACKAGE.files-list
    1.26 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/mariadb-dev/receipt	Mon Jun 02 00:29:22 2014 +0200
     2.3 @@ -0,0 +1,28 @@
     2.4 +# SliTaz package receipt.
     2.5 +
     2.6 +PACKAGE="mariadb-dev"
     2.7 +VERSION="10.0.11"
     2.8 +CATEGORY="development"
     2.9 +SHORT_DESC="SQL database system devel files."
    2.10 +MAINTAINER="erjo@slitaz.org"
    2.11 +LICENSE="GPL2"
    2.12 +WEB_SITE="http://mariadb.org/"
    2.13 +WANTED="mariadb"
    2.14 +PROVIDE="mysql-dev"
    2.15 +
    2.16 +DEPENDS="zlib"
    2.17 +
    2.18 +# Rules to gen a SliTaz package suitable for Tazpkg.
    2.19 +genpkg_rules()
    2.20 +{
    2.21 +	mkdir -p $fs/usr/lib/mysql/plugin $fs/usr/share
    2.22 +	cp -a $install/usr/include $fs/usr
    2.23 +	cp -a $install/usr/share/aclocal $fs/usr/share
    2.24 +	cp -a $install/usr/lib/mysql/*.*a $fs/usr/lib/mysql
    2.25 +	#~ cp -a $install/usr/lib/mysql/plugin/*.*a $fs/usr/lib/mysql/plugin
    2.26 +	while read file; do
    2.27 +		dir=$(dirname $file)
    2.28 +		[ -d $fs$dir ] || mkdir -p $fs$dir
    2.29 +		cp -a $install$file $fs$file
    2.30 +	done < $wanted_stuff/$PACKAGE.files-list
    2.31 +}
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/mariadb-test/receipt	Mon Jun 02 00:29:22 2014 +0200
     3.3 @@ -0,0 +1,28 @@
     3.4 +# SliTaz package receipt.
     3.5 +
     3.6 +PACKAGE="mariadb-test"
     3.7 +VERSION="10.0.11"
     3.8 +CATEGORY="misc"
     3.9 +SHORT_DESC="SQL database system tests and benchs."
    3.10 +MAINTAINER="erjo@slitaz.org"
    3.11 +LICENSE="GPL2"
    3.12 +WEB_SITE="http://www.mysql.com/"
    3.13 +WANTED="mariadb"
    3.14 +
    3.15 +DEPENDS="mariadb perl"
    3.16 +
    3.17 +# Rules to gen a SliTaz package suitable for Tazpkg.
    3.18 +genpkg_rules()
    3.19 +{
    3.20 +	mkdir -p $fs/usr/share
    3.21 +	cp -a $install/usr/mysql-test $fs/usr
    3.22 +	cp -a $install/usr/sql-bench $fs/usr
    3.23 +	find $fs/usr/mysql-test $fs/usr/sql-bench -type d -exec chmod 2777 {} \;
    3.24 +	while read file; do
    3.25 +		dir=$(dirname $file)
    3.26 +		[ -d $fs$dir ] || mkdir -p $fs$dir
    3.27 +		cp -a $install$file $fs$file
    3.28 +	done < $wanted_stuff/$PACKAGE.files-list
    3.29 +	mv $fs/usr/mysql-test $fs/usr/share/mysql-test
    3.30 +	mv $fs/usr/sql-bench $fs/usr/share/sql-bench
    3.31 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/mariadb/receipt	Mon Jun 02 00:29:22 2014 +0200
     4.3 @@ -0,0 +1,119 @@
     4.4 +# SliTaz package receipt.
     4.5 +
     4.6 +PACKAGE="mariadb"
     4.7 +VERSION="10.0.11"
     4.8 +CATEGORY="office"
     4.9 +SHORT_DESC="SQL database system."
    4.10 +MAINTAINER="erjo@slitaz.org"
    4.11 +LICENSE="GPL2"
    4.12 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    4.13 +WEB_SITE="http://mariadb.org/en/"
    4.14 +WGET_URL="http://ftp.igh.cnrs.fr/pub/mariadb/mariadb-10.0.11/source/$TARBALL"
    4.15 +CONFIG_FILES="/etc/mysql"
    4.16 +TAZPANEL_DAEMON="man|edit::/etc/mysql/my.cnf|options|web::$WEB_SITE"
    4.17 +PROVIDE="mysql"
    4.18 +
    4.19 +CONFIG_FILES="/etc/mysql/my.cnf"
    4.20 +DATABASE_FILES="/var/lib/mysql"
    4.21 +CROSS="bug: can not run test programm"
    4.22 +
    4.23 +DEPENDS="busybox libmariadbclient mariadb-client zlib slitaz-base-files \
    4.24 +gcc-lib-base"
    4.25 +BUILD_DEPENDS="cmake ncurses-dev openssl-dev"
    4.26 +
    4.27 +# Rules to configure and make the package.
    4.28 +compile_rules()
    4.29 +{
    4.30 +	
    4.31 +	cd $src
    4.32 +	cmake  . -DCMAKE_INSTALL_PREFIX=/usr \
    4.33 +	-DINSTALL-DOCREADMEDIR=/usr/share/doc \
    4.34 +	-DINSTALL_MYSQLDATADIR=/var/lib/mysql \
    4.35 +	-DINSTALL_SYSCONFDIR=/etc \
    4.36 +	-DINSTALL_LIBDIR=lib/mysql \
    4.37 +	-DINSTALL_INFODIR=share/doc/mysql \
    4.38 +	-DINSTALL_MANDIR=share/man \
    4.39 +	-DINSTALL_PLUGINDIR=lib/mysql/plugin \
    4.40 +	-DINSTALL_SHAREDIR=share \
    4.41 +	-DINSTALL_MYSQLSHAREDIR=share/mysql \
    4.42 +	-DINSTALL_UNIX_ADDRDIR=/var/run/mysqld/mysqld.sock &&
    4.43 +	make $MAKEFLAGS &&
    4.44 +	make install 
    4.45 +}
    4.46 +
    4.47 +# Rules to gen a SliTaz package suitable for Tazpkg.
    4.48 +genpkg_rules()
    4.49 +{
    4.50 +	mkdir -p \
    4.51 +		$fs/usr/share \
    4.52 +		$fs/usr/lib/mysql/plugin \
    4.53 +		$fs/etc/mysql \
    4.54 +		$fs/etc/mysql.d \
    4.55 +		$fs/var/lib/mysql 
    4.56 +
    4.57 +	cp -a $install/usr/bin $fs/usr
    4.58 +	cp -a $install/usr/scripts/* $fs/usr/bin
    4.59 +	cp -a $install/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin
    4.60 +	cp -a $install/usr/share/mysql $fs/usr/share
    4.61 +
    4.62 +	# Configuration file
    4.63 +	cp -a $stuff/etc/init.d $fs/etc
    4.64 +	cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf
    4.65 +	cp -a $src/support-files/my-small.cnf $fs/etc/mysql
    4.66 +	grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \
    4.67 +		's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \
    4.68 +		$fs/etc/mysql/my.cnf
    4.69 +
    4.70 +	# Permissions
    4.71 +	chmod 600 $fs/etc/mysql/my.cnf
    4.72 +
    4.73 +	cat $stuff/*.files-list | while read file; do
    4.74 +		[ -f $fs$file ] && rm -f $fs$file
    4.75 +	done
    4.76 +
    4.77 +}
    4.78 +
    4.79 +# Pre and post install commands for Tazpkg.
    4.80 +post_install()
    4.81 +{
    4.82 +	
    4.83 +	local user
    4.84 +	local group
    4.85 +	
    4.86 +	user=mysql
    4.87 +	group=mysql
    4.88 +	
    4.89 +	if ! grep -q $user $1/etc/passwd; then
    4.90 +		echo -n "Adding user/group $user..."
    4.91 +		chroot $1/ addgroup -S $group
    4.92 +		chroot $1/ adduser -s /bin/false -S -D -H -G $group $user
    4.93 +		status
    4.94 +	fi
    4.95 +
    4.96 +	mkdir -p $1/var/run/mysqld
    4.97 +	chroot $1/ chown -R ${user}.${group} /var/lib/mysql /var/run/mysqld
    4.98 +	
    4.99 +	cat <<EOF
   4.100 +----
   4.101 +To start $PACKAGE server you can run :
   4.102 +
   4.103 +    /etc/init.d/$PACKAGE start
   4.104 +
   4.105 +Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
   4.106 +----
   4.107 +EOF
   4.108 +}
   4.109 +
   4.110 +pre_install()
   4.111 +{
   4.112 +	# Cleanup old files
   4.113 +	rm -f $1/usr/libexec/mysql*
   4.114 +	# Mv config
   4.115 +	[ -f $1/etc/my.cnf ] && mv -f $1/etc/my.cnf $1/etc/mysql/my.cnf
   4.116 +}
   4.117 +
   4.118 +post_remove()
   4.119 +{
   4.120 +	echo "Removing user/group mysl"
   4.121 +	deluser mysql
   4.122 +}
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/mariadb/stuff/etc/init.d/mysql	Mon Jun 02 00:29:22 2014 +0200
     5.3 @@ -0,0 +1,70 @@
     5.4 +#!/bin/sh
     5.5 +# /etc/init.d/mysql : Start, stop and restart MySQL server on SliTaz, at 
     5.6 +# boot time or with the command line.
     5.7 +#
     5.8 +# To start MySQL server at boot time, just put mysql in the $RUN_DAEMONS
     5.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf
    5.10 +#
    5.11 +. /etc/init.d/rc.functions
    5.12 +. /etc/daemons.conf
    5.13 +
    5.14 +NAME=Mysql
    5.15 +DESC="MySQL server"
    5.16 +DAEMON=/usr/bin/mysqld_safe
    5.17 +OPTIONS=$MYSQL_OPTIONS
    5.18 +PIDFILE=/var/run/mysqld/mysql.pid
    5.19 +[ -n "$OPTIONS" ] || OPTIONS="--pid-file=$PIDFILE --datadir=/var/lib/mysql --user=mysql --socket=/var/run/mysqld/mysqld.sock"
    5.20 +
    5.21 +case "$1" in
    5.22 +  start)
    5.23 +    if active_pidfile $PIDFILE mysqld ; then
    5.24 +      echo "$NAME already running."
    5.25 +      exit 1
    5.26 +    fi
    5.27 +    if [ ! -d /var/lib/mysql/mysql ]; then
    5.28 +      echo "Initializing $DESC: "
    5.29 +      rm -rf /var/lib/mysql/* 2> /dev/null
    5.30 +      mysql_install_db --user=mysql --datadir=/var/lib/mysql
    5.31 +    fi
    5.32 +    echo -n "Starting $DESC: $NAME... "
    5.33 +    $DAEMON $OPTIONS  > /dev/null &
    5.34 +    status
    5.35 +    sleep 2
    5.36 +    for i in /etc/mysql.d/* ; do
    5.37 +    	[ -x $i ] || continue
    5.38 +	echo -n "Running $i..."
    5.39 +	$i
    5.40 +	status
    5.41 +    done
    5.42 +    ;;
    5.43 +  stop)
    5.44 +    if ! active_pidfile $PIDFILE mysqld ; then
    5.45 +      echo "$NAME is not running."
    5.46 +      exit 1
    5.47 +    fi
    5.48 +    echo -n "Stopping $DESC: $NAME... "
    5.49 +    kill `cat $PIDFILE`> /dev/null
    5.50 +    status
    5.51 +    sleep 2
    5.52 +    ;;
    5.53 +  restart)
    5.54 +    if ! active_pidfile $PIDFILE mysqld ; then
    5.55 +      echo "$NAME is not running."
    5.56 +      exit 1
    5.57 +    fi
    5.58 +    echo -n "Restarting $DESC: $NAME... "
    5.59 +    kill `cat $PIDFILE`
    5.60 +    sleep 2
    5.61 +    $DAEMON $OPTIONS &
    5.62 +    status
    5.63 +    sleep 2
    5.64 +    ;;
    5.65 +  *)
    5.66 +    echo ""
    5.67 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    5.68 +    echo ""
    5.69 +    exit 1
    5.70 +    ;;
    5.71 +esac
    5.72 +
    5.73 +exit 0
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/mariadb/stuff/etc/logrotate.d/mysql	Mon Jun 02 00:29:22 2014 +0200
     6.3 @@ -0,0 +1,36 @@
     6.4 +# This logname can be set in /etc/my.cnf
     6.5 +# by setting the variable "err-log"
     6.6 +# in the [safe_mysqld] section as follows:
     6.7 +#
     6.8 +# [safe_mysqld]
     6.9 +# err-log=/var/lib/mysql/mysqld.log
    6.10 +#
    6.11 +# If the root user has a password you have to create a
    6.12 +# /root/.my.cnf configuration file with the following
    6.13 +# content:
    6.14 +#
    6.15 +# [mysqladmin]
    6.16 +# password = <secret> 
    6.17 +# user= root
    6.18 +#
    6.19 +# where "<secret>" is the password. 
    6.20 +#
    6.21 +# ATTENTION: This /root/.my.cnf should be readable ONLY
    6.22 +# for root !
    6.23 +
    6.24 +/var/lib/mysql/mysqld.log {
    6.25 +        # create 600 mysql mysql
    6.26 +        notifempty
    6.27 +	daily
    6.28 +        rotate 3
    6.29 +        missingok
    6.30 +        compress
    6.31 +    postrotate
    6.32 +	# just if mysqld is really running
    6.33 +	if test -x /usr/bin/mysqladmin && \
    6.34 +	   /usr/bin/mysqladmin ping &>/dev/null
    6.35 +	then
    6.36 +	   /usr/bin/mysqladmin flush-logs
    6.37 +	fi
    6.38 +    endscript
    6.39 +}
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/mariadb/stuff/mariadb-client.files-list	Mon Jun 02 00:29:22 2014 +0200
     7.3 @@ -0,0 +1,11 @@
     7.4 +/usr/bin/msql2mysql
     7.5 +/usr/bin/mysql
     7.6 +/usr/bin/mysql_find_rows
     7.7 +/usr/bin/mysql_waitpid
     7.8 +/usr/bin/mysqlaccess
     7.9 +/usr/bin/mysqladmin
    7.10 +/usr/bin/mysqlbinlog
    7.11 +/usr/bin/mysqlcheck
    7.12 +/usr/bin/mysqldump
    7.13 +/usr/bin/mysqlimport
    7.14 +/usr/bin/mysqlshow
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/mariadb/stuff/mariadb-dev.files-list	Mon Jun 02 00:29:22 2014 +0200
     8.3 @@ -0,0 +1,1 @@
     8.4 +/usr/bin/mysql_config
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/mariadb/stuff/mariadb-test.files-list	Mon Jun 02 00:29:22 2014 +0200
     9.3 @@ -0,0 +1,2 @@
     9.4 +/usr/bin/mysql_client_test
     9.5 +/usr/bin/mysqltest