# -*- 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               subtitleripper
version            0.3-4
categories         multimedia
platforms          darwin
maintainers        shortround.net:stephen
description        DVD subtitle ripper
long_description   If you want to convert DVD subtitles into text format \
                   (e.g. subrip format) or VobSub format this program could be useful for you.

homepage           http://subtitleripper.sourceforge.net
extract.suffix     .tgz
master_sites       sourceforge:subtitleripper
worksrcdir         ${name}
checksums          md5 c0bd49a88f667c68c4430ad25bbed510 \
                   sha1 d93ff3578dd5f722c8f4ef16bc0903eec5781a0d \
                   rmd160 141355960773ab2dfe3782522858273d197cf797

depends_lib        port:netpbm \
                   port:transcode

use_configure      no

pre-build {
  # Add paths to MacPorts
  reinplace "s|LIBS    := -lm|LIBS    := -L${destroot}${prefix} -lm|g" ${worksrcpath}/Makefile
  reinplace "s|INCLUDES :=|INCLUDES := -I${destroot}${prefix}|g" ${worksrcpath}/Makefile
}

destroot {
  xinstall -m 755 -d ${destroot}${prefix}/bin
  xinstall -m 755 ${worksrcpath}/subtitle2pgm ${destroot}${prefix}/bin
  xinstall -m 755 ${worksrcpath}/srttool ${destroot}${prefix}/bin
  xinstall -m 755 ${worksrcpath}/subtitle2vobsub ${destroot}${prefix}/bin
  xinstall -m 755 ${worksrcpath}/vobsub2pgm ${destroot}${prefix}/bin
}

