aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authorwg <wg@FreeBSD.org>2015-09-25 20:55:10 +0800
committerwg <wg@FreeBSD.org>2015-09-25 20:55:10 +0800
commit348f394a84cb23bcb726217f563906beda1306f9 (patch)
tree7f7a56b103717629c3bdcf57079947f0ab4b2fb2 /sysutils
parentbf138fa1be5a170a540bcc9a1583fe5dbba5591f (diff)
downloadfreebsd-ports-gnome-348f394a84cb23bcb726217f563906beda1306f9.tar.gz
freebsd-ports-gnome-348f394a84cb23bcb726217f563906beda1306f9.tar.zst
freebsd-ports-gnome-348f394a84cb23bcb726217f563906beda1306f9.zip
sysutils/riak-cs: Open source, distributed, S3 interface to Riak KV
Riak CS is an object storage system built on top of Riak. It facilitates storing large objects in Riak and presents an S3-compatible interface. It also provides multi-tenancy features such as user accounts, authentication, access control mechanisms, and per account usage reporting. WWW: https://github.com/basho/riak_cs Submitted by: Scott Kamp (based on)
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/riak-cs/Makefile80
-rw-r--r--sysutils/riak-cs/distinfo2
-rw-r--r--sysutils/riak-cs/files/patch-rel_vars.config47
-rw-r--r--sysutils/riak-cs/files/riak-cs.in84
-rw-r--r--sysutils/riak-cs/pkg-descr6
-rw-r--r--sysutils/riak-cs/pkg-plist19
7 files changed, 239 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 7a2d693ce418..7c56aa7ac48b 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -828,6 +828,7 @@
SUBDIR += retail
SUBDIR += rfstool
SUBDIR += rhc
+ SUBDIR += riak-cs
SUBDIR += rinse
SUBDIR += rmonitor
SUBDIR += roottail
diff --git a/sysutils/riak-cs/Makefile b/sysutils/riak-cs/Makefile
new file mode 100644
index 000000000000..7aa0553ef0a5
--- /dev/null
+++ b/sysutils/riak-cs/Makefile
@@ -0,0 +1,80 @@
+# $FreeBSD$
+
+PORTNAME= riak-cs
+PORTVERSION= 2.0.1
+CATEGORIES= sysutils
+MASTER_SITES= http://s3.amazonaws.com/downloads.basho.com/riak-cs/${PORTVERSION:R}/${PORTVERSION}/ \
+ http://downloads.basho.com.s3.amazonaws.com/riak-cs/${PORTVERSION:R}/${PORTVERSION}/
+
+MAINTAINER= wg@FreeBSD.org
+COMMENT= Open source, distributed, S3 interface to Riak KV
+
+LICENSE= APACHE20
+
+BUILD_DEPENDS= ${LOCALBASE}/lib/riak-erlang/bin/erlc:${PORTSDIR}/lang/erlang-riak
+
+USES= gmake readline
+USE_RC_SUBR= riak-cs
+USE_GCC= yes
+
+USERS= riakcs
+GROUPS= riak
+
+RIAKCS_CONFDIR?=${PREFIX}/etc/riak-cs
+RIAKCS_DBDIR?= /var/db/riak-cs
+RIAKCS_HOMEDIR?=${PREFIX}/lib/riak-cs
+RIAKCS_LIBDIR?= ${PREFIX}/lib/riak-cs/lib
+RIAKCS_LOGDIR?= /var/log/riak-cs
+
+PLIST_SUB+= RIAKCS_CONFDIR=${RIAKCS_CONFDIR} \
+ RIAKCS_DBDIR=${RIAKCS_DBDIR} \
+ RIAKCS_HOMEDIR=${RIAKCS_HOMEDIR} \
+ RIAKCS_LIBDIR=${RIAKCS_LIBDIR} \
+ RIAKCS_LOGDIR=${RIAKCS_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
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${RIAKCS_CONFDIR}
+ ${MKDIR} ${STAGEDIR}${RIAKCS_DBDIR}
+ ${MKDIR} ${STAGEDIR}${RIAKCS_LOGDIR}
+ ${INSTALL_DATA} ${WRKSRC}/rel/riak-cs/etc/riak-cs.conf ${STAGEDIR}${RIAKCS_CONFDIR}/riak-cs.conf
+ ${INSTALL_DATA} ${WRKSRC}/rel/riak-cs/etc/advanced.config ${STAGEDIR}${RIAKCS_CONFDIR}/advanced.config
+ ${INSTALL_DATA} ${WRKSRC}/rel/riak-cs/etc/cert.pem ${STAGEDIR}${RIAKCS_CONFDIR}/cert.pem
+ ${INSTALL_DATA} ${WRKSRC}/rel/riak-cs/etc/key.pem ${STAGEDIR}${RIAKCS_CONFDIR}/key.pem
+ (cd ${WRKSRC}/rel/riak-cs/lib/ && ${COPYTREE_BIN} . ${STAGEDIR}${RIAKCS_LIBDIR})
+ (cd ${WRKSRC}/rel/riak-cs/bin/ && ${COPYTREE_BIN} . ${STAGEDIR}${PREFIX}/sbin/)
+ (cd ${WRKSRC}/rel/riak-cs/lib/basho-patches && ${COPYTREE_SHARE} . ${STAGEDIR}${RIAKCS_LIBDIR}/basho-patches)
+ (cd ${WRKSRC}/rel/riak-cs/releases && ${COPYTREE_SHARE} . ${STAGEDIR}${RIAKCS_HOMEDIR}/releases)
+ ${CP} -R ${WRKSRC}/rel/riak-cs/erts-* ${STAGEDIR}${RIAKCS_HOMEDIR}
+
+post-install:
+ (cd ${STAGEDIR}${RIAKCS_HOMEDIR}; ${FIND} releases -type f \
+ | ${SED} -e 's,^\./,,g' \
+ | ${AWK} '{print length, $$0}' | ${SORT} -rn | ${SED} -e 's/^/lib\//' \
+ | ${AWK} '{print "lib/riak-cs/"$$2 }' >> ${TMPPLIST})
+ (cd ${STAGEDIR}${RIAKCS_HOMEDIR}; ${FIND} erts-* -type f \
+ | ${SED} -e 's,^\./,,g' \
+ | ${AWK} '{print length, $$0}' | ${SORT} -rn \
+ | ${AWK} '{print "lib/riak-cs/"$$2 }' >> ${TMPPLIST})
+ (cd ${STAGEDIR}${RIAKCS_HOMEDIR}; ${FIND} erts-* -type d -empty \
+ | ${SED} -e 's,^\./,,g' \
+ | ${AWK} '{print length, $$0}' | ${SORT} -rn | ${SED} -e 's/^/lib\//' \
+ | ${AWK} '{print "@dir lib/riak-cs/"$$2 }' >> ${TMPPLIST})
+ (cd ${STAGEDIR}${RIAKCS_LIBDIR}; ${FIND} . -type f \
+ | ${SED} -e 's,^\./,,g' \
+ | ${AWK} '{print length, $$0}' | ${SORT} -rn | ${SED} -e 's/^/lib\//' \
+ | ${AWK} '{print "lib/riak-cs/lib/"$$2 }' >> ${TMPPLIST})
+ (cd ${STAGEDIR}${RIAKCS_LIBDIR}; ${FIND} . -type d -empty \
+ | ${SED} -e 's,^\./,,g' \
+ | ${AWK} '{print length, $$0}' | ${SORT} -rn | ${SED} -e 's/^/lib\//' \
+ | ${AWK} '{print "@dir lib/riak-cs/lib/"$$2 }' >> ${TMPPLIST})
+
+.include <bsd.port.mk>
diff --git a/sysutils/riak-cs/distinfo b/sysutils/riak-cs/distinfo
new file mode 100644
index 000000000000..7b42b11f6f9b
--- /dev/null
+++ b/sysutils/riak-cs/distinfo
@@ -0,0 +1,2 @@
+SHA256 (riak-cs-2.0.1.tar.gz) = 7c8d38ff678c42271e51270bb9e82002358f8c2d15a071ae8e406d52655c64da
+SIZE (riak-cs-2.0.1.tar.gz) = 9734438
diff --git a/sysutils/riak-cs/files/patch-rel_vars.config b/sysutils/riak-cs/files/patch-rel_vars.config
new file mode 100644
index 000000000000..e84e06e89c7d
--- /dev/null
+++ b/sysutils/riak-cs/files/patch-rel_vars.config
@@ -0,0 +1,47 @@
+--- rel/vars.config.orig 2015-05-29 10:29:55.000000000 +1000
++++ rel/vars.config 2015-09-24 14:36:24.429038742 +1000
+@@ -2,11 +2,12 @@
+ %% ex: 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-cs"}.
++{platform_bin_dir, "%%PREFIX%%/sbin"}.
++{platform_etc_dir, "%%PREFIX%%/etc/riak-cs"}.
++{platform_lib_dir, "%%PREFIX%%/lib/riak-cs/lib"}.
++{platform_data_dir, "/var/db/riak-cs"}.
++{platform_log_dir, "/var/log/riak-cs"}.
+
+ %% lager
+ {console_log_default, file}.
+@@ -41,16 +42,18 @@
+ %% bin/riak_cs
+ %%
+ {data_dir, "{{target_dir}}/data"}.
+-{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-cs"}.
++{runner_user, "riakcs"}.
+ {runner_wait_process, "riak_cs_put_fsm_sup"}.
+
++
++
+ %%
+ %% cuttlefish
+ %%
diff --git a/sysutils/riak-cs/files/riak-cs.in b/sysutils/riak-cs/files/riak-cs.in
new file mode 100644
index 000000000000..843f5a308597
--- /dev/null
+++ b/sysutils/riak-cs/files/riak-cs.in
@@ -0,0 +1,84 @@
+#!/bin/sh
+# $FreeBSD$
+
+# PROVIDE: riak-cs
+# REQUIRE: LOGIN cleanvar
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable riak-cs:
+# riak-cs_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable riak-cs on boot.
+#
+
+. /etc/rc.subr
+
+name="riak-cs"
+rcvar=riak_cs_enable
+
+pidfile=/var/run/riak-cs/riak-cs.pid
+
+start_cmd="riak-cs_start"
+stop_cmd="riak-cs_stop"
+restart_cdm="riak-cs_restart"
+status_cmd="riak-cs_status"
+command="%%PREFIX%%/sbin/riak-cs"
+
+load_rc_config $name
+
+# Read rc.d config and set defaults
+load_rc_config "$name"
+: ${riak-cs_enable="NO"}
+
+riak-cs_start()
+{
+ echo "Starting Riak."
+ %%PREFIX%%/sbin/riak-cs start
+ return 0
+}
+
+riak-cs_stop()
+{
+ echo "Stopping Riak processes"
+ %%PREFIX%%/sbin/riak-cs stop
+ killall -9 epmd
+ return 0
+}
+
+riak-cs_restart()
+{
+ riak-cs_stop
+ riak-cs_start
+ return 0
+}
+
+riak-cs_status()
+{
+ if riak-cs_running; then
+ echo "Riak is running."
+ return 0
+ else
+ echo "Riak is not running"
+ return 1
+ fi
+}
+
+riak-cs_running()
+{
+ local pid result ps
+ pid=`%%PREFIX%%/sbin/riak-cs getpid`
+ result=`echo $?`
+ if [ "$result" == 0 ]; then
+ ps=`ps -waux | grep ${pid} | grep riak-cs`
+ result=`echo $?`
+ if [ "$result" ]; then
+ return 0
+ else
+ return 1
+ fi
+ else
+ return 1
+ fi
+}
+
+run_rc_command "$1"
diff --git a/sysutils/riak-cs/pkg-descr b/sysutils/riak-cs/pkg-descr
new file mode 100644
index 000000000000..433dfdd9270d
--- /dev/null
+++ b/sysutils/riak-cs/pkg-descr
@@ -0,0 +1,6 @@
+Riak CS is an object storage system built on top of Riak. It facilitates
+storing large objects in Riak and presents an S3-compatible interface. It also
+provides multi-tenancy features such as user accounts, authentication, access
+control mechanisms, and per account usage reporting.
+
+WWW: https://github.com/basho/riak_cs
diff --git a/sysutils/riak-cs/pkg-plist b/sysutils/riak-cs/pkg-plist
new file mode 100644
index 000000000000..3dadb32bbb93
--- /dev/null
+++ b/sysutils/riak-cs/pkg-plist
@@ -0,0 +1,19 @@
+sbin/riak-cs
+sbin/riak-cs-access
+sbin/riak-cs-admin
+sbin/riak-cs-debug
+sbin/riak-cs-gc
+sbin/riak-cs-multibag
+sbin/riak-cs-stanchion
+sbin/riak-cs-storage
+@sample %%RIAKCS_CONFDIR%%/riak-cs.conf
+@sample %%RIAKCS_CONFDIR%%/advanced.config
+@sample %%RIAKCS_CONFDIR%%/key.pem
+@sample %%RIAKCS_CONFDIR%%/cert.pem
+@dir %%RIAKCS_CONFDIR%%
+@owner %%USERS%%
+@group %%GROUPS%%
+@dir %%RIAKCS_DBDIR%%
+@dir %%RIAKCS_HOMEDIR%%
+@dir %%RIAKCS_LIBDIR%%
+@dir %%RIAKCS_LOGDIR%%