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

PortSystem          1.0
PortGroup           perl5 1.0
PortGroup           github 1.0

github.setup        jpoliv wakeonlan 0.42 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            0
categories          net
platforms           any
license             Artistic-1
supported_archs     noarch
maintainers         {i0ntempest @i0ntempest} openmaintainer

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.

checksums           rmd160  20d10c1f9ce92ae1ddbbf35a7ca70804265d8c5a \
                    sha256  5a37bad8d4dd1f3dd0ba81aa2b6a75528a81ce9ab2bf7a2a03686b8d1377d28b \
                    size    8994

perl5.branches      5.28 5.32 5.34
perl5.default_branch \
                    5.34
perl5.create_variants \
                    ${perl5.branches}

depends_lib         port:perl${perl5.major}

installs_libs       no

patch {
    reinplace -locale C "s|/usr/bin/perl -w|${perl5.bin} -w|g" ${worksrcpath}/wakeonlan
}

configure {
    system -W ${worksrcpath} "${perl5.bin} 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.md \
        examples/lab001.wol ${destroot}${prefix}/share/doc/${name}
}
