source: trunk/dports/net/rabbitmq-server/Portfile

Last change on this file was 153377, checked in by sean@…, 14 months ago

rabbitmq-server: update to 3.6.5; fixes #52428

Also, we mark this as nomaintainer because hayder has not responded for
at least six weeks since a 'are you there?' ping.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.1 KB
Line 
1# -*- 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 153377 2016-09-29 18:06:18Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                rabbitmq-server
7version             3.6.5
8categories          net
9platforms           darwin
10maintainers         nomaintainer
11license             MPL-1.1 MIT Apache-2
12supported_archs     noarch
13
14description         The RabbitMQ AMQP Server
15long_description    \
16    RabbitMQ is an implementation of AMQP, the emerging standard for \
17    high performance enterprise messaging. The RabbitMQ server is a \
18    robust and scalable implementation of an AMQP broker.
19
20homepage            http://www.rabbitmq.com/
21master_sites        http://www.rabbitmq.com/releases/rabbitmq-server/v${version}/
22
23use_xz              yes
24
25distfiles           ${name}-generic-unix-${version}${extract.suffix}
26worksrcdir          [string map {- _} $name]-$version
27
28checksums           rmd160  6133c55ae339c5e0b86895830ec42524530521f1 \
29                    sha256  232d558addf74cb371fc65ca10a7b3a2b6b31951b39baa1610488135d0f8ebf1
30
31depends_lib         port:erlang
32depends_build       port:libxslt
33
34platform darwin 8 {
35    depends_build-append port:py26-simplejson
36    build.args      PYTHON=${prefix}/bin/python2.6
37}
38
39platform darwin 9 {
40    depends_build-append port:py26-simplejson
41    build.args      PYTHON=${prefix}/bin/python2.6
42}
43
44# no need for simplejson on Snow Leopard or higher
45if {${os.major} > 9 && ${os.platform} eq "darwin"} {
46    # python3.X doesn't work
47    build.args      PYTHON=python2.7
48}
49
50set serveruser      rabbitmq
51set servergroup     rabbitmq
52set serverhome      ${prefix}/var/lib/rabbitmq
53set logdir          ${prefix}/var/log/rabbitmq
54set confdir         ${prefix}/etc/rabbitmq
55set mnesiadbdir     ${prefix}/var/lib/rabbitmq/mnesia
56set plistloc        ${prefix}/etc/LaunchDaemons/org.macports.rabbitmq-server
57set rootdest        ${prefix}/lib/rabbitmq
58set rootserver      ${rootdest}/lib/${worksrcdir}
59set sbindir         ${destroot}${rootdest}/bin
60set wrappersbin     ${destroot}${prefix}/sbin
61set realsbin        ${destroot}${rootserver}/sbin
62set mansrc          ${workpath}/${worksrcdir}/share/man
63set mandest         ${destroot}${prefix}/share/man
64
65add_users ${serveruser} group=${servergroup} realname=RabbitMQ\ Server home=${serverhome}
66
67use_configure       no
68
69build {}
70
71destroot.keepdirs \
72    ${destroot}${confdir} \
73    ${destroot}${logdir} \
74    ${destroot}${mnesiadbdir}
75
76destroot {
77    # This is a hack: We need to patch the startupitem, so generate it manually
78    # here, then define the function to empty to avoid overwriting it later
79    package require portstartupitem 1.0
80    portstartupitem::startupitem_create
81    proc portstartupitem::startupitem_create {args} {}
82    system -W "${destroot}${plistloc}" "patch <${filespath}/patch-org.macports.rabbitmq-server.plist.diff"
83
84    xinstall -d -m 775 ${destroot}${confdir}
85    xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}${logdir}
86    xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}${serverhome}
87    xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}${mnesiadbdir}
88    xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}${rootserver}
89    xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}
90    xinstall -d -g [existsgroup ${servergroup}] -m 775 ${sbindir}
91
92    copy {*}[glob ${worksrcpath}/*] ${destroot}${rootserver}/
93
94    reinplace -E "s:^SYS_PREFIX=\${RABBITMQ_HOME}$:SYS_PREFIX=${prefix}:" \
95        ${realsbin}/rabbitmq-defaults
96    reinplace -E "s:^SYS_PREFIX=$:SYS_PREFIX=${prefix}:" \
97        ${realsbin}/rabbitmq-defaults
98
99    xinstall -m 755 ${filespath}/rabbitmq-script-wrapper \
100                ${wrappersbin}/rabbitmq-server
101    reinplace -E "s:@MACPORTS_PREFIX@:${prefix}:g" \
102                ${wrappersbin}/rabbitmq-server
103    reinplace -E "s:/usr/lib/rabbitmq/bin/:${prefix}/lib/rabbitmq/bin/:g" \
104                ${wrappersbin}/rabbitmq-server
105    reinplace -E "s:/var/lib/rabbitmq:${prefix}/var/lib/rabbitmq:g" \
106                ${wrappersbin}/rabbitmq-server
107
108    copy ${wrappersbin}/rabbitmq-server ${wrappersbin}/rabbitmqctl
109    copy ${wrappersbin}/rabbitmq-server ${wrappersbin}/rabbitmq-plugins
110    file attributes ${destroot}${serverhome} -owner ${serveruser} -group ${servergroup}
111    file attributes ${destroot}${logdir} -owner ${serveruser} -group ${servergroup}
112
113    foreach script {rabbitmq-defaults rabbitmq-env rabbitmq-plugins rabbitmq-server rabbitmqctl} {
114        ln -s ../lib/${worksrcdir}/sbin/${script} ${sbindir}/${script}
115    }
116
117    xinstall -m 644 -W ${mansrc}/man1 rabbitmq-server.1.gz rabbitmqctl.1.gz rabbitmq-plugins.1.gz \
118        ${mandest}/man1/
119    xinstall -m 644 -W ${mansrc}/man5 rabbitmq-env.conf.5.gz ${mandest}/man5/
120}
121
122startupitem.create  yes
123startupitem.init    "PATH=${prefix}/bin:${prefix}/sbin:\$PATH; export PATH"
124startupitem.start   "rabbitmq-server 2>&1"
125startupitem.stop    "rabbitmqctl stop 2>&1"
126startupitem.logfile ${prefix}/var/log/rabbitmq/startupitem.log
127
128livecheck.type      regex
129livecheck.url       http://www.rabbitmq.com/releases/rabbitmq-server/current/
130livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)"
Note: See TracBrowser for help on using the repository browser.