Ticket #14230: Portfile

File Portfile, 3.1 KB (added by tonyg-macports@…, 17 years ago)

Portfile for RabbitMQ

Line 
1# $Id: Portfile,v 1.1 2008-02-06 23:31:59 tonyg Exp $ -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
2
3PortSystem 1.0
4name            rabbitmq-server
5version         1.2.0
6revision        0
7categories      net
8maintainers     tonyg@rabbitmq.com
9platforms       darwin
10description     The RabbitMQ AMQP Server
11long_description        \
12    RabbitMQ is an implementation of AMQP, the emerging standard for \
13    high performance enterprise messaging. The RabbitMQ server is a \
14    robust and scalable implementation of an AMQP broker.
15
16homepage        http://www.rabbitmq.com/
17master_sites    http://www.rabbitmq.com/releases/source/
18
19distname        rabbitmq-${version}
20
21checksums \
22    md5 46ee6dbbacdc67b25cc6ccd9c394b6f2 \
23    sha1 67e1e640136a1993567ace97dc5f67b1ad8e6304 \
24    rmd160 9e92502d36ab5cd1e3f0d39a46bb512b9440f35a
25
26depends_build   port:erlang
27depends_run     port:erlang
28
29use_configure no
30
31worksrcdir rabbitmq-${version}/erlang/rabbit
32
33use_parallel_build yes
34
35destroot.destdir \
36    DIST_DIR=${destroot}${prefix}/lib/erlang/lib/rabbitmq_server-${version} \
37    SBIN_DIR=${destroot}${prefix}/sbin
38destroot.target dist-unix
39
40destroot.keepdirs \
41    ${destroot}${prefix}/var/lib/rabbitmq/pids \
42    ${destroot}${prefix}/var/log/rabbitmq \
43    ${destroot}${prefix}/var/lib/rabbitmq/mnesia
44
45pre-destroot {
46    addgroup rabbitmq
47    adduser rabbitmq gid=[existsgroup rabbitmq] realname=RabbitMQ\ Server home=${prefix}/var/lib/rabbitmq
48}
49
50post-destroot {
51    xinstall -d ${destroot}${prefix}/etc/default
52    xinstall -d -g [existsgroup rabbitmq] -m 775 ${destroot}${prefix}/var/log/rabbitmq
53    xinstall -d -g [existsgroup rabbitmq] -m 775 ${destroot}${prefix}/var/lib/rabbitmq
54    xinstall -d -g [existsgroup rabbitmq] -m 775 ${destroot}${prefix}/var/lib/rabbitmq/pids
55    xinstall -d -g [existsgroup rabbitmq] -m 775 ${destroot}${prefix}/var/lib/rabbitmq/mnesia
56    file rename ${destroot}${prefix}/sbin/rabbitmqctl ${destroot}${prefix}/sbin/rabbitmqctl_real
57    xinstall -m 555 ${filespath}/rabbitmqctl_wrapper ${destroot}${prefix}/sbin
58    file rename ${destroot}${prefix}/sbin/rabbitmqctl_wrapper ${destroot}${prefix}/sbin/rabbitmqctl
59    file copy ${filespath}/rabbitmq-defaults ${destroot}${prefix}/etc/default/rabbitmq
60    reinplace "s:^CLUSTER_CONFIG_FILE=:CLUSTER_CONFIG_FILE=${prefix}:" \
61        ${destroot}${prefix}/sbin/rabbitmq-multi \
62        ${destroot}${prefix}/sbin/rabbitmq-server \
63        ${destroot}${prefix}/sbin/rabbitmqctl \
64        ${destroot}${prefix}/sbin/rabbitmqctl_real
65    reinplace "s:^CONFIG_FILE=:CONFIG_FILE=${prefix}:" \
66        ${destroot}${prefix}/sbin/rabbitmq-multi \
67        ${destroot}${prefix}/sbin/rabbitmq-server \
68        ${destroot}${prefix}/sbin/rabbitmqctl \
69        ${destroot}${prefix}/sbin/rabbitmqctl_real
70    reinplace "s|@PREFIX@|${prefix}|" \
71        ${destroot}${prefix}/sbin/rabbitmqctl \
72        ${destroot}${prefix}/etc/default/rabbitmq
73}
74
75startupitem.create      yes
76startupitem.init        "PATH=${prefix}/bin:${prefix}/sbin:\$PATH; export PATH"
77startupitem.start       "su rabbitmq -c rabbitmq-server 2>&1"
78startupitem.stop        "rabbitmqctl stop 2>&1"
79startupitem.logfile     ${prefix}/var/log/rabbitmq/startupitem.log