Portfile

# $Id: Portfile 19781 2006-09-30 04:23:55Z takanori@macports.org $
PortSystem 1.0
name jnethack
version 3.4.3-0.8
revision 5
categories games japanese
maintainers kyut@rutiler.net takanori@macports.org
description Classic dungeon adventure game, translated in Japanese.
long_description ${description}
homepage http://jnethack.sourceforge.jp/
platforms darwin

set nethacksrc "nethack-343-src.tgz"
set jnethackpatch "${name}-${version}.diff.gz"
set sfj "http://dl.sourceforge.jp/jnethack"

master_sites ${sfj}/9091/:nh \
${sfj}/19600/:jnh
distfiles ${nethacksrc}:nh \
${jnethackpatch}:jnh
checksums ${nethacksrc} sha1 c26537093c38152bc0fbcec20468d975b35f59fd \
${jnethackpatch} sha1 e25e9d354f546394a80a451bb262c6e3d55e8858
patchfiles patch-sys__unix__Makefile.doc \
patch-sys__unix__Makefile.top \
patch-sys__unix__nethack.sh \
patch-win__tty__termcap.c \
patch-src__options.c

depends_build port:bison \
port:flex
depends_run port:cocot

livecheck.check regex
livecheck.url ${homepage}
livecheck.regex

  • \\(\[0-9/\]+\\) (\[0-9.-\]+)

    extract.only ${nethacksrc}
    worksrcdir nethack-3.4.3

    ## extract ##

    post-extract {
    system "cd ${worksrcpath} && gunzip -dc ${distpath}/${jnethackpatch} | patch -p 1"
    }

    ## patch ##

    post-patch {
    reinplace "s|__PREFIX__|${prefix}|" \
    "${worksrcpath}/sys/unix/Makefile.doc" \
    "${worksrcpath}/sys/unix/Makefile.top" \
    "${worksrcpath}/sys/unix/nethack.sh"
    }

    ## configure ##

    configure.dir ${worksrcpath}/sys/unix
    configure.cmd /bin/sh
    configure.pre_args setup.sh

    ## destroot ##

    pre-destroot {
    addgroup games
    adduser games gid=[existsgroup games]

    file mkdir "${destroot}${prefix}/share/man/man6"
    file mkdir "${destroot}${prefix}/share/jnethackdir/save"
    }

    destroot.target install manpages
    destroot.keepdirs "${destroot}${prefix}/share/jnethackdir/save/"

    post-destroot {
    reinplace "s|${destroot}||" "${destroot}${prefix}/bin/jnethack"
    if {[variant_isset x11]} {
    file copy ${worksrcpath}/win/X11/JNetHack.ad ${destroot}${prefix}/share/jnethackdir/
    }
    }

    ## install ##

    pre-install {
    addgroup games
    adduser games gid=[existsgroup games]
    }

    ## variants ##

    variant x11 {
    patchfiles-append \
    x11/patch-include__config.h \
    x11/patch-sys__unix__Makefile.top \
    x11/patch-sys__unix__Makefile.src \
    x11/patch-win__X11__JNetHack.ad
    }

    files