mysql-proxy-0.8.2-r1.ebuild 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils versionator
  5. MY_PV=$(get_version_component_range 1-2)
  6. DESCRIPTION="A Proxy for the MySQL Client/Server protocol"
  7. HOMEPAGE="http://dev.mysql.com/doc/mysql-proxy/en/"
  8. SRC_URI="https://launchpad.net/${PN}/${MY_PV}/${PV}/+download/${P}.tar.gz"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~x86"
  12. IUSE="examples"
  13. RDEPEND=">=dev-libs/libevent-2.1
  14. >=dev-libs/glib-2.16
  15. >=dev-lang/lua-5.1:0"
  16. DEPEND="${RDEPEND}
  17. >=virtual/mysql-5.0
  18. virtual/pkgconfig"
  19. src_prepare() {
  20. sed -i \
  21. -e 's|_EVENT_VERSION|LIBEVENT_VERSION|g' \
  22. src/chassis-mainloop.c || die
  23. }
  24. src_configure() {
  25. econf \
  26. --includedir=/usr/include/${PN} \
  27. --with-mysql \
  28. --with-lua \
  29. || die "econf failed"
  30. }
  31. src_install() {
  32. emake DESTDIR="${D}" install || die "emake install failed"
  33. newinitd "${FILESDIR}"/${PN}.initd ${PN} || die
  34. newconfd "${FILESDIR}"/${PN}.confd-0.8.0-r1 ${PN} || die
  35. dodoc ChangeLog NEWS README
  36. if use examples; then
  37. docinto examples
  38. dodoc examples/*.lua || die
  39. dodoc lib/*.lua || die
  40. fi
  41. # mysql-proxy will refuse to start unless the config file is at most 0660.
  42. insinto /etc/mysql
  43. insopts -m0660
  44. doins "${FILESDIR}"/${PN}.cnf || die
  45. }