--- /dev/null
+# ChangeLog for dev-db/lib_mysqludf_fPROJ4
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_fPROJ4/ChangeLog,v 1.1 2011/10/19 12:12:02 sbriesen Exp $
+
+*lib_mysqludf_fPROJ4-0.1.0 (19 Oct 2011)
+
+ 19 Oct 2011; Stefan Briesenick <sbriesen@gentoo.org>
+ +files/lib_mysqludf_fPROJ4-warnings.patch, +lib_mysqludf_fPROJ4-0.1.0.ebuild,
+ +metadata.xml:
+ initial commit
+
--- /dev/null
+--- lib_mysqludf_fPROJ4.c.orig 2010-05-09 13:46:12.000000000 +0200
++++ lib_mysqludf_fPROJ4.c 2011-10-19 02:32:48.000000000 +0200
+@@ -1,5 +1,3 @@
+-/*\r
+-\r
+ /* \r
+ lib_mysqludf_fPROJ4 - An extended set of scientific functions which \r
+ converts geographic longitude and latitude coordinates into cartesian \r
+@@ -178,7 +176,7 @@
+ }\r
+ double fPROJ4_transform(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error)\r
+ {\r
+- projPJ pj_in, pj_out;\r
++ projPJ pj_in=NULL, pj_out=NULL;\r
+ double x, y,z;\r
+ int p,t;\r
+ \r
+@@ -248,7 +246,7 @@
+ }\r
+ double fPROJ4_Geo2UTM(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error)\r
+ {\r
+- projPJ pj_in, pj_out;\r
++ projPJ pj_in=NULL, pj_out=NULL;\r
+ double x, y;\r
+ int p,t,zone;\r
+ char *tmp;\r
+@@ -323,7 +321,7 @@
+ }\r
+ double fPROJ4_UTM2Geo(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error)\r
+ {\r
+- projPJ pj_in, pj_out;\r
++ projPJ pj_in=NULL, pj_out=NULL;\r
+ double x, y;\r
+ int p,t,zone;\r
+ char *tmp;\r
--- /dev/null
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_fPROJ4/lib_mysqludf_fPROJ4-0.1.0.ebuild,v 1.1 2011/10/19 12:12:02 sbriesen Exp $
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="MySQL UDFs which converts geographic/cartesian coordinates"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_fPROJ4/"
+SRC_URI="http://www.mysqludf.org/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1
+ sci-libs/proj"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${P}-src"
+
+# compile helper
+_compile() {
+ local CC="$(tc-getCC)"
+ echo "${CC} ${@}" && "${CC}" "${@}"
+}
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-warnings.patch"
+
+ # fix doc (BOM, CR/LF, soname)
+ sed -i -e '1 s|^\xEF\xBB\xBF||' \
+ -e "s|'\(${PN}\).*'|'\1.so'|g" ${PN}.sql
+ echo >> ${PN}.sql # add LF
+ edos2unix ${PN}.sql
+}
+
+src_compile() {
+ _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} -lproj \
+ -shared ${LDFLAGS} -o ${PN}.so ${PN}.c
+}
+
+src_install() {
+ exeinto "${MYSQL_PLUGINDIR}"
+ doexe ${PN}.so
+ dodoc ${PN}.sql
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>no-herd</herd>
+ <maintainer>
+ <email>sbriesen@gentoo.org</email>
+ <name>Stefan Briesenick</name>
+ </maintainer>
+</pkgmetadata>
--- /dev/null
+# ChangeLog for dev-db/lib_mysqludf_json
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_json/ChangeLog,v 1.1 2011/10/19 12:13:42 sbriesen Exp $
+
+*lib_mysqludf_json-0.0.2 (19 Oct 2011)
+
+ 19 Oct 2011; Stefan Briesenick <sbriesen@gentoo.org>
+ +lib_mysqludf_json-0.0.2.ebuild, +metadata.xml:
+ initial commit
+
--- /dev/null
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_json/lib_mysqludf_json-0.0.2.ebuild,v 1.1 2011/10/19 12:13:42 sbriesen Exp $
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="MySQL UDFs to map relational data to the JSON format"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_json/"
+SRC_URI="http://www.mysqludf.org/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+# compile helper
+_compile() {
+ local CC="$(tc-getCC)"
+ echo "${CC} ${@}" && "${CC}" "${@}"
+}
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ # remove precompiled object
+ rm -f -- ${PN}.so
+}
+
+src_compile() {
+ _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} \
+ -shared ${LDFLAGS} -o ${PN}.so ${PN}.c
+}
+
+src_install() {
+ exeinto "${MYSQL_PLUGINDIR}"
+ doexe ${PN}.so
+ dodoc ${PN}.sql
+ dohtml ${PN}.html
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>no-herd</herd>
+ <maintainer>
+ <email>sbriesen@gentoo.org</email>
+ <name>Stefan Briesenick</name>
+ </maintainer>
+</pkgmetadata>
--- /dev/null
+# ChangeLog for dev-db/lib_mysqludf_log
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_log/ChangeLog,v 1.1 2011/10/19 12:15:36 sbriesen Exp $
+
+*lib_mysqludf_log-0.0.2 (19 Oct 2011)
+
+ 19 Oct 2011; Stefan Briesenick <sbriesen@gentoo.org>
+ +lib_mysqludf_log-0.0.2.ebuild, +files/lib_mysqludf_log-warnings.patch,
+ +metadata.xml:
+ initial commit
+
--- /dev/null
+--- lib_mysqludf_log.c.orig 2008-07-07 01:17:06.000000000 +0200
++++ lib_mysqludf_log.c 2011-10-18 12:50:52.000000000 +0200
+@@ -159,7 +159,7 @@
+ } else {
+ fmt = (char *)initid->ptr;
+ memcpy(fmt, "%0.", 3);
+- sprintf(fmt+3, "%d", args->lengths[0]<=9999? args->lengths[0]: 9999);
++ sprintf(fmt+3, "%d", (int)(args->lengths[0]<=9999? args->lengths[0]: 9999));
+ numDigits = strlen(fmt + 4);
+ memcpy(fmt + 4 + numDigits, "s\n\0", 3);
+ fprintf(stderr, fmt, args->args[0]);
--- /dev/null
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_log/lib_mysqludf_log-0.0.2.ebuild,v 1.1 2011/10/19 12:15:36 sbriesen Exp $
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="MySQL UDF to write to log files"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_log/"
+SRC_URI="http://www.mysqludf.org/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+# compile helper
+_compile() {
+ local CC="$(tc-getCC)"
+ echo "${CC} ${@}" && "${CC}" "${@}"
+}
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-warnings.patch"
+}
+
+src_compile() {
+ _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} \
+ -shared ${LDFLAGS} -o ${PN}.so ${PN}.c
+}
+
+src_install() {
+ exeinto "${MYSQL_PLUGINDIR}"
+ doexe ${PN}.so
+ dodoc ${PN}.sql
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>no-herd</herd>
+ <maintainer>
+ <email>sbriesen@gentoo.org</email>
+ <name>Stefan Briesenick</name>
+ </maintainer>
+</pkgmetadata>
--- /dev/null
+# ChangeLog for dev-db/lib_mysqludf_preg
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_preg/ChangeLog,v 1.1 2011/10/19 12:17:26 sbriesen Exp $
+
+*lib_mysqludf_preg-1.0.1 (19 Oct 2011)
+
+ 19 Oct 2011; Stefan Briesenick <sbriesen@gentoo.org>
+ +lib_mysqludf_preg-1.0.1.ebuild, +metadata.xml:
+ initial commit
+
--- /dev/null
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_preg/lib_mysqludf_preg-1.0.1.ebuild,v 1.1 2011/10/19 12:17:26 sbriesen Exp $
+
+EAPI=4
+
+inherit eutils toolchain-funcs autotools
+
+DESCRIPTION="MySQL UDFs that provide access to the PCRE library for pattern matching"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_preg/"
+SRC_URI="http://www.mysqludf.org/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1
+ dev-libs/libpcre"
+RDEPEND="${DEPEND}"
+
+RESTRICT="test"
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ edos2unix README
+ eautoreconf
+}
+
+src_configure() {
+ econf --with-pic --disable-static --libdir="${MYSQL_PLUGINDIR}"
+}
+
+src_install() {
+ local X
+ emake DESTDIR="${D}" install
+ [ -f ${PN}.html ] && dohtml ${PN}.html
+ [ -d doc/html ] && dohtml -r doc/html/.
+ for X in API AUTHORS ChangeLog NEWS README *installdb.sql; do
+ [ -s "${X}" ] && dodoc "${X}"
+ done
+
+ # remove obsolete *.la file
+ rm -f -- "${D}${MYSQL_PLUGINDIR}"/*.la
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>no-herd</herd>
+ <maintainer>
+ <email>sbriesen@gentoo.org</email>
+ <name>Stefan Briesenick</name>
+ </maintainer>
+</pkgmetadata>
--- /dev/null
+# ChangeLog for dev-db/lib_mysqludf_stat
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_stat/ChangeLog,v 1.1 2011/10/19 12:19:53 sbriesen Exp $
+
+*lib_mysqludf_stat-0.0.3 (19 Oct 2011)
+
+ 19 Oct 2011; Stefan Briesenick <sbriesen@gentoo.org>
+ +lib_mysqludf_stat-0.0.3.ebuild, +files/lib_mysqludf_stat-warnings.patch,
+ +metadata.xml:
+ initial commit
+
--- /dev/null
+--- lib_mysqludf_stat.c.orig 2011-10-19 04:30:24.000000000 +0200
++++ lib_mysqludf_stat.c 2011-10-19 04:31:21.000000000 +0200
+@@ -550,7 +550,7 @@
+ , char *error\r
+ ){\r
+ PEARSON* pearson_struct = (PEARSON *)initid->ptr;\r
+- double result; \r
++ double result=0.0; \r
+ if (pearson_struct->n==0){\r
+ *is_null = 1;\r
+ } else if (\r
+@@ -700,7 +700,7 @@
+ POINT_BISERIAL_GROUP* X0;\r
+ POINT_BISERIAL_GROUP* X1;\r
+ double s;\r
+- double result;\r
++ double result=0.0;\r
+ \r
+ point_biserial_struct = (POINT_BISERIAL *)initid->ptr;\r
+ X = &point_biserial_struct->X;\r
--- /dev/null
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_stat/lib_mysqludf_stat-0.0.3.ebuild,v 1.1 2011/10/19 12:19:53 sbriesen Exp $
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="MySQL UDFs with statistical functions"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_stat/"
+SRC_URI="http://www.mysqludf.org/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+# compile helper
+_compile() {
+ local CC="$(tc-getCC)"
+ echo "${CC} ${@}" && "${CC}" "${@}"
+}
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-warnings.patch"
+
+ # remove precompiled object
+ rm -f -- ${PN}.so
+}
+
+src_compile() {
+ _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} \
+ -shared ${LDFLAGS} -o ${PN}.so ${PN}.c
+}
+
+src_install() {
+ exeinto "${MYSQL_PLUGINDIR}"
+ doexe ${PN}.so
+ dodoc ${PN}.sql
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>no-herd</herd>
+ <maintainer>
+ <email>sbriesen@gentoo.org</email>
+ <name>Stefan Briesenick</name>
+ </maintainer>
+</pkgmetadata>
--- /dev/null
+# ChangeLog for dev-db/lib_mysqludf_stem
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_stem/ChangeLog,v 1.1 2011/10/19 12:23:45 sbriesen Exp $
+
+*lib_mysqludf_stem-0.9.1 (19 Oct 2011)
+
+ 19 Oct 2011; Stefan Briesenick <sbriesen@gentoo.org>
+ +files/lib_mysqludf_stem-mysql_m4.patch, +lib_mysqludf_stem-0.9.1.ebuild,
+ +metadata.xml:
+ initial commit
+
--- /dev/null
+--- config/ax_lib_mysql.m4.orig 2008-05-28 17:31:47.000000000 +0200
++++ config/ax_lib_mysql.m4 2008-11-26 22:43:48.000000000 +0100
+@@ -87,10 +87,9 @@
+ MYSQL_LDFLAGS="`$MYSQL_CONFIG --libs`"
+
+ MYSQL_VERSION=`$MYSQL_CONFIG --version`
+-
+- if test `$MYSQL_CONFIG | /usr/bin/awk '{if ($1 == "--plugindir") print 1}'` == "1"; then
+- MYSQL_PLUGINDIR=`$MYSQL_CONFIG --plugindir`
+- fi
++ if $MYSQL_CONFIG --plugindir > /dev/null; then
++ MYSQL_PLUGINDIR=`$MYSQL_CONFIG --plugindir`
++ fi
+
+ AC_DEFINE([HAVE_MYSQL], [1],
+ [Define to 1 if MySQL libraries are available])
+--- config/ax_mysql_bin.m4.orig 2007-08-15 02:22:37.000000000 +0200
++++ config/ax_mysql_bin.m4 2008-11-26 22:55:40.000000000 +0100
+@@ -43,35 +43,36 @@
+ fi
+
+ if test -z "$withmysqlbin" -o "$withmysqlbin" = "yes"; then
+- for i in /usr/bin /usr/local/bin ; do
+- if test -f "$i/mysql" ; then
+- MYSQL="$i/mysql $MYSQL_ARGS"
+- fi
+- done
++ MYSQL=`which mysql`;
++ if test -n "$MYSQL"; then MYSQL="$MYSQL $MYSQL_ARGS"; fi
+ elif test "$withmysqlbin" != "no"; then
+ MYSQL="$withmysqlbin"
+ fi
+
+ if test -n "$MYSQL" ; then
+- MYSQLBIN_PATH = `dirname "$MYSQL"`
++ MYSQLBIN_PATH=`dirname "$MYSQL"`
+ fi
+
+ if test -z "$withmysqladmin" -o "$withmysqladmin" = "yes"; then
+- for i in "$MYSQLBIN_PATH" /usr/bin /usr/local/bin ; do
+- if test -n "$i" -a -f "$i/mysqladmin" ; then
+- MYSQLADMIN="$i/mysqladmin $MYSQL_ARGS"
+- fi
+- done
++ if test -n "$MYSQLBIN_PATH" -a -f "$MYSQLBIN_PATH/mysqladmin"; then
++ MYSQLADMIN="$MYSQLBIN_PATH/mysqladmin";
++ else
++ MYSQLADMIN=`which mysqladmin`;
++ fi
++
++ if test -n "$MYSQLADMIN"; then MYSQLADMIN="$MYSQLADMIN $MYSQL_ARGS"; fi
+ elif test "$withmysqladmin" != "no"; then
+ MYSQLADMIN="$withmysqladmin"
+ fi
+
+ if test -z "$withmysqltest" -o "$withmysqltest" = "yes"; then
+- for i in "$MYSQLBIN_PATH" /usr/bin /usr/local/bin ; do
+- if test -n "$i" -a -f "$i/mysqltest" ; then
+- MYSQLTEST="$i/mysqltest $MYSQL_ARGS"
+- fi
+- done
++ if test -n "$MYSQLBIN_PATH" -a -f "$MYSQLBIN_PATH/mysqltest"; then
++ MYSQLTEST="$MYSQLBIN_PATH/mysqltest";
++ else
++ MYSQLTEST=`which mysqltest`;
++ fi
++
++ if test -n "$MYSQLTEST"; then MYSQLTEST="$MYSQLTEST $MYSQL_ARGS"; fi
+ elif test "$withmysqltest" != "no"; then
+ MYSQLTEST="$withmysqltest"
+ fi
--- /dev/null
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_stem/lib_mysqludf_stem-0.9.1.ebuild,v 1.1 2011/10/19 12:23:45 sbriesen Exp $
+
+EAPI=4
+
+inherit eutils toolchain-funcs autotools
+
+DESCRIPTION="MySQL UDFs which provides stemming capability for a variety of languages"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_stem/"
+SRC_URI="http://www.mysqludf.org/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1"
+RDEPEND="${DEPEND}"
+
+RESTRICT="test"
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ # add AC_PROG_CXX to configure.ac
+ sed -i -e 's|\(AC_PROG_CC\)|\1\nAC_PROG_CXX|g' configure.ac
+
+ # fix ax_lib_mysql.m4 + ax_mysql_bin.m4
+ epatch "${FILESDIR}/${PN}-mysql_m4.patch"
+
+ # fix and clean libstemmer_c
+ sed -i -e 's|^\(CFLAGS\)=|\1+=-fPIC |g' libstemmer_c/Makefile
+ rm -f -- libstemmer_c/stemwords libstemmer_c/*.{o,a} libstemmer_c/*/*.o
+
+ edos2unix installdb.sql
+ eautoreconf
+}
+
+src_configure() {
+ econf --with-pic --disable-static --libdir="${MYSQL_PLUGINDIR}"
+}
+
+src_install() {
+ local X
+ emake DESTDIR="${D}" install
+ dodoc libstemmer_c/libstemmer/*.txt
+ [ -f ${PN}.html ] && dohtml ${PN}.html
+ [ -d doc/html ] && dohtml -r doc/html/.
+ for X in API AUTHORS ChangeLog NEWS README *installdb.sql; do
+ [ -s "${X}" ] && dodoc "${X}"
+ done
+
+ # remove obsolete *.la file
+ rm -f -- "${D}${MYSQL_PLUGINDIR}"/*.la
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>no-herd</herd>
+ <maintainer>
+ <email>sbriesen@gentoo.org</email>
+ <name>Stefan Briesenick</name>
+ </maintainer>
+</pkgmetadata>
--- /dev/null
+# ChangeLog for dev-db/lib_mysqludf_str
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_str/ChangeLog,v 1.1 2011/10/19 12:26:37 sbriesen Exp $
+
+*lib_mysqludf_str-0.3 (19 Oct 2011)
+
+ 19 Oct 2011; Stefan Briesenick <sbriesen@gentoo.org>
+ +lib_mysqludf_str-0.3.ebuild, +metadata.xml:
+ initial commit
+
--- /dev/null
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_str/lib_mysqludf_str-0.3.ebuild,v 1.1 2011/10/19 12:26:37 sbriesen Exp $
+
+EAPI=4
+
+inherit eutils toolchain-funcs autotools
+
+DESCRIPTION="MySQL UDFs of string functions that complement the set of native ones"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_str/"
+SRC_URI="http://www.mysqludf.org/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1"
+RDEPEND="${DEPEND}"
+
+RESTRICT="test"
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ edos2unix README
+ eautoreconf
+}
+
+src_configure() {
+ econf --with-pic --disable-static --libdir="${MYSQL_PLUGINDIR}"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ [ -f ${PN}.html ] && dohtml ${PN}.html
+ [ -d doc/html ] && dohtml -r doc/html/.
+ for X in API AUTHORS ChangeLog NEWS README *installdb.sql; do
+ [ -s "${X}" ] && dodoc "${X}"
+ done
+
+ # remove obsolete *.la file
+ rm -f -- "${D}${MYSQL_PLUGINDIR}"/*.la
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>no-herd</herd>
+ <maintainer>
+ <email>sbriesen@gentoo.org</email>
+ <name>Stefan Briesenick</name>
+ </maintainer>
+</pkgmetadata>
--- /dev/null
+# ChangeLog for dev-db/lib_mysqludf_sys
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_sys/ChangeLog,v 1.1 2011/10/19 12:28:09 sbriesen Exp $
+
+*lib_mysqludf_sys-0.0.2 (19 Oct 2011)
+
+ 19 Oct 2011; Stefan Briesenick <sbriesen@gentoo.org>
+ +lib_mysqludf_sys-0.0.2.ebuild, +metadata.xml:
+ initial commit
+
--- /dev/null
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_sys/lib_mysqludf_sys-0.0.2.ebuild,v 1.1 2011/10/19 12:28:09 sbriesen Exp $
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="MySQL UDFs that allows one to interact with the operating system"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_sys/"
+SRC_URI="http://www.mysqludf.org/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+# compile helper
+_compile() {
+ local CC="$(tc-getCC)"
+ echo "${CC} ${@}" && "${CC}" "${@}"
+}
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ # remove precompiled object
+ rm -f -- ${PN}.so
+}
+
+src_compile() {
+ _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} \
+ -shared ${LDFLAGS} -o ${PN}.so ${PN}.c
+}
+
+src_install() {
+ exeinto "${MYSQL_PLUGINDIR}"
+ doexe ${PN}.so
+ dodoc ${PN}.sql
+ dohtml ${PN}.html
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>no-herd</herd>
+ <maintainer>
+ <email>sbriesen@gentoo.org</email>
+ <name>Stefan Briesenick</name>
+ </maintainer>
+</pkgmetadata>
--- /dev/null
+# ChangeLog for dev-db/lib_mysqludf_ta
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_ta/ChangeLog,v 1.1 2011/10/19 12:30:29 sbriesen Exp $
+
+*lib_mysqludf_ta-0.1 (19 Oct 2011)
+
+ 19 Oct 2011; Stefan Briesenick <sbriesen@gentoo.org>
+ +lib_mysqludf_ta-0.1.ebuild, +metadata.xml:
+ initial commit
+
--- /dev/null
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_ta/lib_mysqludf_ta-0.1.ebuild,v 1.1 2011/10/19 12:30:29 sbriesen Exp $
+
+EAPI=4
+
+inherit eutils toolchain-funcs autotools
+
+MY_REV="a8e623c" # checkout revision
+MY_USR="joaocosta" # user name
+
+MY_P="${MY_USR}-${PN}-${MY_REV}"
+
+DESCRIPTION="MySQL UDFs with technical analysis functions"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_ta/"
+SRC_URI="https://github.com/${MY_USR}/${PN}/tarball/${MY_REV} -> ${MY_P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1"
+RDEPEND="${DEPEND}"
+
+RESTRICT="test"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+
+ # fix Makefile.am
+ sed -i -e "s|\(-shared\)|\1 -avoid-version|g" Makefile.am
+
+ # convert to UTF-8
+ iconv -f LATIN1 -t UTF-8 < README > README~
+ mv -f README~ README
+
+ edos2unix README
+ eautoreconf
+}
+
+src_compile() {
+ econf --with-pic --disable-static --libdir="${MYSQL_PLUGINDIR}"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc README sampledb.sql
+
+ # remove obsolete *.la file
+ rm -f -- "${D}${MYSQL_PLUGINDIR}"/*.la
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>no-herd</herd>
+ <maintainer>
+ <email>sbriesen@gentoo.org</email>
+ <name>Stefan Briesenick</name>
+ </maintainer>
+</pkgmetadata>
--- /dev/null
+# ChangeLog for dev-db/lib_mysqludf_udf
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_udf/ChangeLog,v 1.1 2011/10/19 12:34:53 sbriesen Exp $
+
+*lib_mysqludf_udf-0.0.3 (19 Oct 2011)
+
+ 19 Oct 2011; Stefan Briesenick <sbriesen@gentoo.org>
+ +lib_mysqludf_udf-0.0.3.ebuild, +metadata.xml:
+ initial commit
+
--- /dev/null
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_udf/lib_mysqludf_udf-0.0.3.ebuild,v 1.1 2011/10/19 12:34:53 sbriesen Exp $
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="MySQL UDFs for reporting internals from the udf interface"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_udf/"
+SRC_URI="http://www.mysqludf.org/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+# compile helper
+_compile() {
+ local CC="$(tc-getCC)"
+ echo "${CC} ${@}" && "${CC}" "${@}"
+}
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_compile() {
+ _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} \
+ -shared ${LDFLAGS} -o ${PN}.so ${PN}.c
+}
+
+src_install() {
+ exeinto "${MYSQL_PLUGINDIR}"
+ doexe ${PN}.so
+ dodoc ${PN}.sql
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>no-herd</herd>
+ <maintainer>
+ <email>sbriesen@gentoo.org</email>
+ <name>Stefan Briesenick</name>
+ </maintainer>
+</pkgmetadata>
--- /dev/null
+# ChangeLog for dev-db/lib_mysqludf_xql
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_xql/ChangeLog,v 1.1 2011/10/19 12:37:20 sbriesen Exp $
+
+*lib_mysqludf_xql-1.0.0 (19 Oct 2011)
+
+ 19 Oct 2011; Stefan Briesenick <sbriesen@gentoo.org>
+ +lib_mysqludf_xql-1.0.0.ebuild, +metadata.xml:
+ initial commit
+
--- /dev/null
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/lib_mysqludf_xql/lib_mysqludf_xql-1.0.0.ebuild,v 1.1 2011/10/19 12:37:20 sbriesen Exp $
+
+EAPI=4
+
+inherit eutils toolchain-funcs autotools
+
+DESCRIPTION="MySQL UDFs which can be used to create XML output directly from MySQL"
+HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_xql/"
+SRC_URI="http://www.mysqludf.org/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1
+ dev-libs/libxml2"
+RDEPEND="${DEPEND}"
+
+RESTRICT="test"
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ edos2unix API installdb.sql
+ eautoreconf
+}
+
+src_configure() {
+ econf --with-pic --disable-static --libdir="${MYSQL_PLUGINDIR}"
+}
+
+src_install() {
+ local X
+ emake DESTDIR="${D}" install
+ [ -f ${PN}.html ] && dohtml ${PN}.html
+ [ -d doc/html ] && dohtml -r doc/html/.
+ for X in API AUTHORS ChangeLog NEWS README *installdb.sql; do
+ [ -s "${X}" ] && dodoc "${X}"
+ done
+
+ # remove obsolete *.la file
+ rm -f -- "${D}${MYSQL_PLUGINDIR}"/*.la
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>no-herd</herd>
+ <maintainer>
+ <email>sbriesen@gentoo.org</email>
+ <name>Stefan Briesenick</name>
+ </maintainer>
+</pkgmetadata>
--- /dev/null
+# ChangeLog for dev-db/mysql-udf-http
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-udf-http/ChangeLog,v 1.1 2011/10/19 12:07:46 sbriesen Exp $
+
+*mysql-udf-http-1.0 (19 Oct 2011)
+
+ 19 Oct 2011; Stefan Briesenick <sbriesen@gentoo.org>
+ +mysql-udf-http-1.0.ebuild, +files/mysql-udf-http-stdlib.patch,
+ +metadata.xml:
+ initial commit
+
--- /dev/null
+--- src/mysql-udf-http.c.orig 2010-09-06 06:00:32.000000000 +0200
++++ src/mysql-udf-http.c 2011-10-18 16:36:37.000000000 +0200
+@@ -2,6 +2,7 @@
+ #include <string.h>
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <curl/curl.h>
+ #include "mysql-udf-http.h"
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>no-herd</herd>
+ <maintainer>
+ <email>sbriesen@gentoo.org</email>
+ <name>Stefan Briesenick</name>
+ </maintainer>
+</pkgmetadata>
--- /dev/null
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-udf-http/mysql-udf-http-1.0.ebuild,v 1.1 2011/10/19 12:07:46 sbriesen Exp $
+
+EAPI=4
+
+WANT_AUTOCONF="latest"
+WANT_AUTOMAKE="latest"
+
+inherit eutils toolchain-funcs autotools
+
+DESCRIPTION="MySQL User-defined function (UDF) for HTTP REST"
+HOMEPAGE="http://code.google.com/p/mysql-udf-http/"
+SRC_URI="http://${PN}.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/mysql-5.1
+ net-misc/curl"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ # fix README
+ sed -i -e "s|${PN}\(\.so\)|${PN//-/_}\1|g" README
+
+ # fix Makefile.am
+ sed -i -e "s|${PN}\([_\.]la\)|${PN//-/_}\1|g" \
+ -e "s|\(-module\)|\1 -avoid-version|g" src/Makefile.am
+
+ epatch "${FILESDIR}/${PN}-stdlib.patch"
+ eautoreconf
+}
+
+src_configure() {
+ econf --with-pic --disable-static --libdir="${MYSQL_PLUGINDIR}" \
+ --with-mysql="$(type -p mysql_config)"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc README
+
+ # remove obsolete *.la file
+ rm -f -- "${D}${MYSQL_PLUGINDIR}"/*.la
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}
--- /dev/null
+# ChangeLog for dev-db/mysql-udf-ipv6
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-udf-ipv6/ChangeLog,v 1.1 2011/10/19 12:04:55 sbriesen Exp $
+
+*mysql-udf-ipv6-0.4 (19 Oct 2011)
+
+ 19 Oct 2011; Stefan Briesenick <sbriesen@gentoo.org>
+ +files/mysql-udf-ipv6-warnings.patch, +mysql-udf-ipv6-0.4.ebuild,
+ +metadata.xml:
+ initial commit
+
--- /dev/null
+--- mysql_udf_ipv6.c.orig 2011-08-10 10:45:49.000000000 +0200
++++ mysql_udf_ipv6.c 2011-10-18 16:27:58.000000000 +0200
+@@ -282,7 +282,7 @@
+ {
+ unsigned long length = args->lengths[0];
+ long long mask = *((long long *) args->args[1]);
+- unsigned char mask8, i;
++ unsigned char i;
+
+ if (!args->args[0] || !length)
+ {
+@@ -299,7 +299,7 @@
+
+ // my ugly get-the-job-done 128-bit masking
+ memset(result, 0, INET6_ADDRLEN);
+- for (i = 0; i < INET6_ADDRLEN, mask >= 8; i++, mask -= 8)
++ for (i = 0; i < INET6_ADDRLEN && mask >= 8; i++, mask -= 8)
+ {
+ result[i] = args->args[0][i];
+ }
+@@ -347,7 +347,6 @@
+ {
+ struct addrinfo *info;
+ char *addr;
+- ushort i;
+
+ if (!args->args[0] || !args->lengths[0])
+ {
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>no-herd</herd>
+ <maintainer>
+ <email>sbriesen@gentoo.org</email>
+ <name>Stefan Briesenick</name>
+ </maintainer>
+</pkgmetadata>
--- /dev/null
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-udf-ipv6/mysql-udf-ipv6-0.4.ebuild,v 1.1 2011/10/19 12:04:55 sbriesen Exp $
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+MY_REV="01c591b05b79" # checkout revision
+MY_USR="watchmouse" # user name
+
+MY_P="${MY_USR}-${PN}-${MY_REV}"
+
+DESCRIPTION="IPv6 and internationalized domain (IDNA) functions for MySQL"
+HOMEPAGE="http://labs.watchmouse.com/2009/10/extending-mysql-5-with-ipv6-functions/"
+SRC_URI="https://bitbucket.org/${MY_USR}/${PN}/get/${MY_REV}.tar.bz2 -> ${MY_P}.tar.bz2"
+
+LICENSE="EUPL-1.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="idn"
+
+DEPEND=">=virtual/mysql-5.1
+ idn? ( net-dns/libidn )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+# compile helper
+_compile() {
+ local CC="$(tc-getCC)"
+ echo "${CC} ${@}" && "${CC}" "${@}"
+}
+
+pkg_setup() {
+ MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
+ MYSQL_INCLUDE="$(mysql_config --include)"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-warnings.patch"
+}
+
+src_compile() {
+ _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} \
+ -shared ${LDFLAGS} -o mysql_udf_ipv6.so mysql_udf_ipv6.c
+
+ if use idn; then
+ _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} -lidn \
+ -shared ${LDFLAGS} -o mysql_udf_idna.so mysql_udf_idna.c
+ fi
+}
+
+src_install() {
+ exeinto "${MYSQL_PLUGINDIR}"
+ doexe mysql_udf_*.so
+ newdoc Changelog ChangeLog
+ dodoc README
+}
+
+pkg_postinst() {
+ elog
+ elog "Please have a look at the documentation, how to"
+ elog "enable/disable the UDF functions of ${PN}."
+ elog
+ elog "The documentation is located here:"
+ elog "/usr/share/doc/${PF}"
+ elog
+}