aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2009-07-05 01:59:45 +0800
committerbms <bms@FreeBSD.org>2009-07-05 01:59:45 +0800
commit412f344ff03507715bbcd233efacffe5f3f71c44 (patch)
treec39e0409bc46f7f08b5d79e1490ba963039051d7 /net
parent19ceca58b8e60fa91c2e5aa379647d4d940d8f3a (diff)
downloadfreebsd-ports-gnome-412f344ff03507715bbcd233efacffe5f3f71c44.tar.gz
freebsd-ports-gnome-412f344ff03507715bbcd233efacffe5f3f71c44.tar.zst
freebsd-ports-gnome-412f344ff03507715bbcd233efacffe5f3f71c44.zip
Use pkg-message.in instead of post-install so it will appear in a
binary package. Push UID/GID/group/user substitutions into Makefile, use SUBST_LIST. Tidy up variable definitions in Makefile. Suggested by: wxs
Diffstat (limited to 'net')
-rw-r--r--net/rabbitmq/Makefile36
-rw-r--r--net/rabbitmq/files/pkg-install.in8
-rw-r--r--net/rabbitmq/files/pkg-message.in16
3 files changed, 37 insertions, 23 deletions
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 <bsd.port.mk>
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 ...
+
+##############################################################################
+