# $Id: Portfile 62719 2010-01-14 21:44:12Z jmr@macports.org $

PortSystem 1.0

name			h4h5tools
version			2.0
categories		science
platforms		darwin
maintainers		dal.ca:tom.duck openmaintainer

description		HDF4 to HDF5 conversion tools.
long_description	Provides the h4toh5 conversion utility and \
			library.

homepage		http://hdf.ncsa.uiuc.edu/h4toh5/
master_sites		ftp://ftp.hdfgroup.org/HDF5/h4toh5/src/
distname		h4h5tools_20

checksums		md5 fda518fb9441fb04ca9f9b3ae0688260 \
			sha1 eb26d1c094d5d2ab9bef2b488cdbba709ebe6ca3 \
			rmd160 19a452244b3d4b6afa3f26ff0bd3b713b469e566

depends_lib-append	port:hdf5 \
			port:hdf4 \
			port:netcdf

configure.cc		${prefix}/bin/h4cc

# Setting H4_HAVE_NETCDF overcomes a bug in the distribution.  This has been
# communicated upstream, and hopefully will be fixed.
configure.cflags	-DH4_HAVE_NETCDF

post-destroot {
  xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
  xinstall -m 644 -W ${worksrcpath} README.txt COPYING Copyright.html \
    ${destroot}${prefix}/share/doc/${name}

  xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/doc/pdf
  xinstall -m 644 -W ${worksrcpath}/doc \
    H4H5ProgrammersNotes.pdf h4toh5lib_RM.pdf h4toh5lib_UG.pdf \
    ${destroot}${prefix}/share/doc/${name}/doc/pdf

  xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/doc/html
  xinstall -m 644 -W ${worksrcpath}/doc \
    h4toh5lib_RM.html h4toh5lib_UG.html \
    ${destroot}${prefix}/share/doc/${name}/doc/html
}

livecheck.type     regexm
livecheck.url      ${homepage}
livecheck.regex    {Latest Official Release of H4 / H5 Conversion Library:.?<[^>]*>([0-9]+\.[0-9])}
