# $Id: Portfile,v 1.3 2006/07/24 17:54:34 jberry Exp $

PortSystem 1.0

name					xtide
version					2.8.3
revision				1

categories				x11 science
platforms				darwin
maintainers				darwinports@opendarwin.org jberry@darwinports.org

description				Tide prediction software, with a large database of locations.
long_description		XTide is a package that provides tide and current predictions \
						in a wide variety of formats.  Graphs, text listings, and calendars \
						can be generated, or a tide clock can be provided on your desktop. \
						For x11, plain command line, and as an http server.

homepage				http://www.flaterco.com/xtide
master_sites			ftp://www.flaterco.com/xtide
use_bzip2				yes

set harmonics_version	20060708
set harmonics_file		harmonics-dwf-${harmonics_version}.tcd.bz2

distfiles				${distname}${extract.suffix} \
						${harmonics_file}
checksums				${distname}${extract.suffix} md5 653fd807116290ab96bd5aa1bb974315 \
						${harmonics_file} md5 7e8acfeb5aa454c1c19fc14bb7263513
patchfiles				patch-Makefile.in
extract.only			${distname}${extract.suffix}

depends_lib				port:libpng
configure.args			--mandir=${prefix}/share/man

post-patch {
	# Make the default harmonics path conveniently point to our file
	reinplace s|harmonics.tcd|${prefix}/share/${name}/harmonics.tcd| ${worksrcpath}/TideContext.cc
}

post-destroot {
	xinstall -d -m 755 ${destroot}${prefix}/share/xtide
	xinstall -m 644 ${distpath}/${harmonics_file} ${destroot}${prefix}/share/${name}/harmonics.tcd.bz2
	system "bzip2 -d ${destroot}${prefix}/share/${name}/harmonics.tcd.bz2"
}