diff --git a/net/rabbitmq/Makefile b/net/rabbitmq/Makefile index e8edc9a2df14..a888cc36c487 100644 --- a/net/rabbitmq/Makefile +++ b/net/rabbitmq/Makefile @@ -1,84 +1,85 @@ PORTNAME= rabbitmq DISTVERSION= 3.11.19 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= https://github.com/rabbitmq/rabbitmq-server/releases/download/v${PORTVERSION}/ DISTNAME= ${PORTNAME}-server-${PORTVERSION} MAINTAINER= erlang@FreeBSD.org COMMENT= Erlang implementation of AMQP WWW= https://www.rabbitmq.com/ LICENSE= MPL20 LICENSE_FILE= ${WRKSRC}/LICENSE-MPL-RabbitMQ BUILD_DEPENDS= erlang-runtime${_ERLANG_VER}>=${_ERLANG_VER}:lang/erlang-runtime${_ERLANG_VER} \ elixir>=1.13.4:lang/elixir \ ${PYTHON_PKGNAMEPREFIX}simplejson>=2.0:devel/py-simplejson@${PY_FLAVOR} \ xmlto:textproc/xmlto \ zip:archivers/zip \ rsync:net/rsync RUN_DEPENDS= erlang-runtime${_ERLANG_VER}>=${_ERLANG_VER}:lang/erlang-runtime${_ERLANG_VER} USES= cpe gmake shebangfix tar:xz CPE_VENDOR= pivotal_software USE_LOCALE= en_US.UTF-8 USE_RC_SUBR= rabbitmq SHEBANG_FILES= deps/rabbitmq_management/bin/rabbitmqadmin MAKE_ARGS+= PYTHON=${PYTHON_CMD} MAKE_ENV+= PATH="${LOCALBASE}/lib/${_ERLANG_LIB}/bin:${PATH}" \ RMQ_LIBDIR="${PREFIX}/lib" \ MANDIR="${PREFIX}/man" \ DESTDIR="${STAGEDIR}" MAKE_JOBS_UNSAFE= yes ALL_TARGET= install REINPLACE_ARGS= -i "" NO_ARCH= yes SUB_LIST+= _ERLANG_LIB=${_ERLANG_LIB} USERS= rabbitmq GROUPS= rabbitmq PLIST_SUB= VERSION=${PORTVERSION} OPTIONS_DEFINE= ADMIN OPTIONS_SUB= yes ADMIN_DESC= Install rabbitmqadmin script ADMIN_USES= python ADMIN_USES_OFF= python:build _ERLANG_VER= 25 _ERLANG_LIB= erlang${_ERLANG_VER} .include post-patch: # ensure our OTP is always preferred over other installed versions @${REINPLACE_CMD} -e 's|LOCALBASE|${LOCALBASE}|' \ -e 's|ERLANG_LIB|${_ERLANG_LIB}|' \ ${WRKSRC}/deps/rabbit/scripts/rabbitmq-defaults # ensure docs match heir(7) paths @${REINPLACE_CMD} -i '' \ -e 's|/etc/rabbitmq|${PREFIX}/etc/rabbitmq|g' \ -e 's|/var/lib|/var/db|g' \ ${WRKSRC}/deps/rabbit/docs/* post-install: @${MKDIR} ${STAGEDIR}${PREFIX}/etc/rabbitmq @${MKDIR} ${STAGEDIR}/var/db/rabbitmq/mnesia @${MKDIR} ${STAGEDIR}/var/log/rabbitmq ${INSTALL_DATA} ${WRKSRC}/deps/rabbit/docs/advanced.config.example \ ${STAGEDIR}${PREFIX}/etc/rabbitmq/advanced.config.sample ${INSTALL_DATA} ${WRKSRC}/deps/rabbit/docs/rabbitmq.conf.example \ ${STAGEDIR}${PREFIX}/etc/rabbitmq/rabbitmq.conf.sample .for _file in rabbitmq-defaults rabbitmq-diagnostics rabbitmq-env rabbitmq-plugins rabbitmq-queues rabbitmq-server rabbitmq-streams rabbitmq-tanzu rabbitmq-upgrade rabbitmqctl vmware-rabbitmq ${LN} -s ../lib/rabbitmq_server-${PORTVERSION}/sbin/${_file} ${STAGEDIR}${PREFIX}/sbin .endfor ${INSTALL_MAN} ${WRKSRC}/deps/rabbit/docs/*.8 ${STAGEDIR}${MAN1PREFIX}/man/man8 ${INSTALL_MAN} ${WRKSRC}/deps/rabbit/docs/rabbitmq-env.conf.5 ${STAGEDIR}${MAN5PREFIX}/man/man5 post-install-ADMIN-on: ${INSTALL} ${WRKSRC}/deps/rabbitmq_management/bin/rabbitmqadmin ${STAGEDIR}${PREFIX}/bin .include diff --git a/net/rabbitmq/files/rabbitmq.in b/net/rabbitmq/files/rabbitmq.in index b2581043633d..0d5699bbb58f 100644 --- a/net/rabbitmq/files/rabbitmq.in +++ b/net/rabbitmq/files/rabbitmq.in @@ -1,93 +1,93 @@ #!/bin/sh # PROVIDE: rabbitmq # REQUIRE: DAEMON # BEFORE: LOGIN # KEYWORD: shutdown # # Add the following line to /etc/rc.conf to enable RabbitMQ # # rabbitmq_enable="YES" . /etc/rc.subr name=rabbitmq rcvar=rabbitmq_enable load_rc_config $name # Set some defaults : ${rabbitmq_enable="NO"} : ${rabbitmq_user="rabbitmq"} rabbitmq_server="%%PREFIX%%/sbin/rabbitmq-server" rabbitmq_ctl="%%PREFIX%%/sbin/rabbitmqctl" rabbitmq_env_conf="%%PREFIX%%/etc/rabbitmq/rabbitmq-env.conf" pidfile="/var/run/rabbitmq/${name}.pid" start_cmd="${name}_start" stop_cmd="${name}_stop" rotate_logs_cmd="su -m ${rabbitmq_user} -c 'sh -c \"${rabbitmq_ctl} rotate_logs\"'" status_cmd="su -m ${rabbitmq_user} -c 'sh -c \"${rabbitmq_ctl} status\"'" extra_commands="rotate_logs status" # ensure scripts find erlang_cookie export HOME=/var/db/${name} # set defaults but allow admin to override them in rabbitmq_env_conf : ${RABBITMQ_HOME:=/var/db/${name}} : ${RABBITMQ_LOG_BASE:=/var/log/${name}} : ${RABBITMQ_PID_FILE:=${pidfile}} # require precise OTP version in case multiple erlangs are installed -export PATH=%%PREFIX%%/lib/%%ERLANG_LIB%%/bin:$PATH +export PATH=%%PREFIX%%/lib/%%_ERLANG_LIB%%/bin:$PATH if [ -f ${rabbitmq_env_conf} ]; then . ${rabbitmq_env_conf} fi # Prevent conflicts with amqp_client and rabbit_common applications that # may be installed in ERL_LIBS. unset ERL_LIBS rabbitmq_start() { echo "Starting ${name}." if [ -d ${RABBITMQ_HOME} ]; then chown -R ${rabbitmq_user}:${rabbitmq_user} ${RABBITMQ_HOME} fi mkdir -p ${RABBITMQ_LOG_BASE} chown -R ${rabbitmq_user}:${rabbitmq_user} ${RABBITMQ_LOG_BASE} if [ -f ${RABBITMQ_HOME}/.erlang.cookie ]; then chmod 600 ${RABBITMQ_HOME}/.erlang.cookie fi install -d -o ${rabbitmq_user} -g ${rabbitmq_user} /var/run/${name} export RABBITMQ_HOME RABBITMQ_LOG_BASE RABBITMQ_PID_FILE rm -f ${pidfile} debug "Running: rabbitmq-server -detached" su -m ${rabbitmq_user} -c "${rabbitmq_server} -detached" >/dev/null 2>&1 debug "Running: rabbitmqctl wait ${pidfile}" su -m ${rabbitmq_user} -c "${rabbitmq_ctl} wait ${pidfile}" >/dev/null 2>&1 } rabbitmq_stop() { echo "Stopping ${name}." if [ -f ${pidfile} ]; then debug "Running: ${rabbitmq_ctl} stop ${pidfile}" su -m ${rabbitmq_user} -c "${rabbitmq_ctl} stop ${pidfile}" >/dev/null 2>&1 else debug "Running: ${rabbitmq_ctl} shutdown" su -m ${rabbitmq_user} -c "${rabbitmq_ctl} shutdown" >/dev/null 2>&1 fi } run_rc_command "$1"