# $Id: Portfile 81632 2011-08-03 06:20:54Z jmr@macports.org $
PortSystem			1.0

name				angband
version				3.0.6
revision                        1
categories			games
platforms			darwin
maintainers			nomaintainer
description			a rogue-like dungeon exploration game (curses-based)
long_description	Angband is a freeware computer dungeon exploration game \
based (loosely) on the books of J.R.R.Tolkien. You explore a very deep \
dungeon, kill monsters, try to equip yourself with the best weapons and \
armor you can find, and finally face Morgoth - The Dark Enemy.
                    
homepage			http://rephial.org/

master_sites        http://angband.oook.cz/download/:source \
                    http://angband.oook.cz/download/extra/:extras \
                    http://angband.oook.cz/download/extra/:mac

distfiles           ${name}-${version}.tar.gz:source
checksums			${name}-${version}.tar.gz md5 4c31b1b3679dff20db6a5fcb182c3e96
extract.only        ${name}-${version}.tar.gz

post-patch {   
	addgroup games
}

configure.args      --with-setgid=games --with-libpath=${prefix}/var/games/angband --bindir=${prefix}/bin --without-x

variant x11 {
                        distfiles-append ${name}-graf.zip:extras
                        checksums-append ${name}-graf.zip md5 488320ea35e3542d959543dd3c0dacec
                        
                        depends_lib-append lib:libXaw:xorg-libXaw
                        configure.args-delete --without-x
                        configure.args-append --with-x
                        
                        post-destroot { system "mkdir ${worksrcpath}/graf; \
                                        unzip ${distpath}/angband-graf.zip -d ${worksrcpath}/graf/"
                                        xinstall -m 755 -d ${destroot}${prefix}/var/games/angband/xtra/graf
                                        xinstall -m 644 -c ${worksrcpath}/graf/16x16.bmp ${destroot}${prefix}/var/games/angband/xtra/graf
                                        xinstall -m 644 -c ${worksrcpath}/graf/8X8.bmp ${destroot}${prefix}/var/games/angband/xtra/graf
                                        xinstall -m 644 -c ${worksrcpath}/graf/8x13.bmp ${destroot}${prefix}/var/games/angband/xtra/graf
                                        xinstall -m 644 -c ${worksrcpath}/graf/backgrnd.bmp ${destroot}${prefix}/var/games/angband/xtra/graf
                                        xinstall -m 644 -c ${worksrcpath}/graf/mask.bmp ${destroot}${prefix}/var/games/angband/xtra/graf }
}
                    
# variant aqua        {
#                          distfiles-append ext-mac-306.zip:mac ext-graf-mac-306.zip:mac ext-sound-mac-306.zip:mac
#                          checksums-append ext-mac-306.zip md5 e8989e1c4acf9efb10e0ab078e7303f2 \
#                                           ext-graf-mac-306.zip md5 263d33545a8be198a4a014c73f581035 \
#                                           ext-sound-mac-306.zip md5 7886ff8cd9ac98bdfec50c50131c406e
#                          
#                          post-extract {
#                                          system "unzip ${distpath}/ext-mac-306.zip -d ${worksrcpath}/src/; \
#                                                  unzip ${distpath}/ext-graf-mac-306.zip -d ${worksrcpath}/src/; \
#                                                  unzip ${distpath}/ext-sound-mac-306.zip -d ${worksrcpath}/src/" 
#                                       }
#                         
#                          configure { reinplace "s|# define SET_UID||" ${worksrcpath}/src/h-config.h }
#                                       
#                          build {
#                                     cd ${worksrcpath}/src
#                                     system "make -f Makefile.osx; \
#                                             make -f Makefile.osx install-tiles; \
#                                             make -f Makefile.osx install-sound"
#                                }
#                                
#                          destroot { xinstall -d ${destroot}/Applications/MacPorts/
#                          system "cp -r ${worksrcpath}/Angband.app ${destroot}/Applications/MacPorts/." }
#                     }                    
