# $Id: Portfile 50984 2009-05-14 21:08:43Z and.damore@macports.org $

PortSystem  1.0

name		webdec
version		0.46.2
revision    1
categories	archivers
maintainers	verizon.net:izmir
description	Extract webshots pictures
homepage	http://www.jamesbarford.net/webdec.php
platforms	darwin

long_description \
		WebDec is a command line tool that extracts the JPEG images \
		files from webshots .wbz,wbp and wbc files.

master_sites	http://www.jamesbarford.net/downloads/

checksums   md5 14341604153c4605ecf81162b09c67fa \
            sha1 6f0d90f09627f023f71ddd30ca67edf3e62f673e \
            rmd160 e49877e5e9598326b319f882a877af691156f03f

configure {
    reinplace -E "/^CFLAGS/s|\$| [join ${configure.cflags} " "]|" ${worksrcpath}/Makefile
    reinplace -E "/^LDFLAGS/s|\$| [join ${configure.ldflags} " "]|" ${worksrcpath}/Makefile
}

destroot {
    xinstall ${worksrcpath}/webdec ${destroot}${prefix}/bin

    set docdir ${prefix}/share/doc/${name}-${version}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} GPL README ${destroot}${docdir}
}

variant debug {
    post-configure {
        reinplace -E "/^CFLAGS/s|\$| -DDEBUG|" ${worksrcpath}/Makefile
    }
}

