# $Id: Portfile 66287 2010-04-08 13:35:32Z jmr@macports.org $

PortSystem 1.0

name            liquidwar
version         5.6.4
categories      games
platforms       darwin
maintainers     raimue
description     \
        Liquid War is a unique multiplayer wargame. \
        You control an army of liquid and have to try and eat your opponents.
long_description \
        Liquid War is a unique multiplayer wargame. \
        You control an army of liquid and have to try and eat your opponents. \
        The rules of Liquid War are truely original and have been invented \
        by Thomas Colcombet. A single player mode is available, but the \
        game is definitely designed to be multiplayer, and has network support.

homepage        http://www.ufoot.org/liquidwar/
master_sites    http://www.ufoot.org/download/${name}/v5/${version} \
                http://download.savannah.nongnu.org/releases/liquidwar/
checksums       md5 6917dd1026e6685404ffbd086f8ba374

depends_build   port:gmake
depends_lib     port:allegro

patch {
    reinplace -E "s|^GAMEDIR =(.*)$|GAMEDIR = \$(exec_prefix)/bin|" ${worksrcpath}/Makefile.in
    reinplace -E "s|^GAMEDIR =(.*)$|GAMEDIR = \$(exec_prefix)/bin|" ${worksrcpath}/src/Makefile.in

    reinplace -E "s|^DATADIR =(.*)$|DATADIR = \$(datadir)/liquidwar|" ${worksrcpath}/Makefile.in
    reinplace -E "s|^DATADIR =(.*)$|DATADIR = \$(datadir)/liquidwar|" ${worksrcpath}/src/Makefile.in
}

if {$build_arch == "x86_64"} {
    # Allegro does not compile 64-bit due to NS* stuff, so we have to do i386
    configure.build_arch i386
} elseif {$build_arch == "ppc64"} {
    configure.build_arch ppc
}

configure.cflags-append     -DALLEGRO_UNIX
configure.args-append       --disable-target-opt --disable-asm
build.args                  CFLAGS="-DALLEGRO_UNIX -arch ${configure.build_arch}" LDFLAGS="-arch ${configure.build_arch}" \
                            DOC_TXT=no DOC_HTML=no DOC_MAN=yes DOC_INFO=no DOC_PS=no DOC_PDF=no
destroot.target             install_nolink

livecheck.type  regex
livecheck.url   http://www.ufoot.org/download/liquidwar/v5/
livecheck.regex {(5\.[0-9.]+)}
