Ticket #18665: Portfile-rabbitmq-server.diff

File Portfile-rabbitmq-server.diff, 5.9 KB (added by cpettitt@…, 16 years ago)
  • Portfile

    old new  
    11# -*- 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 # $Id: Portfile 38567 2008-07-25 08:46:05Z ryandesign@macports.org $
     2# $Id$
    33
    44PortSystem      1.0
    55
    66name            rabbitmq-server
    7 version         1.3.0
     7version         1.5.3
    88revision        0
    99categories      net
    1010maintainers     tonyg@rabbitmq.com
     
    1515    high performance enterprise messaging. The RabbitMQ server is a \
    1616    robust and scalable implementation of an AMQP broker.
    1717
     18
    1819homepage        http://www.rabbitmq.com/
    19 master_sites    http://www.rabbitmq.com/releases/source/
     20master_sites    http://www.rabbitmq.com/releases/rabbitmq-server/v${version}/
    2021
    21 distname        rabbitmq-${version}
     22distname        rabbitmq-server-${version}
    2223
    2324checksums \
    24     md5 3206716f78a22e5c1d82529c660410d5 \
    25     sha1 2f8584daaaab1af55037478b77b9927b81bb919d \
    26     rmd160 24c6be02f3680a36023586211187337243b13955
     25    md5 3242a67885c2471b5ab62254bf024679 \
     26    sha1 f4d6a01eaa2c74fa32f567fe410d21d9be1b43aa \
     27    rmd160 1a1c4b97d765548028c161d1617905151ca9e040
    2728
    28 depends_build   port:erlang
     29depends_build   port:erlang port:py25-simplejson
    2930depends_run     port:erlang
    3031
    31 use_configure   no
     32set serveruser  rabbitmq
     33set servergroup rabbitmq
     34set serverhome ${prefix}/var/lib/rabbitmq
     35set logdir ${prefix}/var/log/rabbitmq
     36set mnesiadbdir ${prefix}/var/lib/rabbitmq/mnesia
     37set plistloc ${prefix}/etc/LaunchDaemons/org.macports.rabbitmq-server
    3238
    33 worksrcdir      rabbitmq-${version}/erlang/rabbit
     39use_configure   no
    3440
    3541use_parallel_build yes
    3642
     43build.args      PYTHON=${prefix}/bin/python2.5
     44
    3745destroot.destdir \
    38     DIST_DIR=${destroot}${prefix}/lib/erlang/lib/rabbitmq_server-${version} \
    39     SBIN_DIR=${destroot}${prefix}/sbin
    40 destroot.target dist-unix
     46    TARGET_DIR=${destroot}${prefix}/lib/erlang/lib/rabbitmq_server-${version} \
     47    SBIN_DIR=${destroot}${prefix}/sbin \
     48    MAN_DIR=${destroot}${prefix}/share/man
    4149
    4250destroot.keepdirs \
    43     ${destroot}${prefix}/var/lib/rabbitmq/pids \
    44     ${destroot}${prefix}/var/log/rabbitmq \
    45     ${destroot}${prefix}/var/lib/rabbitmq/mnesia
     51    ${destroot}${logdir} \
     52    ${destroot}${mnesiadbdir}
    4653
    4754pre-destroot {
    48     addgroup rabbitmq
    49     adduser rabbitmq gid=[existsgroup rabbitmq] realname=RabbitMQ\ Server home=${prefix}/var/lib/rabbitmq
     55    addgroup ${servergroup}
     56    adduser ${serveruser} gid=[existsgroup ${servergroup}] realname=RabbitMQ\ Server home=${serverhome}
    5057}
    5158
    5259post-destroot {
    53     xinstall -d ${destroot}${prefix}/etc/default
    54     xinstall -d -g [existsgroup rabbitmq] -m 775 ${destroot}${prefix}/var/log/rabbitmq
    55     xinstall -d -g [existsgroup rabbitmq] -m 775 ${destroot}${prefix}/var/lib/rabbitmq
    56     xinstall -d -g [existsgroup rabbitmq] -m 775 ${destroot}${prefix}/var/lib/rabbitmq/pids
    57     xinstall -d -g [existsgroup rabbitmq] -m 775 ${destroot}${prefix}/var/lib/rabbitmq/mnesia
    58     file rename ${destroot}${prefix}/sbin/rabbitmqctl ${destroot}${prefix}/sbin/rabbitmqctl_real
    59     xinstall -m 555 ${filespath}/rabbitmqctl_wrapper ${destroot}${prefix}/sbin
    60     file rename ${destroot}${prefix}/sbin/rabbitmqctl_wrapper ${destroot}${prefix}/sbin/rabbitmqctl
    61     file copy ${filespath}/rabbitmq-defaults ${destroot}${prefix}/etc/default/rabbitmq
    62     reinplace "s:^CLUSTER_CONFIG_FILE=:CLUSTER_CONFIG_FILE=${prefix}:" \
     60    xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}${logdir}
     61    xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}${serverhome}
     62    xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}${mnesiadbdir}
     63
     64    reinplace -E "s:(/etc/rabbitmq/rabbitmq.conf):${prefix}\\1:g" \
    6365        ${destroot}${prefix}/sbin/rabbitmq-multi \
    6466        ${destroot}${prefix}/sbin/rabbitmq-server \
    65         ${destroot}${prefix}/sbin/rabbitmqctl \
    66         ${destroot}${prefix}/sbin/rabbitmqctl_real
    67     reinplace "s:^CONFIG_FILE=:CONFIG_FILE=${prefix}:" \
     67        ${destroot}${prefix}/sbin/rabbitmqctl
     68    reinplace -E "s:(RABBITMQ_CLUSTER_CONFIG_FILE)=/:\\1=${prefix}/:" \
    6869        ${destroot}${prefix}/sbin/rabbitmq-multi \
    6970        ${destroot}${prefix}/sbin/rabbitmq-server \
    70         ${destroot}${prefix}/sbin/rabbitmqctl \
    71         ${destroot}${prefix}/sbin/rabbitmqctl_real
    72     reinplace "s|@PREFIX@|${prefix}|" \
    73         ${destroot}${prefix}/sbin/rabbitmqctl \
    74         ${destroot}${prefix}/etc/default/rabbitmq
     71        ${destroot}${prefix}/sbin/rabbitmqctl
     72    reinplace -E "s:(RABBITMQ_LOG_BASE)=/:\\1=${prefix}/:" \
     73        ${destroot}${prefix}/sbin/rabbitmq-multi \
     74        ${destroot}${prefix}/sbin/rabbitmq-server \
     75        ${destroot}${prefix}/sbin/rabbitmqctl
     76    reinplace -E "s:(RABBITMQ_MNESIA_BASE)=/:\\1=${prefix}/:" \
     77        ${destroot}${prefix}/sbin/rabbitmq-multi \
     78        ${destroot}${prefix}/sbin/rabbitmq-server \
     79        ${destroot}${prefix}/sbin/rabbitmqctl
     80    reinplace -E "s:(RABBITMQ_PIDS_FILE)=/:\\1=${prefix}/:" \
     81        ${destroot}${prefix}/sbin/rabbitmq-multi \
     82        ${destroot}${prefix}/sbin/rabbitmq-server \
     83        ${destroot}${prefix}/sbin/rabbitmqctl
     84
     85    file rename ${destroot}${prefix}/sbin/rabbitmqctl ${destroot}${prefix}/sbin/rabbitmqctl_real
     86    xinstall -m 555 ${filespath}/rabbitmqctl_wrapper ${destroot}${prefix}/sbin
     87    file rename ${destroot}${prefix}/sbin/rabbitmqctl_wrapper ${destroot}${prefix}/sbin/rabbitmqctl
     88
     89    reinplace -E "s:@PREFIX@:${prefix}:" \
     90        ${destroot}${prefix}/sbin/rabbitmqctl
     91}
     92
     93pre-install {
     94    system "cd ${destroot}${plistloc}; patch <${filespath}/patch-org.macports.rabbitmq-server.plist.diff"
    7595}
    7696
    7797startupitem.create      yes
    7898startupitem.init        "PATH=${prefix}/bin:${prefix}/sbin:\$PATH; export PATH"
    79 startupitem.start       "su rabbitmq -c rabbitmq-server 2>&1"
     99startupitem.start       "rabbitmq-server 2>&1"
    80100startupitem.stop        "rabbitmqctl stop 2>&1"
    81101startupitem.logfile     ${prefix}/var/log/rabbitmq/startupitem.log