updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / grass-svn / PKGBUILD
blob3c91497dee7cb49ea828074d307a017315eb9ead
1 # Maintainer: Thomas Dziedzic < gostrc at gmail >
2 # Based off of dibblethewrecker's PKGBUILD for grass in community.
4 pkgname=grass-svn
5 pkgver=45039
6 pkgrel=1
7 pkgdesc='Geographic Information System (GIS) used for geospatial data management and analysis, image processing, graphics/maps production, spatial modeling, and visualization.'
8 arch=('i686' 'x86_64')
9 url='http://grass.itc.it/index.php'
10 license=('GPL')
11 conflicts=('grass')
12 provides=('grass')
13 depends=('gdal' 'tk' 'sqlite3' 'xorg-server' 'python' 'mesa' 'swig' 'proj' 'libjpeg' 'libpng' 'libtiff')
14 makedepends=('mysql' 'postgresql' 'r' 'fftw' 'freetype2' 'subversion')
15 optdepends=('fftw: required for i.fft and i.ifft modules'
16             'postgresql: PostgreSQL database interface'
17             'r: R language interface'
18             'lapack: required for GMATH library'
19             'blas: required for GMATH library'
20             'xorg-server: required for the graphical interface')
21 options=('!libtool' '!makeflags')
22 install=grass.install
23 source=('grass.desktop'
24         'grass.sh'
25         'grass.png')
26 md5sums=('c0d669c77f60f8544a34a55c5e9e087c'
27          'db93730dd330f1539bd31b4373e1c00e'
28          'ae778ed261a40b078a8465994a0eb25e')
30 _svntrunk='https://svn.osgeo.org/grass/grass/branches/releasebranch_6_4'
31 _svnmod='grass64_release'
33 build() {
34   if [ -d ${_svnmod} ]; then
35     cd ${_svnmod}
36     svn up
37   else
38     svn co ${_svntrunk} ${_svnmod}
39     cd ${_svnmod}
40   fi
42   msg "SVN checkout done or server timeout"
43   msg "Starting make..."
46   # python2 fix
47   sed -i 's_python $< $(GISBASE) > $@_python2 $< $(GISBASE) > $@_' gui/wxpython/Makefile
48   for file in $(find . -name '*.py' -print); do
49     #sed -i 's_^#!.*/usr/bin/python_#!/usr/bin/python2_' $file
50     #sed -i 's_^#!.*/usr/bin/env.*python_#!/usr/bin/env python2_' $file
51     sed -i '1 i#!/usr/bin/python2' $file
52   done
54   find -type f -exec sed -i 's/$(PYTHON)/&2/g' {} \;
56   export PYTHON=python2
58   PYTHON=python2 ./configure \
59     --prefix=/opt \
60     --with-mysql-includes=/usr/include/mysql \
61     --with-mysql \
62     --with-sqlite \
63     --with-postgres \
64     --with-fftw \
65     --with-gdal=/usr/bin/gdal-config \
66     --with-python=/usr/bin/python2-config \
67     --with-blas \
68     --with-lapack \
69     --with-proj-libs=/usr/lib \
70     --with-proj-includes=/usr/include \
71     --with-proj-share=/usr/share/proj \
72     --with-fftw-includes=/usr/include \
73     --with-fftw-libs=/usr/lib
75   make
78 package() {
79   cd ${_svnmod}
81   make \
82     INST_DIR=${pkgdir}/opt/grass-${pkgver} \
83     BINDIR=${pkgdir}/usr/bin \
84     install
86   # fix $GISBASE path
87   sed -i "s|GISBASE=${pkgdir}/opt/grass-${pkgver}|GISBASE=/opt/grass-${pkgver}|g" \
88     ${pkgdir}/usr/bin/grass64
90   # strip html docs
91   #rm -r ${pkgdir}/opt/grass-${pkgver}/docs/html
93   # install profile.d file
94   install -D ${srcdir}/grass.sh \
95     ${pkgdir}/etc/profile.d/grass.sh
97   # install some freedesktop.org compatibility
98   install -D -m644 ${srcdir}/grass.desktop \
99     ${pkgdir}/usr/share/applications/grass.desktop
101   install -D -m644 ${srcdir}/grass.png \
102     ${pkgdir}/usr/share/pixmaps/grass.png
104   # create a symlink for version work around
105   ln -sf /opt/grass-${pkgver} ${pkgdir}/opt/grass
107   install -d ${pkgdir}/etc/ld.so.conf.d/
108   echo '/opt/grass/lib' > ${pkgdir}/etc/ld.so.conf.d/grass.conf