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

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

  ViewVC Help
Powered by ViewVC 1.1.20