# $Id: Portfile,v 1.12 2006/08/04 05:43:27 markd Exp $

PortSystem 1.0
name		larn
version		4.6.2-RELEASE
revision	2
categories	games
maintainers	eric@opendarwin.org
description	Text-based cavern exploring game
long_description Larn is text-based fantasy role-playing game similar to Rogue, \
            Nethack, etc.
platforms	darwin
use_bzip2	yes
master_sites	opendarwin
checksums	md5 cea96f48caa057793f6bcaf3394ca388
build.type	bsd
build.args	LDADD+=-L${prefix}/lib\\ -lcompat\\ -lncurses
worksrcdir	${portname}
patchfiles	patch-diag.c \
            patch-display.c \
            patch-global.c \
            patch-help.c \
            patch-io.c \
            patch-main.c \
            patch-monster.c \
            patch-moreobj.c \
            patch-movem.c \
            patch-object.c \
            patch-scores.c \
            patch-store.c

depends_lib port:libcompat \
            port:ncurses

configure	{ reinplace "s|MAN|MAN6|" ${worksrcpath}/Makefile
		  reinplace "s|/usr/share|${prefix}/share|g" \
		    ${worksrcpath}/pathnames.h
		  reinplace "s|/var/games|${prefix}/var/games|g" \
		    ${worksrcpath}/pathnames.h }

destroot	{ cd ${worksrcpath}
          xinstall -m 755 -d ${destroot}${prefix}/share/games/larn
		  xinstall -m 755 -c larn ${destroot}${prefix}/bin
		  xinstall -m 644 -c larn.6.gz ${destroot}${prefix}/share/man/man6
		  xinstall -m 644 -c datfiles/larn.help ${destroot}${prefix}/share/games/larn
		  xinstall -m 644 -c datfiles/larnmaze ${destroot}${prefix}/share/games/larn
		  destroot.keepdirs ${destroot}${prefix}/var/games/larn }