aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/rabbitmq/Makefile23
-rw-r--r--net/rabbitmq/files/pkg-install.in41
-rw-r--r--net/rabbitmq/pkg-plist2
3 files changed, 12 insertions, 54 deletions
diff --git a/net/rabbitmq/Makefile b/net/rabbitmq/Makefile
index a9e3a045a0ad..4fd3f1be6394 100644
--- a/net/rabbitmq/Makefile
+++ b/net/rabbitmq/Makefile
@@ -7,6 +7,7 @@
PORTNAME= rabbitmq
PORTVERSION= 2.7.1
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= http://www.rabbitmq.com/releases/rabbitmq-server/v${PORTVERSION}/
DISTNAME= ${PORTNAME}-server-${PORTVERSION}
@@ -25,19 +26,11 @@ USE_GMAKE= yes
USE_PYTHON= yes
USE_RC_SUBR= rabbitmq
-RABBITMQ_GID= 135
-RABBITMQ_GROUP= rabbitmq
-RABBITMQ_UID= 135
-RABBITMQ_USER= rabbitmq
+USERS= rabbitmq
+GROUPS= rabbitmq
PLIST_SUB= "VERSION=${PORTVERSION}"
-SUB_FILES= pkg-install
-SUB_LIST= RABBITMQ_GID=${RABBITMQ_GID} \
- RABBITMQ_GROUP=${RABBITMQ_GROUP} \
- RABBITMQ_UID=${RABBITMQ_UID} \
- RABBITMQ_USER=${RABBITMQ_USER}
-
MAN1= rabbitmq-server.1 rabbitmqctl.1 rabbitmq-plugins.1
MAN5= rabbitmq-env.conf.5
MANCOMPRESSED= yes
@@ -48,17 +41,21 @@ MAKE_ENV+= TARGET_DIR="${PREFIX}/lib/erlang/lib/rabbitmq_server-${PORTVERSION}"
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-server ${SCRIPTS_DIR}/rabbitmqctl ${SCRIPTS_DIR}/rabbitmq-env
+ ${SCRIPTS_DIR}/rabbitmq-server ${SCRIPTS_DIR}/rabbitmqctl \
+ ${SCRIPTS_DIR}/rabbitmq-env ${SCRIPTS_DIR}/rabbitmq-plugins
@${FIND} ${WRKSRC} -name "*.bak" -delete
pre-install:
- @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
@${FIND} ${WRKSRC}/ebin ${WRKSRC}/include -type d | \
${XARGS} ${CHMOD} 0755
@${FIND} ${WRKSRC}/ebin ${WRKSRC}/include -type f | \
${XARGS} ${CHMOD} 0644
+ @${MKDIR} ${PREFIX}/etc/rabbitmq
post-install:
- @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+ @${MKDIR} /var/db/rabbitmq/mnesia
+ @${MKDIR} /var/log/rabbitmq
+ @${CHOWN} -R rabbitmq:rabbitmq /var/db/rabbitmq
+ @${CHOWN} -R rabbitmq:rabbitmq /var/log/rabbitmq
.include <bsd.port.mk>
diff --git a/net/rabbitmq/files/pkg-install.in b/net/rabbitmq/files/pkg-install.in
deleted file mode 100644
index 7066ed2a81e7..000000000000
--- a/net/rabbitmq/files/pkg-install.in
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-
-RABBITMQ_GID=%%RABBITMQ_GID%%
-RABBITMQ_GROUP=%%RABBITMQ_GROUP%%
-RABBITMQ_UID=%%RABBITMQ_UID%%
-RABBITMQ_USER=%%RABBITMQ_USER%%
-
-case $2 in
-PRE-INSTALL)
-
- if ! pw group show "${RABBITMQ_GROUP}" > /dev/null; then
- if pw groupadd ${RABBITMQ_GROUP} -g ${RABBITMQ_GID}; then
- echo "Added group \"${RABBITMQ_GROUP}\"."
- else
- echo "Adding group \"${RABBITMQ_GROUP}\" failed..."
- exit 1
- fi
- fi
-
- if ! pw user show "${RABBITMQ_USER}" > /dev/null; then
- if pw useradd ${RABBITMQ_USER} -u ${RABBITMQ_UID} \
- -g ${RABBITMQ_GROUP} -h - -d /var/db/rabbitmq \
- -s /usr/sbin/nologin -c "RabbitMQ"
- then
- echo "Added user \"${RABBITMQ_USER}\"."
- else
- echo "Adding user \"${RABBITMQ_USER}\" failed..."
- exit 1
- fi
- fi
-;;
-
-POST-INSTALL)
- mkdir -p %%PREFIX%%/etc/rabbitmq
- mkdir -p /var/db/rabbitmq/mnesia
- mkdir -p /var/log/rabbitmq
- chown -R ${RABBITMQ_USER}:${RABBITMQ_GROUP} /var/db/rabbitmq
- chown -R ${RABBITMQ_USER}:${RABBITMQ_GROUP} /var/log/rabbitmq
-;;
-
-esac
diff --git a/net/rabbitmq/pkg-plist b/net/rabbitmq/pkg-plist
index 7602663c9a4a..928d769cb4f7 100644
--- a/net/rabbitmq/pkg-plist
+++ b/net/rabbitmq/pkg-plist
@@ -166,5 +166,7 @@ lib/erlang/lib/rabbitmq_server-%%VERSION%%/plugins/README
@unexec rmdir /var/db/rabbitmq/mnesia 2>/dev/null || true
@unexec rmdir /var/db/rabbitmq 2>/dev/null || true
@exec mkdir -p /var/log/rabbitmq
+@exec chown -R rabbitmq:rabbitmq /var/log/rabbitmq
@exec mkdir -p /var/db/rabbitmq/mnesia
+@exec chown -R rabbitmq:rabbitmq /var/db/rabbitmq
@exec mkdir -p %D/etc/rabbitmq