summaryrefslogtreecommitdiff
blob: 8a9800835f289de747fc068b925ff9e8af7795ef (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
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-sci/cdf/cdf-2.7.ebuild,v 1.5 2004/06/24 21:54:34 agriffis Exp $

MY_P="${P/-}"
MY_P="${MY_P/.}"

DESCRIPTION="CDF library and toolkit for storing, manipulating, and accessing multi-dimensional data sets"
HOMEPAGE="http://nssdc.gsfc.nasa.gov/cdf/cdf_home.html"
SRC_URI="ftp://nssdcftp.gsfc.nasa.gov/standards/cdf/dist/${MY_P}/unix/${MY_P}-dist-cdf.tar.gz
	java? ( ftp://nssdcftp.gsfc.nasa.gov/standards/cdf/dist/${MY_P}/unix/${MY_P}-dist-java.tar.gz )"
LICENSE="CDF"
SLOT="0"
KEYWORDS="x86 ~ppc"
IUSE="ncurses java"

RDEPEND="ncurses? ( sys-libs/ncurses )"
DEPEND="${RDEPEND}
		java? ( virtual/jdk
				dev-java/java-config )"

S=${WORKDIR}/${MY_P}-dist

src_compile() {
	local myconf
	if use ncurses; then
		myconf="CURSES=yes"
	else
		myconf="CURSES=no"
	fi
	emake OS=linux ENV=gnu ${myconf} all || die "make failed"
	make test || die "test failed"
	if use java; then
		export CDF_BASE="${S}"
		export CDF_LIB="${S}/src/lib"
		cd cdfjava/jni
		cc -c cdfNativeLibrary.c -I${CDF_BASE}/src/include \
			-I$(java-config -O)/include -I$(java-config -O)/include/linux \
			-o cdfNativeLibrary.o || die "cc failed"
		ld -shared cdfNativeLibrary.o -L${CDF_LIB} -lcdf \
			-o ../lib/libcdfNativeLibrary.so -lc -lm || die "ld failed"
	fi
}

src_install() {
	make INSTALLDIR="${D}/usr" install || die "install failed"
	if use java; then
		cd ${S}/cdfjava
		dolib lib/libcdfNativeLibrary.so
		insinto /usr/share/cdf
		doins */*.jar
	fi
}