/[gentoo-x86]/sci-libs/cdf/cdf-3.3.1.ebuild
Gentoo

Contents of /sci-libs/cdf/cdf-3.3.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun Aug 7 04:55:41 2011 UTC (3 years ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Version bump

(Portage version: 2.1.10.10/cvs/Linux x86_64)

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-libs/cdf/cdf-3.3.0.ebuild,v 1.4 2009/08/09 13:46:18 nixnut Exp $
4
5 EAPI=4
6 inherit eutils toolchain-funcs multilib versionator java-pkg-opt-2
7
8 MY_DP="${PN}$(get_version_component_range 1)$(get_version_component_range 2)"
9 MY_P="${MY_DP}_$(get_version_component_range 3)"
10
11 DESCRIPTION="Common Data Format I/O library for multi-dimensional data sets"
12 HOMEPAGE="http://cdf.gsfc.nasa.gov/"
13 SRC_BASE="ftp://cdaweb.gsfc.nasa.gov/pub/${PN}/dist/${MY_P}/unix"
14
15 SRC_URI="${SRC_BASE}/${MY_P}-dist-${PN}.tar.gz
16 java? ( ${SRC_BASE}/${MY_P}-dist-java.tar.gz )
17 doc? ( ${SRC_BASE}/${MY_DP}_documentation/${MY_DP}crm.pdf
18 ${SRC_BASE}/${MY_DP}_documentation/${MY_DP}frm.pdf
19 ${SRC_BASE}/${MY_DP}_documentation/${MY_DP}ifd.pdf
20 ${SRC_BASE}/${MY_DP}_documentation/${MY_DP}prm.pdf
21 ${SRC_BASE}/${MY_DP}_documentation/${MY_DP}ug.pdf
22 java? ( ${SRC_BASE}/${MY_DP}_documentation/${MY_DP}jrm.pdf ) )"
23
24 LICENSE="CDF"
25 SLOT="0"
26 KEYWORDS="~amd64 ~ppc ~x86"
27 IUSE="doc examples java ncurses static-libs"
28
29 RDEPEND="ncurses? ( sys-libs/ncurses )
30 java? ( >=virtual/jre-1.5 )"
31 DEPEND="ncurses? ( sys-libs/ncurses )
32 java? ( >=virtual/jdk-1.5 )"
33
34 S="${WORKDIR}/${MY_P}-dist"
35
36 src_prepare() {
37 # respect cflags, remove useless scripts
38 epatch "${FILESDIR}"/${PN}-3.2-Makefile.patch
39 epatch "${FILESDIR}"/${PN}-3.2-soname.patch
40 # use proper lib dir
41 sed -i \
42 -e "s:\$(INSTALLDIR)/lib:\$(INSTALLDIR)/$(get_libdir):g" \
43 Makefile || die "sed failed"
44 }
45
46 src_compile() {
47 local myconf
48 if use ncurses; then
49 myconf="${myconf} CURSES=yes"
50 else
51 myconf="${myconf} CURSES=no"
52 fi
53 PV_SO=${PV:0:1}
54 emake \
55 OS=linux \
56 ENV=gnu \
57 SHARED=yes \
58 SHAREDEXT_linux=so.${PV_SO} \
59 ${myconf} \
60 all
61
62 if use java; then
63 export CDF_BASE="${S}"
64 export CDF_LIB="${S}/src/lib"
65 cd cdfjava/jni
66 $(tc-getCC) \
67 ${CFLAGS} -fPIC \
68 -I${CDF_BASE}/src/include \
69 -I$(java-config -O)/include \
70 -I$(java-config -O)/include/linux \
71 -c cdfNativeLibrary.c \
72 -o cdfNativeLibrary.o \
73 || die "compiling java lib failed"
74 $(tc-getCC) \
75 ${LDFLAGS} \
76 -L${CDF_LIB} -lcdf -lm \
77 -shared cdfNativeLibrary.o \
78 -Wl,-soname=libcdfNativeLibrary.so.${PV_SO} \
79 -o libcdfNativeLibrary.so.${PV_SO} \
80 || die "linking java lib failed"
81 fi
82 }
83
84 src_test() {
85 emake -j1 test
86 }
87
88 src_install() {
89 dodir /usr/bin
90 dodir /usr/$(get_libdir)
91 # -j1 (fragile non-autotooled make)
92 emake -j1 \
93 INSTALLDIR="${ED}/usr" \
94 SHAREDEXT=so.${PV_SO} \
95 install
96 dosym libcdf.so.${PV_SO} /usr/$(get_libdir)/libcdf.so
97 use static-libs && rm -f "${ED}"/usr/$(get_libdir)/libcdf.a
98 dodoc Release.notes CHANGES.txt Welcome.txt
99 doenvd "${FILESDIR}"/50cdf
100
101 if use doc; then
102 insinto /usr/share/doc/${PF}
103 doins "${DISTDIR}"/${MY_DP}*.pdf
104 use java || rm "${D}"/usr/share/doc/${PF}/${MY_P}jrm.pdf
105 fi
106
107 if use examples; then
108 insinto /usr/share/doc/${PF}/examples
109 doins samples/*
110 fi
111
112 if use java; then
113 cd cdfjava
114 dolib.so jni/libcdfNativeLibrary.so.${PV_SO}
115 dosym libcdfNativeLibrary.so.${PV_SO} \
116 /usr/$(get_libdir)/libcdfNativeLibrary.so
117 java-pkg_dojar */*.jar
118 if use examples; then
119 insinto /usr/share/doc/${PF}/examples/java
120 doins examples/*
121 fi
122 fi
123 }

  ViewVC Help
Powered by ViewVC 1.1.20