--- /opt/local/var/db/dports/sources/rsync.rsync.darwinports.org_dpupdate_dports/games/angband-nox/Portfile	2006-08-30 01:19:41.000000000 -0400
+++ Portfile	2006-09-10 02:09:18.000000000 -0400
@@ -1,8 +1,9 @@
-# $Id: Portfile,v 1.1 2006/01/23 21:34:56 olegb Exp $
+# $Id: $
 PortSystem			1.0
 
-name				angband-nox
+name				angband
 version				3.0.6
+revision            0
 categories			games
 maintainers			amonre@amonre.org
 description			a rogue-like dungeon exploration game (curses-based)
@@ -10,19 +11,71 @@
 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://www.thangorodrim.net/
 
-distname			angband-${version}
-master_sites		ftp://ftp.thangorodrim.net/pub/angband/Source/
-checksums			md5 4c31b1b3679dff20db6a5fcb182c3e96
-configure.args		--with-setgid=games --with-libpath=${prefix}/lib/angband --bindir=${prefix}/games
+master_sites		ftp://ftp.thangorodrim.net/pub/angband/Source/:source \
+                    ftp://ftp.thangorodrim.net/pub/angband/Extra/:extras \
+                    ftp://ftp.thangorodrim.net/pub/angband/Macintosh/:mac
+
+distfiles           ${name}-${version}.tar.gz:source
+checksums			${name}-${version}.tar.gz md5 4c31b1b3679dff20db6a5fcb182c3e96
+extract.only        ${name}-${version}.tar.gz
+
+configure.args      --with-setgid=games --with-libpath=${prefix}/var/games/angband --bindir=${prefix}/bin --without-x
 
-pre-destroot {
+default_variants    +nox
+
+variant nox conflicts x11 {
+                        
+                        pre-configure {   
 	addgroup games
-	adduser games gid=[existsgroup games]
+                                      }
 }
 
-pre-install {
+variant x11 conflicts nox {
+                        distfiles-append ${name}-graf.zip:extras
+                        checksums-append ${name}-graf.zip md5 488320ea35e3542d959543dd3c0dacec
+                        
+                        depends_lib-append lib:libX11:XFree86
+                        configure.args-delete --without-x
+                        configure.args-append --with-x
+                        
+                        pre-configure {   
 	addgroup games
-	adduser games gid=[existsgroup games]
 }
+
+                        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/DarwinPorts/
+#                          system "cp -r ${worksrcpath}/Angband.app ${destroot}/Applications/DarwinPorts/." }
+#                     }                    
