# $Id: Portfile 65306 2010-03-25 01:31:15Z ryandesign@macports.org $

PortSystem              1.0

name                    qtplay
version                 1.3.1
categories              audio
platforms               macosx
maintainers             nomaintainer

description \
    a command line utility to play Audio CDs and music files

long_description \
    ${name} is ${description}. \
    Plays any audio file supported by QuickTime \
    Special flag for simply playing CDs, for lazy people. \
    Playlist features such as loop, shuffle, and random. \
    Special flag for reading playlist via standard input. \
    Support for process signals: SIGINT, SIGTSTP, and SIGCONT.

homepage                http://rainbowflight.googlepages.com/
master_sites            ${homepage}
distname                ${name}${version}
checksums               md5 f6cb47521afbfc5b40efdd2d8433830d
use_parallel_build      no

extract.mkdir           yes
post-extract {
    file delete ${worksrcpath}/${name}
}

use_configure           no

configure.ldflags       -framework Carbon -framework QuickTime

# Force 32-bit (#21115)
if {${build_arch} == "x86_64"} {
    configure.build_arch i386
} elseif {${build_arch} == "ppc64"} {
    configure.build_arch ppc
}

# Respect build_arch
if {![variant_isset universal]} {
    configure.ldflags-append ${configure.cc_archflags}
}

build {
    set cmd "cd ${worksrcpath} && ${configure.cc} -o ${name} [join ${configure.ldflags}] ${name}.c"
    ui_debug ${cmd}
    system ${cmd}
}

destroot {
    xinstall -m 755 -W ${worksrcpath} ${name} \
        ${destroot}${prefix}/bin
    xinstall -m 644 -W ${worksrcpath} ${name}.1 \
        ${destroot}${prefix}/share/man/man1
}

livecheck.type          regex
livecheck.regex         ${name}(\[0-9.\]+)\\.tar
