Ticket #52428: rabbitmq-server.patch

File rabbitmq-server.patch, 6.1 KB (added by seanfarley (Sean Farley), 8 years ago)

update rabbitmq to newest version; should fix compiling errors

  • dports/net/rabbitmq-server/Portfile

    diff --git a/dports/net/rabbitmq-server/Portfile b/dports/net/rabbitmq-server/Portfile
    a b  
    22# $Id$
    33
    44PortSystem          1.0
    55
    66name                rabbitmq-server
    7 version             3.5.7
     7version             3.6.5
    88categories          net
    99platforms           darwin
    1010maintainers         gmail.com:hayder.net
    1111license             MPL-1.1 MIT Apache-2
    1212supported_archs     noarch
    long_description \ 
    1818    robust and scalable implementation of an AMQP broker.
    1919
    2020homepage            http://www.rabbitmq.com/
    2121master_sites        http://www.rabbitmq.com/releases/rabbitmq-server/v${version}/
    2222
    23 distfiles           ${name}-${version}${extract.suffix} \
    24                     ${name}-generic-unix-${version}${extract.suffix}
     23use_xz              yes
    2524
    26 checksums \
    27         ${name}-${version}${extract.suffix} \
    28                     rmd160  4b89e8ed8d5af2333b93d2ad8276f4f6cf29a40c \
    29                     sha256  380c9cab8f24add440a0aead3b70a0830e0f32a531139828003ae18e08b72028 \
    30         ${name}-generic-unix-${version}${extract.suffix} \
    31                     rmd160  8b4af6925bd4ce97acff82bef9b5304ddad27529 \
    32                     sha256  821b6349554a89ef038c56c7b1e0ceb8553645597142b8c3d564b3a8fa371b8b
     25distfiles           ${name}-generic-unix-${version}${extract.suffix}
     26worksrcdir          [string map {- _} $name]-$version
    3327
     28checksums           rmd160  6133c55ae339c5e0b86895830ec42524530521f1 \
     29                    sha256  232d558addf74cb371fc65ca10a7b3a2b6b31951b39baa1610488135d0f8ebf1
    3430
    3531depends_lib         port:erlang
    36 depends_build       port:libxslt \
    37                     port:git
    38 # no code from git is incorporated, so its license doesn't prevent distribution
    39 set license_noconflict git
     32depends_build       port:libxslt
    4033
    4134platform darwin 8 {
    4235    depends_build-append port:py26-simplejson
    4336    build.args      PYTHON=${prefix}/bin/python2.6
    4437}
    4538
    4639platform darwin 9 {
    4740    depends_build-append port:py26-simplejson
    4841    build.args      PYTHON=${prefix}/bin/python2.6
    4942}
     43
    5044# no need for simplejson on Snow Leopard or higher
    51 
    5245if {${os.major} > 9 && ${os.platform} eq "darwin"} {
    5346    # python3.X doesn't work
    5447    build.args      PYTHON=python2.7
    5548}
    5649
    set servergroup rabbitmq 
    5952set serverhome      ${prefix}/var/lib/rabbitmq
    6053set logdir          ${prefix}/var/log/rabbitmq
    6154set confdir         ${prefix}/etc/rabbitmq
    6255set mnesiadbdir     ${prefix}/var/lib/rabbitmq/mnesia
    6356set plistloc        ${prefix}/etc/LaunchDaemons/org.macports.rabbitmq-server
    64 set sbindir         ${destroot}${prefix}/lib/rabbitmq/bin
     57set rootdest        ${prefix}/lib/rabbitmq
     58set rootserver      ${rootdest}/lib/${worksrcdir}
     59set sbindir         ${destroot}${rootdest}/bin
    6560set wrappersbin     ${destroot}${prefix}/sbin
    66 set realsbin        ${destroot}${prefix}/lib/rabbitmq/lib/rabbitmq_server-${version}/sbin
    67 set mansrc          ${workpath}/rabbitmq_server-${version}/share/man
     61set realsbin        ${destroot}${rootserver}/sbin
     62set mansrc          ${workpath}/${worksrcdir}/share/man
    6863set mandest         ${destroot}${prefix}/share/man
    6964
     65add_users ${serveruser} group=${servergroup} realname=RabbitMQ\ Server home=${serverhome}
     66
    7067use_configure       no
    7168
    72 use_parallel_build  no
    73 
    74 build.env-append    HOME=${workpath}
    75 
    76 build.env-append    VERSION=${version}
    77 
    78 destroot.env-append VERSION=${version}
    79 
    80 destroot.target     install_bin
    81 
    82 destroot.destdir \
    83     TARGET_DIR=${destroot}${prefix}/lib/rabbitmq/lib/rabbitmq_server-${version} \
    84     SBIN_DIR=${sbindir} \
    85     MAN_DIR=${destroot}${prefix}/share/man
     69build {}
    8670
    8771destroot.keepdirs \
    8872    ${destroot}${confdir} \
    8973    ${destroot}${logdir} \
    9074    ${destroot}${mnesiadbdir}
    9175
    92 add_users ${serveruser} group=${servergroup} realname=RabbitMQ\ Server home=${serverhome}
    93 
    94 post-destroot {
     76destroot {
    9577    # This is a hack: We need to patch the startupitem, so generate it manually
    9678    # here, then define the function to empty to avoid overwriting it later
    9779    package require portstartupitem 1.0
    9880    portstartupitem::startupitem_create
    9981    proc portstartupitem::startupitem_create {args} {}
    10082    system -W "${destroot}${plistloc}" "patch <${filespath}/patch-org.macports.rabbitmq-server.plist.diff"
    10183
    102 
    10384    xinstall -d -m 775 ${destroot}${confdir}
    10485    xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}${logdir}
    10586    xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}${serverhome}
    10687    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}/
    10793
    10894    reinplace -E "s:^SYS_PREFIX=\${RABBITMQ_HOME}$:SYS_PREFIX=${prefix}:" \
    10995        ${realsbin}/rabbitmq-defaults
    11096    reinplace -E "s:^SYS_PREFIX=$:SYS_PREFIX=${prefix}:" \
    11197        ${realsbin}/rabbitmq-defaults
    post-destroot { 
    117103    reinplace -E "s:/usr/lib/rabbitmq/bin/:${prefix}/lib/rabbitmq/bin/:g" \
    118104                ${wrappersbin}/rabbitmq-server
    119105    reinplace -E "s:/var/lib/rabbitmq:${prefix}/var/lib/rabbitmq:g" \
    120106                ${wrappersbin}/rabbitmq-server
    121107
    122     file copy ${wrappersbin}/rabbitmq-server ${wrappersbin}/rabbitmqctl
    123     file copy ${wrappersbin}/rabbitmq-server ${wrappersbin}/rabbitmq-plugins
     108    copy ${wrappersbin}/rabbitmq-server ${wrappersbin}/rabbitmqctl
     109    copy ${wrappersbin}/rabbitmq-server ${wrappersbin}/rabbitmq-plugins
    124110    file attributes ${destroot}${serverhome} -owner ${serveruser} -group ${servergroup}
    125111    file attributes ${destroot}${logdir} -owner ${serveruser} -group ${servergroup}
    126112
     113    foreach script {rabbitmq-defaults rabbitmq-env rabbitmq-plugins rabbitmq-server rabbitmqctl} {
     114        ln -s ../lib/${worksrcdir}/sbin/${script} ${sbindir}/${script}
     115    }
     116
    127117    xinstall -m 644 -W ${mansrc}/man1 rabbitmq-server.1.gz rabbitmqctl.1.gz rabbitmq-plugins.1.gz \
    128118        ${mandest}/man1/
    129119    xinstall -m 644 -W ${mansrc}/man5 rabbitmq-env.conf.5.gz ${mandest}/man5/
    130120}
    131121