games-board/freedoko: Drop old
[gentoo.git] / dev-db / mysql-udf-infusion / mysql-udf-infusion-20110109.ebuild
1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=4
5
6 inherit eutils toolchain-funcs
7
8 MY_REV="8599a9c"   # checkout revision
9 MY_USR="infusion"  # user name
10
11 MY_PN="udf_infusion"
12 MY_P="${MY_USR}-${MY_PN}-${MY_REV}"
13
14 DESCRIPTION="New functions for MySQL implemented as UDF"
15 HOMEPAGE="http://www.xarg.org/2010/11/mysql-my-new-playground/"
16 SRC_URI="https://github.com/${MY_USR}/${MY_PN}/tarball/${MY_REV} -> ${MY_P}.tar.gz"
17
18 LICENSE="GPL-2"
19 SLOT="0"
20 KEYWORDS="~amd64 ~x86"
21 IUSE=""
22
23 DEPEND=">=virtual/mysql-5.1"
24 RDEPEND="${DEPEND}"
25
26 S="${WORKDIR}/${MY_P}"
27
28 # compile helper
29 _compile() {
30         local CC="$(tc-getCC)"
31         echo "${CC} ${@}" && "${CC}" "${@}"
32 }
33
34 pkg_setup() {
35         MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
36         MYSQL_INCLUDE="$(mysql_config --include)"
37 }
38
39 src_prepare() {
40         # fix soname
41         sed -i -e "s|${MY_PN}\.so|${PN//-/_}.so|g" *.sql
42
43         # add LF
44         echo >> create.sql
45         echo >> delete.sql
46 }
47
48 src_compile() {
49         _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} \
50                 -shared ${LDFLAGS} -o ${PN//-/_}.so ${MY_PN}.c
51 }
52
53 src_install() {
54         exeinto "${MYSQL_PLUGINDIR}"
55         doexe *.so
56         dodoc *.sql
57 }
58
59 pkg_postinst() {
60         elog
61         elog "Please have a look at the documentation, how to"
62         elog "enable/disable the UDF functions of ${PN}."
63         elog
64         elog "The documentation is located here:"
65         elog "/usr/share/doc/${PF}"
66         elog
67 }