diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/Makefile | 1 | ||||
-rw-r--r-- | net/openmq/Makefile | 99 | ||||
-rw-r--r-- | net/openmq/distinfo | 3 | ||||
-rw-r--r-- | net/openmq/files/imq.in | 104 | ||||
-rw-r--r-- | net/openmq/files/patch-imqbrokerd | 16 | ||||
-rw-r--r-- | net/openmq/files/patch-imqinit | 20 | ||||
-rw-r--r-- | net/openmq/files/pkg-message.in | 10 | ||||
-rw-r--r-- | net/openmq/pkg-deinstall | 13 | ||||
-rw-r--r-- | net/openmq/pkg-descr | 4 | ||||
-rw-r--r-- | net/openmq/pkg-install | 14 |
10 files changed, 284 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile index ad91a8a05790..a0ede8919f6f 100644 --- a/net/Makefile +++ b/net/Makefile @@ -454,6 +454,7 @@ SUBDIR += openldap24-server SUBDIR += openmcu SUBDIR += openmpi + SUBDIR += openmq SUBDIR += openntpd SUBDIR += openospfd SUBDIR += openradius diff --git a/net/openmq/Makefile b/net/openmq/Makefile new file mode 100644 index 000000000000..5731e68e2546 --- /dev/null +++ b/net/openmq/Makefile @@ -0,0 +1,99 @@ +# New ports collection makefile for: openmq +# Date created: 2009-12-05 +# Whom: Radim Kolar <hsn@sanatana.iol.cz> +# +# $FreeBSD$ +# + +PORTNAME= openmq +PORTVERSION= 4.5.b03 +CATEGORIES= net java +MASTER_SITES= http://download.java.net/mq/open-mq/4.5/b03/ +DISTNAME= openmq4_5-source + +MAINTAINER= hsn@sendmail.cz +COMMENT= Open Message Queue - OSS Java Message Service Broker + +BUILD_DEPENDS= wget:${PORTSDIR}/ftp/wget + +USE_ZIP= yes +USE_JAVA= yes +JAVA_VERSION= 1.6 +JAVA_VENDOR= openjdk + +WRKSRC= ${WRKDIR}/mq +PLIST= ${WRKDIR}/pkg-plist + +USE_ANT= yes +ALL_TARGET= bootstrap all +.ifndef IMQ_CLIENT +USE_RC_SUBR= imq +.else +SUB_FILES= pkg-message +.endif + +post-build: + @${RM} ${WRKSRC}/dist/mq/bin/*.exe + @cd ${WRKSRC}/dist/mq/etc && \ + ${MV} imqenv.conf imqenv.conf.sample + @cd ${WRKSRC}/dist/mq/etc && \ + ${MV} imqbrokerd.conf imqbrokerd.conf.sample +pre-install: +.ifndef IMQ_CLIENT + @cd ${WRKSRC}/dist/mq && ${FIND} bin lib -type f -exec \ + ${ECHO_CMD} "imq/{}" \; > ${PLIST} + @cd ${WRKSRC}/dist/mq && ${FIND} -d bin lib -type d -exec \ + ${ECHO_CMD} "@dirrm imq/{}" \; >> ${PLIST} + @cd ${WRKSRC}/dist/mq/etc && ${FIND} . -depth 1 -type f -exec \ + ${ECHO_CMD} "etc/mq/{}" \; >> ${PLIST} + @${ECHO_CMD} "@dirrmtry etc/mq" >> ${PLIST} +.ifndef NOPORTDOCS + @cd ${WRKSRC}/dist/mq/javadoc && ${FIND} . -type f -exec \ + ${ECHO_CMD} "%%DOCSDIR%%/{} " \; >> ${PLIST} + @cd ${WRKSRC}/dist/mq/javadoc && ${FIND} -d . -mindepth 1 -type d -exec \ + ${ECHO_CMD} "@dirrm %%DOCSDIR%%/{}" \; >> ${PLIST} + @cd ${WRKSRC}/dist/mq/examples && ${FIND} . -type f -exec \ + ${ECHO_CMD} "%%EXAMPLESDIR%%/{}" \; >> ${PLIST} + @cd ${WRKSRC}/dist/mq/examples && ${FIND} -d . -mindepth 1 -type d -exec \ + ${ECHO_CMD} "@dirrm %%EXAMPLESDIR%%/{}" \; >> ${PLIST} + @${ECHO_CMD} "@dirrm %%EXAMPLESDIR%%" >> ${PLIST} + @${ECHO_CMD} "@dirrm %%DOCSDIR%%" >> ${PLIST} +.endif + @${ECHO_CMD} "@dirrmtry imq" >> ${PLIST} +.else + @${ECHO_CMD} "%%JAVAJARDIR%%/jms.jar" > ${PLIST} + @${ECHO_CMD} "%%JAVAJARDIR%%/imq.jar" >> ${PLIST} + @${ECHO_CMD} "%%JAVAJARDIR%%/fscontext.jar" >> ${PLIST} +.endif + +do-install: +.ifndef IMQ_CLIENT + @${MKDIR} ${PREFIX}/imq + @${MKDIR} ${PREFIX}/etc/mq + @cd ${WRKSRC}/dist/mq && ${FIND} bin lib | \ + ${CPIO} --quiet -pdmu -R ${BINOWN}:${BINGRP} ${PREFIX}/imq + @cd ${WRKSRC}/dist/mq/etc && ${FIND} . -depth 1 -type f | \ + ${CPIO} --quiet -pdmu -R ${BINOWN}:${BINGRP} ${PREFIX}/etc/mq + @${CHMOD} 640 ${PREFIX}/etc/mq/*.sample +.if !defined(NOPORTDOCS) + @${MKDIR} ${DOCSDIR} + @cd ${WRKSRC}/dist/mq/javadoc && ${FIND} . | \ + ${CPIO} --quiet -pdmu -R ${SHAREOWN}:${SHAREGRP} ${DOCSDIR} + @${MKDIR} ${EXAMPLESDIR} + @cd ${WRKSRC}/dist/mq/examples && ${FIND} . | \ + ${CPIO} --quiet -pdmu -R ${SHAREOWN}:${SHAREGRP} ${EXAMPLESDIR} +.endif +.else + @${INSTALL_DATA} ${WRKSRC}/dist/mq/lib/imq.jar ${JAVAJARDIR} + @${INSTALL_DATA} ${WRKSRC}/dist/mq/lib/jms.jar ${JAVAJARDIR} + @${INSTALL_DATA} ${WRKSRC}/dist/mq/lib/fscontext.jar ${JAVAJARDIR} +.endif + +post-install: +.ifdef IMQ_CLIENT + @${CAT} ${PKGMESSAGE} +.else + PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL +.endif + +.include <bsd.port.mk> diff --git a/net/openmq/distinfo b/net/openmq/distinfo new file mode 100644 index 000000000000..c3438c580862 --- /dev/null +++ b/net/openmq/distinfo @@ -0,0 +1,3 @@ +MD5 (openmq4_5-source.zip) = e7907ff1e63d51b9e87affe04057579c +SHA256 (openmq4_5-source.zip) = db078d9b08bd939a9f106e1365646bb2c72f4cae1270aa51576bdf25e13cdc05 +SIZE (openmq4_5-source.zip) = 6709699 diff --git a/net/openmq/files/imq.in b/net/openmq/files/imq.in new file mode 100644 index 000000000000..6bb06708561b --- /dev/null +++ b/net/openmq/files/imq.in @@ -0,0 +1,104 @@ +#!/bin/sh +# +# Copyright (c) 2009 Radim Kolar. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +# $Id$ + +# PROVIDE: imq +# REQUIRE: DAEMON +# KEYWORD: shutdown +# +# Add the following line to /etc/rc.conf to enable Open MQ: +# +# imq_enable="YES" +# # optional +# imq_data="/var/spool/imq" +# imq_vmargs="-Xms192m -Xmx192m -Xss128k -XX:MaxGCPauseMillis=5000" + +name="imq" +. %%RC_SUBR%% + +# set defaults +imq_enable=${imq_enable:-"NO"} +imq_data=${imq_data:-"/var/spool/imq"} + +rcvar=`set_rcvar` +load_rc_config $name +pidfile=/var/run/imq.pid +start_cmd="${name}_start" +command=/usr/local/imq/bin/imqbrokerd +command_args="-bgnd -silent" +command_interpreter="/bin/sh" +sigstop=INT +CONF_FILE=%%PREFIX%%/etc/mq/imqbrokerd.conf + +#Check if we have enabled AUTOSTART feature, which overrides rcvar=NO +if ! checkyesno ${rcvar}; then + if [ -f $CONF_FILE -a -r $CONF_FILE ]; then + autostart=`grep "^AUTOSTART=" $CONF_FILE | cut -c11-` + if checkyesno autostart; then + eval ${rcvar}=YES + fi + fi +fi + +#check if RESTART feature is enabled +if [ -f $CONF_FILE -a -r $CONF_FILE ]; then + autorestart=`grep "^RESTART=" $CONF_FILE | cut -c9-` + autoargs=`grep "^ARGS=" $CONF_FILE | cut -c6-` + if checkyesno autorestart; then + command_args="$command_args -autorestart" + fi +fi + +#add vmargs if needed +if [ -n "$imq_vmargs" ]; then + command_args="$command_args -vmargs \"$imq_vmargs\"" +fi + +#load aditional command line arguments from broker config file +if [ -n $autoargs ]; then + echo "$autoargs" | grep -q -- '-varhome' + if [ ! $? -eq 0 ]; then + command_args="$command_args -varhome $imq_data $autoargs" + else + command_args="$command_args $autoargs" + fi +fi + +imq_start() +{ + if [ -z "$rc_pid" ]; then + echo -n "Starting $name" + ${command} ${command_args} & + echo -n $! > $pidfile + echo "." + else + echo "imq is already running with pid=$rc_pid." + fi +} + +run_rc_command "$1" diff --git a/net/openmq/files/patch-imqbrokerd b/net/openmq/files/patch-imqbrokerd new file mode 100644 index 000000000000..c65ee2db2225 --- /dev/null +++ b/net/openmq/files/patch-imqbrokerd @@ -0,0 +1,16 @@ +--- src/solaris/bin/imqbrokerd.sh.orig 2009-09-11 20:39:07.000000000 +0200 ++++ src/solaris/bin/imqbrokerd.sh 2009-12-09 23:42:43.000000000 +0100 +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/sh -T + ############################################################################# + # + # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +@@ -53,6 +53,7 @@ + # The broker's shutdown hooks will make sure it exits cleanly + if [ -n "$_javapid" ]; then + kill -TERM $_javapid ++ wait $_javapid + fi + } + diff --git a/net/openmq/files/patch-imqinit b/net/openmq/files/patch-imqinit new file mode 100644 index 000000000000..94011d40b48b --- /dev/null +++ b/net/openmq/files/patch-imqinit @@ -0,0 +1,20 @@ +--- src/solaris/etc/imqinit.bak 2009-12-05 23:16:02.000000000 +0100 ++++ src/solaris/etc/imqinit.sh 2009-12-07 19:50:34.000000000 +0100 +@@ -149,7 +149,16 @@ + /usr \ + " + ;; +- ++ FreeBSD) ++ _j2se_locations="\ ++/usr/local/openjdk6 \ ++/usr/local/diablo-jdk1.6.0 \ ++/usr/local/diablo-jre1.6.0 \ ++/usr/local/jdk1.5.0 \ ++/usr/local/diablo-jdk1.5.0 \ ++/usr/local/diablo-jre1.5.0 \ ++" ++ ;; + *) + _j2se_locations="\ + /usr/jdk/entsys-j2se \ diff --git a/net/openmq/files/pkg-message.in b/net/openmq/files/pkg-message.in new file mode 100644 index 000000000000..ba3bed93cbd4 --- /dev/null +++ b/net/openmq/files/pkg-message.in @@ -0,0 +1,10 @@ +To use imq-client in your Java application you need to add following jars +to your classpath: + +%%JAVAJARDIR%%/imq.jar - Connector to IMQ broker. REQUIRED. +%%JAVAJARDIR%%/jms.jar - JMS 1.1 API classes. MOST LIKELY NEEDED + If you have only one jms provider used in + your application or not using application + server you will need this. Otherwise other + jms provider will most likely to ship this. +%%JAVAJARDIR%%/fscontext.jar - JDNI file based lookups. OPTIONAL diff --git a/net/openmq/pkg-deinstall b/net/openmq/pkg-deinstall new file mode 100644 index 000000000000..fd6afbc22bbb --- /dev/null +++ b/net/openmq/pkg-deinstall @@ -0,0 +1,13 @@ +#! /bin/sh +# +# Removes unchanged configuration files +# +if [ "$2" = "DEINSTALL" ]; then + if [ ! -d $PKG_PREFIX/etc/mq ]; then exit 1;fi + cd $PKG_PREFIX/etc/mq + for cfgfile in imqbrokerd.conf imqenv.conf passfile; do + if cmp -s $cfgfile.sample $cfgfile; then + rm $cfgfile + fi + done +fi diff --git a/net/openmq/pkg-descr b/net/openmq/pkg-descr new file mode 100644 index 000000000000..34d3a730a226 --- /dev/null +++ b/net/openmq/pkg-descr @@ -0,0 +1,4 @@ +Open Message Queue is a complete message-oriented middle-ware +platform. High quality, enterprise ready messaging. + +WWW: https://mq.dev.java.net/ diff --git a/net/openmq/pkg-install b/net/openmq/pkg-install new file mode 100644 index 000000000000..5bb4b421c161 --- /dev/null +++ b/net/openmq/pkg-install @@ -0,0 +1,14 @@ +#! /bin/sh +# +# Copies sample imq etc files to real ones if real ones does not exists +# +if [ "$2" = "POST-INSTALL" ]; then + if [ ! -d $PKG_PREFIX/etc/mq ]; then exit 1;fi + umask 027 + cd $PKG_PREFIX/etc/mq + for cfgfile in imqbrokerd.conf imqenv.conf passfile; do + if [ ! -f $cfgfile ]; then + cp $cfgfile.sample $cfgfile + fi + done +fi |