# -*- 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

set realname        proj
name                ${realname}4
version             4.9.3
set datumgrid_version   1.5
categories          gis
license             MIT
platforms           darwin
distname            ${realname}-${version}

maintainers         nomaintainer

description         PROJ.4 - Cartographic Projections Library

long_description    PROJ.4 is a library for converting data between \
                    cartographic projections.

homepage            http://trac.osgeo.org/proj/
master_sites        http://download.osgeo.org/proj/

distfiles-append    ${realname}-datumgrid-${datumgrid_version}.zip

checksums           ${realname}-${version}.tar.gz \
                    rmd160  cffdce968c8929fd7f38a65e3d905a62858589a2 \
                    sha256  6984542fea333488de5c82eea58d699e4aff4b359200a9971537cd7e047185f7 \
                    ${realname}-datumgrid-${datumgrid_version}.zip \
                    rmd160  f5deacd0242557c92c35d43941cd52a7e4096467 \
                    sha256  723c4017d95d7a8abdf3bda4e18d3c15d79b00f9326d453da5fdf13f96c287db

extract.only        ${realname}-${version}.tar.gz

post-extract {
    system "unzip ${distpath}/${realname}-datumgrid-${datumgrid_version}.zip -d ${worksrcpath}/nad"
}

configure.pre_args  --prefix=${prefix}/lib/proj49
configure.args      --mandir=${prefix}/lib/proj49/share/man

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     "${realname}-(\\d\\.7+(?:\\.\\d+)*)${extract.suffix}"
