diff --git a/net/rabbitmq/Makefile b/net/rabbitmq/Makefile index 318c10977cb4..518d644e98ca 100644 --- a/net/rabbitmq/Makefile +++ b/net/rabbitmq/Makefile @@ -20,19 +20,29 @@ RUN_DEPENDS= erlc:${PORTSDIR}/lang/erlang-lite USE_GMAKE= yes USE_PYTHON= yes -MAKE_ENV+= TARGET_DIR="${PREFIX}/lib/erlang/lib/rabbitmq_server-${PORTVERSION}" SBIN_DIR="${PREFIX}/sbin/" \ - MAN_DIR="${PREFIX}/man" -SCRIPTS_DIR= ${WRKSRC}/scripts/ USE_RC_SUBR= rabbitmq -PLIST_SUB= "VERSION=${PORTVERSION}" -SUB_FILES= pkg-install + +RABBITMQ_GID= 135 +RABBITMQ_GROUP= rabbitmq +RABBITMQ_UID= 135 RABBITMQ_USER= rabbitmq -RABBITMQ_GROUP= ${RABBITMQ_USER} + +PLIST_SUB= "VERSION=${PORTVERSION}" + +SUB_FILES= pkg-install pkg-message +SUB_LIST= RABBITMQ_GID=${RABBITMQ_GID} \ + RABBITMQ_GROUP=${RABBITMQ_GROUP} \ + RABBITMQ_UID=${RABBITMQ_UID} \ + RABBITMQ_USER=${RABBITMQ_USER} MAN1= rabbitmq-multi.1 rabbitmq-server.1 rabbitmqctl.1 MAN5= rabbitmq.conf.5 MANCOMPRESSED= yes +SCRIPTS_DIR= ${WRKSRC}/scripts/ +MAKE_ENV+= TARGET_DIR="${PREFIX}/lib/erlang/lib/rabbitmq_server-${PORTVERSION}" SBIN_DIR="${PREFIX}/sbin/" \ + MAN_DIR="${PREFIX}/man" + post-patch: @${REINPLACE_CMD} -e 's|/etc/rabbitmq|${PREFIX}/etc/rabbitmq|g ; s|/var/lib|/var/db|g ; s|erl|${LOCALBASE}/bin/erl|g' \ ${SCRIPTS_DIR}/rabbitmq-multi ${SCRIPTS_DIR}/rabbitmq-server ${SCRIPTS_DIR}/rabbitmqctl @@ -49,18 +59,6 @@ pre-install: # the installed rc.d script, for user convenience. post-install: @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL - @${ECHO_MSG} - @${ECHO_MSG} "###############################################################################" - @${ECHO_MSG} - @${ECHO_MSG} "Please note:" - @${ECHO_MSG} "The \"rabbitmqctl\" command must be run as the \"${RABBITMQ_USER}\" user," - @${ECHO_MSG} "with a real shell, and with the HOME environment variable set to that" - @${ECHO_MSG} "user's real home directory." - @${ECHO_MSG} - @${ECHO_MSG} "sudo users can do something like this:" - @${ECHO_MSG} " # sudo -H -u rabbitmq rabbitmqctl ..." - @${ECHO_MSG} - @${ECHO_MSG} "###############################################################################" - @${ECHO_MSG} + @${CAT} ${PKGMESSAGE} .include diff --git a/net/rabbitmq/files/pkg-install.in b/net/rabbitmq/files/pkg-install.in index 6dc6a8397ca5..7066ed2a81e7 100644 --- a/net/rabbitmq/files/pkg-install.in +++ b/net/rabbitmq/files/pkg-install.in @@ -1,9 +1,9 @@ #!/bin/sh -RABBITMQ_USER=rabbitmq -RABBITMQ_GROUP=${RABBITMQ_USER} -RABBITMQ_UID=135 -RABBITMQ_GID=${RABBITMQ_UID} +RABBITMQ_GID=%%RABBITMQ_GID%% +RABBITMQ_GROUP=%%RABBITMQ_GROUP%% +RABBITMQ_UID=%%RABBITMQ_UID%% +RABBITMQ_USER=%%RABBITMQ_USER%% case $2 in PRE-INSTALL) diff --git a/net/rabbitmq/files/pkg-message.in b/net/rabbitmq/files/pkg-message.in new file mode 100644 index 000000000000..6678185bc221 --- /dev/null +++ b/net/rabbitmq/files/pkg-message.in @@ -0,0 +1,16 @@ + +############################################################################## + +Please note: +The "rabbitmqctl" command must be run as the %%RABBITMQ_USER%% user, +with a real shell, and with the ${HOME} environment variable set to that +user's real home directory. + +su users can do something like this: + # env HOME=/home/%%RABBITMQ_USER%% su -m %%RABBITMQ_USER%% -c 'rabbitmqctl ...' + +sudo users can do something like this: + # sudo -H -u %%RABBITMQ_USER%% rabbitmqctl ... + +############################################################################## +