# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sci-geosciences/gmt/gmt-4.1.1.ebuild,v 1.1 2006/04/10 00:28:49 cryos Exp $ inherit multilib GSHHS="GSHHS1.9" DESCRIPTION="Powerful map generator" HOMEPAGE="http://gmt.soest.hawaii.edu/" SRC_URI="mirror://gmt/GMT${PV}_src.tar.bz2 mirror://gmt/${GSHHS}_coast.tar.bz2 mirror://gmt/GMT${PV}_share.tar.bz2 mirror://gmt/GMT${PV}_tut.tar.bz2 mirror://gmt/GMT${PV}_scripts.tar.bz2 doc? ( mirror://gmt/GMT${PV}_pdf.tar.bz2 ) doc? ( mirror://gmt/GMT${PV}_web.tar.bz2 ) gmtsuppl? ( mirror://gmt/GMT${PV}_suppl.tar.bz2 ) gmtfull? ( mirror://gmt/${GSHHS}_full.tar.bz2 ) gmthigh? ( mirror://gmt/${GSHHS}_high.tar.bz2 )" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="gmtsuppl gmtfull gmthigh gmttria doc" RDEPEND=">=sci-libs/netcdf-3.5.0" DEPEND="${RDEPEND} gmtsuppl? ( >=sys-devel/autoconf-2.58 )" S="${WORKDIR}/GMT${PV}" src_unpack() { use gmtfull && einfo "Please be patient, this will take some time to unpack..." unpack ${A} || die "Unpacking failed." mv -f ${WORKDIR}/share/* ${S}/share/ || die "Moving sources failed." } src_compile() { if use gmtsuppl; then # the configure in 3.4.4 is faulty when using gmtsuppl WANT_AUTOCONF=2.5 autoconf || die "Autoconf failed." fi # Don't prestrip libs sed -i 's/OPTS="-s "/OPTS=" "/' configure || die "Error disabling stripping" # In make process will include /lib and /include to NETCDFHOME export NETCDFHOME="/usr" local myconf= use gmttria && myconf="${myconf} --enable-triangle" econf \ --libdir=/usr/$(get_libdir)/${P} \ --includedir=/usr/include/${P} \ --datadir=/usr/share/${P} \ ${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" mkdir -p www/gmt/doc/html use doc && mymake="${mymake} install-www" einstall \ includedir=${D}/usr/include/${P} \ libdir=${D}/usr/$(get_libdir)/${P} \ datadir=${D}/usr/share/${P} \ install \ install-data \ install-man \ ${mymake} \ || die "Make install failed." #now some docs dodoc CHANGES README cp -r ${S}/{examples,tutorial} ${D}/usr/share/doc/${PF}/ use doc && dodoc ${WORKDIR}/*pdf* # Move the HTML and PDF docs to the docs directory. Old location breaks FHS # compliance, and is not used by web servers generally. if use doc; then mv ${D}/usr/www/gmt/doc/pdf/*.pdf ${D}/usr/share/doc/${PF}/ mv ${D}/usr/www/gmt/doc/html ${D}/usr/share/doc/${PF}/ rm -rf ${D}/usr/www fi cd ${D}/usr/share/${P} ln -s . share } pkg_postinst() { einfo "The default installation is the cleanest one" einfo "To include more resources use the syntax:" einfo "USE=\"gmt_flags\" emerge gmt" einfo "Possible GMT flags are:" einfo "gmthigh -> High resolution bathimetry database;" einfo "gmtfull -> Full resolution bathimetry database;" einfo "gmtsuppl -> Supplementary functions for GMT;" }