summaryrefslogtreecommitdiff
blob: df21252a94bf20ef0017b911d92fcb96dd6fa8ce (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-sci/gmt/gmt-3.4.3.ebuild,v 1.3 2003/11/04 10:32:07 phosphan Exp $

DESCRIPTION="Powerfull map generator"
HOMEPAGE="http://gmt.soest.hawaii.edu/"
SRC_URI="ftp://gmt.soest.hawaii.edu/pub/gmt/GMT${PV}_progs.tar.bz2
	ftp://gmt.soest.hawaii.edu/pub/gmt/GMT_share.tar.bz2
	ftp://gmt.soest.hawaii.edu/pub/gmt/GMT${PV}_tut.tar.bz2
	ftp://gmt.soest.hawaii.edu/pub/gmt/GMT${PV}_scripts.tar.bz2
	ftp://gmt.soest.hawaii.edu/pub/gmt/GMT${PV}_man.tar.bz2
	gmtsuppl? ( ftp://gmt.soest.hawaii.edu/pub/gmt/GMT${PV}_suppl.tar.bz2)
	gmtfull? ( ftp://gmt.soest.hawaii.edu/pub/gmt/GMT_full.tar.bz2 )
	gmthigh? ( ftp://gmt.soest.hawaii.edu/pub/gmt/GMT_high.tar.bz2 )
	gmttria? ( ftp://gmt.soest.hawaii.edu/pub/gmt/triangle.tar.bz2 )"
	#gmtpdf? ( ftp://gmt.soest.hawaii.edu/pub/gmt/GMT${PV}_pdf.tar.bz2 )

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86"
IUSE="gmtsuppl gmtfull gmthigh gmttria"

#Need to include gcc and bzip??
DEPEND=">=app-sci/netcdf-3.5.0"
#RDEPEND=""

S="${WORKDIR}/GMT${PV}"

pkg_setup() {
	einfo "The default instalation is the cleanest one. To include more "
	einfo "resources take a look at ebuild file."
}

src_unpack() {

	unpack ${A} || die

	mv -f ${WORKDIR}/share/*  ${S}/share/ || die
	if [ `use gmttria` ] ; then
		mv -f ${WORKDIR}/src/*  ${S}/src/ || die
	fi
}

src_compile() {
	#In make process will include /lib and /include to NETCDFHOME
	export NETCDFHOME="/usr"

	local myconf=
	use gmttria && myconf="${myconf} --enable-triangle"
	econf \
		--libdir=/usr/lib/gmt-${PV}\
		--includedir=/usr/include/gmt-${PV}\
		 ${myconf} \
		|| die "configure failed"

	local mymake=
	use gmtsuppl && mymake="${mymake} suppl"
	make gmt ${mymake} || die "make ${mymake} failed"
}

src_install() {
	local mymake=
	use gmtsuppl && mymake="${mymake} install-suppl"
	use doc && mymake="${mymake} install-www"

	einstall \
		includedir=${D}/usr/include/gmt-${PV} \
		libdir=${D}/usr/lib/gmt-${PV}\
		install \
		install-data \
		install-man \
		${mymake} \
		|| die "install failed"

	#now some docs
	dodoc CHANGES COPYING README
	cp -r ${S}/{examples,tutorial} ${D}/usr/share/doc/${PF}/
}

pkg_postinst() {
	einfo "The default instalation is the cleanest one"
	einfo "To include more resources use the syntax:"
	einfo "env USE=\"\${USE} gmt_flags\" emerge gmt"
	einfo "Possible GMT flags are:"
	#einfo "gmtman -> man documents;"
	#einfo "gmtpdf -> PDF documents;"#Not right setted yet
	einfo "gmthigh -> High resolution bathimetry data base;"
	einfo "gmtfull -> Full resolution bathimetry data base;"
	einfo "gmttria -> Non GNU triangulate method, but more efficient;"
	einfo "gmtsuppl -> Supplement functions for GMT;"
	einfo "Others GMT flags will be included soon."
}