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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Mon Nov 12 02:47:14 2012 UTC (23 months, 1 week ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +3 -3 lines
Proper static libs removal

(Portage version: 2.2.01.21313-prefix/cvs/Linux x86_64, signed Manifest commit with key 0x13CB1360)

1 # Copyright 1999-2012 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.4.1.ebuild,v 1.1 2012/08/03 17:15:34 bicatali 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 ~amd64-linux ~x86-linux"
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.4-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 CC=$(tc-getCC) \
57 ENV=gnu \
58 SHARED=yes \
59 SHAREDEXT_linux=so.${PV_SO} \
60 ${myconf} \
61 all
62
63 if use java; then
64 export CDF_BASE="${S}"
65 export CDF_LIB="${S}/src/lib"
66 cd cdfjava/jni
67 $(tc-getCC) \
68 ${CFLAGS} -fPIC \
69 -I${CDF_BASE}/src/include \
70 -I$(java-config -O)/include \
71 -I$(java-config -O)/include/linux \
72 -c cdfNativeLibrary.c \
73 -o cdfNativeLibrary.o \
74 || die "compiling java lib failed"
75 $(tc-getCC) \
76 ${LDFLAGS} \
77 -shared cdfNativeLibrary.o \
78 -Wl,-soname=libcdfNativeLibrary.so.${PV_SO} \
79 -L${CDF_LIB} -lcdf -lm \
80 -o libcdfNativeLibrary.so.${PV_SO} \
81 || die "linking java lib failed"
82 fi
83 }
84
85 src_test() {
86 emake -j1 test
87 }
88
89 src_install() {
90 dodir /usr/bin
91 dodir /usr/$(get_libdir)
92 # -j1 (fragile non-autotooled make)
93 emake -j1 \
94 INSTALLDIR="${ED}/usr" \
95 SHAREDEXT=so.${PV_SO} \
96 install
97 dosym libcdf.so.${PV_SO} /usr/$(get_libdir)/libcdf.so
98 use static-libs || rm "${ED}"/usr/$(get_libdir)/libcdf.a
99 dodoc Release.notes CHANGES.txt Welcome.txt
100 doenvd "${FILESDIR}"/50cdf
101
102 if use doc; then
103 insinto /usr/share/doc/${PF}
104 doins "${DISTDIR}"/${MY_DP}*.pdf
105 use java || rm "${D}"/usr/share/doc/${PF}/${MY_P}jrm.pdf
106 fi
107
108 if use examples; then
109 insinto /usr/share/doc/${PF}/examples
110 doins samples/*
111 fi
112
113 if use java; then
114 cd cdfjava
115 dolib.so jni/libcdfNativeLibrary.so.${PV_SO}
116 dosym libcdfNativeLibrary.so.${PV_SO} \
117 /usr/$(get_libdir)/libcdfNativeLibrary.so
118 java-pkg_dojar */*.jar
119 if use examples; then
120 insinto /usr/share/doc/${PF}/examples/java
121 doins examples/*
122 fi
123 fi
124 }

  ViewVC Help
Powered by ViewVC 1.1.20