mysql-udf-base64-20010618.ebuild 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. MY_PN="${PN//-/_}"
  6. DESCRIPTION="MySQL UDFs that provide base64 encode/decode"
  7. HOMEPAGE="http://mirrors.sohu.com/mysql/Contrib/Old-Versions/"
  8. SRC_URI="http://mirrors.sohu.com/mysql/Contrib/Old-Versions/${PN}.c -> ${P}.c
  9. http://mirrors.sohu.com/mysql/Contrib/Old-Versions/${PN}.readme -> ${P}.readme"
  10. LICENSE="PHP-2.02"
  11. SLOT="0"
  12. KEYWORDS="~amd64 ~x86"
  13. IUSE=""
  14. DEPEND=">=virtual/mysql-5.1"
  15. RDEPEND="${DEPEND}"
  16. S="${WORKDIR}"
  17. # compile helper
  18. _compile() {
  19. local CC="$(tc-getCC)"
  20. echo "${CC} ${@}" && "${CC}" "${@}"
  21. }
  22. pkg_setup() {
  23. MYSQL_PLUGINDIR="$(mysql_config --plugindir)"
  24. MYSQL_INCLUDE="$(mysql_config --include)"
  25. }
  26. src_unpack() {
  27. cp -f "${DISTDIR}/${P}.c" "${S}/${PN}.c"
  28. cp -f "${DISTDIR}/${P}.readme" "${S}/${PN}.readme"
  29. }
  30. src_prepare() {
  31. epatch "${FILESDIR}/${PN}-signedness.patch"
  32. }
  33. src_compile() {
  34. _compile ${CFLAGS} -Wall -fPIC ${MYSQL_INCLUDE} \
  35. -shared ${LDFLAGS} -o ${MY_PN}.so ${PN}.c
  36. }
  37. src_install() {
  38. exeinto "${MYSQL_PLUGINDIR}"
  39. doexe ${MY_PN}.so
  40. newdoc ${PN}.readme README
  41. newdoc "${FILESDIR}/${PN}.sql" ${MY_PN}.sql
  42. }
  43. pkg_postinst() {
  44. elog
  45. elog "Please have a look at the documentation, how to"
  46. elog "enable/disable the UDF functions of ${PN}."
  47. elog
  48. elog "The documentation is located here:"
  49. elog "/usr/share/doc/${PF}"
  50. elog
  51. }