Ticket #24042: mpd.diff

File mpd.diff, 1.2 KB (added by milosh@…, 15 years ago)
  • Portfile

    old new  
    5656platform darwin 10 {
    5757    patchfiles patch-src-output-osx_plugin.c
    5858}
     59
     60if {"darwin" == ${os.platform} && ${os.major} > 8} {
     61    set mpduser       _mpd
     62} else {
     63    set mpduser       mpd
     64}
     65
    5966startupitem.create  yes
    60 startupitem.start   "${prefix}/bin/mpd --no-daemon ${prefix}/etc/mpd.conf"
    61 startupitem.stop    "${prefix}/bin/mpd --kill"
     67startupitem.start   "su ${mpduser} -c \"${prefix}/bin/mpd --no-daemon ${prefix}/etc/mpd.conf\""
     68startupitem.stop    "su ${mpduser} -c \"${prefix}/bin/mpd --kill\""
    6269destroot.keepdirs   ${destroot}${prefix}/var/lib/mpd/music \
    6370    ${destroot}${prefix}/var/lib/mpd/playlists \
    6471    ${destroot}${prefix}/var/log/mpd
    6572post-destroot {
     73        # Create new user for mpd:
     74        addgroup ${mpduser}
     75        set gid [existsgroup ${mpduser}]
     76        adduser ${mpduser} gid=${gid} realname=Music\ Player\ Daemon
     77
    6678        # ensure ${prefix}/var/[lib/mpd/[music,playlists],log/mpd] exist
    67         xinstall -m 755 -d \
     79        xinstall -m 755 -o ${mpduser} -g ${mpduser} -d \
    6880        ${destroot}${prefix}/var/lib/mpd/music \
    6981        ${destroot}${prefix}/var/lib/mpd/playlists \
    7082        ${destroot}${prefix}/var/log/mpd