View | Details | Raw Unified | Return to bug 195457 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-31 / +28 lines)
Lines 4-10 Link Here
4
PORTNAME=	galera
4
PORTNAME=	galera
5
PORTVERSION=	25.3.5
5
PORTVERSION=	25.3.5
6
DISTVERSIONSUFFIX=	-src
6
DISTVERSIONSUFFIX=	-src
7
PORTREVISION=	1
7
PORTREVISION=	2
8
CATEGORIES=	databases
8
CATEGORIES=	databases
9
MASTER_SITES=	https://launchpadlibrarian.net/170877450/
9
MASTER_SITES=	https://launchpadlibrarian.net/170877450/
10
10
Lines 21-35 Link Here
21
USES=		execinfo python:build scons shebangfix
21
USES=		execinfo python:build scons shebangfix
22
22
23
USE_CXXSTD=	c++11
23
USE_CXXSTD=	c++11
24
USE_GCC=	yes
24
USE_LDCONFIG=	yes
25
USE_LDCONFIG=	yes
25
USE_OPENSSL=	yes
26
USE_OPENSSL=	yes
26
27
28
LDFLAGS+=	-lboost_program_options -lboost_system
27
MAKE_CMD=	${SCONS} -j${MAKE_JOBS_NUMBER} --config=force
29
MAKE_CMD=	${SCONS} -j${MAKE_JOBS_NUMBER} --config=force
28
30
29
SHEBANG_FILES=	docs/sphinx-*
31
SHEBANG_FILES=	docs/sphinx-*
30
32
31
PLIST_FILES=	%%GARB%%bin/garbd \
33
PLIST_FILES=	lib/libgalera_smm.so \
32
		lib/libgalera_smm.so \
33
		lib/libgalera.so
34
		lib/libgalera.so
