# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 68241 2010-05-29 20:29:22Z phw@macports.org $

PortSystem 1.0

name			rocksndiamonds
version			3.3.0.0
categories		games
platforms		darwin
maintainers		phw
description		Arcade style game Boulderdash or Emerald Mine clone
long_description	Arcade style game Boulderdash (C64) or Emerald Mine \
				(Amiga) clone. Included are many levels known from the \
				games Boulderdash, Emerald Mine, Sokoban, Supaplex and \
				DX-Boulderdash, level elements for Diamond Caves II \
				style games and a lot of new levels designed by others.

homepage		http://www.artsoft.org/rocksndiamonds/
master_sites	http://www.artsoft.org/RELEASES/unix/${name}
checksums           md5     191b7a63de9706b0aee52cdf983b3267 \
                    sha1    87adc52a2ee648d0199612641d55a1c5fa0d82fe \
                    rmd160  20735fd0edb871663ba615592d94f1663480844b


patchfiles		patch-Makefile.diff

depends_lib		path:lib/pkgconfig/sdl.pc:libsdl \
				port:libsdl_image \
				port:libsdl_mixer \
				port:libsdl_net

configure	{
	reinplace "s|_PREFIX_|${prefix}|g" ${worksrcpath}/Makefile
}

build.target	sdl
build.args		CC=${configure.cc}

destroot	{
	xinstall -s -m 755 ${worksrcpath}/rocksndiamonds ${destroot}${prefix}/bin
	file mkdir ${destroot}${prefix}/share/games/rocksndiamonds
	file copy ${worksrcpath}/graphics ${worksrcpath}/levels \
		${worksrcpath}/music ${worksrcpath}/sounds \
		${destroot}${prefix}/share/games/rocksndiamonds
}

platform macosx {
	post-destroot	{
		file mkdir ${destroot}${applications_dir}/RocksnDiamonds.app/Contents/MacOS
		ln -s ${prefix}/bin/rocksndiamonds \
			${destroot}${applications_dir}/RocksnDiamonds.app/Contents/MacOS/RocksnDiamonds
	}
}

livecheck.type  regex
livecheck.url   ${homepage}/download.html
livecheck.regex           "Rocks'n'Diamonds (\\d+(?:\\.\\d+)*)"
