Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Dec 2013 10:28:53 GMT
From:      Horia Racoviceanu <horia@racoviceanu.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/184654: New port: databases/galera Synchronous multi-master replication engine
Message-ID:  <201312101028.rBAASrJP094811@oldred.freebsd.org>
Resent-Message-ID: <201312101030.rBAAU05o006987@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         184654
>Category:       ports
>Synopsis:       New port: databases/galera Synchronous multi-master replication engine
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 10 10:30:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Horia Racoviceanu
>Release:        9.2-RELEASE
>Organization:
>Environment:
FreeBSD aitch 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Fri Sep 27 03:52:52 UTC 2013 root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC i386
>Description:
Galera is a synchronous multi-master replication engine that provides its
service through wsrep API (https://launchpad.net/wsrep). It features
optimistic transaction execution and commit time replication and
certification of writesets.

WWW: http://www.codership.com/
>How-To-Repeat:
Build log:
https://redports.org/buildarchive/20131210083729-79880/
>Fix:


Patch attached with submission follows:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	galera
#	galera/Makefile
#	galera/pkg-descr
#	galera/distinfo
#	galera/files
#	galera/files/garb.in
#
echo c - galera
mkdir -p galera > /dev/null 2>&1
echo x - galera/Makefile
sed 's/^X//' >galera/Makefile << 'a56e76b7267450f451944cd75a5ade44'
X# Created by: Horia Racoviceanu <horia@racoviceanu.com>
X# $FreeBSD$
X
XPORTNAME=	galera
XPORTVERSION=	25.3.2
XDISTVERSIONSUFFIX=	-src
XCATEGORIES=	databases
XMASTER_SITES=	https://launchpadlibrarian.net/158038010/
X
XMAINTAINER=	horia@racoviceanu.com
XCOMMENT=	Synchronous multi-master replication engine
X
XLICENSE=	GPLv3
X
XBUILD_DEPENDS+=	${LOCALBASE}/include/boost/shared_ptr.hpp:${PORTSDIR}/devel/boost-libs \
X		${LOCALBASE}/bin/checkmk:${PORTSDIR}/devel/libcheck
XLIB_DEPENDS=	libexecinfo.so:${PORTSDIR}/devel/libexecinfo
X
XSCRIPTS_ENV=	TARGET=${STAGEDIR}${PREFIX}/lib
X
XUSES=		scons
XSCONS_ARGS=	-Q -c --conf=force --warn=no-missing-sconscript
X
XUSE_GCC=	yes
XUSE_LDCONFIG=	yes
XUSE_OPENSSL=	yes
XUSE_RC_SUBR=	garb
X
XCXXFLAGS+=	-std=c++11
X
XSUB_LIST=	LD_LIBRARY_PATH=${TEST_MAKE_ENV}
X
XPLIST_FILES=	bin/garbd \
X		lib/libgalera_smm.so \
X		lib/libgalera.so
X
XPORTDOCS=	AUTHORS README
X
XOPTIONS_DEFINE=	DOCS TEST
X
XTEST_MAKE_ENV+=	LD_LIBRARY_PATH=${LOCALBASE}/lib/${CC}:$$LD_LIBRARY_PATH
X
X.include <bsd.port.options.mk>
X
X.if ${OSVERSION} < 900506
XIGNORE=	need __WORDSIZE found in FreeBSD 9
X.endif
X
Xpost-patch:
X	@${REINPLACE_CMD} -e "/    conf.env.Append(CPPFLAGS = ' -Werror')/d" \
X		${WRKSRC}/SConstruct
X.if ! ${PORT_OPTIONS:MTEST}
X	@${REINPLACE_CMD} -e "s|'tests', 1|'tests', 0|" ${WRKSRC}/SConstruct
X.endif
X.if ${PORT_OPTIONS:MTEST}
X	@${REINPLACE_CMD} -e "s|(tc, 60)|(tc, 180)|" \
X		${WRKSRC}/${PORTNAME}/tests/ist_check.cpp
X.endif
X
Xdo-install:
X	${INSTALL_LIB} ${WRKDIR}/${DISTNAME}/libgalera_smm.so ${STAGEDIR}${PREFIX}/lib/
X	@(cd ${STAGEDIR}${PREFIX}/lib && ${LN} -sf libgalera_smm.so lib${PORTNAME}.so)
X	${INSTALL_PROGRAM} ${WRKDIR}/${DISTNAME}/garb/garbd ${STAGEDIR}${PREFIX}/bin/
X
X	@${MKDIR} ${STAGEDIR}${DOCSDIR}
X	${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
X
X.include <bsd.port.mk>
a56e76b7267450f451944cd75a5ade44
echo x - galera/pkg-descr
sed 's/^X//' >galera/pkg-descr << '379cdda07570333c04313562f33484b8'
XGalera is a synchronous multi-master replication engine that provides its
Xservice through wsrep API (https://launchpad.net/wsrep). It features
Xoptimistic transaction execution and commit time replication and
Xcertification of writesets.
X
XWWW: http://www.codership.com/
379cdda07570333c04313562f33484b8
echo x - galera/distinfo
sed 's/^X//' >galera/distinfo << '7a063854f908d24c7d2d206b7a92676b'
XSHA256 (galera-25.3.2-src.tar.gz) = 5dd54364720f8854088590bdfea1e3a7f3e37fda3dfe8a5f58ebcc987cc6788d
XSIZE (galera-25.3.2-src.tar.gz) = 3808803
7a063854f908d24c7d2d206b7a92676b
echo c - galera/files
mkdir -p galera/files > /dev/null 2>&1
echo x - galera/files/garb.in
sed 's/^X//' >galera/files/garb.in << '257044ddbaf13cd105f11ad73bf9a165'
X#!/bin/sh
X#
X# garb.sh for rc.d usage (c) 2013 Codership Oy
X# $Id$
X
X# PROVIDE: garb
X# REQUIRE: LOGIN
X# KEYWORD: shutdown
X#
X# Add the following line to /etc/rc.conf to enable Galera Arbitrator Daemon (garbd):
X#  garb_enable (bool):         Set to "NO" by default.
X#                              Set it to "YES" to enable Galera Arbitrator Daemon.
X#  garb_galera_nodes (str):    A space-separated list of node addresses (address[:port]) in the cluster
X#                              (default empty).
X#  garb_galera_group (str):    Galera cluster name, should be the same as on the rest of the nodes.
X#                              (default empty).
X# Optional:
X#  garb_galera_options (str):  Optional Galera internal options string (e.g. SSL settings)
X#                              see http://www.codership.com/wiki/doku.php?id=galera_parameters
X#                              (default empty).
X#  garb_log_file (str):        Log file for garbd (default empty). Optional, by default logs to syslog
X#  garb_pid_file (str):        Custum PID file path and name.
X#                              Default to "/var/run/garb.pid".
X#
X
X. /etc/rc.subr
X
Xname="garb"
Xrcvar=garb_enable
X
Xload_rc_config $name
X
X# set defaults
X: ${garb_enable="NO"}
X: ${garb_galera_nodes=""}
X: ${garb_galera_group=""}
X: ${garb_galera_options=""}
X: ${garb_log_file=""}
X: ${garb_pid_file="/var/run/garb.pid"}
X
Xprocname="%%PREFIX%%/bin/garbd"
Xcommand="/usr/sbin/daemon"
Xcommand_args="-c -f -u nobody -p $garb_pid_file $procname"
Xstart_precmd="${name}_prestart"
X#start_cmd="${name}_start"
Xstart_postcmd="${name}_poststart"
Xstop_precmd="${name}_prestop"
X#stop_cmd="${name}_stop"
X#stop_postcmd="${name}_poststop"
X#extra_commands="reload"
X#reload_cmd="${name}_reload"
Xexport %%LD_LIBRARY_PATH%%
X
Xgarb_prestart()
X{
X	[ "$(id -ur)" != "0" ] && err 4 "root rights are required to start $name"
X	[ -r "$garb_pid_file" ] && err 0 "$procname is already running with PID $(cat $garb_pid_file)"
X	[ -x "$procname" ] || err 5 "$procname is not found"
X
X	# check that node addresses are configured
X	[ -z "$garb_galera_nodes" ] && err 6 "List of garb_galera_nodes is not configured"
X	[ -z "$garb_galera_group" ] && err 6 "garb_galera_group name is not configured"
X
X	GALERA_PORT=${GALERA_PORT:-4567}
X
X	# Find a working node
X	for ADDRESS in ${garb_galera_nodes} 0; do
X		HOST=$(echo $ADDRESS | cut -d \: -f 1)
X		PORT=$(echo $ADDRESS | cut -d \: -f 2)
X		PORT=${PORT:-$GALERA_PORT}
X		nc -z $HOST $PORT >/dev/null 2>&1 && break
X	done
X	[ ${ADDRESS} == "0" ] && err 1 "None of the nodes in $garb_galera_nodes is accessible"
X
X	command_args="$command_args -a gcomm://$ADDRESS"
X	[ -n "$garb_galera_group" ]   && command_args="$command_args -g $garb_galera_group"
X	[ -n "$garb_galera_options" ] && command_args="$command_args -o $garb_galera_options"
X	[ -n "$garb_log_file" ]       && command_args="$command_args -l $garb_log_file"
X	return 0
X}
X
Xgarb_poststart()
X{
X	local timeout=15
X	while [ ! -f "$garb_pid_file" -a $timeout -gt 0 ]; do
X		timeout=$(( timeout - 1 ))
X		sleep 1
X	done
X	return 0
X}
X
Xgarb_prestop() {
X	[ "$(id -ur)" != "0" ] && err 4 "root rights are required to stop $name"
X	[ -r $garb_pid_file ] || err 0 ""
X	return 0
X}
X
Xrun_rc_command "$1"
257044ddbaf13cd105f11ad73bf9a165
exit



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312101028.rBAASrJP094811>