# -*- 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
# $Id: Portfile 114015 2013-11-27 12:29:51Z ryandesign@macports.org $

PortSystem          1.0

name                pngcheck
version             2.3.0
categories          graphics
license             MIT GPL-2
platforms           darwin
maintainers         vt.edu:jpo openmaintainer
description         validate and inspect PNG, JNG and MNG files
long_description    pngcheck verifies the integrity of PNG, JNG and MNG files \
                    (by checking the internal 32-bit CRCs [checksums] and \
                    decompressing the image data)\; it can optionally dump \
                    almost all of the chunk-level information in the image in \
                    human-readable form. For example, it can be used to print \
                    the basic statistics about an image (dimensions, bit \
                    depth, etc.)\; to list the color and transparency info in \
                    its palette (assuming it has one)\; or to extract the \
                    embedded text annotations. This is a command-line program \
                    with batch capabilities.
homepage            http://www.libpng.org/pub/png/apps/pngcheck.html
master_sites        sourceforge:project/png-mng/pngcheck/${version}

checksums           rmd160  6a132516eeaf787eefa4d02eaecb06834fe9d2be \
                    sha256  77f0a039ac64df55fbd06af6f872fdbad4f639d009bbb5cd5cbe4db25690f35f

depends_lib         port:zlib

variant universal   {}

use_configure       no

build.pre_args-append   -f Makefile.unx
build.args-append       CC="${configure.cc} [get_canonical_archflags cc]" \
                        LD="${configure.cc} [get_canonical_archflags ld]" \
                        ZLIB="${configure.ldflags} -lz" \
                        ZINC="${configure.cppflags}"

destroot {
    xinstall -m 755 -W ${worksrcpath} pngcheck pngsplit png-fix-IDAT-windowsize ${destroot}${prefix}/bin

    set docdir ${prefix}/share/doc/${subport}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 ${worksrcpath}/README ${destroot}${docdir}
}

livecheck.regex     ${name}-(\\d+(?:\\.\\d+)*)
