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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Mon Jun 24 11:09:35 2013 UTC (7 years ago) by titanofold
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
FILE REMOVED
Version bump. (Bug 468592) Call java-pkg-opt-2 functions. (Bug 471262; thanks to Tom Wijsman) Remove "=external". (Bug 470046; thanks to Ronan Dunklau.) Clean out old versions and patches, and update hdf to hdf5 in the local USE description.

(Portage version: 2.1.11.62/cvs/Linux x86_64, signed Manifest commit with key D1BBFDA0)

1 # Copyright 1999-2012 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.8.1-r1.ebuild,v 1.5 2012/06/05 21:08:15 ranger Exp $
4
5 EAPI=3
6
7 WANT_AUTOCONF="2.5"
8
9 RUBY_OPTIONAL="yes"
10 USE_RUBY="ruby18"
11
12 PYTHON_DEPEND="python? 2:2.6"
13
14 inherit autotools eutils libtool perl-module python ruby-ng toolchain-funcs
15
16 DESCRIPTION="Translator library for raster geospatial data formats (includes OGR support)"
17 HOMEPAGE="http://www.gdal.org/"
18 SRC_URI="http://download.osgeo.org/gdal/${P}.tar.gz"
19
20 SLOT="0"
21 LICENSE="MIT"
22 KEYWORDS="amd64 ppc ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
23 IUSE="+aux_xml curl debug doc ecwj2k fits geos gif gml hdf5 jpeg jpeg2k mysql netcdf odbc ogdi pdf perl png postgres python ruby sqlite threads"
24
25 RDEPEND="
26 dev-libs/expat
27 media-libs/tiff
28 sci-libs/libgeotiff
29 ( || ( <sys-libs/zlib-1.2.5.1-r1 >=sys-libs/zlib-1.2.5.1-r2[minizip] ) )
30 curl? ( net-misc/curl )
31 ecwj2k? ( sci-libs/libecwj2 )
32 fits? ( sci-libs/cfitsio )
33 geos? ( >=sci-libs/geos-2.2.1 )
34 gif? ( media-libs/giflib )
35 gml? ( >=dev-libs/xerces-c-3 )
36 hdf5? ( >=sci-libs/hdf5-1.6.4[szip] )
37 jpeg? ( virtual/jpeg )
38 jpeg2k? ( media-libs/jasper )
39 mysql? ( virtual/mysql )
40 netcdf? ( sci-libs/netcdf )
41 odbc? ( dev-db/unixODBC )
42 ogdi? ( sci-libs/ogdi )
43 pdf? ( app-text/poppler )
44 perl? ( dev-lang/perl )
45 png? ( media-libs/libpng )
46 postgres? ( >=dev-db/postgresql-base-8.4 )
47 python? ( dev-python/numpy )
48 ruby? ( $(ruby_implementation_depend ruby18) )
49 sqlite? ( >=dev-db/sqlite-3 )"
50
51 SWIG_DEP=">=dev-lang/swig-2.0.2"
52 DEPEND="${RDEPEND}
53 doc? ( app-doc/doxygen )
54 perl? ( ${SWIG_DEP} )
55 python? ( ${SWIG_DEP} )
56 ruby? ( ${SWIG_DEP} )"
57
58 AT_M4DIR="${S}/m4"
59 MAKEOPTS+=" -j1"
60
61 pkg_setup() {
62 if use python; then
63 python_set_active_version 2
64 python_pkg_setup
65 fi
66 }
67
68 src_unpack() {
69 # prevent ruby-ng.eclass from messing with the src path
70 default
71 }
72
73 src_prepare() {
74 # fix datadir and docdir placement
75 sed -i \
76 -e "s:@datadir@:@datadir@/gdal:" \
77 -e "s:@exec_prefix@/doc:@exec_prefix@/share/doc/${PF}/html:g" \
78 GDALmake.opt.in || die
79
80 # the second sed expression should fix bug 371075
81 sed -i \
82 -e "s:setup.py install:setup.py install --root=\$(DESTDIR):" \
83 -e "s:--prefix=\$(DESTDIR):--prefix=:" \
84 swig/python/GNUmakefile || die
85
86 epatch "${FILESDIR}"/1.7.2-ruby_cflags.patch
87
88 # -soname is only accepted by GNU ld/ELF
89 [[ ${CHOST} == *-darwin* ]] \
90 && epatch "${FILESDIR}"/${PN}-1.5.0-install_name.patch \
91 || epatch "${FILESDIR}"/${PN}-1.5.0-soname.patch
92
93 # Update for zlib header changes (see bug #383569)
94 epatch "${FILESDIR}"/${P}-zlib_header_fix.patch
95
96 # Fix ldflags when building with ruby
97 sed -e '/^LDFLAGS/s/-Xcompiler//' -i swig/ruby/RubyMakefile.mk || die
98
99 # autoheader fail
100 eaclocal
101 eautoconf
102 eautomake
103 elibtoolize
104 }
105
106 src_configure() {
107 if use ruby; then
108 RUBY_MOD_DIR="$(ruby18 -r rbconfig -e 'print Config::CONFIG["sitearchdir"]')"
109 echo "Ruby module dir is: $RUBY_MOD_DIR"
110 fi
111
112 # pcidsk is internal, because there is no such library yet released
113 # also that thing is developed by the gdal people
114 # kakadu, mrsid jp2mrsid - another jpeg2k stuff, ignore
115 # bsb - legal issues
116 # oracle - disabled, i dont have and can't test
117 # ingres - same story as oracle oci
118 # tiff is a hard dep
119 econf \
120 --enable-shared \
121 --disable-static \
122 --with-expat \
123 --without-grass \
124 --without-hdf4 \
125 --without-fme \
126 --without-pcraster \
127 --without-kakadu \
128 --without-mrsid \
129 --without-jp2mrsid \
130 --without-msg \
131 --without-bsb \
132 --without-dods-root \
133 --without-oci \
134 --without-ingres \
135 --without-spatialite \
136 --without-dwgdirect \
137 --without-epsilon \
138 --without-idb \
139 --without-sde \
140 --without-libtool \
141 --with-libz="${EPREFIX}/usr/" \
142 --with-ogr \
143 --with-grib \
144 --with-vfk \
145 --with-libtiff=external \
146 --with-geotiff=external \
147 $(use_enable debug) \
148 $(use_with postgres pg) \
149 $(use_with fits cfitsio) \
150 $(use_with netcdf) \
151 $(use_with png) \
152 $(use_with jpeg) \
153 $(use_with jpeg pcidsk) \
154 $(use_with gif) \
155 $(use_with ogdi ogdi "${EPREFIX}"/usr) \
156 $(use_with hdf5) \
157 $(use_with jpeg2k jasper) \
158 $(use_with ecwj2k ecw) \
159 $(use_with gml xerces) \
160 $(use_with odbc) \
161 $(use_with curl) \
162 $(use_with sqlite sqlite3 "${EPREFIX}"/usr) \
163 $(use_with mysql mysql "${EPREFIX}"/usr/bin/mysql_config) \
164 $(use_with geos) \
165 $(use_with aux_xml pam) \
166 $(use_with pdf poppler) \
167 $(use_with perl) \
168 $(use_with ruby) \
169 $(use_with python) \
170 $(use_with threads) \
171 --with-pymoddir="${EPREFIX}"/$(python_get_sitedir)
172
173 # mysql-config puts this in (and boy is it a PITA to get it out)
174 if use mysql; then
175 sed -i \
176 -e "s: -rdynamic : :" \
177 GDALmake.opt || die "sed LIBS failed"
178 fi
179
180 # updated for newer swig (must specify the path to input files)
181 if use python; then
182 sed -i \
183 -e "s: gdal_array.i: ../include/gdal_array.i:" \
184 -e "s:\$(DESTDIR)\$(prefix):\$(DESTDIR)\$(INST_PREFIX):g" \
185 swig/python/GNUmakefile || die "sed python makefile failed"
186 sed -i \
187 -e "s:library_dirs = :library_dirs = /usr/$(get_libdir):g" \
188 swig/python/setup.cfg || die "sed python setup.cfg failed"
189 fi
190 }
191
192 src_compile() {
193 local i
194 for i in perl ruby python; do
195 if use $i; then
196 rm "${S}"/swig/$i/*_wrap.cpp
197 emake -C "${S}"/swig/$i generate || \
198 die "make generate failed for swig/$i"
199 fi
200 done
201
202 emake || die "emake failed"
203
204 if use perl ; then
205 pushd "${S}"/swig/perl > /dev/null
206 perl-module_src_prep
207 perl-module_src_compile
208 popd > /dev/null
209 fi
210
211 if use doc ; then
212 emake docs || die "make docs failed"
213 fi
214 }
215
216 src_install() {
217 if use perl ; then
218 pushd "${S}"/swig/perl > /dev/null
219 perl-module_src_install
220 popd > /dev/null
221 sed -i \
222 -e "s:BINDINGS = python ruby perl:BINDINGS = python ruby:g" \
223 GDALmake.opt || die
224 fi
225
226 emake DESTDIR="${D}" install || die "make install failed"
227
228 if use ruby ; then
229 # weird reinstall collision; needs manual intervention...
230 pushd "${S}"/swig/ruby > /dev/null
231 rm -rf "${D}"${RUBY_MOD_DIR}/gdal
232 exeinto ${RUBY_MOD_DIR}/gdal
233 doexe *.so || die "doins ruby modules failed"
234 popd > /dev/null
235 fi
236
237 use perl && fixlocalpod
238
239 dodoc Doxyfile HOWTO-RELEASE NEWS || die
240
241 if use doc ; then
242 dohtml html/* || die "install html failed"
243 docinto ogr
244 dohtml ogr/html/* || die "install ogr html failed"
245 fi
246
247 if use python; then
248 newdoc swig/python/README.txt README-python.txt || die
249 insinto /usr/share/${PN}/samples
250 doins swig/python/samples/* || die
251 fi
252 }
253
254 pkg_postinst() {
255 if use python; then
256 python_need_rebuild
257 python_mod_optimize osgeo
258 fi
259 echo
260 elog "Check available image and data formats after building with"
261 elog "gdalinfo and ogrinfo (using the --formats switch)."
262 }
263
264 pkg_postrm() {
265 if use python; then
266 python_mod_cleanup osgeo
267 fi
268 }

  ViewVC Help
Powered by ViewVC 1.1.20