# -*- 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 84986 2011-10-06 19:50:59Z jmr@macports.org $

PortSystem          1.0

name                wcalc
version             1.1
categories          science electronics
maintainers         and.damore  openmaintainer
platforms           darwin
license             GPL-2
description         analyze and synthesize transmission line structures and related components
long_description \
                    Wcalc is a tool for the analysis and synthesis of transmission line structures \
                    and related components. Wcalc provides the ability to analyze the electrical \
                    parameters of a particular structure based on the physical dimensions and \
                    material parameters. The synthesis portion calculates the required physical \
                    parameters to meet desired electrical specifications. Wcalc includes several \
                    models and places an emphasis on accuracy. Wcalc is part of gEDA project, a \
                    full GPL'd suite of Electronic Design Automation tools.  
homepage            http://wcalc.sourceforge.net/
master_sites        sourceforge:${name}

checksums           md5     62d41eac2979c1a745e4e4c7045d97c4 \
                    sha1    f6a96ef3abad9c87b491bc7fb0379b022809d182 \
                    rmd160  d59b8b3dd8a850cc33bef601a61b6aafb6116384

depends_build       port:pkgconfig
depends_lib         port:gtk2 \
                    port:gawk

use_parallel_build  no

patchfiles          patch-utils_shtml2html.diff
post-patch {
    #patch the usage of 'include' variable in awk script, not working with gawk 4.0+
    reinplace "s|shtml2html include=|shtml2html env_include=|" ${worksrcpath}/htdocs/Makefile.in 
}

configure.args-append \
                    --enable-gtk2 \
                    --enable-htdocs \
                    --enable-stdio \
                    --enable-sourceforge \
                    --enable-cgi \
                    --without-matlab \
                    --without-octave \
                    --without-scilab \

post-destroot {
    xinstall -d -m 755 ${destroot}${prefix}/share/doc
    file rename ${destroot}${prefix}/share/${distname} \
                ${destroot}${prefix}/share/doc/${name}
    eval move  [glob ${destroot}${prefix}/share/${name}/*] \
                ${destroot}${prefix}/share/doc/${name}
}

livecheck.type  regex
livecheck.url   http://sourceforge.net/projects/${name}/files/
livecheck.regex "${name}-(\\d+)${extract.suffix}"
