# $Id: Portfile 84409 2011-09-26 07:03:33Z mww@macports.org $

PortSystem 1.0

name                wakeonlan
version             0.41
categories          net
maintainers         mww
platforms           darwin freebsd
license             Artistic
supported_archs     noarch
description         wakeonlan sends magic packets for network-devices to wake up
long_description    Wakeonlan is a Perl script that sends 'magic packets' \
                    to wake-on-LAN enabled ethernet adapters and \
                    motherboards, in order to switch on remote computers. 

homepage            http://gsd.di.uminho.pt/jpo/software/wakeonlan/
master_sites        ${homepage}downloads/
checksums           md5 d3143c5fe92d16196ac853b55dd421b5 \
                    rmd160  ddbc2af097bb46bd8afd2c37007c5ed5291ee0e7 \
                    sha256  581b1b27a7e810ab72668cce4bd9aa9b3e0cea34b2db24dd1a44c09d63ddda98

depends_lib         path:bin/perl:perl5

patch {
    reinplace "s|/usr/bin/perl -w|${prefix}/bin/perl -w|g" ${worksrcpath}/wakeonlan
}

configure {
    system -W ${worksrcpath} "perl Makefile.PL"
}

destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 ${worksrcpath}/blib/man1/wakeonlan.1pm \
        ${destroot}${prefix}/share/man/man1/
    xinstall -m 755 ${worksrcpath}/blib/script/wakeonlan \
        ${destroot}${prefix}/bin/
    xinstall -m 644 -W ${worksrcpath} Changes MANIFEST README \
        examples/lab001.wol ${destroot}${prefix}/share/doc/${name}
}

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.regex     wakeonlan-(\[0-9\\.\]+)\\.tar.gz
