summaryrefslogtreecommitdiff
blob: dc3c09bf524c6742a6610ea17a076ae3db3e4be6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/hdf/hdf-4.2.0-r3.ebuild,v 1.2 2004/06/02 11:36:40 phosphan Exp $

# substitute second dot by "r"
MY_PV=${PV/./X}
TMP_PV=${MY_PV/./r}
MY_PV=${TMP_PV/X/.}

S="${WORKDIR}/${PN}${MY_PV}"

DESCRIPTION="HDF4 is a general purpose library and file format for storing scientific data."
SRC_URI="ftp://ftp.ncsa.uiuc.edu/HDF/pub/outgoing/hdf4/hdf${MY_PV}/hdf${MY_PV}.tar.gz"
HOMEPAGE="http://hdf.ncsa.uiuc.edu/hdf4.html"

LICENSE="NCSA-HDF"
KEYWORDS="~x86 ~amd64"
SLOT="0"
IUSE="szip"

DEPEND="sys-libs/zlib
		media-libs/jpeg
		app-sci/netcdf
		>=sys-apps/sed-4
		szip? ( dev-libs/szip )"

pkg_setup() {
	if ! which &>/dev/null g77; then
		die "g77 not found, please re-emerge gcc with f77 in your USE flags."
	fi
}

src_compile() {
	local myconf="--enable-production"
	use szip && myconf="${myconf} --with-szlib=/usr"
	econf ${myconf} || die "configure failed"
	make LDFLAGS="-lm" || die "make failed"
}

src_install() {
	make DESTDIR="${D}" install || die "make install failed"
	dodoc README release_notes/*.txt
	cd ${D}
	einfo Renaming included versions of ncdump and ncgen to hdfdump and hdfgen, respectively
	mv -v usr/bin/ncgen usr/bin/hdfgen
	mv -v usr/bin/ncdump usr/bin/hdfdump
	mv -v usr/share/man/man1/ncgen.1 usr/share/man/man1/hdfgen.1
	mv -v usr/share/man/man1/ncdump.1 usr/share/man/man1/hdfdump.1
	if has_version app-sci/netcdf; then
		einfo app-sci/netcdf is already installed - not installing netcdf related header files
		rm -v usr/include/netcdf.inc
		rm -v usr/include/netcdf.h
	fi
}