summaryrefslogtreecommitdiff
path: root/dev-db/mysql-proxy
diff options
context:
space:
mode:
Diffstat (limited to 'dev-db/mysql-proxy')
-rw-r--r--dev-db/mysql-proxy/Manifest9
-rw-r--r--dev-db/mysql-proxy/files/mysql-proxy.cnf47
-rw-r--r--dev-db/mysql-proxy/files/mysql-proxy.confd12
-rw-r--r--dev-db/mysql-proxy/files/mysql-proxy.confd-0.8.0-r112
-rw-r--r--dev-db/mysql-proxy/files/mysql-proxy.initd22
-rw-r--r--dev-db/mysql-proxy/metadata.xml13
-rw-r--r--dev-db/mysql-proxy/mysql-proxy-0.8.2-r1.ebuild51
7 files changed, 166 insertions, 0 deletions
diff --git a/dev-db/mysql-proxy/Manifest b/dev-db/mysql-proxy/Manifest
new file mode 100644
index 000000000000..5d2038c14c14
--- /dev/null
+++ b/dev-db/mysql-proxy/Manifest
@@ -0,0 +1,9 @@
+AUX mysql-proxy.cnf 1120 SHA256 ae0e763dc1e5ef37d1b8708dc7a2c49c063843268a57e1fc0294678d173330af SHA512 5f889422d7232608dcde5f332577c563b0c29b0db5a327659ce7b30cef7e4d498eca641159d49671b7368080ff2113511b6b362b44fb75ddd781a00e2879246b WHIRLPOOL 2dd62bf08eefed090e6d6db161925201daad44c443d0f314472ecd5a435a90384d78b3c7cc3b2fbf229b158d4a7182606d56375583e78a2de35dcf040e18955b
+AUX mysql-proxy.confd 365 SHA256 4828001b27499b5de40810ed74dbfe907a6369a11670c523ea3b4898bbb56b5f SHA512 9a4a6499e03d939fcc5fbd5f71d1e377a1d003e542be7fab47d810899649f58e518aa34617c67b207477c7b1a85b75ce3045eb5959156c673b4c28c2c101185b WHIRLPOOL 57ac502c0b9763bfb0b804d25f3d55b53700359d396315627894de4e1fb6d18b8ed2f799b67ca16d0e9da4fb0354faa582a68606000ee314cafbf61eb89eb937
+AUX mysql-proxy.confd-0.8.0-r1 391 SHA256 68301473edd001349639dd4b2c826c0f6c5f68b59a32843e9bd4d9429258d2ac SHA512 e07afd8502d87006cfd4640e83c1ecab98b862d0916ee351c9c60aaaa01f0766d51d0749d3f63f33df9f8bbbbc45ef21517fa0dbc87bf3ade8e3e6c4048c8a5b WHIRLPOOL 038ec55217d58de957d00f768a85088cd214918f52e4a1d6250e8ede4c9b9a21cdfc20f17a72f7c6d399135e7f2d21f4e7acf4dbf52171147004c531887563d4
+AUX mysql-proxy.initd 431 SHA256 c7fe4c6b42fb369dc552fcd698e48fb4a1957bbecf64060761ea940bd727357a SHA512 184850991fbc7c2c625e28f217b12a6e44a38392d1f054dfd25ab6b4c298fb5c53177d6590f536ec3b23bf03b127ae7ee144cc5402bcd2cc8be44a478bc82af3 WHIRLPOOL cf92cc161c9f6524a8695228ec8fe183eb066b9e7cab1d132c216deeb3ac94a71e649f718731c44acf71c502c33ce3b016a67ca68aca734475145606e6f7ecc7
+DIST mysql-proxy-0.8.2.tar.gz 861995 SHA256 3955d9a60249d36b2c5c949706f7a3294419d2563c1e8474164a3a307865f550 SHA512 e083ea6344bf2d3b85a38127e42cbab659a959684f7f0f63272fa0df926d6d32dbbaaab2b6479ee8fc227fbc9af6f24e855d19700ec1ab4b904c5e638b4d64c8 WHIRLPOOL e7c3355b221c7d150004a3bcb02db28c67759d9c83f9d8d4219c2b8e403d176fdbe562e05f5e7ea1e6768f78144a4438678991fcc974448e2c271405d8c6f3a2
+EBUILD mysql-proxy-0.8.2-r1.ebuild 1268 SHA256 de37204e72cb7781acbeba7896e3a571a154ebc15fa925787edc0f8c4a4dc261 SHA512 491326aa07da2e83e440420950c687162d33c3393dd33ae845259a4e663726258f2bc2ba4783ad03289e99cd4164d008d0c8805e36358fa519fe528697d95c76 WHIRLPOOL 582a5db112901a8f3d774d5f9069b9b6bb020cbd039e5f7b1a0783ce0e128177d414419fc6b3a819bf090e68562351fb4852bb6ea234cbc416c8b7d83f4e823f
+MISC ChangeLog 2686 SHA256 a7f63773a48a6bbc42b765feae7ac0118df71ea23851b69d7c6e971b2c900426 SHA512 5043242ee334c4e1bf57246f4cb2ff8b40e9ba633e9e63c7e25be324d3a8ce16c3fa5bfc16351d6072574be8b06839a1d2a8df054b6df494d8085db0b0b197a3 WHIRLPOOL cb9110e8208e618aacb4a1e71737a089f43c633d429df2a015e522abe8073c73a160515534d1a038555a5cf02b0c9906c75a7cbe17275f4611276c76d8c468aa
+MISC ChangeLog-2015 3136 SHA256 b1e6551e1987aab3eb3820177869d8a5068698654d98baf3e4341186a3aadb47 SHA512 3aa5e8cac7dea7079a5ccfd16767401e27e91a11136045e7eee843814f2a8669070f971d512bb959f4390f9461e4ec53ec7a3401ed1cd11921572c7a39048646 WHIRLPOOL 2d649517e46406d58c17ad746362e372b49892f84558157f9add4ea411a146675bb221f4edcbaec53fe6a0084f188303ffacf615b988fcbd4e979ad0e3a82527
+MISC metadata.xml 553 SHA256 906baee9822534af75c70dcb1c773e285475b0e2de7458855345dd135cf4d4f1 SHA512 ea9b0711830e204234c0395e2637005cbf83187c7554435351447871ca99595756893ab4113adcac3deaa6df5495fdf9bf4d3091140c6d2ef498e832cc520388 WHIRLPOOL 5c96a1c8b2de41d3c3057c0344bb97273990a680fb7db797871c8d469880f40e96b4af940feac4b95d0e8299e2aeaf74661a2ebc8a271f09235c8cebe5fd9cb9
diff --git a/dev-db/mysql-proxy/files/mysql-proxy.cnf b/dev-db/mysql-proxy/files/mysql-proxy.cnf
new file mode 100644
index 000000000000..7d15674f6b9d
--- /dev/null
+++ b/dev-db/mysql-proxy/files/mysql-proxy.cnf
@@ -0,0 +1,47 @@
+# MySQL Proxy's configuration file (mysql-proxy.cnf)
+# This file must be 0660 or more restrictive
+# otherwise mysql-proxy will refuse to load
+[mysql-proxy]
+#basedir = ...
+#daemon = true
+#defaults-file = ...
+#event-threads = ...
+keepalive = true
+log-backtrace-on-crash = true
+log-file = /var/log/mysql/mysql-proxy.log
+log-level = warning
+#log-use-syslog = true
+#lua-cpath = ...
+#lua-path = ...
+#max-open-files = ...
+pid-file = /var/run/mysql-proxy.pid
+#plugin-dir = ...
+#plugins = admin,proxy,debug,replicant
+#plugins = admin,proxy
+plugins = proxy
+#user = ...
+
+# module: admin
+admin-address = 127.0.0.1:4041
+#admin-lua-script = ...
+#admin-password = ...
+#admin-username = ...
+
+# module: proxy
+#no-proxy = false
+proxy-address = 127.0.0.1:4040
+proxy-backend-addresses = 127.0.0.1:3306
+proxy-fix-bug-25371 = false
+#proxy-lua-script = ...
+#proxy-pool-no-change-user = ...
+#proxy-read-only-backend-addresses = ...
+proxy-skip-profiling = false
+
+# module: replicant
+#replicant-master-address = ...
+#replicant-username = ...
+#replicant-password = ...
+#replicant-read-binlogs = ...
+
+# module: debug
+debug-address = 127.0.0.1:4043
diff --git a/dev-db/mysql-proxy/files/mysql-proxy.confd b/dev-db/mysql-proxy/files/mysql-proxy.confd
new file mode 100644
index 000000000000..079530159f82
--- /dev/null
+++ b/dev-db/mysql-proxy/files/mysql-proxy.confd
@@ -0,0 +1,12 @@
+# /etc/conf.d/mysql-proxy: config file for /etc/init.d/mysql-proxy
+
+# location of pidfile
+PIDFILE="/var/run/mysql-proxy.pid"
+
+# general options for mysql-proxy
+# do NOT specify --daemon or --pid-file=... here!
+OPTS="--log-use-syslog"
+
+# if you want mysql-proxy to depend on mysql, enable this:
+#RC_NEED="mysql" # baselayout-1
+#rc_need="mysql" # baselayout-2/OpenRC
diff --git a/dev-db/mysql-proxy/files/mysql-proxy.confd-0.8.0-r1 b/dev-db/mysql-proxy/files/mysql-proxy.confd-0.8.0-r1
new file mode 100644
index 000000000000..8b86431a3d8f
--- /dev/null
+++ b/dev-db/mysql-proxy/files/mysql-proxy.confd-0.8.0-r1
@@ -0,0 +1,12 @@
+# /etc/conf.d/mysql-proxy: config file for /etc/init.d/mysql-proxy
+
+# location of pidfile
+PIDFILE="/var/run/mysql-proxy.pid"
+
+# general options for mysql-proxy
+# do NOT specify --daemon or --pid-file=... here!
+OPTS="--defaults-file=/etc/mysql/mysql-proxy.cnf"
+
+# if you want mysql-proxy to depend on mysql, enable this:
+#RC_NEED="mysql" # baselayout-1
+#rc_need="mysql" # baselayout-2/OpenRC
diff --git a/dev-db/mysql-proxy/files/mysql-proxy.initd b/dev-db/mysql-proxy/files/mysql-proxy.initd
new file mode 100644
index 000000000000..7107facfd6f8
--- /dev/null
+++ b/dev-db/mysql-proxy/files/mysql-proxy.initd
@@ -0,0 +1,22 @@
+#!/sbin/openrc-run
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting MySQL Proxy"
+ start-stop-daemon --start --quiet \
+ --exec /usr/bin/mysql-proxy \
+ -- --daemon --pid-file="${PIDFILE}" ${OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping MySQL Proxy"
+ start-stop-daemon --stop --quiet \
+ --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/dev-db/mysql-proxy/metadata.xml b/dev-db/mysql-proxy/metadata.xml
new file mode 100644
index 000000000000..dc0c708273db
--- /dev/null
+++ b/dev-db/mysql-proxy/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <longdescription>
+MySQL Proxy is a simple program that sits between your client and MySQL
+server(s) that can monitor, analyze or transform their communication. Its
+flexibility allows for unlimited uses; common ones include: load balancing;
+failover; query analysis; query filtering and modification; and many more.
+</longdescription>
+ <upstream>
+ <remote-id type="launchpad">mysql-proxy</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/mysql-proxy/mysql-proxy-0.8.2-r1.ebuild b/dev-db/mysql-proxy/mysql-proxy-0.8.2-r1.ebuild
new file mode 100644
index 000000000000..6a7abae6bab8
--- /dev/null
+++ b/dev-db/mysql-proxy/mysql-proxy-0.8.2-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils versionator
+
+MY_PV=$(get_version_component_range 1-2)
+DESCRIPTION="A Proxy for the MySQL Client/Server protocol"
+HOMEPAGE="http://dev.mysql.com/doc/mysql-proxy/en/"
+SRC_URI="https://launchpad.net/${PN}/${MY_PV}/${PV}/+download/${P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="examples"
+RDEPEND=">=dev-libs/libevent-2.1
+ >=dev-libs/glib-2.16
+ >=dev-lang/lua-5.1:0"
+DEPEND="${RDEPEND}
+ >=virtual/mysql-5.0
+ virtual/pkgconfig"
+
+src_prepare() {
+ sed -i \
+ -e 's|_EVENT_VERSION|LIBEVENT_VERSION|g' \
+ src/chassis-mainloop.c || die
+}
+
+src_configure() {
+ econf \
+ --includedir=/usr/include/${PN} \
+ --with-mysql \
+ --with-lua \
+ || die "econf failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ newinitd "${FILESDIR}"/${PN}.initd ${PN} || die
+ newconfd "${FILESDIR}"/${PN}.confd-0.8.0-r1 ${PN} || die
+ dodoc ChangeLog NEWS README
+ if use examples; then
+ docinto examples
+ dodoc examples/*.lua || die
+ dodoc lib/*.lua || die
+ fi
+ # mysql-proxy will refuse to start unless the config file is at most 0660.
+ insinto /etc/mysql
+ insopts -m0660
+ doins "${FILESDIR}"/${PN}.cnf || die
+}