Subject: [alpine-devel] new aport MySQL

From: "Carlo Landmeter" <[email-masked]>
Date: Thu, 22 Jan 2009 13:27:52 +0000

Hi list,

I created a new aport for MySQL.
Natanael, could you please check my poor apkbuild skills :)

carlo

From de669d0c6a0126b7d803ba40023e239e36ed03c1 Mon Sep 17 00:00:00 2001
From: Carlo Landmeter <[email-masked]>
Date: Thu, 22 Jan 2009 13:24:29 +0000
Subject: [PATCH] testing/mysql new aport mysql

---
 testing/mysql/APKBUILD    |   41 +++++++++++++++++++++++++++++++++++++
 testing/mysql/mysql.initd |   38 ++++++++++++++++++++++++++++++++++
 testing/mysql/mysql.mycnf |   49 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 128 insertions(+), 0 deletions(-)
 create mode 100644 testing/mysql/APKBUILD
 create mode 100644 testing/mysql/mysql.initd
 create mode 100644 testing/mysql/mysql.mycnf

diff --git a/testing/mysql/APKBUILD b/testing/mysql/APKBUILD
new file mode 100644
index 0000000..7787c41
--- /dev/null
+++ b/testing/mysql/APKBUILD
@@ -0,0 +1,41 @@
+# Contributor: Carlo Landmeter <[email-masked]>
+pkgname=mysql
+pkgver=5.0.75
+pkgrel=0
+pkgdesc="A fast SQL database server"
+url="http://www.mysql.com/"
+license='GPL'
+depends="g++ readline"
+makedepends="libtool g++ readline-dev"
+source="http://sunsite.informatik.rwth-aachen.de/mysql/Downloads/MySQL-5.0/${pkgname}-${pkgver}.tar.gz
+$pkgname.initd
+$pkgname.mycnf"
+subpackages="$pkgname-doc $pkgname-dev $pkgname-test"
+
+build() {
+        cd "$srcdir/$pkgname-$pkgver"
+        ./configure --prefix=/usr --libexecdir=/usr/sbin \
+        --localstatedir=/var/lib/mysql \
+        --disable-assembler --with-pthread \
+        --without-raid --without-libwrap \
+        --without-pstack --without-docs \
+        --without-embedded-server --without-openssl \
+        --without-mysqlfs --without-vio \
+        --without-bench --without-debug \
+        --with-innodb --mandir=/usr/share/man || return 1
+        make || return 1
+        make DESTDIR="$pkgdir/" install
+        install -Dm 755 "$startdir"/$pkgname.initd $pkgdir/etc/init.d/$pkgname
+        install -Dm 644 "$startdir"/$pkgname.mycnf $pkgdir/etc/mysql/my.cnf
+        install -dDo mysql $pkgdir/var/log/mysql
+        install -dDo mysql $pkgdir/var/run/mysqld
+}
+
+test() {
+        mkdir -p "$subpkgdir"/usr
+        mv "$pkgdir"/usr/mysql-test "$subpkgdir"/usr/
+}
+
+md5sums="a234f0a60a7f8c290d9875cba3a2c5a2  mysql-5.0.75.tar.gz
+3ce9827b22d8fbbb29d83a91cbe98ffc  mysql.initd
+ca0e193da25d2f10e41334c6d83fa859  mysql.mycnf"
diff --git a/testing/mysql/mysql.initd b/testing/mysql/mysql.initd
new file mode 100644
index 0000000..8f84164
--- /dev/null
+++ b/testing/mysql/mysql.initd
@@ -0,0 +1,38 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/dev-db/mysql/files/mysql.init,v 1.7 2004/07/14 21:41:15 agriffis Exp $
+
+depend() {
+  need net
+  use dns
+}
+
+checkconfig() {
+  if [ ! -f /etc/mysql/my.cnf ] ; then
+    eerror "No /etc/mysql/my.cnf file exists!"
+  fi
+
+    dir=`my_print_defaults -c /etc/mysql/my.cnf mysqld | grep -- --datadir | sed -e "s|^.*=\(.*\)|\1|"`
+
+  if [ ! -d $dir/mysql ] ; then
+    eerror "You dont appear to have the mysql database installed yet."
+    eerror "Please run /usr/bin/mysql_install_db --user=mysql to have this done..."
+    return 1
+  fi
+}
+
+start() {
+  checkconfig || return 1
+  ebegin "Starting mysqld"
+  /usr/bin/mysqld_safe --defaults-file=/etc/mysql/my.cnf >/dev/null 2>&1 &
+  eend $?
+}
+
+stop () {
+  ebegin "Stopping mysqld"
+  start-stop-daemon --stop --quiet \
+    --pidfile=/var/run/mysqld/mysqld.pid --retry 20
+  eend $?
+}
+
diff --git a/testing/mysql/mysql.mycnf b/testing/mysql/mysql.mycnf
new file mode 100644
index 0000000..a84c569
--- /dev/null
+++ b/testing/mysql/mysql.mycnf
@@ -0,0 +1,49 @@
+# /etc/mysql/my.cnf: The global mysql configuration file.
+# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/dev-db/mysql/files/my.cnf,v 1.5 2008/11/14 01:49:37 robbat2 Exp $
+#
+# This file can be simultaneously placed in three places:
+# 1. /etc/mysql/my.cnf to set global options.
+# 2. /var/lib/mysql/my.cnf to set server-specific options.
+# 3. ~/.my.cnf to set user-specific options.
+#
+# One can use all long options that the program supports.
+# Run the program with --help to get a list of them.
+#
+# The following values assume you have at least 32M RAM!
+
+[client]
+#password = my_password
+port    = 3306
+socket    = /var/run/mysqld/mysqld.sock
+
+[safe_mysqld]
+err-log   = /var/log/mysql/mysql.err
+
+[mysqld]
+#skip-networking
+skip-innodb
+innodb_file_per_table
+user    = mysql
+pid-file  = /var/run/mysqld/mysqld.pid
+socket    = /var/run/mysqld/mysqld.sock
+port    = 3306
+log   = /var/log/mysql/mysql.log
+basedir   = /usr
+datadir   = /var/lib/mysql
+tmpdir    = /tmp
+language  = /usr/share/mysql/english
+skip-locking
+set-variable  = key_buffer=16M
+set-variable  = max_allowed_packet=1M
+set-variable  = thread_stack=128K
+
+[mysqldump]
+quick
+set-variable  = max_allowed_packet=1M
+
+[mysql]
+#no-auto-rehash # faster start of mysql but no tab completition
+
+[isamchk]
+set-variable  = key_buffer=16M
+
-- 
1.6.1