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

Contents of /sci-libs/gdal/gdal-1.6.0-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Fri Jul 30 12:27:51 2010 UTC (9 years, 11 months ago) by scarabeus
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
Version bump. Drop older. Grass support to be done.
(Portage version: 2.2_rc67/cvs/Linux x86_64)

1 # Copyright 1999-2010 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.6.0-r1.ebuild,v 1.6 2010/06/17 21:06:34 patrick Exp $
4
5 WANT_AUTOCONF="2.5"
6 RUBY_OPTIONAL="yes"
7 USE_RUBY="ruby18"
8
9 inherit autotools distutils eutils perl-module ruby toolchain-funcs
10
11 DESCRIPTION="GDAL is a translator library for raster geospatial data formats (includes OGR support)"
12 HOMEPAGE="http://www.gdal.org/"
13 SRC_URI="http://download.osgeo.org/gdal/${P}.tar.gz"
14
15 SLOT="0"
16 LICENSE="MIT"
17 KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
18 # need to get these arches updated on several libs first
19 #KEYWORDS="~alpha ~hppa"
20
21 IUSE="curl debug doc ecwj2k fits geos gif gml hdf hdf5 jpeg jpeg2k mysql \
22 netcdf odbc png ogdi perl postgres python ruby sqlite threads"
23
24 RDEPEND=">=sys-libs/zlib-1.1.4
25 >=media-libs/tiff-3.7.0
26 sci-libs/libgeotiff
27 dev-libs/expat
28 curl? ( net-misc/curl )
29 jpeg? ( media-libs/jpeg )
30 gif? ( media-libs/giflib )
31 png? ( media-libs/libpng )
32 perl? ( dev-lang/perl )
33 python? ( virtual/python
34 dev-python/numpy )
35 ruby? ( >=dev-lang/ruby-1.8.4.20060226 )
36 fits? ( sci-libs/cfitsio )
37 ogdi? ( sci-libs/ogdi )
38 gml? ( >=dev-libs/xerces-c-3 )
39 hdf5? ( >=sci-libs/hdf5-1.6.4 )
40 postgres? ( dev-db/postgresql-server )
41 || (
42 netcdf? ( sci-libs/netcdf )
43 hdf? ( sci-libs/hdf )
44 )
45 || (
46 jpeg2k? ( media-libs/jasper )
47 ecwj2k? ( !media-libs/lcms
48 sci-libs/libecwj2 )
49 )
50 mysql? ( virtual/mysql )
51 odbc? ( dev-db/unixODBC )
52 geos? ( >=sci-libs/geos-2.2.1 )
53 sqlite? ( >=dev-db/sqlite-3 )"
54
55 DEPEND="${RDEPEND}
56 perl? ( python? ( ruby? ( >=dev-lang/swig-1.3.28 ) ) )
57 doc? ( app-doc/doxygen )"
58
59 AT_M4DIR="${S}/m4"
60
61 pkg_setup() {
62 if [ -n "${GDAL_CONFIGURE_OPTS}" ]; then
63 elog "User-specified configure options are ${GDAL_CONFIGURE_OPTS}."
64 else
65 elog "User-specified configure options are not set."
66 elog "If needed, set GDAL_CONFIGURE_OPTS to enable grass support."
67 fi
68 }
69
70 src_unpack() {
71 unpack ${A}
72 cd "${S}"
73
74 eaclocal
75 eautoconf
76
77 epatch "${FILESDIR}"/${PN}-1.4.2-datadir.patch \
78 "${FILESDIR}"/${PN}-1.5.0-soname.patch \
79 "${FILESDIR}"/${PN}-1.5.1-python-install.patch \
80 "${FILESDIR}"/${PN}-1.6.1-ruby-make.patch \
81 "${FILESDIR}"/${P}-swig-fix.patch \
82 "${FILESDIR}"/${P}-mysql_ogr_header.patch \
83 || die "sed failed"
84
85 if useq hdf; then
86 einfo "Checking if HDF4 is compiled with szip..."
87 if built_with_use sci-libs/hdf szip ; then
88 einfo "Found HDF4 compiled with szip. Nice."
89 else
90 ewarn "HDF4 (sci-libs/hdf) must be compiled with the szip USE flag!"
91 einfo "Please emerge hdf with szip USE flag and then emerge GDAL."
92 die "HDF4 not merged with szip use flag"
93 fi
94
95 if useq netcdf; then
96 ewarn "Netcdf and HDF4 are incompatible due to certain tools in"
97 ewarn "common; HDF5 is now the preferred choice for HDF data."
98 die "Please disable either the hdf or netcdf use flag."
99 fi
100 fi
101 }
102
103 src_compile() {
104 local pkg_conf="${GDAL_CONFIGURE_OPTS}"
105 local use_conf=""
106
107 pkg_conf="${pkg_conf} --enable-shared=yes --with-pic \
108 --with-libgrass=no --without-libtool"
109
110 use_conf="$(use_with jpeg) $(use_with png) $(use_with mysql) \
111 $(use_with postgres pg) $(use_with python) $(use_with ruby) \
112 $(use_with threads) $(use_with fits cfitsio) $(use_with perl) \
113 $(use_with netcdf) $(use_with hdf hdf4) $(use_with geos) \
114 $(use_with sqlite sqlite3) $(use_with jpeg2k jasper) $(use_with odbc) \
115 $(use_with gml xerces) $(use_with hdf5) $(use_with curl) \
116 $(use_enable debug)"
117
118 # It can't find this
119 if useq ogdi ; then
120 use_conf="--with-ogdi=/usr/$(get_libdir) ${use_conf}"
121 fi
122
123 if useq mysql ; then
124 use_conf="--with-mysql=/usr/bin/mysql_config ${use_conf}"
125 fi
126
127 if useq gif ; then
128 use_conf="--with-gif=internal ${use_conf}"
129 else
130 use_conf="--with-gif=no ${use_conf}"
131 fi
132
133 if useq python ; then
134 use_conf="--with-pymoddir=$(python_get_sitedir) \
135 ${use_conf}"
136 fi
137
138 # Fix doc path just in case
139 sed -i -e "s:@exec_prefix@/doc:@exec_prefix@/share/doc/${PF}/html:g" \
140 GDALmake.opt.in || die "sed gdalmake.opt failed"
141
142 econf ${pkg_conf} ${use_conf} || die "econf failed"
143
144 # parallel makes fail on the ogr stuff (C++, what can I say?)
145 # also failing with gcc4 in libcsf
146 emake -j1 || die "emake failed"
147
148 if useq python; then
149 sed -i -e "s#library_dirs = #library_dirs = /usr/$(get_libdir):#g" \
150 swig/python/setup.cfg || die "sed python setup.cfg failed"
151 sed -i -e "s:\$(DESTDIR)\$(prefix):\$(DESTDIR)\$(INST_PREFIX):g" \
152 swig/python/GNUmakefile || die "sed python makefile failed"
153 fi
154
155 if useq perl ; then
156 cd "${S}"/swig/perl
157 perl-module_src_prep
158 perl-module_src_compile
159 cd "${S}"
160 fi
161
162 if useq doc ; then
163 make docs || die "make docs failed"
164 fi
165 }
166
167 src_install() {
168
169 if useq perl ; then
170 cd "${S}"/swig/perl
171 perl-module_src_install
172 sed -i -e "s:BINDINGS = python ruby perl:BINDINGS = python ruby:g" \
173 GDALmake.opt
174 cd "${S}"
175 fi
176
177 # einstall causes sandbox violations on /usr/lib/libgdal.so
178 make DESTDIR="${D}" install \
179 || die "make install failed"
180
181 dodoc Doxyfile HOWTO-RELEASE NEWS
182
183 if useq doc ; then
184 dohtml html/* || die "install html failed"
185 docinto ogr
186 dohtml ogr/html/* || die "install ogr html failed"
187 fi
188
189 if useq python; then
190 newdoc swig/python/README.txt README-python.txt
191 dodir /usr/share/${PN}/samples
192 insinto /usr/share/${PN}/samples
193 doins swig/python/samples/*
194 fi
195
196 use perl && fixlocalpod
197 }
198
199 pkg_postinst() {
200 elog
201 elog "If you need libgrass support, then you must rebuild gdal, after"
202 elog "installing the latest Grass, and set the following option:"
203 elog
204 elog "GDAL_CONFIGURE_OPTS=--with-grass=${GRASS_HOME} emerge gdal"
205 elog
206 elog "GDAL is most useful with full graphics support enabled via various"
207 elog "USE flags: png, jpeg, gif, jpeg2k, etc. Also python, fits, ogdi,"
208 elog "geos, and support for either netcdf or HDF4 is available, as well as"
209 elog "grass, and mysql, sqlite, or postgres (grass support requires grass 6"
210 elog "and rebuilding gdal). HDF5 support is now included."
211 elog
212 elog "Note: tiff and geotiff are now hard depends, so no USE flags."
213 elog "Also, this package will check for netcdf before hdf, so if you"
214 elog "prefer hdf, please emerge hdf with USE=szip prior to emerging"
215 elog "gdal. Detailed API docs require doxygen (man pages are free)."
216 elog
217 elog "Check available image and data formats after building with"
218 elog "gdalinfo and ogrinfo (using the --formats switch)."
219 elog
220 }

  ViewVC Help
Powered by ViewVC 1.1.20