# $Id: Portfile 63397 2010-02-04 00:37:32Z ecronin@macports.org $

PortSystem          1.0

name                hdhomerun
version             20100121
set firm_version    ${version}
categories          net multimedia
platforms           darwin

maintainers         ecronin
description         HDHomeRun Software and Firmware
long_description    ${description}
homepage            http://www.silicondust.com/wiki/products/hdhomerun

master_sites        http://download.silicondust.com/hdhomerun
distname            lib${name}_${version}
extract.suffix      .tgz
distfiles-append    ${name}_atsc_firmware_${firm_version}.bin
extract.only        ${distname}${extract.suffix}
worksrcdir          lib${name}
checksums           ${distname}${extract.suffix} \
                        md5     c6d991eb4d27db1c28fbf7adcc5d48a5 \
                        sha1    a9a18ee254b4d3218ef007c56791f846841073a9 \
                        rmd160  35d76630a0373145bf52cb3fd2482573382629f0 \
                    ${name}_atsc_firmware_${firm_version}.bin \
                        md5     f686c5923d9c0143eebab2dcd7d79da0 \
                        sha1    5e19855abfd4ea1a4e081161b83c4c08332d02fe \
                        rmd160  0d1c51aaaa0e356839b8bf3fffd5d54328095e45
livecheck.type      regex
livecheck.url       http://www.silicondust.com/wiki/downloads
livecheck.regex     libhdhomerun_(\[0-9\]+)\\.tgz

use_configure       no

build.target        hdhomerun_config

destroot {
    xinstall -m 0755 ${worksrcpath}/hdhomerun_config \
        ${destroot}${prefix}/bin/hdhomerun_config
    xinstall -d -m 0755 ${destroot}${prefix}/share/${name}/
    xinstall -m 0644 ${distpath}/${name}_atsc_firmware_${firm_version}.bin \
        ${destroot}${prefix}/share/${name}/${name}_atsc_firmware_${firm_version}.bin
    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}/
    xinstall -m 0644 ${worksrcpath}/README \
        ${destroot}${prefix}/share/doc/${name}/README
}

post-activate {
    ui_msg "to upgrade device firmware run:"
    ui_msg "     hdhomerun_config <id> upgrade ${prefix}/share/${name}/${name}_atsc_firmware_${firm_version}.bin"
}

