core/gdal/PKGBUILD

71 lines
2.6 KiB
Bash
Raw Normal View History

2015-03-06 02:56:36 +08:00
# Contributions from Arch: https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/gdal
2010-10-20 00:40:53 +08:00
pkgname=gdal
2016-09-12 09:16:53 +08:00
pkgver=2.1.1
2016-12-10 17:52:35 +08:00
pkgrel=3
2010-10-20 00:40:53 +08:00
pkgdesc="A translator library for raster geospatial data formats"
arch=('x86_64')
2010-10-20 00:40:53 +08:00
url="http://www.gdal.org/"
license=('custom')
2011-07-12 10:04:17 +08:00
depends=('curl' 'geos' 'giflib' 'hdf5' 'libgeotiff' 'libjpeg' 'libpng' 'libtiff'
2015-01-06 05:15:44 +08:00
'netcdf' 'poppler' 'libspatialite' 'python2' 'python2-numpy' 'sqlite3' 'libmariadbclient' 'postgresql-libs' 'pcre')
makedepends=('perl' 'swig' 'chrpath' 'doxygen')
optdepends=('postgresql: postgresql database support'
'mariadb: mariadb database support'
'perl: perl binding support'
'swig: perl binding support')
2015-01-06 05:15:44 +08:00
options=('!makeflags')
2016-09-12 09:16:53 +08:00
source=("http://download.osgeo.org/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.xz")
sha256sums=('87ce516ce757ad1edf1e21f007fbe232ed2e932af422e9893f40199711c41f92')
2010-10-20 00:40:53 +08:00
2015-01-06 05:15:44 +08:00
prepare() {
cd "${srcdir}"/$pkgname-$pkgver
# python2 fixes
2010-10-20 00:40:53 +08:00
sed -i 's_python python1.5_python2 python python1.5_' configure
for file in swig/python/{,osgeo/,samples/,scripts/}*.py; do
sed -i 's_#!/usr/bin/env python_#!/usr/bin/env python2_' $file
done
2015-01-06 05:15:44 +08:00
# Fix mandir
sed -i "s|^mandir=.*|mandir='\${prefix}/share/man'|" configure
}
build() {
export CFLAGS="$CFLAGS -fno-strict-aliasing"
export LDFLAGS="$LDFLAGS -Wl,--as-needed"
cd ${srcdir}/$pkgname-$pkgver
2010-10-20 00:40:53 +08:00
./configure --prefix=/usr --with-netcdf --with-libtiff --with-sqlite3 \
2015-01-06 05:15:44 +08:00
--with-geotiff --with-mysql --with-python --with-curl \
2015-12-07 20:25:01 +08:00
--with-hdf5 --with-perl --with-geos --with-png --with-poppler --with-spatialite
2010-10-20 00:40:53 +08:00
# workaround for bug #13646
sed -i 's/PY_HAVE_SETUPTOOLS=1/PY_HAVE_SETUPTOOLS=/g' ./GDALmake.opt
sed -i 's/EXE_DEP_LIBS/KILL_EXE_DEP_LIBS/' apps/GNUmakefile
make
2015-01-06 05:15:44 +08:00
make man
2011-07-12 10:04:17 +08:00
}
package () {
cd ${srcdir}/$pkgname-$pkgver
install -d ${pkgdir}/usr/lib/python2.7/site-packages/
2010-10-20 00:40:53 +08:00
make DESTDIR=${pkgdir} install
2015-01-06 05:15:44 +08:00
make DESTDIR="${pkgdir}" install-man
2010-10-20 00:40:53 +08:00
2011-07-12 10:04:17 +08:00
# install license
2015-01-06 05:15:44 +08:00
install -D -m644 LICENSE.TXT "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
2010-10-20 00:40:53 +08:00
2011-07-12 10:04:17 +08:00
#FS15477 clean up junks
2015-01-06 05:15:44 +08:00
rm -f "${pkgdir}"/usr/bin/*.dox
rm -f "${pkgdir}"/usr/share/man/man1/_build_gdal_src_gdal-${pkgver}_apps_.1
# Remove RPATH
chrpath --delete "${pkgdir}"/usr/lib/perl5/${CARCH}-linux-thread-multi/auto/Geo/OSR/OSR.so
chrpath --delete "${pkgdir}"/usr/lib/perl5/${CARCH}-linux-thread-multi/auto/Geo/OGR/OGR.so
chrpath --delete "${pkgdir}"/usr/lib/perl5/${CARCH}-linux-thread-multi/auto/Geo/GDAL/GDAL.so
chrpath --delete "${pkgdir}"/usr/lib/perl5/${CARCH}-linux-thread-multi/auto/Geo/GDAL/Const/Const.so
2010-10-20 00:40:53 +08:00
}