# -*- 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 53945 2009-07-16 23:47:48Z snc@macports.org $

PortSystem      1.0

name            spin
version         5.2.0
set version_no_dot [join [split ${version} .] ""]
distname        ${name}${version_no_dot}
categories      devel
platforms       darwin
maintainers     jann
description     The Spin model checker

long_description \
    SPIN is a general tool for verifying the correctness of \
    distributed software (software design) in a rigorous and \
    mostly automated fashion.

homepage        http://spinroot.com
master_sites    http://spinroot.com/spin/Src/
checksums       md5     0e23a034cc3e5adbf9e90919a0888ab0 \
                sha1    edac8e1d0aaa89bb17d5ce6a9ec6726708801bf1 \
                rmd160  9109f146d15f5b44d6e4b333c50b65e770af1c1c
depends_lib     port:tk port:tcl
patchfiles      patch-makefile.diff \
                patch-xspin.diff
worksrcdir      Spin/Src${version}
use_configure   no

set xspin_dir   Xspin5.2
set xspin_name  xspin520.tcl

pre-patch   {
    file rename ${worksrcpath}/../${xspin_dir}/${xspin_name} ${worksrcpath}/../${xspin_dir}/xspin
}

post-patch  {
    reinplace "s,@prefix@,${prefix},g" ${worksrcpath}/../${xspin_dir}/xspin
}

build.target    ""
build.args      CC="${configure.cc} -DNXT"

destroot    {
    xinstall -m 0444 ${worksrcpath}/../Man/${name}.1 \
        ${destroot}${prefix}/share/man/man1
    xinstall -m 0755 ${worksrcpath}/${name} \
        ${destroot}${prefix}/bin
    xinstall -m 0755 ${worksrcpath}/../${xspin_dir}/xspin \
        ${destroot}${prefix}/bin
}
