diff options
author | Ryan Steinmetz <zi@FreeBSD.org> | 2012-06-11 02:20:53 +0000 |
---|---|---|
committer | Ryan Steinmetz <zi@FreeBSD.org> | 2012-06-11 02:20:53 +0000 |
commit | 849135e9c63ac7059977d6e8e33e32ce54c6f13e (patch) | |
tree | 4d07bdedff64f0daf781d2de76294ee50f1ec640 /security/razorback-dispatcher | |
parent | 6389f5c857e2bbefb515a0ac780044cd73bffb4c (diff) | |
download | ports-849135e9c63ac7059977d6e8e33e32ce54c6f13e.tar.gz ports-849135e9c63ac7059977d6e8e33e32ce54c6f13e.zip |
Notes
Diffstat (limited to 'security/razorback-dispatcher')
-rw-r--r-- | security/razorback-dispatcher/Makefile | 69 | ||||
-rw-r--r-- | security/razorback-dispatcher/distinfo | 2 | ||||
-rw-r--r-- | security/razorback-dispatcher/files/dispatcher.in | 50 | ||||
-rw-r--r-- | security/razorback-dispatcher/files/dispatcher_safed.in | 32 | ||||
-rw-r--r-- | security/razorback-dispatcher/files/pkg-message.in | 37 | ||||
-rw-r--r-- | security/razorback-dispatcher/pkg-descr | 5 | ||||
-rw-r--r-- | security/razorback-dispatcher/pkg-plist | 11 |
7 files changed, 206 insertions, 0 deletions
diff --git a/security/razorback-dispatcher/Makefile b/security/razorback-dispatcher/Makefile new file mode 100644 index 000000000000..90b8c7c171db --- /dev/null +++ b/security/razorback-dispatcher/Makefile @@ -0,0 +1,69 @@ +# New ports collection makefile for: razorback-dispatcher +# Date created: 2011/06/8 +# Whom: Tom Judge <tom@tomjudge.com> +# +# $FreeBSD$ +# + +PORTNAME= dispatcher +PORTVERSION= 0.5.0 +CATEGORIES= security +MASTER_SITES= SF/razorbacktm/Dispatcher +PKGNAMEPREFIX= razorback- +DIST_SUBDIR= razorback + +MAINTAINER= tj@FreeBSD.org +COMMENT= Framework for an intelligence driven security - Dispatcher + +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/LICENSE + +LIB_DEPENDS= razorback_api:${PORTSDIR}/security/razorback-api \ + memcached:${PORTSDIR}/databases/libmemcached \ + cli:${PORTSDIR}/devel/libcli + +OPTIONS_DEFINE= DEBUG ASSERT ACTIVEMQ +OPTIONS_DEFAULT=ACTIVEMQ +ASSERT_DESC= Enable Asserts +ACTIVEMQ_DESC= ActiveMQ runs locally + +.include <bsd.port.options.mk> + +USE_GNOME= gnomehack +USE_AUTOTOOLS= libtool +GNU_CONFIGURE= yes +USE_MYSQL= yes +USE_RC_SUBR= dispatcher dispatcher_safed +SUB_FILES= pkg-message +CPPFLAGS+= -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib + +USERS?= razorback +GROUPS?= razorback + +.if ${PORT_OPTIONS:MDEBUG} +CONFIGURE_ARGS+=--enable-debug +.endif + +.if ${PORT_OPTIONS:MASSERT} +CONFIGURE_ARGS+=--enable-assert +.endif + +.if ${PORT_OPTIONS:MACTIVEMQ} +RUN_DEPENDS= ${LOCALBASE}/etc/rc.d/activemq:${PORTSDIR}/net/activemq +SUB_LIST= ACTIVEMQ="activemq " ACTIVEMQ_LOC="local" \ + ACTIVEMQ_LOCATION="in the ActiveMQ configuration directory:" \ + ACTIVEMQ_CONFIG="${LOCALBASE}/etc/activemq/" +.else +SUB_LIST= ACTIVEMQ="" ACTIVEMQ_LOC="remote" \ + ACTIVEMQ_LOCATION="on the remote ActiveMQ host." \ + ACTIVEMQ_CONFIG="" +.endif + +post-install: + @if [ ! -f ${PREFIX}/etc/razorback/dispatcher.conf ]; then \ + ${CP} -p ${PREFIX}/etc/razorback/dispatcher.conf.sample ${PREFIX}/etc/razorback/dispatcher.conf ; \ + fi + @${CAT} ${PKGMESSAGE} + +.include <bsd.port.mk> diff --git a/security/razorback-dispatcher/distinfo b/security/razorback-dispatcher/distinfo new file mode 100644 index 000000000000..3a7d269202d3 --- /dev/null +++ b/security/razorback-dispatcher/distinfo @@ -0,0 +1,2 @@ +SHA256 (razorback/dispatcher-0.5.0.tar.gz) = 8e7fcc03ea08c86fd35971857c8ca03531909942b2c9e3c6d159252c1dec26a7 +SIZE (razorback/dispatcher-0.5.0.tar.gz) = 401689 diff --git a/security/razorback-dispatcher/files/dispatcher.in b/security/razorback-dispatcher/files/dispatcher.in new file mode 100644 index 000000000000..33d515c6fffc --- /dev/null +++ b/security/razorback-dispatcher/files/dispatcher.in @@ -0,0 +1,50 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: dispatcher +# REQUIRE: %%ACTIVEMQ%%mysql +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable the razorback dispatcher: +# +# dispatcher_enable="YES" + +. /etc/rc.subr + +name=dispatcher +rcvar=dispatcher_enable + +load_rc_config $name + +dispatcher_enable=${dispatcher_enable:-"NO"} +dispatcher_user=${dispatcher_user:-"razorback"} +dispatcher_group=${dispatcher_group:-"razorback"} + +command=%%PREFIX%%/bin/dispatcher + +start_precmd="dispatcher_precmd-%%ACTIVEMQ_LOC%%" +_piddir=/var/run/razorback +pidfile=${_piddir}/dispatcher.pid + +dispatcher_precmd-remote() +{ + install -d -o $dispatcher_user -g $dispatcher_user -m 755 $_piddir +} + +dispatcher_precmd-local() +{ + local iter + + install -d -o $dispatcher_user -g $dispatcher_user -m 755 $_piddir + iter=0 + while [ `sockstat -l | egrep -c '^activemq.*tcp.*'` -lt 3 ]; do + if [ ${iter} -eq 60 ]; then + err 1 "Failed to detect a functional activemq. Please check your configuration" + fi + sleep 1 + iter=$(( ${iter} + 1)) + done +} + +run_rc_command "$1" diff --git a/security/razorback-dispatcher/files/dispatcher_safed.in b/security/razorback-dispatcher/files/dispatcher_safed.in new file mode 100644 index 000000000000..4db324fd5627 --- /dev/null +++ b/security/razorback-dispatcher/files/dispatcher_safed.in @@ -0,0 +1,32 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: dispatcher_safed +# REQUIRE: dispatcher +# KEYWORD: shutdown +# +# Add the ollowing lines to /etc/rc.conf to enable dispatcher_safed: +# +# dispatcher_safed_enable="YES" + +. /etc/rc.subr + +name=dispatcher_safed +rcvar=dispatcher_safed_enable + +load_rc_config $name + +dispatcher_safed_enable=${dispatcher_safed_enable:-"NO"} + +pidfile="/var/run/dispatcher_safed.pid" +command="%%PREFIX%%/bin/dispatcher_safed" +start_cmd=dispatcher_safed_start +procname="/bin/sh" + +dispatcher_safed_start() +{ + /usr/sbin/daemon -cf -p ${pidfile} ${command} +} + +run_rc_command "$1" diff --git a/security/razorback-dispatcher/files/pkg-message.in b/security/razorback-dispatcher/files/pkg-message.in new file mode 100644 index 000000000000..bc1ae3ef74fd --- /dev/null +++ b/security/razorback-dispatcher/files/pkg-message.in @@ -0,0 +1,37 @@ + +This port requires additional configuration before it can be used. + +The MySQL database schema must be loaded: +================================================================== +cd %%PREFIX%%/share/razorback/ +mysql +create database razorback; +use razorback; +source razorback.sql; +source razorback-with-data.sql; + + +There are two modifications that need to be made. The first is to +edit the activemq.xml file %%ACTIVEMQ_LOCATION%% +%%ACTIVEMQ_CONFIG%% + +ActiveMQ's configuration must be updated: +================================================================== +In the transportConnectors property, the entry needs to look like +the following: + + <transportConnectors> + <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/> + <transportConnector name="stomp" uri="stomp://0.0.0.0:61612?transport.closeAsync=false"/> + <transportConnector name="stomp+nio" uri="stomp+nio://0.0.0.0:61613?transport.closeAsync=false"/> + </transportConnectors> + +Note: If activemq is running on the same system as the dispatcher, +it is advised that you use 127.0.0.1 instead of 0.0.0.0. + +The razorback dispatcher's configuration must be created and +customized: +================================================================== +cp rzb.conf.sample rzb.conf +cp magic.sample magic +cp dispatcher.conf.sample dispatcher.conf diff --git a/security/razorback-dispatcher/pkg-descr b/security/razorback-dispatcher/pkg-descr new file mode 100644 index 000000000000..930082261c40 --- /dev/null +++ b/security/razorback-dispatcher/pkg-descr @@ -0,0 +1,5 @@ +Razorback is a framework for an intelligence driven security solution. +It consists of a Dispatcher at the core of the system, surrounded by +Nuggets of varying types. + +WWW: http://razorbacktm.sourceforge.net/ diff --git a/security/razorback-dispatcher/pkg-plist b/security/razorback-dispatcher/pkg-plist new file mode 100644 index 000000000000..96c9e85b3ccf --- /dev/null +++ b/security/razorback-dispatcher/pkg-plist @@ -0,0 +1,11 @@ +@comment $FreeBSD$ +bin/dispatcher +bin/dispatcher_safed +@unexec if cmp -s %D/etc/razorback/dispatcher.conf %D/etc/razorback/dispatcher.conf.sample; then rm -f %D/etc/razorback/dispatcher.conf; fi +etc/razorback/dispatcher.conf.sample +@exec if [ ! -f %D/etc/razorback/dispatcher.conf ]; then cp -p %D/%F %B/dispatcher.conf; fi +@dirrmtry etc/razorback +share/razorback/razorback.sql +share/razorback/razorback-data.sql +share/razorback/truncate.sql +@dirrmtry share/razorback |