summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys-cluster/galera/ChangeLog11
-rw-r--r--sys-cluster/galera/files/disable-tests.patch80
-rw-r--r--sys-cluster/galera/files/garb.cnf17
-rw-r--r--sys-cluster/galera/files/garb.sh63
-rw-r--r--sys-cluster/galera/files/respect-flags.patch35
-rw-r--r--sys-cluster/galera/galera-25.3.5.ebuild87
-rw-r--r--sys-cluster/galera/metadata.xml8
7 files changed, 301 insertions, 0 deletions
diff --git a/sys-cluster/galera/ChangeLog b/sys-cluster/galera/ChangeLog
new file mode 100644
index 000000000000..c299b5b013db
--- /dev/null
+++ b/sys-cluster/galera/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for sys-cluster/galera
+# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/galera/ChangeLog,v 1.1 2014/07/30 06:26:05 robbat2 Exp $
+
+*galera-25.3.5 (30 Jul 2014)
+
+ 30 Jul 2014; Robin H. Johnson <robbat2@gentoo.org> +files/disable-tests.patch,
+ +files/garb.cnf, +files/garb.sh, +files/respect-flags.patch,
+ +galera-25.3.5.ebuild, +metadata.xml:
+ Bring MariaDB-Galera from the overlay into the tree. Thanks to the great work
+ of Brian Evans <grknight@gentoo.org>.
diff --git a/sys-cluster/galera/files/disable-tests.patch b/sys-cluster/galera/files/disable-tests.patch
new file mode 100644
index 000000000000..b82294b32241
--- /dev/null
+++ b/sys-cluster/galera/files/disable-tests.patch
@@ -0,0 +1,80 @@
+diff -aurN a/galera/SConscript b/galera/SConscript
+--- a/galera/SConscript 2013-03-11 02:44:50.000000000 -0400
++++ b/galera/SConscript 2013-05-13 13:13:20.851827437 -0400
+@@ -1,2 +1,2 @@
+
+-SConscript(['src/SConscript', 'tests/SConscript'])
++SConscript(['src/SConscript'])
+diff -aurN a/galerautils/SConscript b/galerautils/SConscript
+--- a/galerautils/SConscript 2013-03-11 02:44:50.000000000 -0400
++++ b/galerautils/SConscript 2013-05-13 13:15:37.010071765 -0400
+@@ -1,3 +1,3 @@
+ # SConscript for building galerautils
+
+-SConscript(Split('''src/SConscript tests/SConscript'''))
++SConscript(Split('''src/SConscript'''))
+diff -aurN a/gcache/SConscript b/gcache/SConscript
+--- a/gcache/SConscript 2013-03-11 02:44:50.000000000 -0400
++++ b/gcache/SConscript 2013-05-13 13:15:55.179837389 -0400
+@@ -1,3 +1,3 @@
+ # SConscript for building galerautils
+
+-SConscript(Split('''src/SConscript tests/SConscript'''))
++SConscript(Split('''src/SConscript'''))
+diff -aurN a/gcomm/SConscript b/gcomm/SConscript
+--- a/gcomm/SConscript 2013-03-11 02:44:50.000000000 -0400
++++ b/gcomm/SConscript 2013-05-13 13:16:08.979659369 -0400
+@@ -1,3 +1,3 @@
+ # SCons build script for building gcomm
+
+-SConscript(Split('''src/SConscript test/SConscript'''))
++SConscript(Split('''src/SConscript'''))
+diff -aurN a/gcs/src/SConscript b/gcs/src/SConscript
+--- a/gcs/src/SConscript 2013-03-11 02:44:50.000000000 -0400
++++ b/gcs/src/SConscript 2013-05-13 13:12:53.122184848 -0400
+@@ -46,8 +46,6 @@
+ source = 'gcs_test.c',
+ LINK = libgcs_env['CXX'])
+
+-SConscript('unit_tests/SConscript')
+-
+ #
+ env.Append(LIBGALERA_OBJS = libgcs_env.SharedObject(libgcs_sources))
+
+diff -aurN a/SConstruct b/SConstruct
+--- a/SConstruct 2013-03-11 02:44:50.000000000 -0400
++++ b/SConstruct 2013-05-13 13:11:03.493597370 -0400
+@@ -305,20 +305,6 @@
+ # Clone base from default environment
+ check_env = env.Clone()
+
+-conf = Configure(check_env)
+-
+-# Check header and library
+-
+-if not conf.CheckHeader('check.h'):
+- print 'Error: check header file not found or not usable'
+- Exit(1)
+-
+-if not conf.CheckLib('check'):
+- print 'Error: check library not found or not usable'
+- Exit(1)
+-
+-conf.Finish()
+-
+ # Note: Don't do this, glibc does not like static linking
+ # Link unit tests statically
+ # check_env.Append(LINKFLAGS = ' -static')
+@@ -328,11 +314,7 @@
+ #
+
+ def builder_unit_test(target, source, env):
+- app = str(source[0].abspath)
+- if os.spawnl(os.P_WAIT, app, app)==0:
+- open(str(target[0]),'w').write("PASSED\n")
+- else:
+- return 1
++ print("Disabled\n")
+ # Create a builder for tests
+ bld = Builder(action = builder_unit_test)
+ check_env.Append(BUILDERS = {'Test' : bld})
diff --git a/sys-cluster/galera/files/garb.cnf b/sys-cluster/galera/files/garb.cnf
new file mode 100644
index 000000000000..4f0047a02c25
--- /dev/null
+++ b/sys-cluster/galera/files/garb.cnf
@@ -0,0 +1,17 @@
+# Copyright (C) 2012 Coedership Oy
+# This config file is to be sourced by garbd service script.
+
+# A space-separated list of node addresses (address[:port]) in the cluster
+# GALERA_NODES=""
+
+# Galera cluster name, should be the same as on the rest of the nodes.
+# GALERA_GROUP=""
+
+# Optional Galera internal options string (e.g. SSL settings)
+# see http://www.codership.com/wiki/doku.php?id=galera_parameters
+# GALERA_OPTIONS=""
+
+# Log file for garbd. Optional, by default logs to syslog
+# LOG_FILE=""
+
+PIDFILE=/var/run/garbd
diff --git a/sys-cluster/galera/files/garb.sh b/sys-cluster/galera/files/garb.sh
new file mode 100644
index 000000000000..e5538bcb4269
--- /dev/null
+++ b/sys-cluster/galera/files/garb.sh
@@ -0,0 +1,63 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ use net
+ after mysql
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+
+ if [ -z "${GALERA_NODES}" ]; then
+ eerror "List of GALERA_NODES is not configured"
+ return 1
+ fi
+
+ if [ -z "${GALERA_GROUP}" ]; then
+ eerror "GALERA_GROUP name is not configured"
+ return 1
+ fi
+
+ GALERA_PORT="${GALERA_PORT:-4567}"
+
+ for ADDRESS in ${GALERA_NODES} 0; do
+ HOST=$(echo $ADDRESS | cut -d \: -f 1 )
+ PORT=$(echo $ADDRESS | cut -d \: -f 2 )
+ if [[ "${HOST}" == "${PORT}" ]]; then
+ PORT=${GALERA_PORT}
+ fi
+ PORT=${PORT:-$GALERA_PORT}
+ nc -z ${HOST} ${PORT} > /dev/null && break
+ done
+ if [ ${ADDRESS} == "0" ]; then
+ eerror "None of the nodes in GALERA_NODES is accessible"
+ return 1
+ fi
+
+ OPTIONS="-a gcomm://${ADDRESS} -g ${GALERA_GROUP}"
+ [ -n "${GALERA_OPTIONS}" ] && OPTIONS="${OPTIONS} -o ${GALERA_OPTIONS}"
+ [ -n "${LOG_FILE}" ] && OPTIONS="${OPTIONS} -l ${LOG_FILE}"
+
+ start-stop-daemon \
+ --start \
+ --exec /usr/bin/garbd \
+ --pidfile "${PIDFILE}" \
+ --make-pidfile \
+ --user garbd \
+ --group garbd \
+ --background \
+ -- ${OPTIONS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon \
+ --stop \
+ --exec /usr/bin/garbd \
+ --pidfile "${PIDFILE}"
+ eend $?
+}
+
diff --git a/sys-cluster/galera/files/respect-flags.patch b/sys-cluster/galera/files/respect-flags.patch
new file mode 100644
index 000000000000..d7e5f37817ef
--- /dev/null
+++ b/sys-cluster/galera/files/respect-flags.patch
@@ -0,0 +1,35 @@
+--- a/SConstruct 2014-03-07 14:27:26.797904671 -0500
++++ b/SConstruct 2014-03-07 14:31:18.672478115 -0500
+@@ -49,7 +49,7 @@
+ build_target = 'all'
+
+ # Optimization level
+-opt_flags = ' -g -O3 -DNDEBUG'
++opt_flags = ' -DNDEBUG'
+
+ # Architecture (defaults to build host type)
+ compile_arch = ''
+@@ -214,12 +214,12 @@
+ ' -Wall -Wextra -Wno-unused-parameter')
+
+ # C-specific flags
+-env.Replace(CFLAGS = ' -std=c99 -fno-strict-aliasing -pipe')
++env.Replace(CFLAGS = os.getenv('CFLAGS','') + ' -std=c99 -fno-strict-aliasing -pipe')
+
+ # CXX-specific flags
+ # Note: not all 3rd-party libs like '-Wold-style-cast -Weffc++'
+ # adding those after checks
+-env.Replace(CXXFLAGS = ' -Wno-long-long -Wno-deprecated -ansi')
++env.Replace(CXXFLAGS = os.getenv('CXXFLAGS','') + ' -Wno-long-long -Wno-deprecated -ansi')
+ if sysname != 'sunos':
+ env.Append(CXXFLAGS = ' -pipe')
+
+@@ -228,7 +228,7 @@
+ # TODO: enable '-Wl,--warn-common -Wl,--fatal-warnings' after warnings from
+ # static linking have beed addressed
+ #
+-env.Append(LINKFLAGS = link_arch)
++env.Append(LINKFLAGS = link_arch + ' ' + os.getenv('LDFLAGS',''))
+
+ #
+ # Check required headers and libraries (autoconf functionality)
diff --git a/sys-cluster/galera/galera-25.3.5.ebuild b/sys-cluster/galera/galera-25.3.5.ebuild
new file mode 100644
index 000000000000..bc4359116e58
--- /dev/null
+++ b/sys-cluster/galera/galera-25.3.5.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/galera/galera-25.3.5.ebuild,v 1.1 2014/07/30 06:26:05 robbat2 Exp $
+
+EAPI=5
+
+MY_P="${PN}-${PV}-src"
+
+inherit scons-utils multilib toolchain-funcs base versionator eutils
+DESCRIPTION="Synchronous multi-master replication engine that provides its service through wsrep API"
+HOMEPAGE="http://www.codership.org/"
+SRC_URI="https://launchpad.net/${PN}/$(get_version_component_range 2).x/${PV}/+download/${MY_P}.tar.gz"
+LICENSE="GPL-2 BSD"
+
+SLOT="0"
+
+KEYWORDS="~amd64 ~x86"
+IUSE="garbd ssl test"
+
+CDEPEND="
+ ssl? ( dev-libs/openssl )
+ >=dev-libs/boost-1.41
+ "
+DEPEND="${DEPEND}
+ ${CDEPEND}
+ dev-libs/check
+ >=sys-devel/gcc-4.4
+ >=dev-cpp/asio-1.4.8[ssl?]
+ "
+#Run time only
+RDEPEND="${CDEPEND}
+ garbd? ( || (
+ net-analyzer/netcat
+ net-analyzer/netcat6
+ net-analyzer/gnu-netcat
+ net-analyzer/openbsd-netcat
+ ) )"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_preinst() {
+ if use garbd ; then
+ enewgroup garbd
+ enewuser garbd
+ fi
+}
+
+src_prepare() {
+ # Remove bundled dev-cpp/asio
+ rm -r "${S}/asio" || die
+
+ # Respect {C,LD}FLAGS.
+ epatch "${FILESDIR}/respect-flags.patch"
+
+ #Remove optional garbd daemon
+ if ! use garbd ; then
+ rm -r "${S}/garb" || die
+ fi
+
+ epatch_user
+}
+
+src_configure() {
+ tc-export CC CXX
+ # strict_build_flags=0 disables -Werror, -pedantic, -Weffc++,
+ # and -Wold-style-cast
+ myesconsargs=(
+ $(use_scons ssl ssl 1 0)
+ $(use_scons test tests 1 0)
+ strict_build_flags=0
+ )
+}
+
+src_compile() {
+ escons --warn=no-missing-sconscript
+}
+
+src_install() {
+ dodoc scripts/packages/README scripts/packages/README-MySQL
+ if use garbd ; then
+ dobin garb/garbd
+ newconfd "${FILESDIR}/garb.cnf" garbd
+ newinitd "${FILESDIR}/garb.sh" garbd
+ fi
+ exeinto /usr/$(get_libdir)/${PN}
+ doexe libgalera_smm.so
+}
diff --git a/sys-cluster/galera/metadata.xml b/sys-cluster/galera/metadata.xml
new file mode 100644
index 000000000000..6c8e5852a141
--- /dev/null
+++ b/sys-cluster/galera/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>mysql</herd>
+<use>
+ <flag name='garbd'>Install Galera Arbitrator - a stateless daemon which acts as a lightweight group member</flag>
+</use>
+</pkgmetadata>