/[gentoo-x86]/sci-libs/gdal/gdal-1.3.2.ebuild
Gentoo

Contents of /sci-libs/gdal/gdal-1.3.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Wed Jun 17 04:45:59 2009 UTC (11 years ago) by nerdboy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +1 -1 lines
FILE REMOVED
Removed older versions (see bug #271137) and marked 1.5.2 stable for ppc
(Portage version: 2.2_rc33/cvs/Linux x86_64)

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-libs/gdal/gdal-1.3.2.ebuild,v 1.8 2008/10/18 19:08:36 nerdboy Exp $
4
5 inherit eutils libtool distutils toolchain-funcs
6
7 IUSE="jpeg png geos gif jpeg2k netcdf hdf hdf5 python ruby postgres \
8 odbc sqlite ogdi fits gml doc debug"
9
10 DESCRIPTION="GDAL is a translator library for raster geospatial data formats (includes OGR support)"
11 HOMEPAGE="http://www.remotesensing.org/gdal/index.html"
12 SRC_URI="http://dl.maptools.org/dl/gdal/${P}.tar.gz"
13
14 SLOT="0"
15 LICENSE="MIT"
16 KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
17 # need to get these arches updated on several libs first
18 #KEYWORDS="~alpha ~hppa"
19
20 RDEPEND=">=sys-libs/zlib-1.1.4
21 >=media-libs/tiff-3.7.0
22 sci-libs/libgeotiff
23 jpeg? ( media-libs/jpeg )
24 gif? ( media-libs/giflib )
25 png? ( media-libs/libpng )
26 python? ( dev-lang/python )
27 ruby? ( >=dev-lang/ruby-1.8.4.20060226 )
28 fits? ( sci-libs/cfitsio )
29 ogdi? ( sci-libs/ogdi )
30 gml? ( <dev-libs/xerces-c-2.8.0 )
31 hdf5? ( >=sci-libs/hdf5-1.6.4 )
32 postgres? ( virtual/postgresql-server )
33 || (
34 netcdf? ( sci-libs/netcdf )
35 hdf? ( sci-libs/hdf )
36 )
37 jpeg2k? ( media-libs/jasper )
38 odbc? ( dev-db/unixODBC )
39 geos? ( >=sci-libs/geos-2.2.1 )
40 sqlite? ( >=dev-db/sqlite-3 )"
41
42 DEPEND="${RDEPEND}
43 ruby? ( >=dev-lang/swig-1.3.28 )
44 doc? ( app-doc/doxygen )"
45
46 src_unpack() {
47 unpack ${A}
48 cd "${S}"
49 epatch "${FILESDIR}/${P}-destdir.patch" || die "epatch failed"
50 epatch "${FILESDIR}/${P}-ruby-install.patch" || die "epatch failed"
51 if [ $(gcc-major-version) -eq 4 ]; then
52 epatch "${FILESDIR}/${P}-gcc4-stl.patch" || die "epatch failed"
53 fi
54 elibtoolize --patch-only
55 if useq netcdf && useq hdf; then
56 einfo "Checking is HDF4 compiled with szip..."
57 if built_with_use sci-libs/hdf szip ; then
58 einfo "Found HDF4 compiled with szip. Nice."
59 else
60 ewarn "HDF4 (sci-libs/hdf) must be compiled with szip USE flag!"
61 einfo "Emerge HDF with szip USE flag and then emerge GDAL."
62 die "HDF4 not merged with szip use flag"
63 fi
64 fi
65 }
66
67 src_compile() {
68 distutils_python_version
69
70 pkg_conf="--enable-static=no --enable-shared=yes --with-pic \
71 --with-libgrass=no"
72
73 use_conf="$(use_with jpeg) $(use_with png) $(use_with ruby) \
74 $(use_with postgres pg) $(use_with fits cfitsio) \
75 $(use_with netcdf) $(use_with hdf hdf4) $(use_with geos) \
76 $(use_with sqlite) $(use_with jpeg2k jasper) $(use_with odbc) \
77 $(use_with gml xerces) $(use_with hdf5)"
78 # mysql support temporarily disabled $(use_with mysql)
79
80 # It can't find this
81 if useq ogdi ; then
82 use_conf="--with-ogdi=/usr/$(get_libdir) ${use_conf}"
83 fi
84
85 #if useq mysql ; then
86 # use_conf="--with-mysql=/usr/bin/mysql_config ${use_conf}"
87 #fi
88
89 if useq gif ; then
90 use_conf="--with-gif=internal ${use_conf}"
91 else
92 use_conf="--with-gif=no ${use_conf}"
93 fi
94
95 if useq debug ; then
96 export CFG=debug
97 fi
98
99 if useq python ; then
100 use_conf="--with-pymoddir=/usr/$(get_libdir)/python${PYVER}/site-packages \
101 ${use_conf}"
102 else
103 use_conf="--with-python=no ${use_conf}"
104 fi
105
106 # Fix doc path just in case
107 sed -i -e "s:@exec_prefix@/doc:/usr/share/doc/${PF}/html:g" \
108 GDALmake.opt.in || die "sed gdalmake.opt failed"
109
110 econf ${pkg_conf} ${use_conf} || die "econf failed"
111 # parallel makes fail on the ogr stuff (C++, what can I say?)
112 # also failing with gcc4 in libcsf
113 make || die "make failed"
114 if useq ruby ; then
115 cd "${S}"/swig
116 make build || die "make ruby failed"
117 cd "${S}"
118 fi
119 if useq doc ; then
120 make docs || die "make docs failed"
121 fi
122 }
123
124 src_install() {
125 # einstall causes sandbox violations on /usr/lib/libgdal.so
126 make DESTDIR="${D}" install || die "make install failed"
127 dodoc Doxyfile.man Doxyfile HOWTO-RELEASE NEWS
128 if useq doc ; then
129 dohtml html/* || die "install html failed"
130 docinto ogr
131 dohtml ogr/html/* || die "install ogr html failed"
132 fi
133 }
134
135 pkg_postinst() {
136 einfo "GDAL is most useful with full graphics support enabled via various"
137 einfo "USE flags: png, jpeg, gif, jpeg2k, etc. Also python, fits, ogdi,"
138 einfo "geos, and support for either netcdf or HDF4 is available, as well as"
139 einfo "grass, and mysql, sqlite, or postgres (grass support requires grass 6"
140 einfo "and the new gdal-grass ebuild). HDF5 support is now included."
141 ewarn
142 einfo "Note: tiff and geotiff are now hard depends, so no USE flags."
143 einfo "Also, this package will check for netcdf before hdf, so if you"
144 einfo "prefer hdf, please emerge hdf with USE=szip prior to emerging"
145 einfo "gdal. Detailed API docs require doxygen (man pages are free)."
146 einfo ""
147 einfo "Check available image and data formats after building with"
148 einfo "gdalinfo and ogrinfo (using the --formats switch)."
149 }

  ViewVC Help
Powered by ViewVC 1.1.20