# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 53849 2009-07-15 16:47:29Z snc@macports.org $

PortSystem      1.0

name            gplcver
version         2.12a
categories      science
maintainers		nomaintainer
description     Pragmatic C Software GPL Cver 2001

long_description \
     GPL Cver is a Verilog HDL simulator that is released under \
     the GNU General Public License. GPL Cver is a full \
     1995 P1364 Verilog standard HDL simulator. It also implements \
     some of the 2001 P1364 standard features including all three \
     PLI interfaces (tf_, acc_ and vpi_) as defined in the 2001 \
     Language Reference Manual (LRM).  Cver is a full featured \
     IEEE P1364 Verilog simulator.

homepage        http://sourceforge.net/projects/gplcver
platforms       darwin
master_sites    sourceforge
checksums       md5    857a15a9ebc8ef63ece01502509cbeb7 \
				sha1   946bb35b6279646c6e10c309922ed17deb2aca8a \
				rmd160 5af004b345142ac5400c9defc7125bbe127d2c49
use_bzip2       yes
distname        ${name}-${version}.src

use_configure   no

build.dir       "${worksrcpath}/src"
build.target     -f makefile.osx cver

patchfiles      patch-inst_tst.sh.diff

post-configure	{

    # eliminate unneeded flags

    reinplace "s|^ARCHFLGS= -mcpu=powerpc||g" ${worksrcpath}/src/makefile.osx
}

destroot {

    # install executable

    xinstall -m 755 -W ${worksrcpath} bin/cver ${destroot}${prefix}/bin

    # create directory for everything else
    
    set docdir "${destroot}${prefix}/share/doc/${name}"
    xinstall -m 755 -d ${docdir}

    # copy doc files

    file copy ${worksrcpath}/COPYING ${docdir}
    file copy ${worksrcpath}/Changelog ${docdir}
    file copy ${worksrcpath}/INSTALL ${docdir}
    file copy ${worksrcpath}/LICENSE ${docdir}
    file copy ${worksrcpath}/NEW.CVER.2001.RELEASE.NOTES ${docdir}
    file copy ${worksrcpath}/OUR_PHILOSOPHY ${docdir}
    file copy ${worksrcpath}/README ${docdir}
    file copy ${worksrcpath}/doc ${docdir}

    # install the systasks man page
    
    file copy ${worksrcpath}/doc/systasks.1 ${destroot}${prefix}/share/man/man1/
    file delete ${docdir}/systasks.1
    
    # create directory for everything else
    
    set instdir "${destroot}${prefix}/share/${name}"
    xinstall -m 755 -d ${instdir}

    # copy files

    file copy ${worksrcpath}/pli_incs ${instdir}
    file copy ${worksrcpath}/pli_src ${instdir}
    file copy ${worksrcpath}/tests_and_examples ${instdir}
    file copy ${worksrcpath}/ver_src ${instdir}
    
}

#  Run the installation tests

test.run    yes
test.cmd    "${worksrcpath}/tests_and_examples/install.tst/inst_tst.sh"
test.target
test.dir    "${worksrcpath}/tests_and_examples/install.tst"

