diff options
-rw-r--r-- | databases/Makefile | 1 | ||||
-rw-r--r-- | databases/galera/Makefile | 221 | ||||
-rw-r--r-- | databases/galera/distinfo | 2 | ||||
-rw-r--r-- | databases/galera/files/garb.in | 94 | ||||
-rw-r--r-- | databases/galera/pkg-descr | 5 |
5 files changed, 323 insertions, 0 deletions
diff --git a/databases/Makefile b/databases/Makefile index e6af21a46d1..4ba0b942768 100644 --- a/databases/Makefile +++ b/databases/Makefile @@ -93,6 +93,7 @@ SUBDIR += frontbase SUBDIR += frontbase-jdbc SUBDIR += gadfly + SUBDIR += galera SUBDIR += gdbm SUBDIR += geoserver-mysql-plugin SUBDIR += gigabase diff --git a/databases/galera/Makefile b/databases/galera/Makefile new file mode 100644 index 00000000000..b4b2483e8ed --- /dev/null +++ b/databases/galera/Makefile @@ -0,0 +1,221 @@ +# Created by: Horia Racoviceanu <horia@racoviceanu.com> +# $FreeBSD$ + +PORTNAME= galera +PORTVERSION= 25.3.5 +DISTVERSIONSUFFIX= -src +CATEGORIES= databases +MASTER_SITES= https://launchpadlibrarian.net/170877450/ + +MAINTAINER= horia@racoviceanu.com +COMMENT= Synchronous multi-master replication engine + +LICENSE= GPLv2 + +BUILD_DEPENDS= checkmk:${PORTSDIR}/devel/libcheck \ + doxygen:${PORTSDIR}/devel/doxygen \ + ${PYTHON_PKGNAMEPREFIX}cloud_sptheme>=0:${PORTSDIR}/textproc/py-cloud_sptheme +LIB_DEPENDS= libboost_date_time.so:${PORTSDIR}/devel/boost-libs \ + libexecinfo.so:${PORTSDIR}/devel/libexecinfo + +USES= scons shebangfix + +USE_CXXSTD= c++11 +USE_LDCONFIG= yes +USE_OPENSSL= yes +USE_PYTHON= yes + +MAKE_CMD= ${SCONS} -j${MAKE_JOBS_NUMBER} --config=force + +SHEBANG_FILES= docs/sphinx-* + +PLIST_FILES= %%GARB%%bin/garbd \ + lib/libgalera_smm.so \ + lib/libgalera.so + +PORTDOCS= * + +DOCSRCDIR1= ${WRKSRC} +DOC_FILES1= AUTHORS README + +DOCSRCDIR2= ${DOCSRCDIR1}/docs/build/doc + +DOCSRCDIR3= ${DOCSRCDIR1}/galerautils +DOCSDIR3= ${DOCSDIR}/galerautils +DOC_FILES3= ChangeLog README + +DOCSRCDIR4= ${DOCSRCDIR1}/gcache +DOCSDIR4= ${DOCSDIR}/gcache +DOC_FILES4= AUTHORS README + +DOCSRCDIR5= ${DOCSRCDIR1}/gcs +DOCSDIR5= ${DOCSDIR}/gcs +DOC_FILES5= ChangeLog README doc/*.txt doc/*.odt doc/*.png + +OPTIONS_DEFINE= BOOSTPOOL BPOSTATIC DEBUG DOCS GARB TEST +OPTIONS_GROUP= DOCS +OPTIONS_GROUP_DOCS= EPUB JSON LATEX PICKLE +OPTIONS_DEFAULT=GARB +OPTIONS_SUB= yes + +BOOSTPOOL_DESC= Use boost pool allocator +BPOSTATIC_DESC= Use static boost_program_options +EPUB_DESC= EPUB support +PICKLE_DESC= Pickle support +GARB_DESC= Galera Arbitrator + +GARB_USE= RC_SUBR=garb + +.include <bsd.port.pre.mk> + +.if ${OSVERSION} > 1000000 +BUILD_DEPENDS+= asio>=0:${PORTSDIR}/net/asio +RUN_DEPENDS:= ${BUILD_DEPENDS} +.else +USE_GCC= yes +.endif + +.if ${OSVERSION} < 900506 +IGNORE= need __WORDSIZE found in FreeBSD 9 +.endif + +.if ${PORT_OPTIONS:MBOOSTPOOL} +MAKE_CMD+= boost_pool=1 +.endif + +.if ${PORT_OPTIONS:MBPOSTATIC} +MAKE_CMD+= bpostatic=${PREFIX}/lib/libboost_program_options.so +.endif + +.if ${PORT_OPTIONS:MDEBUG} +MAKE_CMD+= debug=3 +.endif + +.if ${PORT_OPTIONS:MGARB} +SUB_LIST= LD_LIBRARY_PATH=${LOCALBASE}/lib/${CC}:$$LD_LIBRARY_PATH +.endif + +post-patch: + @${REINPLACE_CMD} -e '/-Werror/d' ${WRKSRC}/SConstruct + +.if ${OSVERSION} > 1000000 + @${REINPLACE_CMD} -e '/#\/asio/d' ${WRKSRC}/SConstruct + @${REINPLACE_CMD} -e 's|LLONG_MAX|gu::LOG_MAX|' \ + ${WRKSRC}/galera/src/monitor.hpp +.endif + +.if ! ${PORT_OPTIONS:MGARB} + @${REINPLACE_CMD} -e "s|'galera/SConscript',|'galera/SConscript'])|; \ + /'garb\/SConscript'])/d" ${WRKSRC}/SConscript +.endif + + @${REINPLACE_CMD} -e "s|'tests', 1|'tests', 0|" ${WRKSRC}/SConstruct + +.if ! ${PORT_OPTIONS:MTEST} + @${REINPLACE_CMD} -e 's| tests/SConscript||' \ + ${WRKSRC}/galerautils/SConscript ${WRKSRC}/gcache/SConscript + @${REINPLACE_CMD} -e "s|, 'tests/SConscript'||" \ + ${WRKSRC}/galera/SConscript +.endif + + @${REINPLACE_CMD} -e "s|\[u'Codership Oy'\], 1|\[u'Codership Oy'\], 8|" \ + ${WRKSRC}/docs/pasture/source/conf.py + +.for d in galerautils gcomm gcs + @${REINPLACE_CMD} -e 's|= ./|= ../../docs/build/doc/${d}|; \ + s|= man|= ../../man|' ${WRKSRC}/${d}/doc/Doxyfile + +. if ! ${PORT_OPTIONS:MDOCS} + @${MKDIR} ${WRKSRC}/docs/build/doc/${d} + @${REINPLACE_CMD} -e '/GENERATE_HTML / s|YES|NO|' \ + ${WRKSRC}/${d}/doc/Doxyfile +. elif ${PORT_OPTIONS:MLATEX} + @${REINPLACE_CMD} -e '/GENERATE_LATEX/ s|NO|YES|; s|= a4wide|= a4|; \ + /LATEX_OUTPUT/ s|latex|&|' ${WRKSRC}/${d}/doc/Doxyfile +. endif +.endfor + +post-build: + @(cd ${BUILD_WRKSRC}/docs && sphinx-build -a -b man \ + -d build/doctrees source build/man/man1) + @(cd ${BUILD_WRKSRC}/docs && sphinx-build -a -b man \ + -d build/doctrees/pasture pasture/source build/man/man8) + +.if ${PORT_OPTIONS:MDOCS} + @(cd ${BUILD_WRKSRC}/docs && sphinx-build -a -b html \ + -d build/doctrees source build/doc/galera/html) + @(cd ${BUILD_WRKSRC}/docs && sphinx-build -a -b text \ + -d build/doctrees source build/doc/galera/text) + @(cd ${BUILD_WRKSRC}/docs && sphinx-build -a -b html \ + -d build/doctrees/pasture pasture/source build/doc/pasture/html) + @(cd ${BUILD_WRKSRC}/docs && sphinx-build -a -b text \ + -d build/doctrees/pasture pasture/source build/doc/pasture/text) + +. if ${PORT_OPTIONS:MEPUB} + @(cd ${BUILD_WRKSRC}/docs && sphinx-build -a -b epub \ + -d build/doctrees source build/doc/galera/epub) + @(cd ${BUILD_WRKSRC}/docs && sphinx-build -a -b epub \ + -d build/doctrees/pasture pasture/source build/doc/pasture/epub) +. endif + +. if ${PORT_OPTIONS:MJSON} + @(cd ${BUILD_WRKSRC}/docs && sphinx-build -a -b json \ + -d build/doctrees source build/doc/galera/json) + @(cd ${BUILD_WRKSRC}/docs && sphinx-build -a -b json \ + -d build/doctrees/pasture pasture/source build/doc/pasture/json) +. endif + +. if ${PORT_OPTIONS:MLATEX} + @(cd ${BUILD_WRKSRC}/docs && sphinx-build -a -b latex \ + -d build/doctrees source build/doc/galera/latex) + @(cd ${BUILD_WRKSRC}/docs && sphinx-build -a -b latex \ + -d build/doctrees/pasture pasture/source \ + build/doc/pasture/latex) +. endif + +. if ${PORT_OPTIONS:MPICKLE} + @(cd ${BUILD_WRKSRC}/docs && sphinx-build -a -b pickle \ + -d build/doctrees source build/doc/galera/pickle) + @(cd ${BUILD_WRKSRC}/docs && sphinx-build -a -b pickle \ + -d build/doctrees/pasture \ + pasture/source build/doc/pasture/pickle) +. endif +.endif + + @(cd ${BUILD_WRKSRC}/galerautils/doc && doxygen Doxyfile) + @(cd ${BUILD_WRKSRC}/gcomm/doc && doxygen Doxyfile) + @(cd ${BUILD_WRKSRC}/gcs/doc && doxygen Doxyfile) + +do-install: + ${INSTALL_LIB} ${WRKDIR}/${DISTNAME}/libgalera_smm.so \ + ${STAGEDIR}${PREFIX}/lib/ + @(cd ${STAGEDIR}${PREFIX}/lib && ${LN} -sf libgalera_smm.so \ + libgalera.so) + +.if ${PORT_OPTIONS:MGARB} + ${INSTALL_PROGRAM} ${WRKDIR}/${DISTNAME}/garb/garbd \ + ${STAGEDIR}${PREFIX}/bin/ +.endif + + @(cd ${WRKSRC}/docs/build/man/man1 && ${INSTALL_MAN} \ + ${PORTNAME}.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/) + @(cd ${WRKSRC}/docs/build/man/man3 && ${RM} _*.3 && ${INSTALL_MAN} \ + *.3 ${STAGEDIR}${MAN3PREFIX}/man/man3/) + @(cd ${WRKSRC}/docs/build/man/man8 && ${INSTALL_MAN} \ + ${PORTNAME}.8 ${STAGEDIR}${MAN8PREFIX}/man/man8/) + + @cd ${STAGEDIR}${MANPREFIX} && \ + ${FIND} -H -s man/man*/ -maxdepth 1 -type f -print | \ + ${SED} 's|$$|.gz|' >> ${TMPPLIST} + +post-install: +.if ${PORT_OPTIONS:MDOCS} + @${MKDIR} ${STAGEDIR}${DOCSDIR} ${STAGEDIR}${DOCSDIR4} + ${INSTALL_DATA} ${DOC_FILES1:S|^|${DOCSRCDIR1}/|} ${STAGEDIR}${DOCSDIR} + (cd ${DOCSRCDIR2} && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}) + ${INSTALL_DATA} ${DOC_FILES3:S|^|${DOCSRCDIR3}/|} ${STAGEDIR}${DOCSDIR3} + ${INSTALL_DATA} ${DOC_FILES4:S|^|${DOCSRCDIR4}/|} ${STAGEDIR}${DOCSDIR4} + ${INSTALL_DATA} ${DOC_FILES5:S|^|${DOCSRCDIR5}/|} ${STAGEDIR}${DOCSDIR5} +.endif + +.include <bsd.port.post.mk> diff --git a/databases/galera/distinfo b/databases/galera/distinfo new file mode 100644 index 00000000000..5dad524de4a --- /dev/null +++ b/databases/galera/distinfo @@ -0,0 +1,2 @@ +SHA256 (galera-25.3.5-src.tar.gz) = 9e6d718bac9608c69cbfc0662963b29c13659c576aaa8469b6a325d75603f7a3 +SIZE (galera-25.3.5-src.tar.gz) = 3820268 diff --git a/databases/galera/files/garb.in b/databases/galera/files/garb.in new file mode 100644 index 00000000000..af7fc634a0e --- /dev/null +++ b/databases/galera/files/garb.in @@ -0,0 +1,94 @@ +#!/bin/sh +# +# garb.sh for rc.d usage (c) 2013 Codership Oy +# $Id$ + +# PROVIDE: garb +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# +# Add the following line to /etc/rc.conf to enable Galera Arbitrator Daemon (garbd): +# garb_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable Galera Arbitrator Daemon. +# garb_galera_nodes (str): A space-separated list of node addresses (address[:port]) in the cluster +# (default empty). +# garb_galera_group (str): Galera cluster name, should be the same as on the rest of the nodes. +# (default empty). +# Optional: +# garb_galera_options (str): Optional Galera internal options string (e.g. SSL settings) +# see http://www.codership.com/wiki/doku.php?id=galera_parameters +# (default empty). +# garb_log_file (str): Log file for garbd (default empty). Optional, by default logs to syslog +# garb_pid_file (str): Custum PID file path and name. +# Default to "/var/run/garb.pid". +# + +. /etc/rc.subr + +name="garb" +rcvar=garb_enable + +load_rc_config $name + +# set defaults +: ${garb_enable="NO"} +: ${garb_galera_nodes=""} +: ${garb_galera_group=""} +: ${garb_galera_options=""} +: ${garb_log_file=""} +: ${garb_pid_file="/var/run/garb.pid"} + +procname="%%PREFIX%%/bin/garbd" +command="/usr/sbin/daemon" +command_args="-c -f -u nobody -p $garb_pid_file $procname" +start_precmd="${name}_prestart" +start_postcmd="${name}_poststart" +stop_precmd="${name}_prestop" +export %%LD_LIBRARY_PATH%% + +garb_prestart() +{ + [ "$(id -ur)" != "0" ] && err 4 "root rights are required to start $name" + [ -r "$garb_pid_file" ] && err 0 "$procname is already running with PID $(cat $garb_pid_file)" + [ -x "$procname" ] || err 5 "$procname is not found" + + # check that node addresses are configured + [ -z "$garb_galera_nodes" ] && err 6 "List of garb_galera_nodes is not configured" + [ -z "$garb_galera_group" ] && err 6 "garb_galera_group name is not configured" + + GALERA_PORT=${GALERA_PORT:-4567} + + # Find a working node + for ADDRESS in ${garb_galera_nodes} 0; do + HOST=$(echo $ADDRESS | cut -d \: -f 1) + PORT=$(echo $ADDRESS | cut -d \: -f 2) + PORT=${PORT:-$GALERA_PORT} + nc -z $HOST $PORT >/dev/null 2>&1 && break + done + [ ${ADDRESS} == "0" ] && err 1 "None of the nodes in $garb_galera_nodes is accessible" + + command_args="$command_args -a gcomm://$ADDRESS" + [ -n "$garb_galera_group" ] && command_args="$command_args -g $garb_galera_group" + [ -n "$garb_galera_options" ] && command_args="$command_args -o $garb_galera_options" + [ -n "$garb_log_file" ] && command_args="$command_args -l $garb_log_file" + return 0 +} + +garb_poststart() +{ + local timeout=15 + while [ ! -f "$garb_pid_file" -a $timeout -gt 0 ]; do + timeout=$(( timeout - 1 )) + sleep 1 + done + return 0 +} + +garb_prestop() { + [ "$(id -ur)" != "0" ] && err 4 "root rights are required to stop $name" + [ -r $garb_pid_file ] || err 0 "" + return 0 +} + +run_rc_command "$1" diff --git a/databases/galera/pkg-descr b/databases/galera/pkg-descr new file mode 100644 index 00000000000..fcc7cf08674 --- /dev/null +++ b/databases/galera/pkg-descr @@ -0,0 +1,5 @@ +Galera wsrep provider to Galera Cluster for MySQL, an easy-to-use +high-availability solution with high system up-time, no data loss, +and scalability for future growth. + +WWW: http://galeracluster.com |