# -*- 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
PortGroup           perl5 1.0

name                dvdrip
perl5.branches      5.34
perl5.setup         ${name} 0.98.11
revision            8
categories          multimedia
maintainers         nomaintainer
license             {Artistic-1 GPL}

description         perl front end for transcode
long_description    dvd::rip is a full featured DVD copy program written in \
                    Perl. It provides an easy to use but feature-rich Gtk+ GUI \
                    to control almost all aspects of the ripping and transcoding \
                    process. It uses the widely known video processing \
                    swissknife transcode and many other Open Source tools.
homepage            https://www.exit1.org/dvdrip/
master_sites        https://www.exit1.org/dvdrip/dist/

checksums           rmd160  008afcecd1eaf6842e907d325b079cc60f4a6b1e \
                    sha256  586c20968b2daa55c0afaaf334d5b9b8b6896d6ea45078a577e165806858c3a5 \
                    size    2075302

depends_lib-append  port:ImageMagick \
                    port:transcode \
                    port:p${perl5.major}-anyevent \
                    port:p${perl5.major}-event \
                    port:p${perl5.major}-event-execflow \
                    port:p${perl5.major}-event-rpc \
                    port:p${perl5.major}-gtk2 \
                    port:p${perl5.major}-gtk2-ex-formfactory \
                    port:p${perl5.major}-libintl-perl

patchfiles          implicit.patch

# transcode is not universal
universal_variant   no

# skip installation of bundled dependencies that can conflict with the equivalent ports
configure.env-append SKIP_UNPACK_REQUIRED_MODULES=1

# mv: dvdrip-splitpipe: No such file or directory
use_parallel_build  no

build.args          CC="${configure.cc} [get_canonical_archflags cc]"

# make unversioned links to binaries
perl5.link_binaries_suffix

post-destroot {
    fs-traverse f ${destroot}${prefix} {
        if {[file isfile ${f}]} {
            switch [file tail ${f}] {
                .packlist -
                perllocal.pod {
                    delete ${f}
                }
            }
        }
    }

    ln -s ${prefix}/libexec/perl${perl5.major}/execflow ${destroot}${prefix}/bin/execflow

    set docdir ${prefix}/share/doc/${subport}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} \
        COPYRIGHT \
        Changes \
        Changes.0.46 \
        Credits \
        README \
        TODO \
        ${destroot}${docdir}
}

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