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