# -*- 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 103666 2013-03-04 13:47:45Z ryandesign@macports.org $

PortSystem          1.0

name                pdf2json
conflicts           poppler xpdf xpdf-tools
version             0.61
categories          textproc pdf
platforms           darwin
maintainers         devaldi.com:pdf2json
license             GPL-2

description         PDF to JSON conversion utility

long_description    PDF2JSON is a conversion library based on XPDF (3.02) \
                    which can be used for high performance PDF page by page \
                    conversion to JSON and XML format.

homepage            http://code.google.com/p/pdf2json/
master_sites        googlecode

checksums           rmd160  44b9d9fb61113193a58db25aaa71d040067761f7 \
                    sha256  36faf337361768f3108ef4e8d9eacb16b5c6ac84623299b3c8d74d5166f21bd7

extract.mkdir       yes

post-extract {
    # DOS to UNIX line endings so we can patch
    reinplace "s|\r||g" ${worksrcpath}/Makefile.in
}

patchfiles          patch-Makefiles.diff

post-patch {
    reinplace "s|/usr/local|${prefix}|g" \
        ${worksrcpath}/doc/sample-xpdfrc \
        ${worksrcpath}/xpdf/GlobalParams.cc
}