34
35
35
PORTDOCS=	*
36
PORTDOCS=	*
Lines 51-60 Link Here
51
DOCSDIR5=	${DOCSDIR}/gcs
52
DOCSDIR5=	${DOCSDIR}/gcs
52
DOC_FILES5=	ChangeLog README doc/*.txt doc/*.odt doc/*.png
53
DOC_FILES5=	ChangeLog README doc/*.txt doc/*.odt doc/*.png
53
54
54
OPTIONS_DEFINE=	BOOSTPOOL BPOSTATIC DEBUG DOCS GARB TEST
55
OPTIONS_DEFINE=	BOOSTPOOL BPOSTATIC DEBUG DOCS TEST
55
OPTIONS_GROUP=	DOCS
56
OPTIONS_GROUP=	DOCS
56
OPTIONS_GROUP_DOCS=	EPUB JSON LATEX PICKLE
57
OPTIONS_GROUP_DOCS=	EPUB JSON LATEX PICKLE
57
OPTIONS_DEFAULT=GARB
58
OPTIONS_SUB=	yes
58
OPTIONS_SUB=	yes
59
59
60
BOOSTPOOL_DESC=	Use boost pool allocator
60
BOOSTPOOL_DESC=	Use boost pool allocator
Lines 61-81 Link Here
61
BPOSTATIC_DESC=	Use static boost_program_options
61
BPOSTATIC_DESC=	Use static boost_program_options
62
EPUB_DESC=	EPUB support
62
EPUB_DESC=	EPUB support
63
PICKLE_DESC=	Pickle support
63
PICKLE_DESC=	Pickle support
64
GARB_DESC=	Galera Arbitrator
65
64
66
GARB_USE=	RC_SUBR=garb
67
68
.include <bsd.port.pre.mk>
65
.include <bsd.port.pre.mk>
69
66
70
.if ${OSVERSION} > 1000000
71
BUILD_DEPENDS+=	asio>=0:${PORTSDIR}/net/asio
72
RUN_DEPENDS+=	asio>=0:${PORTSDIR}/net/asio
73
SUB_LIST=	LD_LIBRARY_PATH=$$LD_LIBRARY_PATH
74
.else
75
USE_GCC=	yes
76
SUB_LIST=	LD_LIBRARY_PATH=${LOCALBASE}/lib/${CC}:$$LD_LIBRARY_PATH
77
.endif
78
79
.if ${OSVERSION} < 900506
67
.if ${OSVERSION} < 900506
80
IGNORE=	need __WORDSIZE found in FreeBSD 9
68
IGNORE=	need __WORDSIZE found in FreeBSD 9
81
.endif
69
.endif
Lines 93-111 Link Here
93
.endif
81
.endif
94
82
95
post-patch:
83
post-patch:
96
	@${REINPLACE_CMD} -e '/-Werror/d' ${WRKSRC}/SConstruct
84
	@${REINPLACE_CMD} -e "/-Werror/d; \
97
85
		s|LINKFLAGS = link_arch|& + ' ' + os.environ['LDFLAGS']|" \
98
.if ${OSVERSION} > 1000000
86
		${WRKSRC}/SConstruct
99
	@${REINPLACE_CMD} -e '/#\/asio/d' ${WRKSRC}/SConstruct
87
	@${REINPLACE_CMD} -e '/#\/asio/d; s|asio.hpp|boost/&|; \
88
		s|asio/ssl.hpp|boost/&|' ${WRKSRC}/SConstruct
89
	@${REINPLACE_CMD} -e 's|asio.hpp|boost/&|; s|asio/ssl.hpp|boost/&|' \
90
		${WRKSRC}/galera/src/ist.hpp \
91
		${WRKSRC}/gcomm/src/asio_protonet.hpp
92
	@${REINPLACE_CMD} -e 's|asio::system_error|::boost::system::system_error|g' \
93
		${WRKSRC}/galera/src/ist.cpp \
94
		${WRKSRC}/gcomm/src/asio_tcp.cpp \
95
		${WRKSRC}/gcomm/src/asio_udp.cpp
96
	@${REINPLACE_CMD} -e 's|asio::error_code|::boost::system::error_code|g' \
97
		${WRKSRC}/gcomm/src/asio_protonet.*pp \
98
		${WRKSRC}/gcomm/src/asio_tcp.*pp \
99
		${WRKSRC}/gcomm/src/asio_udp.*pp
100
	@${REINPLACE_CMD} -e 's|asio::|boost::&|g' \
101
		${WRKSRC}/galera/src/ist.*pp \
102
		${WRKSRC}/galera/src/ist_proto.hpp \
103
		${WRKSRC}/gcomm/src/asio_addr.hpp \
104
		${WRKSRC}/gcomm/src/asio_protonet.*pp \
105
		${WRKSRC}/gcomm/src/asio_tcp.*pp \
106
		${WRKSRC}/gcomm/src/asio_udp.*pp
100
	@${REINPLACE_CMD} -e 's|LLONG_MAX|gu::LOG_MAX|' \
107
	@${REINPLACE_CMD} -e 's|LLONG_MAX|gu::LOG_MAX|' \
101
		${WRKSRC}/galera/src/monitor.hpp
108
		${WRKSRC}/galera/src/monitor.hpp
102
.endif
103
104
.if ! ${PORT_OPTIONS:MGARB}
105
	@${REINPLACE_CMD} -e "s|'galera/SConscript',|'galera/SConscript'])|; \
109
	@${REINPLACE_CMD} -e "s|'galera/SConscript',|'galera/SConscript'])|; \
106
		/'garb\/SConscript'])/d" ${WRKSRC}/SConscript
110
		/'garb\/SConscript'])/d" ${WRKSRC}/SConscript
107
.endif
108
109
	@${REINPLACE_CMD} -e "s|'tests', 1|'tests', 0|" ${WRKSRC}/SConstruct
111
	@${REINPLACE_CMD} -e "s|'tests', 1|'tests', 0|" ${WRKSRC}/SConstruct
110
112
111
.if ! ${PORT_OPTIONS:MTEST}
113
.if ! ${PORT_OPTIONS:MTEST}
Lines 189-199 Link Here
189
	@(cd ${STAGEDIR}${PREFIX}/lib && ${LN} -sf libgalera_smm.so \
191
	@(cd ${STAGEDIR}${PREFIX}/lib && ${LN} -sf libgalera_smm.so \
190
		libgalera.so)
192
		libgalera.so)
191
193
192
.if ${PORT_OPTIONS:MGARB}
193
	${INSTALL_PROGRAM} ${WRKDIR}/${DISTNAME}/garb/garbd \
194
		${STAGEDIR}${PREFIX}/bin/
195
.endif
196
197
	@(cd ${WRKSRC}/docs/build/man/man1 && ${INSTALL_MAN} \
194
	@(cd ${WRKSRC}/docs/build/man/man1 && ${INSTALL_MAN} \
198
		${PORTNAME}.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/)
195
		${PORTNAME}.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/)
199
	@(cd ${WRKSRC}/docs/build/man/man3 && ${RM} _*.3 && ${INSTALL_MAN} \
196
	@(cd ${WRKSRC}/docs/build/man/man3 && ${RM} _*.3 && ${INSTALL_MAN} \
(-)files/garb.in (-94 lines)
Lines 1-94 Link Here
1
#!/bin/sh
2
#
3
# garb.sh for rc.d usage (c) 2013 Codership Oy
4
# $Id$
5
6
# PROVIDE: garb
7
# REQUIRE: LOGIN
8
# KEYWORD: shutdown
9
10
#
11
# Add the following line to /etc/rc.conf to enable Galera Arbitrator Daemon (garbd):
12
#  garb_enable (bool):         Set to "NO" by default.
13
#                              Set it to "YES" to enable Galera Arbitrator Daemon.
14
#  garb_galera_nodes (str):    A space-separated list of node addresses (address[:port]) in the cluster
15
#                              (default empty).
16
#  garb_galera_group (str):    Galera cluster name, should be the same as on the rest of the nodes.
17
#                              (default empty).
18
# Optional:
19
#  garb_galera_options (str):  Optional Galera internal options string (e.g. SSL settings)
20
#                              see http://www.codership.com/wiki/doku.php?id=galera_parameters
21
#                              (default empty).
22
#  garb_log_file (str):        Log file for garbd (default empty). Optional, by default logs to syslog
23
#  garb_pid_file (str):        Custum PID file path and name.
24
#                              Default to "/var/run/garb.pid".
25
#
26
27
. /etc/rc.subr
28
29
name="garb"
30
rcvar=garb_enable
31
32
load_rc_config $name
33
34
# set defaults
35
: ${garb_enable="NO"}
36
: ${garb_galera_nodes=""}
37
: ${garb_galera_group=""}
38
: ${garb_galera_options=""}
39
: ${garb_log_file=""}
40
: ${garb_pid_file="/var/run/garb.pid"}
41
42
procname="%%PREFIX%%/bin/garbd"
43
command="/usr/sbin/daemon"
44
command_args="-c -f -u nobody -p $garb_pid_file $procname"
45
start_precmd="${name}_prestart"
46
start_postcmd="${name}_poststart"
47
stop_precmd="${name}_prestop"
48
export LD_LIBRARY_PATH=%%LD_LIBRARY_PATH%%
49
50
garb_prestart()
51
{
52
	[ "$(id -ur)" != "0" ] && err 4 "root rights are required to start $name"
53
	[ -r "$garb_pid_file" ] && err 0 "$procname is already running with PID $(cat $garb_pid_file)"
54
	[ -x "$procname" ] || err 5 "$procname is not found"
55
56
	# check that node addresses are configured
57
	[ -z "$garb_galera_nodes" ] && err 6 "List of garb_galera_nodes is not configured"
58
	[ -z "$garb_galera_group" ] && err 6 "garb_galera_group name is not configured"
59
60
	GALERA_PORT=${GALERA_PORT:-4567}
61
62
	# Find a working node
63
	for ADDRESS in ${garb_galera_nodes} 0; do
64
		HOST=$(echo $ADDRESS | cut -d \: -f 1)
65
		PORT=$(echo $ADDRESS | cut -d \: -f 2)
66
		PORT=${PORT:-$GALERA_PORT}
67
		nc -z $HOST $PORT >/dev/null 2>&1 && break
68
	done
69
	[ ${ADDRESS} == "0" ] && err 1 "None of the nodes in $garb_galera_nodes is accessible"
70
71
	command_args="$command_args -a gcomm://$ADDRESS"
72
	[ -n "$garb_galera_group" ]   && command_args="$command_args -g $garb_galera_group"
73
	[ -n "$garb_galera_options" ] && command_args="$command_args -o $garb_galera_options"
74
	[ -n "$garb_log_file" ]       && command_args="$command_args -l $garb_log_file"
75
	return 0
76
}
77
78
garb_poststart()
79
{
80
	local timeout=15
81
	while [ ! -f "$garb_pid_file" -a $timeout -gt 0 ]; do
82
		timeout=$(( timeout - 1 ))
83
		sleep 1
84
	done
85
	return 0
86
}
87
88
garb_prestop() {
89
	[ "$(id -ur)" != "0" ] && err 4 "root rights are required to stop $name"
90
	[ -r $garb_pid_file ] || err 0 ""
91
	return 0
92
}
93
94
run_rc_command "$1"
(-)files/patch-SConstruct (+21 lines)
Line 0 Link Here
1
--- ./SConstruct.orig	2014-08-01 16:33:09.000000000 -0400
2
+++ ./SConstruct	2014-08-01 16:34:45.000000000 -0400
3
@@ -153,7 +153,7 @@
4
 
5
 # Initialize CPPFLAGS and LIBPATH from environment to get user preferences
6
 env.Replace(CPPFLAGS = os.getenv('CPPFLAGS', ''))
7
-env.Replace(LIBPATH = [os.getenv('LIBPATH', '')])
8
+env.Replace(RPATH = [os.getenv('RPATH', '')])
9
 
10
 # Set -pthread flag explicitly to make sure that pthreads are
11
 # enabled on all platforms.
12
@@ -165,6 +165,9 @@
13
     env.Append(CPPFLAGS = ' -I/usr/local/include ')
14
 if sysname == 'sunos':
15
    env.Replace(SHLINKFLAGS = '-shared ')
16
+   env.Replace(AR = 'ar')
17
+   env.Replace(ARFLAGS= 'r')
18
+   env.Replace(ARCOM = '$AR $ARFLAGS $TARGET $SOURCES')
19
 
20
 # Add paths is extra_sysroot argument was specified
21
 extra_sysroot = ARGUMENTS.get('extra_sysroot', '')
(-)files/patch-galerautils__src__gu_errno.h (+47 lines)
Line 0 Link Here
1
--- ./galerautils/src/gu_errno.h.orig	2014-07-31 17:55:31.000000000 -0400
2
+++ ./galerautils/src/gu_errno.h	2014-07-31 17:56:57.000000000 -0400
3
@@ -1,5 +1,5 @@
4
 /*
5
- * Copyright (C) 2013 Codership Oy <info@codership.com>
6
+ * Copyright (C) 2014 Codership Oy <info@codership.com>
7
  */
