summaryrefslogtreecommitdiff
path: root/recipes/mysql
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/mysql')
-rw-r--r--recipes/mysql/mysql-5.1.40-have_atomic_pthread_t.patch37
-rw-r--r--recipes/mysql/mysql5-native_5.1.40.bb25
-rw-r--r--recipes/mysql/mysql5/Makefile.am.patch19
-rw-r--r--recipes/mysql/mysql5/configure-ps-cache-check.patch27
-rw-r--r--recipes/mysql/mysql5/configure.in.patch54
-rw-r--r--recipes/mysql/mysql5/fix_host_path.patch37
-rw-r--r--recipes/mysql/mysql5/my.cnf21
-rw-r--r--recipes/mysql/mysql5/mysqld.sh24
-rw-r--r--recipes/mysql/mysql5/plug.in.patch40
-rw-r--r--recipes/mysql/mysql5_5.1.40.bb169
10 files changed, 453 insertions, 0 deletions
diff --git a/recipes/mysql/mysql-5.1.40-have_atomic_pthread_t.patch b/recipes/mysql/mysql-5.1.40-have_atomic_pthread_t.patch
new file mode 100644
index 0000000000..f6401790d4
--- /dev/null
+++ b/recipes/mysql/mysql-5.1.40-have_atomic_pthread_t.patch
@@ -0,0 +1,37 @@
+diff -Naur mysql-5.1.40-old/storage/innodb_plugin/plug.in mysql-5.1.40-new/storage/innodb_plugin/plug.in
+--- mysql-5.1.40-old/storage/innodb_plugin/plug.in 2009-10-06 10:50:23.000000000 -0700
++++ mysql-5.1.40-new/storage/innodb_plugin/plug.in 2009-10-21 16:52:45.000000000 -0700
+@@ -63,8 +63,9 @@
+ ;;
+ esac
+ AC_SUBST(INNODB_DYNAMIC_CFLAGS)
+- AC_MSG_CHECKING(whether pthread_t can be used by GCC atomic builtins)
+- AC_TRY_RUN(
++ AC_CACHE_CHECK([whether pthread_t can be used by GCC atomic builtins],
++ [ac_cv_have_decl_HAVE_ATOMIC_PTHREAD_T],
++ [AC_TRY_RUN(
+ [
+ #include <pthread.h>
+ #include <string.h>
+@@ -84,14 +85,18 @@
+ }
+ ],
+ [
+- AC_DEFINE([HAVE_ATOMIC_PTHREAD_T], [1],
+- [pthread_t can be used by GCC atomic builtins])
+ AC_MSG_RESULT(yes)
++ ac_cv_have_decl_HAVE_ATOMIC_PTHREAD_T=yes
+ ],
+ [
+ AC_MSG_RESULT(no)
++ ac_cv_have_decl_HAVE_ATOMIC_PTHREAD_T=no
+ ]
+- )
++ )])
++ if test "x$ac_cv_have_decl_HAVE_ATOMIC_PTHREAD"= "xyes" ; then
++ AC_DEFINE([HAVE_ATOMIC_PTHREAD_T], [1],
++ [pthread_t can be used by GCC atomic builtins])
++ fi
+
+ # Try using solaris atomics on SunOS if GCC atomics are not available
+ AC_CHECK_DECLS(
diff --git a/recipes/mysql/mysql5-native_5.1.40.bb b/recipes/mysql/mysql5-native_5.1.40.bb
new file mode 100644
index 0000000000..bbe2382a95
--- /dev/null
+++ b/recipes/mysql/mysql5-native_5.1.40.bb
@@ -0,0 +1,25 @@
+require mysql5_${PV}.bb
+inherit native
+PR ="r0"
+
+SRC_URI = "http://downloads.mysql.com/archives/mysql-5.1/mysql-${PV}.tar.gz"
+
+RDEPENDS_${PN} = ""
+PACKAGES = ""
+DEPENDS = "ncurses-native"
+EXTRA_OEMAKE = ""
+EXTRA_OECONF = " --with-embedded-server "
+
+do_stage() {
+ install -m 0755 sql/gen_lex_hash ${STAGING_BINDIR}/
+}
+
+do_install() {
+ :
+}
+
+
+# Mysql tries to access the ${WORKDIR} from this build..
+do_rm_work() {
+ :
+}
diff --git a/recipes/mysql/mysql5/Makefile.am.patch b/recipes/mysql/mysql5/Makefile.am.patch
new file mode 100644
index 0000000000..33fd17acd4
--- /dev/null
+++ b/recipes/mysql/mysql5/Makefile.am.patch
@@ -0,0 +1,19 @@
+Index: mysql-5.1.40/sql/Makefile.am
+===================================================================
+--- mysql-5.1.40.orig/sql/Makefile.am
++++ mysql-5.1.40/sql/Makefile.am
+@@ -174,10 +174,10 @@ link_sources:
+ # This generates lex_hash.h
+ # NOTE Built sources should depend on their sources not the tool
+ # this avoid the rebuild of the built files in a source dist
+-lex_hash.h: gen_lex_hash.cc lex.h
+- $(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT)
+- ./gen_lex_hash$(EXEEXT) > $@-t
+- $(MV) $@-t $@
++GEN_LEX_HASH = ./gen_lex_hash$(EXEEXT)
++
++lex_hash.h: gen_lex_hash$(EXEEXT)
++ $(GEN_LEX_HASH) > $@
+
+ # For testing of udf_example.so
+ udf_example_la_SOURCES= udf_example.c
diff --git a/recipes/mysql/mysql5/configure-ps-cache-check.patch b/recipes/mysql/mysql5/configure-ps-cache-check.patch
new file mode 100644
index 0000000000..3b5b3fd063
--- /dev/null
+++ b/recipes/mysql/mysql5/configure-ps-cache-check.patch
@@ -0,0 +1,27 @@
+Index: mysql-4.1.22/configure.in
+===================================================================
+--- mysql-4.1.22.orig/configure.in 2009-01-28 16:33:28.000000000 +0000
++++ mysql-4.1.22/configure.in 2009-01-28 16:43:26.000000000 +0000
+@@ -471,8 +471,8 @@
+
+ # Lock for PS
+ AC_PATH_PROG(PS, ps, ps)
+-AC_MSG_CHECKING("how to check if pid exists")
+-PS=$ac_cv_path_PS
++AC_CACHE_CHECK([how to check if pid exists], [ac_cv_FIND_PROC],
++[
+ # Linux style
+ if $PS p $$ 2> /dev/null | grep $0 > /dev/null
+ then
+@@ -511,8 +511,9 @@
+ AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
+ esac
+ fi
+-AC_SUBST(FIND_PROC)
+-AC_MSG_RESULT("$FIND_PROC")
++ac_cv_FIND_PROC="$FIND_PROC"
++])
++AC_SUBST([FIND_PROC], [$ac_cv_FIND_PROC])
+
+ # Check if a pid is valid
+ AC_PATH_PROG(KILL, kill, kill)
diff --git a/recipes/mysql/mysql5/configure.in.patch b/recipes/mysql/mysql5/configure.in.patch
new file mode 100644
index 0000000000..3edc5f3c21
--- /dev/null
+++ b/recipes/mysql/mysql5/configure.in.patch
@@ -0,0 +1,54 @@
+Index: mysql-5.1.40/configure.in
+===================================================================
+--- mysql-5.1.40.orig/configure.in
++++ mysql-5.1.40/configure.in
+@@ -226,8 +226,6 @@ else
+ AC_PATH_PROG(AS, as, as)
+ fi
+
+-# Still need ranlib for readline; local static use only so no libtool.
+-AC_PROG_RANLIB
+ # We use libtool
+ #AC_LIBTOOL_WIN32_DLL
+ AC_PROG_LIBTOOL
+@@ -255,39 +253,7 @@ AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL
+ AC_CHECK_PROG(PDFMANUAL, pdftex, manual.pdf)
+ AC_CHECK_PROG(DVIS, tex, manual.dvi)
+
+-#check the return type of sprintf
+-AC_MSG_CHECKING("return type of sprintf")
+-AC_TRY_RUN([
+- int main()
+- {
+- char* s = "hello";
+- char buf[6];
+- if((int)sprintf(buf, s) == strlen(s))
+- return 0;
+-
+- return -1;
+- }
+- ],
+- [AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf])
+- AC_MSG_RESULT("int")],
+- [AC_TRY_RUN([
+- int main()
+- {
+- char* s = "hello";
+- char buf[6];
+- if((char*)sprintf(buf,s) == buf + strlen(s))
+- return 0;
+- return -1;
+- } ],
+- [AC_DEFINE(SPRINTF_RETURNS_PTR, [1], [Broken sprintf])
+- AC_MSG_RESULT("ptr")],
+- [AC_DEFINE(SPRINTF_RETURNS_GARBAGE, [1], [Broken sprintf])
+- AC_MSG_RESULT("garbage")]
+- )],
+- # Cross compile, assume POSIX
+- [AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf])
+- AC_MSG_RESULT("int (we assume)")]
+-)
++MYSQL_SPRINTF_RET
+
+ AC_PATH_PROG(uname_prog, uname, no)
+
diff --git a/recipes/mysql/mysql5/fix_host_path.patch b/recipes/mysql/mysql5/fix_host_path.patch
new file mode 100644
index 0000000000..4f69cd5198
--- /dev/null
+++ b/recipes/mysql/mysql5/fix_host_path.patch
@@ -0,0 +1,37 @@
+--- mysql-4.1.22/configure.in.old 2008-09-18 20:11:15.000000000 -0500
++++ mysql-4.1.22/configure.in 2008-09-18 20:12:28.000000000 -0500
+@@ -456,9 +456,9 @@ else
+ fi
+ fi
+
+-AC_SUBST(HOSTNAME)
+-AC_SUBST(PERL)
+-AC_SUBST(PERL5)
++AC_SUBST(HOSTNAME,/bin/hostname)
++AC_SUBST(PERL,$(bindir)/perl)
++AC_SUBST(PERL5,$(bindir)/perl)
+
+ # for build ndb docs
+
+@@ -516,16 +516,17 @@ AC_MSG_RESULT("$FIND_PROC")
+
+ # Check if a pid is valid
+ AC_PATH_PROG(KILL, kill, kill)
++AC_SUBST(KILL,/bin/kill)
+ AC_MSG_CHECKING("for kill switches")
+-if $ac_cv_path_KILL -0 $$
++if $KILL -0 $$
+ then
+- CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null"
++ CHECK_PID="$KILL -0 \$\$PID > /dev/null 2> /dev/null"
+ elif kill -s 0 $$
+ then
+- CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
++ CHECK_PID="$KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
+ else
+ AC_MSG_WARN([kill -0 to check for pid seems to fail])
+- CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
++ CHECK_PID="$KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
+ fi
+ AC_SUBST(CHECK_PID)
+ AC_MSG_RESULT("$CHECK_PID")
diff --git a/recipes/mysql/mysql5/my.cnf b/recipes/mysql/mysql5/my.cnf
new file mode 100644
index 0000000000..7f557e4250
--- /dev/null
+++ b/recipes/mysql/mysql5/my.cnf
@@ -0,0 +1,21 @@
+[client]
+#password = password
+port = 3306
+socket = /tmp/mysql.sock
+
+[mysqld_safe]
+err-log = /var/log/mysql.err
+
+[mysqld]
+user = mysql
+port = 3306
+socket = /tmp/mysql.sock
+pid-file = /var/lib/mysql/mysqld.pid
+log-error = /var/log/mysqld.err
+basedir = /usr
+datadir = /var/mysql
+skip-locking
+loose-skip-innodb
+skip-networking
+bind-address = localhost
+
diff --git a/recipes/mysql/mysql5/mysqld.sh b/recipes/mysql/mysql5/mysqld.sh
new file mode 100644
index 0000000000..479ebdb257
--- /dev/null
+++ b/recipes/mysql/mysql5/mysqld.sh
@@ -0,0 +1,24 @@
+# MySQL init script
+
+. /etc/default/rcS
+
+case "$1" in
+ start)
+ /usr/bin/mysqld_safe &
+ ;;
+ stop)
+ if test -f /var/lib/mysql/mysqld.pid ; then
+ PID=`cat /var/lib/mysql/mysqld.pid`
+ kill $PID
+ fi
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: /etc/init.d/mysqld {start|stop|restart}"
+ ;;
+esac
+
+exit 0
diff --git a/recipes/mysql/mysql5/plug.in.patch b/recipes/mysql/mysql5/plug.in.patch
new file mode 100644
index 0000000000..70c39fa7a3
--- /dev/null
+++ b/recipes/mysql/mysql5/plug.in.patch
@@ -0,0 +1,40 @@
+Index: mysql-5.1.40/storage/innodb_plugin/plug.in
+===================================================================
+--- mysql-5.1.40.orig/storage/innodb_plugin/plug.in
++++ mysql-5.1.40/storage/innodb_plugin/plug.in
+@@ -63,35 +63,6 @@ MYSQL_PLUGIN_ACTIONS(innodb_plugin, [
+ ;;
+ esac
+ AC_SUBST(INNODB_DYNAMIC_CFLAGS)
+- AC_MSG_CHECKING(whether pthread_t can be used by GCC atomic builtins)
+- AC_TRY_RUN(
+- [
+- #include <pthread.h>
+- #include <string.h>
+-
+- int main(int argc, char** argv) {
+- pthread_t x1;
+- pthread_t x2;
+- pthread_t x3;
+-
+- memset(&x1, 0x0, sizeof(x1));
+- memset(&x2, 0x0, sizeof(x2));
+- memset(&x3, 0x0, sizeof(x3));
+-
+- __sync_bool_compare_and_swap(&x1, x2, x3);
+-
+- return(0);
+- }
+- ],
+- [
+- AC_DEFINE([HAVE_ATOMIC_PTHREAD_T], [1],
+- [pthread_t can be used by GCC atomic builtins])
+- AC_MSG_RESULT(yes)
+- ],
+- [
+- AC_MSG_RESULT(no)
+- ]
+- )
+
+ # Try using solaris atomics on SunOS if GCC atomics are not available
+ AC_CHECK_DECLS(
diff --git a/recipes/mysql/mysql5_5.1.40.bb b/recipes/mysql/mysql5_5.1.40.bb
new file mode 100644
index 0000000000..64281ea109
--- /dev/null
+++ b/recipes/mysql/mysql5_5.1.40.bb
@@ -0,0 +1,169 @@
+DESCRIPTION = "The MySQL Open Source Database System"
+HOMEPAGE = "http://www.mysql.com/"
+SECTION = "libs"
+LICENSE = "GPL"
+DEPENDS = "ncurses"
+PR = "r0"
+
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI = "http://downloads.mysql.com/archives/mysql-5.1/mysql-${PV}.tar.gz \
+ file://configure.in.patch;patch=1 \
+ file://plug.in.patch;patch=1 \
+ file://misc.m4.patch;patch=1 \
+ file://Makefile.am.patch;patch=1 \
+ file://fix_host_path.patch;patch=1 \
+ file://configure-ps-cache-check.patch;patch=1 \
+ file://my.cnf \
+ file://mysqld.sh"
+
+S = "${WORKDIR}/mysql-${PV}"
+
+BINCONFIG_GLOB = "mysql_config"
+
+inherit autotools binconfig update-rc.d
+
+INITSCRIPT_PACKAGES = "${PN}-server"
+INITSCRIPT_NAME = "mysqld"
+INITSCRIPT_PARAMS = "start 45 S . stop 45 0 6 1 ."
+
+export ac_cv_path_PS=/bin/ps
+export ac_cv_FIND_PROC="/bin/ps p \$\$PID | grep -v grep | grep mysqld > /dev/null"
+PARALLEL_MAKE = " "
+EXTRA_OEMAKE = "'GEN_LEX_HASH=${STAGING_BINDIR_NATIVE}/gen_lex_hash'"
+EXTRA_OECONF = " --with-atomic-ops=up --with-embedded-server --prefix=/usr --sysconfdir=/etc/mysql --localstatedir=/var/mysql --disable-dependency-tracking --without-raid --without-debug --with-low-memory --without-query-cache --without-man --without-docs --without-innodb "
+
+do_configure_append() {
+ sed -i /comp_err/d ${S}/sql/share/Makefile
+}
+
+do_stage() {
+ autotools_stage_all
+ oe_libinstall -a -so -C libmysql libmysqlclient ${STAGING_LIBDIR}
+ oe_libinstall -a -C libmysqld libmysqld ${STAGING_LIBDIR}
+}
+
+do_stage_append() {
+ sed -i -es,^pkgincludedir=\'/usr/include/mysql\',pkgincludedir=\'${STAGING_INCDIR}\', ${STAGING_BINDIR_CROSS}/mysql_config
+ sed -i -es,^pkglibdir=\'/usr/lib/mysql\',pkglibdir=\'${STAGING_LIBDIR}\', ${STAGING_BINDIR_CROSS}/mysql_config
+}
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' install
+ mv -f ${D}${libdir}/mysql/* ${D}${libdir}
+ rmdir ${D}${libdir}/mysql
+
+ install -d ${D}/etc/init.d
+ install -m 0644 ${WORKDIR}/my.cnf ${D}/etc/
+ install -m 0755 ${WORKDIR}/mysqld.sh ${D}/etc/init.d/mysqld
+}
+
+pkg_postinst_mysql5-server () {
+ if [ "x$D" != "x" ]; then
+ exit 1
+ fi
+
+ grep mysql /etc/passwd || adduser --disabled-password --home=/var/mysql --ingroup nogroup mysql
+
+ #Install the database
+ test -d /usr/bin || mkdir -p /usr/bin
+ test -e /usr/bin/hostname || ln -s /bin/hostname /usr/bin/hostname
+ mkdir /var/lib/mysql
+ chown mysql.nogroup /var/lib/mysql
+
+ mysql_install_db
+
+}
+
+pkg_postrm_mysql5-server () {
+ grep mysql /etc/passwd && deluser mysql
+}
+
+PACKAGES = "${PN}-dbg ${PN} libmysqlclient libmysqlclient-dev libmysqlclient-dbg \
+ ${PN}-client ${PN}-server ${PN}-leftovers"
+CONFFILES_${PN}-server += "${sysconfdir}/my.cnf"
+
+FILES_${PN} = " "
+RDEPENDS_${PN} = "${PN}-client ${PN}-server"
+ALLOW_EMPTY_${PN} = "1"
+
+FILES_libmysqlclient = "${libdir}/libmysqlclient.so.*"
+FILES_libmysqlclient-dev = " \
+${includedir}/mysql/ \
+${libdir}/lib* \
+${libdir}/plugin/* \
+${sysconfdir}/aclocal \
+${bindir}/mysql_config"
+
+FILES_libmysqlclient-dbg = "${libdir}/plugin/.debug/ \
+/usr/mysql-test/lib/My/SafeProcess/.debug/my_safe_process"
+
+FILES_${PN}-client = "\
+${bindir}/myisam_ftdump \
+${bindir}/mysql \
+${bindir}/mysql_client_test \
+${bindir}/mysql_client_test_embedded \
+${bindir}/mysql_find_rows \
+${bindir}/mysql_fix_extensions \
+${bindir}/mysql_waitpid \
+${bindir}/mysqlaccess \
+${bindir}/mysqladmin \
+${bindir}/mysqlbug \
+${bindir}/mysqlcheck \
+${bindir}/mysqldump \
+${bindir}/mysqldumpslow \
+${bindir}/mysqlimport \
+${bindir}/mysqlshow \
+${bindir}/mysqlslap \
+${bindir}/mysqltest_embedded \
+${libexecdir}/mysqlmanager"
+
+FILES_${PN}-server = "\
+${bindir}/comp_err \
+${bindir}/isamchk \
+${bindir}/isamlog \
+${bindir}/msql2mysql \
+${bindir}/my_print_defaults \
+${bindir}/myisamchk \
+${bindir}/myisamlog \
+${bindir}/myisampack \
+${bindir}/mysql_convert_table_format \
+${bindir}/mysql_fix_privilege_tables \
+${bindir}/mysql_install_db \
+${bindir}/mysql_secure_installation \
+${bindir}/mysql_setpermission \
+${bindir}/mysql_tzinfo_to_sql \
+${bindir}/mysql_upgrade \
+${bindir}/mysql_zap \
+${bindir}/mysqlbinlog \
+${bindir}/mysqld_multi \
+${bindir}/mysqld_safe \
+${bindir}/mysqlhotcopy \
+${bindir}/mysqltest \
+${bindir}/ndb_delete_all \
+${bindir}/ndb_desc \
+${bindir}/ndb_drop_index \
+${bindir}/ndb_drop_table \
+${bindir}/ndb_mgm \
+${bindir}/ndb_restore \
+${bindir}/ndb_select_all \
+${bindir}/ndb_select_count \
+${bindir}/ndb_show_tables \
+${bindir}/ndb_waiter \
+${bindir}/pack_isam \
+${bindir}/perror \
+${bindir}/replace \
+${bindir}/resolve_stack_dump \
+${bindir}/resolveip \
+${libexecdir}/mysqld \
+${sbindir}/mysqld \
+${sbindir}/ndb_cpcd \
+${sbindir}/ndbd \
+${sbindir}/ndb_mgmd \
+${datadir}/mysql/ \
+${localstatedir}/mysql/ \
+${sysconfdir}/init.d \
+${sysconfdir}/my.cnf"
+
+DESCRIPTION_${PN}-leftovers = "unpackaged and probably unneeded files for ${PN}"
+FILES_${PN}-leftovers = "/"