# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit python eutils DESCRIPTION="Translator library for raster (GDAL) and vector (OGR) geospatial data formats" HOMEPAGE="http://www.gdal.org/" SRC_URI="http://gdal.org/dl/${P}.tar.gz ftp://ftp.remotesensing.org/gdal/${P}.tar.gz" LICENSE="MIT" SLOT="0" KEYWORDS="~x86" IUSE="mysql postgres python cfitsio png tiff geotiff jpeg gif ogdi jasper odbc sqlite geos hdf4 netcdf" DEPEND="geos? ( sci-libs/geos ) mysql? ( dev-db/mysql ) postgres? ( dev-db/postgresql ) python? ( dev-lang/python ) cfitsio? ( sci-libs/cfitsio ) png? ( media-libs/libpng ) tiff? ( media-libs/tiff ) geotiff? ( sci-libs/libgeotiff ) jpeg? ( media-libs/jpeg ) gif? ( media-libs/giflib ) ogdi? ( sci-libs/ogdi ) jasper? ( media-libs/jasper ) odbc? ( dev-db/unixODBC ) sqlite? ( dev-db/sqlite ) hdf4? ( sci-libs/hdf ) netcdf? ( sci-libs/netcdf )" src_compile() { MYCONF=" --prefix=${D}/usr " # Python always wants to go directly to /usr/lib not sandbox if use python; then python_version MYCONF="${MYCONF} --with-pymoddir=${D}/usr/lib/python${PYVER}/site-packages " else MYCONF="${MYCONF} --without-python" fi if use cfitsio; then MYCONF="${MYCONF} --with-cfitsio=/usr/lib " else MYCONF="${MYCONF} --with-cfitsio=no " fi # Netcdf has symbol collisions with HDF4 -- can't use both if use netcdf; then MYCONF="${MYCONF} --with-netcdf=/usr --with-hdf4=no " else if use hdf4; then MYCONF="${MYCONF} --with-netcdf=no --with-hdf4=yes " else MYCONF="${MYCONF} --with-netcdf=no --with-hdf4=no " fi fi if use png; then MYCONF="${MYCONF} --with-png=/usr/lib " else MYCONF="${MYCONF} --with-png=no " fi if use tiff; then MYCONF="${MYCONF} --with-libtiff=/usr/lib " else MYCONF="${MYCONF} --with-libtiff=internal " fi if use geotiff; then MYCONF="${MYCONF} --with-geotiff=/usr/lib " else MYCONF="${MYCONF} --with-geotiff=internal " fi if use jpeg; then MYCONF="${MYCONF} --with-jpeg=/usr/lib " else MYCONF="${MYCONF} --with-jpeg=no " fi if use gif; then MYCONF="${MYCONF} --with-gif=/usr/lib " else MYCONF="${MYCONF} --with-gif=no " fi if use ogdi; then MYCONF="${MYCONF} --with-ogdi=/usr " else MYCONF="${MYCONF} --with-ogdi=no " fi if use jasper; then MYCONF="${MYCONF} --with-jasper=/usr/lib " else MYCONF="${MYCONF} --with-jasper=no " fi if use postgres; then MYCONF="${MYCONF} --with-pg=/usr/bin/pg_config " else MYCONF="${MYCONF} --with-pg=no " fi if use mysql; then MYCONF="${MYCONF} --with-mysql=/usr/bin/mysql_config " else MYCONF="${MYCONF} --with-mysql=no " fi if use odbc; then MYCONF="${MYCONF} --with-odbc=/usr " else MYCONF="${MYCONF} --with-odbc=no " fi if use sqlite; then MYCONF="${MYCONF} --with-sqlite=/usr " else MYCONF="${MYCONF} --with-sqlite=no " fi if use geos; then MYCONF="${MYCONF} --with-geos=/usr/bin/geos-config " else MYCONF="${MYCONF} --with-geos=no " fi ./configure ${MYCONF} || die "Error: configure failed!" emake -j1 || die "Error: emake failed!" } src_install() { einstall || die "Error: einstall failed!" # TNX to "acrux" sed -i "s|${D}/usr|/usr|g" ${D}/usr/bin/gdal-config \ || die "Error: failed to clean-up gdal-config" dodoc ChangeLog NEWS VERSION }