aboutsummaryrefslogtreecommitdiffstats
path: root/net/rabbitmq/Makefile
blob: 5caaebfef0e473a7827a383ec5b8adeedfb819f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# New ports collection makefile for:    rabbitmq
# Date Created:             2008-07-11
# Whom:                 Phillip Neumann <pneumann@gmail.com>
#
# $FreeBSD$
#

PORTNAME=   rabbitmq
PORTVERSION=    1.7.0
CATEGORIES= net
MASTER_SITES=   http://www.rabbitmq.com/releases/rabbitmq-server/v${PORTVERSION}/
DISTNAME=   ${PORTNAME}-server-${PORTVERSION}

MAINTAINER= pneumann@gmail.com
COMMENT=    RabbitMQ is an implementation of AMQP

BUILD_DEPENDS=  erlc:${PORTSDIR}/lang/erlang-lite \
        ${PYTHON_PKGNAMEPREFIX}simplejson>=2.0:${PORTSDIR}/devel/py-simplejson
RUN_DEPENDS=    erlc:${PORTSDIR}/lang/erlang-lite

USE_GMAKE=  yes
USE_PYTHON= yes
USE_RC_SUBR=    rabbitmq

RABBITMQ_GID=   135
RABBITMQ_GROUP= rabbitmq
RABBITMQ_UID=   135
RABBITMQ_USER=  rabbitmq

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 \
        rabbitmq-activate-plugins.1 rabbitmq-deactivate-plugins.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
    @${FIND} ${WRKSRC} -name "*.bak" | ${XARGS} ${RM}

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

# TODO: Wrap control scripts to use ${RABBITMQ_USER} via su, much like
# the installed rc.d script, for user convenience.
post-install:
    @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>