lib_mysqludf_stem-0.9.1.ebuild 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 autotools
  5. DESCRIPTION="MySQL UDFs which provides stemming capability for a variety of languages"
  6. HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_stem/"
  7. SRC_URI="http://www.mysqludf.org/${PN}/${P}.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. RESTRICT="test"
  15. pkg_setup() {
  16. MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
  17. MYSQL_INCLUDE="$(mysql_config --include)"
  18. }
  19. src_prepare() {
  20. # add AC_PROG_CXX to configure.ac
  21. sed -i -e 's|\(AC_PROG_CC\)|\1\nAC_PROG_CXX|g' configure.ac
  22. # fix ax_lib_mysql.m4 + ax_mysql_bin.m4
  23. epatch "${FILESDIR}/${PN}-mysql_m4.patch"
  24. # fix and clean libstemmer_c
  25. sed -i -e 's|^\(CFLAGS\)=|\1+=-fPIC |g' libstemmer_c/Makefile
  26. rm -f -- libstemmer_c/stemwords libstemmer_c/*.{o,a} libstemmer_c/*/*.o
  27. edos2unix installdb.sql
  28. eautoreconf
  29. }
  30. src_configure() {
  31. econf --with-pic --disable-static --libdir="${MYSQL_PLUGINDIR}"
  32. }
  33. src_install() {
  34. local X
  35. emake DESTDIR="${D}" install
  36. dodoc libstemmer_c/libstemmer/*.txt
  37. [ -f ${PN}.html ] && dohtml ${PN}.html
  38. [ -d doc/html ] && dohtml -r doc/html/.
  39. for X in API AUTHORS ChangeLog NEWS README *installdb.sql; do
  40. [ -s "${X}" ] && dodoc "${X}"
  41. done
  42. # remove obsolete *.la file
  43. rm -f -- "${D}${MYSQL_PLUGINDIR}"/*.la
  44. }
  45. pkg_postinst() {
  46. elog
  47. elog "Please have a look at the documentation, how to"
  48. elog "enable/disable the UDF functions of ${PN}."
  49. elog
  50. elog "The documentation is located here:"
  51. elog "/usr/share/doc/${PF}"
  52. elog
  53. }