lib_mysqludf_fPROJ4-0.1.0.ebuild 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 UDFs which converts geographic/cartesian coordinates"
  6. HOMEPAGE="http://www.mysqludf.org/lib_mysqludf_fPROJ4/"
  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. sci-libs/proj"
  14. RDEPEND="${DEPEND}"
  15. S="${WORKDIR}/${P}-src"
  16. # compile helper
  17. _compile() {
  18. local CC="$(tc-getCC)"
  19. echo "${CC} ${@}" && "${CC}" "${@}"
  20. }
  21. pkg_setup() {
  22. MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
  23. MYSQL_INCLUDE="$(mysql_config --include)"
  24. }
  25. src_prepare() {
  26. epatch "${FILESDIR}/${PN}-warnings.patch"
  27. # fix doc (BOM, CR/LF, soname)
  28. sed -i -e '1 s|^\xEF\xBB\xBF||' \
  29. -e "s|'\(${PN}\).*'|'\1.so'|g" ${PN}.sql
  30. echo >> ${PN}.sql # add LF
  31. edos2unix ${PN}.sql
  32. }
  33. src_compile() {
  34. _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} -lproj \
  35. -shared ${LDFLAGS} -o ${PN}.so ${PN}.c
  36. }
  37. src_install() {
  38. exeinto "${MYSQL_PLUGINDIR}"
  39. doexe ${PN}.so
  40. dodoc ${PN}.sql
  41. }
  42. pkg_postinst() {
  43. elog
  44. elog "Please have a look at the documentation, how to"
  45. elog "enable/disable the UDF functions of ${PN}."
  46. elog
  47. elog "The documentation is located here:"
  48. elog "/usr/share/doc/${PF}"
  49. elog
  50. }