[46213] trunk/dports/net

Ryan Schmidt ryandesign at macports.org
Sat Jan 31 19:25:06 PST 2009


On Jan 31, 2009, at 15:18, snc at macports.org wrote:

> Revision: 46213
>           http://trac.macports.org/changeset/46213
> Author:   snc at macports.org
> Date:     2009-01-31 13:18:44 -0800 (Sat, 31 Jan 2009)
> Log Message:
> -----------
> created net/murmur, #18289
>
> Added Paths:
> -----------
>     trunk/dports/net/murmur/
>     trunk/dports/net/murmur/Portfile
>
> Added: trunk/dports/net/murmur/Portfile
> ===================================================================
> --- trunk/dports/net/murmur/Portfile	                        (rev 0)
> +++ trunk/dports/net/murmur/Portfile	2009-01-31 21:18:44 UTC (rev  
> 46213)
> @@ -0,0 +1,121 @@
> +# -*- 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
> +# $Id$
> +
> +PortSystem          1.0
> +
> +name                murmur
> +version             1.1.7
> +categories          net audio
> +maintainers         nomaintainer
> +description         server for mumble - low latency voice chat for  
> gaming
> +long_description \
> +    Server component of Mumble - an open source, low-latency, high  
> quality \
> +    voice chat software primarily intended for use while gaming.
> +
> +homepage            http://mumble.sourceforge.net/
> +platforms           macosx
> +
> +master_sites        sourceforge:mumble
> +checksums           md5 5a382d5c065bb264abfe240ca6f03ddc
> +distname            mumble-${version}
> +
> +livecheck.check     regex
> +livecheck.url       ${homepage}
> +livecheck.regex     ">Latest version: (.*?)<"
> +
> +depends_lib \
> +    port:qt4-mac \
> +    port:openssl
> +
> +depends_build \
> +    port:boost
> +
> +configure.cmd       qmake-mac
> +configure.pre_args  CONFIG-=app_bundle CONFIG+=\"
> +configure.post_args \"
> +configure.args      release no-universal no-client no-ice
> +
> +variant universal {
> +    configure.args-delete no-universal
> +}
> +
> +variant ice description "Enable ice support" {
> +    configure.args-delete no-ice
> +    depends_lib-append port:ice-cpp
> +}
> +
> +startupitem.create  yes
> +startupitem.type    launchd
> +startupitem.name    Murmur
> +startupitem.start   "${prefix}/sbin/murmurd -ini ${prefix}/etc/ 
> murmur/murmur.ini"
> +startupitem.stop    "kill -TERM `cat ${prefix}/var/run/murmur/ 
> murmur.pid`"
> +startupitem.pidfile auto "${prefix}/var/run/murmur/murmur.pid"
> +
> +build {
> +    system "cd ${worksrcpath} && make"
> +}

Why override the standard build phase?

> +destroot {
> +    addgroup murmur
> +    adduser murmur gid=[existsgroup murmur] realname=Murmur\ -\  
> Mumble\ Voice\ Chat
> +
> +    set dp      ${destroot}/${prefix}

There should not be a slash before ${prefix} because ${prefix}  
already begins with a slash. (Several occurrences in the portfile.)

> +    set w       ${worksrcpath}
> +
> +    set logdir  ${dp}/var/log/murmur/
> +    set dbdir   ${dp}/var/lib/murmur/
> +    set piddir  ${dp}/var/run/murmur/
> +
> +    xinstall -m 740 -o murmur -g murmur -d \
> +        ${logdir} \
> +        ${dbdir} \
> +        ${piddir}
> +
> +    destroot.keepdirs-append \
> +        ${logdir} \
> +        ${dbdir} \
> +        ${piddir}
> +
> +    file mkdir ${dp}/etc/murmur/
> +    file mkdir ${dp}/sbin/
> +    file mkdir ${dp}/etc/dbus-1/system.d/
> +
> +    file copy ${w}/release/murmurd ${dp}/sbin/murmurd
> +
> +    set conf ${dp}/etc/murmur/murmur.ini
> +    file copy ${w}/scripts/murmur.ini.system ${conf}
> +    system "sed -i '' -e 's,database=.*,database=${prefix}/var/lib/ 
> murmur/murmur.sqlite,' ${conf}"
> +    system "sed -i '' -e 's,pidfile=.*,pidfile=${prefix}/var/run/ 
> murmur/murmur.pid,' ${conf}"
> +    system "sed -i '' -e 's,logfile=.*','logfile=${prefix}/var/log/ 
> murmur/murmur.log,' ${conf}"
> +
> +    if {![variant_isset ice]} {
> +        # This change is made only to avoid confusion. Murmur ignores
> +        # the ice= config option when built without Ice support.
> +        system "sed -i -e 's,ice=,\#ice=,' ${destroot}/${prefix}/ 
> etc/murmur/murmur.ini"
> +    }
> +
> +    set dbusservice ${dp}/etc/dbus-1/system.d/murmur.conf
> +    file copy ${w}/scripts/murmur.conf ${dbusservice}
> +    system "sed -i '' -e 's,user=.*\",user=\"murmur\",' $ 
> {dbusservice}"
> +}
> +
> +pre-install {
> +    set plist ${destroot}/${prefix}/etc/LaunchDaemons/ 
> org.macports.Murmur/org.macports.Murmur.plist
> +    system "sed -i '' -e 's,</dict>,<key>UserName</ 
> key><string>murmur</string></dict>,' ${plist}"
> +}

Could all of these system-sed calls be replaced with reinplace commands?

> +post-install {
> +    ui_msg ""
> +    ui_msg  
> "***************************************************************"
> +    ui_msg "* To set up a password for the SuperUser user on your  
> Murmur"
> +    ui_msg "* server, execute:"
> +    ui_msg "*"
> +    ui_msg "*   ${prefix}/sbin/murmurd -ini ${prefix}/etc/murmur/ 
> murmur.ini -supw \[password\]"
> +    ui_msg "*"
> +    ui_msg "* In case you want to interface with a different  
> database than"
> +    ui_msg "* sqlite, then take a look at the +psql and +mysql5  
> variants of"
> +    ui_msg "* qt4-mac."
> +    ui_msg "*"
> +    ui_msg  
> "***************************************************************"
> +    ui_msg ""
> +}




More information about the macports-dev mailing list