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

Last change on this file since 110930 was 110930, checked in by stromnov@…, 7 years ago

rabbitmq-server: update to version 3.1.5

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.8 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 110930 2013-09-10 10:44:07Z stromnov@macports.org $
3
4PortSystem          1.0
5
6name                rabbitmq-server
7version             3.1.5
8categories          net
9platforms           darwin
10license             MPL-1.1 MIT Apache-2
11supported_archs     noarch
12
13maintainers         paperplanes.de:meyer openmaintainer
14
15description         The RabbitMQ AMQP Server
16long_description    \
17    RabbitMQ is an implementation of AMQP, the emerging standard for \
18    high performance enterprise messaging. The RabbitMQ server is a \
19    robust and scalable implementation of an AMQP broker.
20
21homepage            http://www.rabbitmq.com/
22master_sites        http://www.rabbitmq.com/releases/rabbitmq-server/v${version}/
23
24distfiles           ${name}-${version}${extract.suffix} \
25                    ${name}-generic-unix-${version}${extract.suffix}
26
27checksums \
28        ${name}-${version}${extract.suffix} \
29                    rmd160  b486ce1289fb721b63d9401b3f9994adeba1c053 \
30                    sha256  c6952bdd0f0d9551fa4a068e65ad6506583a3e81babbb4e4747e0073366a6c35 \
31        ${name}-generic-unix-${version}${extract.suffix} \
32                    rmd160  84b4cab15893eedfa2fbce80e7dfdbcc9cb4e536 \
33                    sha256  bf76aa8bdb59a412187c66a7a0739f2b18b069fd3af3fc6e1f66b0518d73978f
34
35depends_lib         port:erlang
36depends_build       port:libxslt \
37                    port:git-core
38
39platform darwin 8 {
40    depends_build-append port:py26-simplejson
41    build.args      PYTHON=${prefix}/bin/python2.6
42}
43
44platform darwin 9 {
45    depends_build-append port:py26-simplejson
46    build.args      PYTHON=${prefix}/bin/python2.6
47}
48# no need for simplejson on Snow Leopard or higher
49
50
51set serveruser      rabbitmq
52set servergroup     rabbitmq
53set serverhome      ${prefix}/var/lib/rabbitmq
54set logdir          ${prefix}/var/log/rabbitmq
55set confdir         ${prefix}/etc/rabbitmq
56set mnesiadbdir     ${prefix}/var/lib/rabbitmq/mnesia
57set plistloc        ${prefix}/etc/LaunchDaemons/org.macports.rabbitmq-server
58set sbindir         ${destroot}${prefix}/lib/rabbitmq/bin
59set wrappersbin     ${destroot}${prefix}/sbin
60set realsbin        ${destroot}${prefix}/lib/rabbitmq/lib/rabbitmq_server-${version}/sbin
61set mansrc          ${workpath}/rabbitmq_server-${version}/share/man
62set mandest         ${destroot}${prefix}/share/man
63
64use_configure       no
65
66use_parallel_build  no
67
68build.env-append    HOME=${workpath}
69
70build.env-append    VERSION=${version}
71
72destroot.env-append VERSION=${version}
73
74destroot.target     install_bin
75
76destroot.destdir \
77    TARGET_DIR=${destroot}${prefix}/lib/rabbitmq/lib/rabbitmq_server-${version} \
78    SBIN_DIR=${sbindir} \
79    MAN_DIR=${destroot}${prefix}/share/man
80
81destroot.keepdirs \
82    ${destroot}${confdir} \
83    ${destroot}${logdir} \
84    ${destroot}${mnesiadbdir}
85
86pre-destroot {
87    addgroup    ${servergroup}
88    add_users   ${serveruser} gid=[existsgroup ${servergroup}] realname=RabbitMQ\ Server home=${serverhome}
89}
90
91post-destroot {
92    xinstall -d -m 775 ${destroot}${confdir}
93    xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}${logdir}
94    xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}${serverhome}
95    xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}${mnesiadbdir}
96
97    reinplace -E "s:^SYS_PREFIX=\${RABBITMQ_HOME}$:SYS_PREFIX=${prefix}:" \
98        ${realsbin}/rabbitmq-defaults
99    reinplace -E "s:^SYS_PREFIX=$:SYS_PREFIX=${prefix}:" \
100        ${realsbin}/rabbitmq-defaults
101
102    xinstall -m 555 ${filespath}/rabbitmq-script-wrapper \
103                ${wrappersbin}/rabbitmq-server
104    reinplace -E "s:@MACPORTS_PREFIX@:${prefix}:g" \
105                ${wrappersbin}/rabbitmq-server
106    reinplace -E "s:/usr/lib/rabbitmq/bin/:${prefix}/lib/rabbitmq/bin/:g" \
107                ${wrappersbin}/rabbitmq-server
108    reinplace -E "s:/var/lib/rabbitmq:${prefix}/var/lib/rabbitmq:g" \
109                ${wrappersbin}/rabbitmq-server
110
111    file copy ${wrappersbin}/rabbitmq-server ${wrappersbin}/rabbitmqctl
112    file copy ${wrappersbin}/rabbitmq-server ${wrappersbin}/rabbitmq-plugins
113
114    xinstall -m 644 -W ${mansrc}/man1 rabbitmq-server.1.gz rabbitmqctl.1.gz rabbitmq-plugins.1.gz \
115        ${mandest}/man1/
116    xinstall -m 644 -W ${mansrc}/man5 rabbitmq-env.conf.5.gz ${mandest}/man5/
117}
118
119pre-install {
120    system "cd ${destroot}${plistloc}; patch <${filespath}/patch-org.macports.rabbitmq-server.plist.diff"
121}
122
123startupitem.create  yes
124startupitem.init    "PATH=${prefix}/bin:${prefix}/sbin:\$PATH; export PATH"
125startupitem.start   "rabbitmq-server 2>&1"
126startupitem.stop    "rabbitmqctl stop 2>&1"
127startupitem.logfile ${prefix}/var/log/rabbitmq/startupitem.log
128
129livecheck.type      regex
130livecheck.url       http://www.rabbitmq.com/releases/rabbitmq-server/current/
131livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.