# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0

name                pianod
version             343
revision            0
checksums           rmd160  37688ee5051dde49c94f65b94616e3a2bd092569 \
                    sha256  188d1f27f7ccba209ae48125ce48912afc0031b31e671243b4f91eae655c6cf6 \
                    size    826654

categories          audio
platforms           darwin
license             MIT
maintainers         {deviousfish.com:perette @perette}
description         Music playing daemon with Pandora support
long_description    Client/server Pandora & local music daemon controllable \
                    via telnet or WebSocket.  Includes web client and \
                    a shell script for command-line control. \
                    Supports multiple listeners with adjustable privileges, \
                    automatic station selection, script to run \
                    programmed station sequences.

homepage            http://deviousfish.com/Pianod
master_sites        http://deviousfish.com/Downloads/pianod2
distname            pianod2-${version}

depends_build       port:pkgconfig

depends_lib         port:curl \
                    port:taglib \
                    port:zlib

compiler.cxx_standard   2014
configure.objcxxflags-append \
                        -std=c++14
configure.args          ac_cv_prog_AWK=/usr/bin/awk \
                        --with-tls=osx \
                        --without-accesscontrol \
                        --without-compression \
                        --without-libsdl

if {${os.platform} eq "darwin" && ${os.major} >= 11} {
    configure.args-append \
                        --with-engine=osx \
                        --without-libao
} else {
    depends_lib-append  path:lib/libavcodec.dylib:ffmpeg \
                        port:libao

    configure.args-append \
                        --with-engine=ffmpeg
}

startupitem.create      yes
startupitem.logfile     ${prefix}/var/log/pianod.log
startupitem.executable  "${prefix}/bin/pianod"

livecheck.type      regex
livecheck.url       [lindex ${master_sites} 0]
livecheck.regex     ${name}2-(\[0-9\]+)${extract.suffix}
