updated on Thu Jan 12 04:00:44 UTC 2012
[aur-mirror.git] / grass-geos / PKGBUILD
blob6fd989dee37cab43ccecdddb1f2c5edb18fff547
1 # Maintainer: Dražen Odobašić < dodobasic at gmail >
3 pkgname=grass-geos
4 pkgver=6.4.1
5 pkgrel=1
6 pkgdesc='Geographic Information System (GIS) used for geospatial data management and analysis, image processing, graphics/maps production, spatial modeling, and visualization with GEOS support'
7 arch=('i686' 'x86_64')
8 url='http://grass.itc.it/index.php'
9 license=('GPL')
10 depends=('gdal' 'tk' 'sqlite3' 'python2' 'mesa' 'swig' 'proj' 'libjpeg' 'libpng' 'libtiff' 'cfitsio')
11 makedepends=('mysql' 'postgresql' 'r' 'fftw' 'freetype2' 'xorg-server' 'geos')
12 optdepends=('fftw: required for i.fft and i.ifft modules'
13             'postgresql: PostgreSQL database interface'
14             'r: R language interface'
15             'lapack: required for GMATH library'
16             'blas: required for GMATH library'
17             'wxpython: to enable the GUI')
19 options=('!libtool' '!makeflags')
20 install='grass.install'
21 source=("http://grass.itc.it/grass64/source/grass-${pkgver}.tar.gz"
22         "grass.sh"
23         "grass.conf")
24 md5sums=('d8ca83d416b5b0cf2aa9d36c81a77b23'
25          'a0e0ac6275e09a272f8ec38d3c0b4b3a'
26          '6103480c2a1adc19a50b9e925e5e6d4c')
28 provides=('grass')
30 build() {
31   cd grass-${pkgver}
33   # python2 fix
34   sed -i 's_python $< $(GISBASE) > $@_python2 $< $(GISBASE) > $@_' gui/wxpython/Makefile
35   for file in $(find . -name '*.py' -print); do
36     sed -i 's_^#!.*/usr/bin/python_#!/usr/bin/python2_' $file
37     sed -i 's_^#!.*/usr/bin/env.*python_#!/usr/bin/env python2_' $file
38   done
40   # the following exports are probably not needed
41   export PYTHON=python2
42   export DOXNAME=python2
43   export GRASS_python=python2
45   # fix wxpython error
46   sed -i 's/python/&2/' ./include/Make/Platform.make.in
48   # see ${srcdir}/grass-6.4.0/REQUIREMENTS.html for options
49   ./configure \
50     --prefix=/opt \
51     --with-mysql-includes=/usr/include/mysql \
52     --with-mysql \
53     --with-sqlite \
54     --with-postgres \
55     --with-fftw \
56     --with-gdal=/usr/bin/gdal-config \
57     --with-geos=/usr/bin/geos-config \
58     --with-blas \
59     --with-lapack \
60     --with-proj-libs=/usr/lib \
61     --with-proj-includes=/usr/include \
62     --with-proj-share=/usr/share/proj \
63     --with-fftw-includes=/usr/include \
64     --with-fftw-libs=/usr/lib \
65     --with-python=/usr/bin/python2-config
67     #--with-freetype-includes=/usr/include
69   make
71   # some more potential problems nvm, works without, but save for future use if problems arrise
72   #cd ${pkgdir}/opt/grass-${pkgver}
73   #sed -i 's/PYTHON = python/PYTHON = python2/' include/Make/Python.make
74   #sed -i 's/GRASS_PYTHON=python/GRASS_PYTHON=python2/' etc/Init.sh
77 package() {
78   cd grass-${pkgver}
80   make \
81     INST_DIR=${pkgdir}/opt/grass-${pkgver} \
82     BINDIR=${pkgdir}/usr/bin \
83     install
85   # fix $GISBASE path
86   sed -i "s|GISBASE=${pkgdir}/opt/grass-${pkgver}|GISBASE=/opt/grass-${pkgver}|g" \
87     ${pkgdir}/usr/bin/grass64
89   # install profile.d file
90   install -D ${srcdir}/grass.sh \
91     ${pkgdir}/etc/profile.d/grass.sh
93   # install some freedesktop.org compatibility
94   install -D -m644 gui/icons/grass.desktop \
95     ${pkgdir}/usr/share/applications/grass.desktop
97   sed -i -e 's/grass65/grass64/' -e 's_/usr/share/icons_/usr/share/pixmaps_' \
98     ${pkgdir}/usr/share/applications/grass.desktop
100   install -D -m644 gui/icons/grass-48x48.png \
101     ${pkgdir}/usr/share/pixmaps/grass-48x48.png
103   # create a symlink for version work around
104   ln -sf /opt/grass-${pkgver} ${pkgdir}/opt/grass
106   install -D -m644 ${srcdir}/grass.conf \
107     ${pkgdir}/etc/ld.so.conf.d/grass.conf