aboutsummaryrefslogtreecommitdiffstats
path: root/net/rabbitmq/Makefile
blob: 7972121387ce0ef8e4438fa8d120e7de43760775 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Created by: Phillip Neumann <pneumann@gmail.com>
# $FreeBSD$

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

MAINTAINER= olgeni@FreeBSD.org
COMMENT=    RabbitMQ is an implementation of AMQP

LICENSE=    MPL11
LICENSE_FILE=   ${WRKSRC}/LICENSE-MPL-RabbitMQ

BUILD_DEPENDS=  erlang-runtime19>=19.0:lang/erlang-runtime19 \
        ${PYTHON_PKGNAMEPREFIX}simplejson>=2.0:devel/py-simplejson \
        xmlto:textproc/xmlto \
        zip:archivers/zip \
        rsync:net/rsync
RUN_DEPENDS=    erlang-runtime19>=19.0:lang/erlang-runtime19

OPTIONS_DEFINE= ADMIN
OPTIONS_SUB=    yes

ADMIN_DESC= Install rabbitmqadmin script
ADMIN_USES= python
ADMIN_USES_OFF= python:build

ALL_TARGET= all manpages
USES=       cpe gmake shebangfix tar:xz
USE_RC_SUBR=    rabbitmq
NO_ARCH=    yes

USERS=      rabbitmq
GROUPS=     rabbitmq

PLIST_SUB=  VERSION=${PORTVERSION}

CPE_VENDOR= pivotal_software

REINPLACE_ARGS= -i ""
SCRIPTS_DIR=    ${WRKSRC}/deps/rabbit/scripts
SHEBANG_FILES=  deps/rabbitmq_management/bin/rabbitmqadmin
MAKE_ARGS+= PYTHON=${PYTHON_CMD}
MAKE_ENV+=  PATH="${LOCALBASE}/lib/erlang19/bin:${PATH}" \
        TARGET_DIR="${STAGEDIR}${PREFIX}/lib/erlang/lib/rabbitmq_server-${PORTVERSION}" \
        SBIN_DIR="${STAGEDIR}${PREFIX}/sbin/" \
        MAN_DIR="${STAGEDIR}${PREFIX}/man" \
        DOC_INSTALL_DIR="${STAGEDIR}${EXAMPLESDIR}" \
        VERSION="${PORTVERSION}"

MAKE_JOBS_UNSAFE=   yes

.include <bsd.port.options.mk>

post-patch:
    @${REINPLACE_CMD} -e 's|/etc/rabbitmq|${PREFIX}/etc/rabbitmq|g ; s|/var/lib|/var/db|g ; s|$${ERL_DIR}erl|${PREFIX}/lib/erlang19/bin/erl|g' \
        ${SCRIPTS_DIR}/rabbitmq-server \
        ${SCRIPTS_DIR}/rabbitmqctl \
        ${SCRIPTS_DIR}/rabbitmq-env \
        ${SCRIPTS_DIR}/rabbitmq-plugins \
        ${SCRIPTS_DIR}/rabbitmq-defaults \
        ${WRKSRC}/deps/rabbit/docs/rabbitmq-env.conf.5.xml

post-install:
    @${MKDIR} ${STAGEDIR}${PREFIX}/etc/rabbitmq
    @${MKDIR} ${STAGEDIR}/var/db/rabbitmq/mnesia
    @${MKDIR} ${STAGEDIR}/var/log/rabbitmq
    ${INSTALL_DATA} ${WRKSRC}/deps/rabbit/docs/rabbitmq.config.example \
        ${STAGEDIR}${PREFIX}/etc/rabbitmq/rabbitmq.config.sample
.for _file in rabbitmq-defaults rabbitmq-env rabbitmq-plugins rabbitmq-server rabbitmqctl
    ${LN} -s ../lib/erlang/lib/rabbitmq_server-${PORTVERSION}/sbin/${_file} ${STAGEDIR}${PREFIX}/sbin
.endfor
.for _file in rabbitmq-plugins.1 rabbitmq-server.1 rabbitmqctl.1
    ${INSTALL_MAN} ${WRKSRC}/deps/rabbit/docs/${_file} ${STAGEDIR}${MAN1PREFIX}/man/man1
.endfor
    ${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 <bsd.port.mk>