# -*- 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
license Restrictive/Distributable
description Moria is a Rogue-like dungeon exploration game
long_description Moria is a Rogue-like dungeon exploration game similar to Angband.
homepage http://www-math.bgsu.edu/~grabine/moria.html
master_sites http://www.nic.funet.fi/pub/unix/games/${name}/source/
checksums rmd160 1556c76f151d7ea29da79071a57398f63d0b138b \
sha256 fffab65703c77058a1aadd8647cc1f44bd4349065af0b334702986f36007b2ed
patchfiles patch-files.c.diff \
patch-source_config.h.diff \
build.dir ${worksrcpath}/source
depends_lib-append port:ncurses
variant singleuser description {Disables system-wide scoreboards and allows local user installation without root privileges} {}
if {![variant_isset singleuser]} {
xinstall -m 644 -W ${worksrcpath}/unix Makefile unix.c ${build.dir}
reinplace "s|^CC = cc|CC = ${configure.cc}|" ${build.dir}/Makefile
reinplace "s|CFLAGS = -O|CFLAGS = -O -I${prefix}/include -I${prefix}/include/ncurses|" ${build.dir}/Makefile
reinplace "s|LFLAGS =|LFLAGS = -L${prefix}/lib|" ${build.dir}/Makefile
reinplace "s|CURSES = -lcurses -ltermcap|CURSES = -lncurses|" ${build.dir}/Makefile
reinplace "s|/home/math/grabiner/moria/files|${prefix}/var/games/moria|" \
${worksrcpath}/source/config.h
if {![variant_isset singleuser]} {
xinstall -m 775 -g games -d ${destroot}${prefix}/var/games/moria
xinstall -m 2755 -g games -c ${worksrcpath}/source/moria ${destroot}${prefix}/bin
xinstall -m 775 -d ${destroot}${prefix}/var/games/moria
xinstall -m 755 -c ${worksrcpath}/source/moria ${destroot}${prefix}/bin