diff options
author | wg <wg@FreeBSD.org> | 2015-09-25 04:53:21 +0800 |
---|---|---|
committer | wg <wg@FreeBSD.org> | 2015-09-25 04:53:21 +0800 |
commit | 736014c2bfe3614e31b4b910270dbe2fa2c5729e (patch) | |
tree | da31ade08728bc641cc641cf1123b6094345bc78 /databases/riak2 | |
parent | 8068d64ff3df6032f6a823931549f38655dd0e05 (diff) | |
download | freebsd-ports-gnome-736014c2bfe3614e31b4b910270dbe2fa2c5729e.tar.gz freebsd-ports-gnome-736014c2bfe3614e31b4b910270dbe2fa2c5729e.tar.zst freebsd-ports-gnome-736014c2bfe3614e31b4b910270dbe2fa2c5729e.zip |
databses/riak2: Riak is an open source, distributed database. Riak is architected for:
* Low-Latency
Riak is designed to store data and serve requests predictably and quickly, even
during peak times.
* Availability
Riak replicates and retrieves data intelligently, making it available for read
and write operations even in failure conditions.
* Fault-Tolerance
Riak is fault-tolerant so you can lose access to nodes due to network partition
or hardware failure and never lose data.
* Operational Simplicity
Riak allows you to add machines to the cluster easily, without a large
operational burden.
WWW: http://basho.com/riak
Submitted by: nbari, Scott Kamp (based on)
Diffstat (limited to 'databases/riak2')
-rw-r--r-- | databases/riak2/Makefile | 97 | ||||
-rw-r--r-- | databases/riak2/distinfo | 8 | ||||
-rw-r--r-- | databases/riak2/files/patch-deps_erlang__js_c__src_patches_js-src-config-FreeBSD.mk.patch | 27 | ||||
-rw-r--r-- | databases/riak2/files/patch-deps_yokozuna_tools_grab-solr.sh | 109 | ||||
-rw-r--r-- | databases/riak2/files/patch-rel_vars.config | 42 | ||||
-rw-r--r-- | databases/riak2/files/riak.in | 27 | ||||
-rw-r--r-- | databases/riak2/pkg-descr | 19 | ||||
-rw-r--r-- | databases/riak2/pkg-plist | 16 |
8 files changed, 345 insertions, 0 deletions
diff --git a/databases/riak2/Makefile b/databases/riak2/Makefile new file mode 100644 index 000000000000..e9b8468b2432 --- /dev/null +++ b/databases/riak2/Makefile @@ -0,0 +1,97 @@ +# $FreeBSD$ + +PORTNAME= riak2 +PORTVERSION= 2.1.1 +CATEGORIES= databases +MASTER_SITES= http://s3.amazonaws.com/downloads.basho.com/riak/${PORTVERSION:R}/${PORTVERSION}/ \ + http://downloads.basho.com.s3.amazonaws.com/riak/${PORTVERSION:R}/${PORTVERSION}/ \ + http://s3.amazonaws.com/files.basho.com/solr/:solr \ + http://s3.amazonaws.com/files.basho.com/yokozuna/:yokozuna +DISTNAME= riak-${PORTVERSION} +DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \ + solr-4.7.0-yz-1.tgz:solr \ + yokozuna-1.jar:yokozuna \ + yz_monitor-1.jar:yokozuna +EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} solr-4.7.0-yz-1.tgz + +MAINTAINER= wg@FreeBSD.org +COMMENT= Riak is an open source, distributed, noSQL database + +LICENSE= APACHE20 + +BUILD_DEPENDS= ${LOCALBASE}/lib/riak-erlang/bin/erlc:${PORTSDIR}/lang/erlang-riak + +USES= gmake readline +USE_RC_SUBR= riak +USE_GCC= yes + +USERS= riak +GROUPS= riak + +RIAK_CONFDIR?= ${PREFIX}/etc/riak +RIAK_DBDIR?= /var/db/riak +RIAK_HOMEDIR?= ${PREFIX}/lib/riak +RIAK_LIBDIR?= ${PREFIX}/lib/riak/lib +RIAK_LOGDIR?= /var/log/riak + +PLIST_SUB+= RIAK_CONFDIR=${RIAK_CONFDIR} \ + RIAK_DBDIR=${RIAK_DBDIR} \ + RIAK_HOMEDIR=${RIAK_HOMEDIR} \ + RIAK_LIBDIR=${RIAK_LIBDIR} \ + RIAK_LOGDIR=${RIAK_LOGDIR} \ + USERS=${USERS} \ + GROUPS=${GROUPS} + +ALL_TARGET= rel +MAKE_JOBS_UNSAFE=yes +MAKE_ENV= PATH=${LOCALBASE}/lib/riak-erlang/bin:${PATH} + +post-patch: + @${REINPLACE_CMD} 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/rel/vars.config + @${REINPLACE_CMD} -e 's|%%BUILD_DIR%%|${WRKDIR}|g' \ + -e 's|%%DISTDIR%%|${DISTDIR}|g' \ + -e 's|%%YOKOZUNA%%|${WRKSRC}/deps/yokozuna|g' \ + ${WRKSRC}/deps/yokozuna/tools/grab-solr.sh + +do-install: + ${MKDIR} ${STAGEDIR}${RIAK_CONFDIR} + ${MKDIR} ${STAGEDIR}${RIAK_DBDIR} + ${MKDIR} ${STAGEDIR}${RIAK_LOGDIR} + ${INSTALL_DATA} ${WRKSRC}/rel/riak/etc/riak.conf ${STAGEDIR}${RIAK_CONFDIR}/riak.conf.sample + ${INSTALL_DATA} ${WRKSRC}/rel/riak/etc/solr-log4j.properties ${STAGEDIR}${RIAK_CONFDIR}/solr-log4j.properties.sample + (cd ${WRKSRC}/rel/riak/lib/ && ${COPYTREE_BIN} . ${STAGEDIR}${RIAK_LIBDIR}) + (cd ${WRKSRC}/rel/riak/bin/ && ${COPYTREE_BIN} . ${STAGEDIR}${PREFIX}/sbin/) + (cd ${WRKSRC}/rel/riak/lib/basho-patches && ${COPYTREE_SHARE} . ${STAGEDIR}${RIAK_LIBDIR}/basho-patches) + (cd ${WRKSRC}/rel/riak/releases && ${COPYTREE_SHARE} . ${STAGEDIR}${RIAK_HOMEDIR}/releases) + ${CP} -R ${WRKSRC}/rel/riak/erts-* ${STAGEDIR}${RIAK_HOMEDIR} + ${INSTALL_MAN} ${WRKSRC}/doc/man/man1/riak.1.gz ${STAGEDIR}${MANPREFIX}/man/man1/ + ${INSTALL_MAN} ${WRKSRC}/doc/man/man1/riak-admin.1.gz ${STAGEDIR}${MANPREFIX}/man/man1/ + ${INSTALL_MAN} ${WRKSRC}/doc/man/man1/riak-debug.1.gz ${STAGEDIR}${MANPREFIX}/man/man1/ + ${INSTALL_MAN} ${WRKSRC}/doc/man/man1/search-cmd.1.gz ${STAGEDIR}${MANPREFIX}/man/man1/ + #@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/riak/lib/bitcask-1.7.0/priv/bitcask.so + #@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/riak/lib/erlang_js-1.3.0-0-g07467d8/priv/erlang_js_drv.so + #@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/riak/lib/syslog-1.0.2/priv/syslog_drv.so + #@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/riak/lib/canola-2.0.0-0-g9bdfee8/priv/canola-port + #@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/riak/lib/sext-1.1p3-0-g846b9cc/priv/sext.so + +post-install: + (cd ${STAGEDIR}${RIAK_HOMEDIR}; ${FIND} releases -type f \ + | ${SED} -e 's,^\./,,g' \ + | ${AWK} '{print length, $$0}' | ${SORT} -rn | ${SED} -e 's/^/lib\//' \ + | ${AWK} '{print "lib/riak/"$$2 }' >> ${TMPPLIST}) + (cd ${STAGEDIR}${RIAK_HOMEDIR}; ${FIND} erts-* -type f \ + | ${SED} -e 's,^\./,,g' \ + | ${AWK} '{print length, $$0}' | ${SORT} -rn \ + | ${AWK} '{print "lib/riak/"$$2 }' >> ${TMPPLIST}) + (cd ${STAGEDIR}${RIAK_LIBDIR}; ${FIND} . -type f \ + | ${SED} -e 's,^\./,,g' \ + | ${AWK} '{print length, $$0}' | ${SORT} -rn | ${SED} -e 's/^/lib\//' \ + | ${AWK} '{print "lib/riak/lib/"$$2 }' >> ${TMPPLIST}) + (cd ${STAGEDIR}${RIAK_LIBDIR}; ${FIND} . -type d -empty \ + | ${SED} -e 's,^\./,,g' \ + | ${AWK} '{print length, $$0}' | ${SORT} -rn | ${SED} -e 's/^/lib\//' \ + | ${AWK} '{print "@dir lib/riak/lib/"$$2 }' >> ${TMPPLIST}) + ${ECHO} "@owner" >> ${TMPPLIST} + ${ECHO} "@group" >> ${TMPPLIST} + +.include <bsd.port.mk> diff --git a/databases/riak2/distinfo b/databases/riak2/distinfo new file mode 100644 index 000000000000..b5b80c8063e5 --- /dev/null +++ b/databases/riak2/distinfo @@ -0,0 +1,8 @@ +SHA256 (riak-2.1.1.tar.gz) = b5414e7bab650862c26fbbad382b81d47135ce55eafd02fdac027d3bff90a5ae +SIZE (riak-2.1.1.tar.gz) = 18771429 +SHA256 (solr-4.7.0-yz-1.tgz) = 172380c6c334797b4639f7c497a2a34a249efbfd3917106b3662f6b1e8a0352f +SIZE (solr-4.7.0-yz-1.tgz) = 166999678 +SHA256 (yokozuna-1.jar) = 91a208e1fde1ef2a931f8d14ba150f730c92bc3a7a8e8bce30c6a6b027e18f82 +SIZE (yokozuna-1.jar) = 10645 +SHA256 (yz_monitor-1.jar) = 35c41c103c83452c6377fac42b6c8bb714d2e1e2b8c02053397c0fa2423b694d +SIZE (yz_monitor-1.jar) = 2661 diff --git a/databases/riak2/files/patch-deps_erlang__js_c__src_patches_js-src-config-FreeBSD.mk.patch b/databases/riak2/files/patch-deps_erlang__js_c__src_patches_js-src-config-FreeBSD.mk.patch new file mode 100644 index 000000000000..ae74902fc19b --- /dev/null +++ b/databases/riak2/files/patch-deps_erlang__js_c__src_patches_js-src-config-FreeBSD.mk.patch @@ -0,0 +1,27 @@ +--- deps/erlang_js/c_src/patches/js-src-config-FreeBSD.mk.patch.orig 2015-02-26 16:11:58 UTC ++++ deps/erlang_js/c_src/patches/js-src-config-FreeBSD.mk.patch +@@ -1,6 +1,6 @@ + --- c_src.orig/js/src/config/FreeBSD.mk 1969-12-31 19:00:00.000000000 -0500 + +++ c_src/js/src/config/FreeBSD.mk 2011-03-30 20:12:51.000000000 -0400 +-@@ -0,0 +1,99 @@ ++@@ -0,0 +1,100 @@ + +# -*- Mode: makefile -*- + +# + +# ***** BEGIN LICENSE BLOCK ***** +@@ -46,6 +46,7 @@ + + + +CC ?= gcc + +CCC ?= g++ +++LD = $(CC) + +CFLAGS += -Wall -Wno-format + +OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R + + +@@ -63,7 +64,7 @@ + +OS_CFLAGS+= -DX86_LINUX + + + +ifeq (gcc, $(CC)) +-+# if using gcc on x86, check version for opt bug +++# if using gcc on x86, check version for opt bug + +# (http://bugzilla.mozilla.org/show_bug.cgi?id=24892) + +GCC_VERSION := $(shell gcc -v 2>&1 | grep version | awk '{ print $$3 }') + +GCC_LIST:=$(sort 2.91.66 $(GCC_VERSION) ) diff --git a/databases/riak2/files/patch-deps_yokozuna_tools_grab-solr.sh b/databases/riak2/files/patch-deps_yokozuna_tools_grab-solr.sh new file mode 100644 index 000000000000..5d8a33107c19 --- /dev/null +++ b/databases/riak2/files/patch-deps_yokozuna_tools_grab-solr.sh @@ -0,0 +1,109 @@ +--- deps/yokozuna/tools/grab-solr.sh.orig 2015-04-15 02:24:04.000000000 +1000 ++++ deps/yokozuna/tools/grab-solr.sh 2015-09-24 10:46:04.504531298 +1000 +@@ -14,10 +14,10 @@ + cd tools + fi + +-PRIV_DIR=../priv ++PRIV_DIR=%%YOKOZUNA%%/priv + CONF_DIR=$PRIV_DIR/conf + SOLR_DIR=$PRIV_DIR/solr +-BUILD_DIR=../build ++BUILD_DIR=%%BUILD_DIR%% + VSN=solr-4.7.0-yz-1 + FILENAME=$VSN.tgz + TMP_DIR=/var/tmp/yokozuna +@@ -32,58 +32,11 @@ + test -e $SOLR_DIR/start.jar + } + +-download() +-{ +- if which wget > /dev/null; then +- wget --no-check-certificate --progress=dot:mega $1 +- elif which curl > /dev/null; then +- curl --insecure --progress-bar -O $1 +- elif which fetch > /dev/null; then +- fetch --no-verify-peer $1 +- fi +-} +- +-get_solr() +-{ +- if [ -z ${SOLR_PKG_DIR+x} ] +- then +- if [ -e $TMP_FILE ]; then +- echo "Using cached copy of Solr $TMP_FILE" +- ln -s $TMP_FILE $FILENAME +- else +- echo "Pulling Solr from S3" +- download "http://s3.amazonaws.com/files.basho.com/solr/$FILENAME" +- if [ -d $TMP_DIR ]; then +- cp $FILENAME $TMP_DIR +- else +- mkdir $TMP_DIR +- cp $FILENAME $TMP_DIR +- fi +- fi +- else +- # This is now obsolete thanks to implicit caching above +- # but will leave in for now as to not break anyone. +- echo "Using local copy of Solr $SOLR_PKG_DIR/$FILENAME" +- cp $SOLR_PKG_DIR/$FILENAME ./ +- fi +- tar zxf $FILENAME +-} +- + if ! check_for_solr + then + +- echo "Create dir $BUILD_DIR" +- if [ ! -e $BUILD_DIR ]; then +- mkdir $BUILD_DIR +- fi +- + cd $BUILD_DIR + +- if [ ! -e $SRC_DIR ] +- then +- get_solr +- fi +- + echo "Creating Solr dir $SOLR_DIR" + + # Explicitly copy files needed rather than copying everything and +@@ -108,7 +61,7 @@ + echo "Solr dir created successfully" + fi + +-JAVA_LIB=../priv/java_lib ++JAVA_LIB=%%YOKOZUNA%%/priv/java_lib +-YZ_JAR_VSN=2 ++YZ_JAR_VSN=1 + YZ_JAR_NAME=yokozuna-$YZ_JAR_VSN.jar + +@@ -118,19 +71,17 @@ + then + mkdir $JAVA_LIB + fi +- +- echo "Downloading $YZ_JAR_NAME" +- download "http://s3.amazonaws.com/files.basho.com/yokozuna/$YZ_JAR_NAME" +- mv $YZ_JAR_NAME $JAVA_LIB/$YZ_JAR_NAME ++ echo "Copying $YZ_JAR_NAME" ++ cp %%DISTDIR%%/$YZ_JAR_NAME $JAVA_LIB/$YZ_JAR_NAME + fi + +-EXT_LIB=../priv/solr/lib/ext ++EXT_LIB=%%YOKOZUNA%%/priv/solr/lib/ext + MON_JAR_VSN=1 + MON_JAR_NAME=yz_monitor-$MON_JAR_VSN.jar + + if [ ! -e $EXT_LIB/$MON_JAR_NAME ] + then + echo "Downloading $MON_JAR_NAME" +- download "http://s3.amazonaws.com/files.basho.com/yokozuna/$MON_JAR_NAME" +- mv $MON_JAR_NAME $EXT_LIB/$MON_JAR_NAME ++ echo "Copying $MON_JAR_NAME" ++ cp %%DISTDIR%%/$MON_JAR_NAME $EXT_LIB/$MON_JAR_NAME + fi diff --git a/databases/riak2/files/patch-rel_vars.config b/databases/riak2/files/patch-rel_vars.config new file mode 100644 index 000000000000..6c93d9baffa3 --- /dev/null +++ b/databases/riak2/files/patch-rel_vars.config @@ -0,0 +1,42 @@ +--- rel/vars.config.orig 2015-02-27 13:37:42 UTC ++++ rel/vars.config +@@ -2,11 +2,12 @@ + %% ex: ft=erlang ts=4 sw=4 et + + %% Platform-specific installation paths +-{platform_bin_dir, "./bin"}. +-{platform_data_dir, "./data"}. +-{platform_etc_dir, "./etc"}. +-{platform_lib_dir, "./lib"}. +-{platform_log_dir, "./log"}. ++{platform_base_dir, "%%PREFIX%%/lib/riak"}. ++{platform_bin_dir, "%%PREFIX%%/sbin"}. ++{platform_etc_dir, "%%PREFIX%%/etc/riak"}. ++{platform_lib_dir, "%%PREFIX%%/lib/riak/lib"}. ++{platform_data_dir, "/var/db/riak"}. ++{platform_log_dir, "/var/log/riak"}. + + %% + %% etc/app.config +@@ -40,14 +41,14 @@ + %% + %% bin/riak + %% +-{runner_script_dir, "\`cd \\`dirname $0\\` && /bin/pwd\`"}. +-{runner_base_dir, "{{runner_script_dir}}/.."}. +-{runner_etc_dir, "$RUNNER_BASE_DIR/etc"}. +-{runner_log_dir, "$RUNNER_BASE_DIR/log"}. +-{runner_lib_dir, "$RUNNER_BASE_DIR/lib"}. +-{runner_patch_dir, "$RUNNER_BASE_DIR/lib/basho-patches"}. +-{pipe_dir, "/tmp/$RUNNER_BASE_DIR/"}. +-{runner_user, ""}. ++{runner_script_dir, "{{platform_bin_dir}}"}. ++{runner_base_dir, "{{platform_base_dir}}"}. ++{runner_etc_dir, "{{platform_etc_dir}}"}. ++{runner_log_dir, "{{platform_log_dir}}"}. ++{runner_lib_dir, "{{platform_lib_dir}}"}. ++{runner_patch_dir, "{{platform_lib_dir}}/basho-patches"}. ++{pipe_dir, "/tmp/riak"}. ++{runner_user, "riak"}. + {runner_wait_process, "riak_core_node_watcher"}. + {runner_ulimit_warn, 65536}. diff --git a/databases/riak2/files/riak.in b/databases/riak2/files/riak.in new file mode 100644 index 000000000000..10e74492b0df --- /dev/null +++ b/databases/riak2/files/riak.in @@ -0,0 +1,27 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: riak +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add these lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# riak_enable (bool): Set to NO by default. +# Set it to YES to enable riak + +. /etc/rc.subr + +name=riak +rcvar=riak_enable + +load_rc_config $name + +command=%%PREFIX%%/lib/riak/erts-5.10.4/bin/beam.smp +pidfile="/var/run/${name}/${name}.pid" +start_cmd="%%PREFIX%%/sbin/${name} start" +stop_cmd="%%PREFIX%%/sbin/${name} stop" + +run_rc_command "$1" diff --git a/databases/riak2/pkg-descr b/databases/riak2/pkg-descr new file mode 100644 index 000000000000..8cb10379da8e --- /dev/null +++ b/databases/riak2/pkg-descr @@ -0,0 +1,19 @@ +Riak is an open source, distributed database. Riak is architected for: + +* Low-Latency +Riak is designed to store data and serve requests predictably and quickly, even +during peak times. + +* Availability +Riak replicates and retrieves data intelligently, making it available for read +and write operations even in failure conditions. + +* Fault-Tolerance +Riak is fault-tolerant so you can lose access to nodes due to network partition +or hardware failure and never lose data. + +* Operational Simplicity +Riak allows you to add machines to the cluster easily, without a large +operational burden. + +WWW: http://basho.com/riak diff --git a/databases/riak2/pkg-plist b/databases/riak2/pkg-plist new file mode 100644 index 000000000000..ea859b367138 --- /dev/null +++ b/databases/riak2/pkg-plist @@ -0,0 +1,16 @@ +sbin/riak +sbin/riak-admin +sbin/riak-debug +sbin/search-cmd +man/man1/riak-admin.1.gz +man/man1/riak-debug.1.gz +man/man1/riak.1.gz +man/man1/search-cmd.1.gz +@sample %%RIAK_CONFDIR%%/riak.conf.sample +@sample %%RIAK_CONFDIR%%/solr-log4j.properties.sample +@owner %%USERS%% +@group %%GROUPS%% +@dir %%RIAK_DBDIR%% +@dir %%RIAK_HOMEDIR%% +@dir %%RIAK_LIBDIR%% +@dir %%RIAK_LOGDIR%% |