# -*- 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
license MPL-1.1 MIT Apache-2
description The RabbitMQ AMQP Server
RabbitMQ is an implementation of AMQP, the emerging standard for \
high performance enterprise messaging. The RabbitMQ server is a \
robust and scalable implementation of an AMQP broker.
homepage http://www.rabbitmq.com/
master_sites https://www.rabbitmq.com/releases/rabbitmq-server/v${version}/ \
https://dl.bintray.com/rabbitmq/all/rabbitmq-server/${version}/
distfiles ${name}-generic-unix-${version}${extract.suffix}
worksrcdir [string map {- _} $name]-$version
checksums rmd160 b1d2e22d39eb711c9fb201513af5dcc7f788422e \
sha256 43214e32316ce4eb6a0a0013b897b2a0c7c96d6814ba6bd01ae60032e8c2479f \
depends_build port:libxslt
depends_build-append port:py27-simplejson
build.args PYTHON=${prefix}/bin/python2.7
depends_build-append port:py27-simplejson
build.args PYTHON=${prefix}/bin/python2.7
# no need for simplejson on Snow Leopard or higher
if {${os.major} > 9 && ${os.platform} eq "darwin"} {
build.args PYTHON=python2.7
set serverhome ${prefix}/var/lib/rabbitmq
set logdir ${prefix}/var/log/rabbitmq
set confdir ${prefix}/etc/rabbitmq
set mnesiadbdir ${prefix}/var/lib/rabbitmq/mnesia
set plistloc ${prefix}/etc/LaunchDaemons/org.macports.${name}
set rootdest ${prefix}/lib/rabbitmq
set rootserver ${rootdest}/lib/${worksrcdir}
set sbindir ${destroot}${rootdest}/bin
set wrappersbin ${destroot}${prefix}/sbin
set realsbin ${destroot}${rootserver}/sbin
set mansrc ${workpath}/${worksrcdir}/share/man
set mandest ${destroot}${prefix}/share/man
add_users ${serveruser} group=${servergroup} realname=RabbitMQ\ Server home=${serverhome}
${destroot}${mnesiadbdir}
# This is a hack: We need to patch the startupitem, so generate it manually
# here, then define the function to empty to avoid overwriting it later
package require portstartupitem 1.0
portstartupitem::startupitem_create
proc portstartupitem::startupitem_create {args} {}
system -W "${destroot}${plistloc}" "/usr/libexec/PlistBuddy -c \"Add :UserName string ${serveruser}\" org.macports.${name}.plist"
xinstall -d -m 775 ${destroot}${confdir}
xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}${logdir}
xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}${serverhome}
xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}${mnesiadbdir}
xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}${rootserver}
xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}
xinstall -d -g [existsgroup ${servergroup}] -m 775 ${sbindir}