Ticket #18289: Portfile-murmur

File Portfile-murmur, 3.9 KB (added by nerdling (Jeremy Lavergne), 16 years ago)

modified murmur portfile (addresses formatting and lint warnings)

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id$
3
4PortSystem          1.0
5
6name                murmur
7version             1.1.7
8categories          net audio
9maintainers         nomaintainer
10description         server for mumble - low latency voice chat for gaming
11long_description \
12    Server component of Mumble - an open source, low-latency, high quality \
13    voice chat software primarily intended for use while gaming.
14
15homepage            http://mumble.sourceforge.net/
16platforms           macosx
17
18master_sites        sourceforge:mumble
19checksums           md5 5a382d5c065bb264abfe240ca6f03ddc
20distname            mumble-${version}
21
22livecheck.check     regex
23livecheck.url       ${homepage}
24livecheck.regex     ">Latest version: (.*?)<"
25
26depends_lib \
27    port:qt4-mac \
28    port:openssl
29
30depends_build \
31    port:boost
32
33configure.cmd       qmake-mac
34configure.pre_args  CONFIG-=app_bundle CONFIG+=\"
35configure.post_args \"
36configure.args      release no-universal no-client no-ice
37
38variant universal {
39    configure.args-delete no-universal
40}
41
42variant ice description "Enable ice support" {
43    configure.args-delete no-ice
44    depends_lib-append port:ice-cpp
45}
46
47startupitem.create  yes
48startupitem.type    launchd
49startupitem.name    Murmur
50startupitem.start   "${prefix}/sbin/murmurd -ini ${prefix}/etc/murmur/murmur.ini"
51startupitem.stop    "kill -TERM `cat ${prefix}/var/run/murmur/murmur.pid`"
52startupitem.pidfile auto "${prefix}/var/run/murmur/murmur.pid"
53
54build {
55    system "cd ${worksrcpath} && make"
56}
57
58destroot {
59    addgroup murmur
60    adduser murmur gid=[existsgroup murmur] realname=Murmur\ -\ Mumble\ Voice\ Chat
61
62    set dp      ${destroot}/${prefix}
63    set w       ${worksrcpath}
64
65    set logdir  ${dp}/var/log/murmur/
66    set dbdir   ${dp}/var/lib/murmur/
67    set piddir  ${dp}/var/run/murmur/
68
69    xinstall -m 740 -o murmur -g murmur -d \
70        ${logdir} \
71        ${dbdir} \
72        ${piddir}
73
74    destroot.keepdirs-append \
75        ${logdir} \
76        ${dbdir} \
77        ${piddir}
78
79    file mkdir ${dp}/etc/murmur/
80    file mkdir ${dp}/sbin/
81    file mkdir ${dp}/etc/dbus-1/system.d/
82
83    file copy ${w}/release/murmurd ${dp}/sbin/murmurd
84
85    set conf ${dp}/etc/murmur/murmur.ini
86    file copy ${w}/scripts/murmur.ini.system ${conf}
87    system "sed -i '' -e 's,database=.*,database=${prefix}/var/lib/murmur/murmur.sqlite,' ${conf}"
88    system "sed -i '' -e 's,pidfile=.*,pidfile=${prefix}/var/run/murmur/murmur.pid,' ${conf}"
89    system "sed -i '' -e 's,logfile=.*','logfile=${prefix}/var/log/murmur/murmur.log,' ${conf}"
90
91    if {![variant_isset ice]} {
92        # This change is made only to avoid confusion. Murmur ignores
93        # the ice= config option when built without Ice support.
94        system "sed -i -e 's,ice=,\#ice=,' ${destroot}/${prefix}/etc/murmur/murmur.ini"
95    }
96
97    set dbusservice ${dp}/etc/dbus-1/system.d/murmur.conf
98    file copy ${w}/scripts/murmur.conf ${dbusservice}
99    system "sed -i '' -e 's,user=.*\",user=\"murmur\",' ${dbusservice}"
100}
101
102pre-install {
103    set plist ${destroot}/${prefix}/etc/LaunchDaemons/org.macports.Murmur/org.macports.Murmur.plist
104    system "sed -i '' -e 's,</dict>,<key>UserName</key><string>murmur</string></dict>,' ${plist}"
105}
106
107post-install {
108    ui_msg ""
109    ui_msg "***************************************************************"
110    ui_msg "* To set up a password for the SuperUser user on your Murmur"
111    ui_msg "* server, execute:"
112    ui_msg "*"
113    ui_msg "*   ${prefix}/sbin/murmurd -ini ${prefix}/etc/murmur/murmur.ini -supw \[password\]"
114    ui_msg "*"
115    ui_msg "* In case you want to interface with a different database than"
116    ui_msg "* sqlite, then take a look at the +psql and +mysql5 variants of"
117    ui_msg "* qt4-mac."
118    ui_msg "*"
119    ui_msg "***************************************************************"
120    ui_msg ""
121}