lib_mysqludf_log-0.0.2.ebuild 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Copyright 1999-2011 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. inherit eutils toolchain-funcs
  5. DESCRIPTION="MySQL UDF to write to log files"
  6. HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_log/"
  7. SRC_URI="http://www.mysqludf.org/${PN}/${PN}_${PV}.tar.gz"
  8. LICENSE="LGPL-2.1"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE=""
  12. DEPEND=">=virtual/mysql-5.1"
  13. RDEPEND="${DEPEND}"
  14. S="${WORKDIR}"
  15. # compile helper
  16. _compile() {
  17. local CC="$(tc-getCC)"
  18. echo "${CC} ${@}" && "${CC}" "${@}"
  19. }
  20. pkg_setup() {
  21. MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
  22. MYSQL_INCLUDE="$(mysql_config --include)"
  23. }
  24. src_prepare() {
  25. epatch "${FILESDIR}/${PN}-warnings.patch"
  26. }
  27. src_compile() {
  28. _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} \
  29. -shared ${LDFLAGS} -o ${PN}.so ${PN}.c
  30. }
  31. src_install() {
  32. exeinto "${MYSQL_PLUGINDIR}"
  33. doexe ${PN}.so
  34. dodoc ${PN}.sql
  35. }
  36. pkg_postinst() {
  37. elog
  38. elog "Please have a look at the documentation, how to"
  39. elog "enable/disable the UDF functions of ${PN}."
  40. elog
  41. elog "The documentation is located here:"
  42. elog "/usr/share/doc/${PF}"
  43. elog
  44. }