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

PortSystem          1.0

name                icmake
version             7.22.01
categories          devel
platforms           darwin
license             GPL-3
maintainers         larryv

description         The Icmake program maintenance utility
long_description    Icmake is a hybrid between a 'make' utility and \
                    a 'shell script' language. Originally, it was \
                    written to provide a useful tool for automatic \
                    program maintenance and system administrative \
                    tasks on old MS-DOS platforms. (Not to be confused \
                    with Kitware's CMake build system.)
homepage            http://icmake.sourceforge.net

installs_libs       no

master_sites        sourceforge:project/icmake/icmake/${version}/
distfiles           icmake_${version}.orig${extract.suffix}
checksums           rmd160  2b82bec2fdd3080d49b360a0b0d4f45a016be409 \
                    sha256  b522e7937e9d4f0bec738dfce371673e3c4a8bc9f4d209a51631e5ed59ba66c7

patchfiles          fix-BRE-substitutions.patch \
                    use-macports-locations.patch
post-patch {
    reinplace -W ${worksrcpath} s|__MACPORTS__|${prefix}|g \
            doc/icmake.1 \
            doc/icmbuild.1 \
            doc/icmconf.7 \
            doc/icmstart.1 \
            doc/icmstart.rc.7 \
            etc/icmake/icmake.rc \
            examples/am \
            examples/bup \
            examples/defines \
            examples/ds \
            examples/ftpxfer \
            examples/idir \
            examples/initialization \
            examples/killprog \
            examples/nesteddirectives \
            examples/r \
            examples/tolower
}

use_configure       no
variant universal {}

build.env           CC=${configure.cc} \
                    CFLAGS='${configure.cflags} [get_canonical_archflags cc]' \
                    LDFLAGS='${configure.ldflags} [get_canonical_archflags ld]'
build.cmd           ./icm_bootstrap
build.pre_args      ${prefix}

destroot.cmd        ./icm_install
destroot.target     all
destroot.destdir    ${destroot}