Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

PKGBUILD_grass642

By: a guest on Feb 21st, 2012  |  syntax: None  |  size: 3.93 KB  |  views: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Maintainer: Thomas Dziedzic < gostrc at gmail >
  2. # Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org
  3.  
  4. pkgname=grass
  5. pkgver=6.4.2
  6. pkgrel=4
  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.fbk.eu/'
  10. license=('GPL')
  11. depends=('gdal' 'tk' 'sqlite3' 'python2' 'mesa' 'swig' 'proj' 'libjpeg' 'libpng' 'libtiff' 'cfitsio' 'wxpython')
  12. makedepends=('mysql' 'postgresql' 'r' 'fftw' 'freetype2' 'xorg-server')
  13. optdepends=('fftw: required for i.fft and i.ifft modules'
  14.             'postgresql: PostgreSQL database interface'
  15.             'r: R language interface'
  16.             'lapack: required for GMATH library'
  17.             'blas: required for GMATH library'
  18.             'xorg-server: required for the graphical interface'
  19.             'wxpython: to enable the GUI')
  20. options=('!libtool' '!makeflags')
  21. install='grass.install'
  22.  
  23. source=("http://grass.osgeo.org/grass64/source/grass-${pkgver}.tar.gz"
  24.         "grass.sh"
  25.         "grass.conf")
  26. md5sums=('d3398d6b1e3a2ef19cfb6e39a5ae9919'
  27.          'a0e0ac6275e09a272f8ec38d3c0b4b3a'
  28.          '6103480c2a1adc19a50b9e925e5e6d4c')
  29.  
  30. build() {
  31.   cd grass-${pkgver}
  32.  
  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
  39.  
  40.   # the following exports are probably not needed
  41.   export PYTHON=python2
  42.   export DOXNAME=python2
  43.   export GRASS_python=python2
  44.  
  45.   # fix wxpython error
  46.   sed -i 's/python/&2/' ./include/Make/Platform.make.in
  47.  
  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-blas \
  58.     --with-lapack \
  59.     --with-proj-libs=/usr/lib \
  60.     --with-proj-includes=/usr/include \
  61.     --with-proj-share=/usr/share/proj \
  62.     --with-fftw-includes=/usr/include \
  63.     --with-fftw-libs=/usr/lib \
  64.     --with-wxwidgets=/usr/bin/wx-config \
  65.     --with-python=/usr/bin/python2-config
  66.  
  67.     #--with-freetype-includes=/usr/include
  68.  
  69.   make
  70.  
  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
  75. }
  76.  
  77. package() {
  78.   cd grass-${pkgver}
  79.  
  80.   make \
  81.     INST_DIR=${pkgdir}/opt/grass-${pkgver} \
  82.     BINDIR=${pkgdir}/usr/bin \
  83.     install
  84.  
  85.   # fix $GISBASE path
  86.   sed -i "s|GISBASE=${pkgdir}/opt/grass-${pkgver}|GISBASE=/opt/grass-${pkgver}|g" \
  87.     ${pkgdir}/usr/bin/grass64
  88.  
  89.   # install profile.d file
  90.   install -D ${srcdir}/grass.sh \
  91.     ${pkgdir}/etc/profile.d/grass.sh
  92.  
  93.   # install some freedesktop.org compatibility
  94.   install -D -m644 gui/icons/grass.desktop \
  95.     ${pkgdir}/usr/share/applications/grass.desktop
  96.  
  97.   sed -i -e 's/grass65/grass64/' -e 's_/usr/share/icons_/usr/share/pixmaps_' \
  98.     ${pkgdir}/usr/share/applications/grass.desktop
  99.  
  100.   install -D -m644 gui/icons/grass-48x48.png \
  101.     ${pkgdir}/usr/share/pixmaps/grass-48x48.png
  102.  
  103.   # create a symlink for version work around
  104.   ln -sf /opt/grass-${pkgver} ${pkgdir}/opt/grass
  105.  
  106.   install -D -m644 ${srcdir}/grass.conf \
  107.     ${pkgdir}/etc/ld.so.conf.d/grass.conf
  108.  
  109.   # install g.html2man which is needed for some extensions
  110.   # FS#25705 - [grass] g.html2man is not installed into package directory
  111.   # https://bugs.archlinux.org/task/25705
  112.   # most likely upstream problem which will be fixed in a version later than 6.4.1
  113.   cp -r ./tools/g.html2man ${pkgdir}/opt/grass-${pkgver}/tools
  114. }