8
 
9
 #ifndef GU_ERRNO_H
10
@@ -8,14 +8,29 @@
11
 #include <errno.h>
12
 
13
 #if defined(__APPLE__) || defined(__FreeBSD__)
14
-# define EBADFD           (ELAST+1) /* the largest errno + 1 */
15
-# define EREMCHG          (ELAST+2)
16
-# define ENOTUNIQ         (ELAST+3)
17
-# define ERESTART         (ELAST+4)
18
-# if defined(__FreeBSD__)
19
-#  define ENOTRECOVERABLE (ELAST+5)
20
-#  define ENODATA         (ELAST+6)
21
-# endif
22
+#  define GU_ELAST ELAST
23
+#else
24
+/* must be high enough to not collide with system errnos but lower than 256 */
25
+#  define GU_ELAST 200
26
+#endif
27
+
28
+#ifndef EBADFD
29
+#  define EBADFD          (GU_ELAST+1)
30
+#endif
31
+#ifndef EREMCHG
32
+#  define EREMCHG         (GU_ELAST+2)
33
+#endif
34
+#ifndef ENOTUNIQ
35
+#  define ENOTUNIQ        (GU_ELAST+3)
36
+#endif
37
+#ifndef ERESTART
38
+#  define ERESTART        (GU_ELAST+4)
39
+#endif
40
+#ifndef ENOTRECOVERABLE
41
+#  define ENOTRECOVERABLE (GU_ELAST+5)
42
+#endif
43
+#ifndef ENODATA
44
+#  define ENODATA         (GU_ELAST+6)
45
 #endif
46
 
47
 #endif /* GU_STR_H */

Return to bug 195457