# $Id: Portfile 57222 2009-09-07 20:35:03Z blb@macports.org $

PortSystem          1.0
name                calc
version             2.12.4.0
categories          math
maintainers         nomaintainer
description         Arbitrary precision calculator
long_description \
   Calc is an interactive calculator which provides for easy large numeric \
   calculations, but which also can be easily programmed for difficult or \
   long calculations. It can accept a command line argument, in which case \
   it executes that single command and exits. Otherwise, it enters \
   interactive mode. There are a great number of pre-defined functions. The \
   calculator can calculate transcendental functions, and accept and display \
   numbers in real or exponential format. The calculator also knows about \
   complex numbers.

platforms           darwin

homepage            http://www.isthe.com/chongo/tech/comp/calc/
master_sites        sourceforge
use_bzip2           yes

checksums           md5     2ef56695837c6e501ca80b64e0be0db6 \
                    sha1    d9984dbffb606416e6cc1d85465d5d78fac7fed2 \
                    rmd160  c27c033d82db56e9068d508533d10388e3d7b4fc

depends_lib         port:readline port:ncurses

patchfiles          patch-Makefile.diff
post-patch {
   reinplace "s|___PREFIX___|${prefix}|" ${worksrcpath}/Makefile
   reinplace "s|___DESTROOT___|${destroot}|" ${worksrcpath}/Makefile
   reinplace "s|___CC___|${configure.cc}|" ${worksrcpath}/Makefile
   reinplace "s|___MACOSX_DEPLOYMENT_TARGET___|${macosx_deployment_target}|" \
      ${worksrcpath}/Makefile
}

use_configure       no
use_parallel_build  no

test.run            yes
test.target         check

destroot.destdir

