Guest User

qgis pkgbuild

a guest
Jan 1st, 2014
78
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Maintainer: SaultDon <sault.don gmail>
  2. # Contributor: Lantald < lantald at gmx.com
  3. # Contributor: Thomas Dziedzic < gostrc at gmail >
  4. # Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org
  5. # Contributor: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
  6. # Contributor: Eric Forgeot < http://esclinux.tk >
  7. pkgname=qgis
  8. pkgver=2.0.1
  9. pkgrel=5
  10. pkgdesc='Quantum GIS is a Geographic Information System (GIS) that supports vector, raster & database formats'
  11. url='http://qgis.org/'
  12. license=('GPL')
  13. arch=('i686' 'x86_64')
  14. # update to http://www.qgis.org/wiki/Building_QGIS_from_Source#Overview
  15. depends=('libmysqlclient'
  16.          'postgresql-libs'
  17.          'sqlite3'
  18.          'jasper'
  19.          'curl'
  20.          'pyqt'
  21.          'python2'
  22.          'python2-pyqt>=4.10.4dev'
  23.          'python2-qscintilla'
  24.          'python2-psycopg2'
  25.          'giflib'
  26.          'cfitsio'
  27.          'qwt'
  28.          'proj'
  29.          'gdal'
  30.          'geos'
  31.          'flex'
  32.          'bison'
  33.          'libspatialite'
  34.          'spatialindex')
  35. makedepends=('cmake'
  36.              'grass'
  37.              'gsl'
  38.              'postgis'
  39.              'netcdf'
  40.              'fcgi'
  41.              'python2-sip>=4.15.3')
  42. optdepends=('osgearth: OpenSceneGraph')
  43. install=${pkgname}.install
  44. source=("http://qgis.org/downloads/${pkgname}-${pkgver}.tar.bz2"
  45.         "qgis.sh"
  46.         "rev-349a4c97.diff::https://hub.qgis.org/projects/quantum-gis/repository/revisions/349a4c974fab88fdda0d612dea8defe037ec50ba/diff.diff"
  47.         "http://hub.qgis.org/attachments/download/6230/QgsFieldValidator.diff"
  48.         "https://github.com/geometeor/QGIS/commit/e4835fb42b914327192e87f9f8ede970d82bdc50.patch"
  49.         "rev-99cee10c.diff::http://hub.qgis.org/projects/quantum-gis/repository/revisions/99cee10cf96314ae911a6d8b99d6a43015a3cf83/diff.diff"
  50.         "rev-4a75a95a.diff::http://hub.qgis.org/projects/quantum-gis/repository/revisions/4a75a95a3602c9d87e6976210c819e8564c77c39/diff.diff")
  51. md5sums=('3822c7dd70e2d893a0f1baa9c72316d2'
  52.          '488a57456d9f3ca5965e0aed617cd8fa'
  53.          '4d66e5546feb08157ed5794b58891b01'
  54.          '775176bb6b9a600e9428a9a34bd88825'
  55.          'fa3ce11866ccab36b2e73771b04e7b53'
  56.          'dc06a0d065e74b5c373544c2435fa589'
  57.          'b0d65d59b5c2a5ff9234cd535e76b73b')
  58.  
  59. prepare() {
  60.         cd "$srcdir/$pkgname-$pkgver"
  61.         patch -Np1 -i "${srcdir}/rev-349a4c97.diff"      # http://hub.qgis.org/issues/8507
  62.         patch -Np1 -i "${srcdir}/QgsFieldValidator.diff" # http://hub.qgis.org/issues/8601
  63.         patch -Np1 -i "${srcdir}/e4835fb42b914327192e87f9f8ede970d82bdc50.patch" # https://github.com/geometeor/QGIS/commit/master
  64.         patch -Np1 -i "${srcdir}/rev-99cee10c.diff"  # http://hub.qgis.org/issues/9011
  65.         patch -Np1 -i "${srcdir}/rev-4a75a95a.diff"      # http://hub.qgis.org/issues/6369
  66. }
  67. build() {
  68.   # Fix insecure RPATH is weird, but just works ;)
  69.   # echo "os.system(\"sed -i '/^LFLAGS/s|-Wl,-rpath,.\+ ||g' gui/Makefile core/Makefile\")" >> python/configure.py.in
  70.  
  71.   cd "${srcdir}"
  72.   rm -rf build
  73.   mkdir build
  74.   cd build
  75.  
  76.   cmake ../${pkgname}-${pkgver} \
  77.     -DENABLE_TESTS=OFF \
  78.     -DCMAKE_BUILD_TYPE=Release \
  79.     -DCMAKE_SKIP_RPATH=ON \
  80.     -DCMAKE_INSTALL_PREFIX=/usr \
  81.     -DGRASS_PREFIX=/opt/grass \
  82.     -DQGIS_MANUAL_SUBDIR=share/man \
  83.     -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so \
  84.     -DPYTHON_EXECUTABLE=/usr/bin/python2 \
  85.     -DPYTHON_SITE_PACKAGES_DIR=/usr/lib/python2.7/site-packages \
  86.     -DPYTHON_INCLUDE_PATH=/usr/include/python2.7 \
  87.     -DQT_QMAKE_EXECUTABLE=qmake4 \
  88.     -DWITH_MAPSERVER=TRUE
  89.  
  90.   make
  91. }
  92.  
  93. package() {
  94.   cd build
  95.  
  96.   make DESTDIR=${pkgdir} install
  97.  
  98.   # create a more user-friendly application name link
  99.   ln -s /usr/bin/qgis $pkgdir/usr/bin/quantum-gis
  100.  
  101.   # install some freedesktop.org compatibility
  102.   install -D -m644 "$srcdir"/"${pkgname}-${pkgver}"/debian/qgis.desktop \
  103.                       "$pkgdir"/usr/share/applications/qgis.desktop
  104.   install -D -m644 "$srcdir"/"${pkgname}-${pkgver}"/debian/qbrowser.desktop \
  105.                       "$pkgdir"/usr/share/applications/qbrowser.desktop
  106.   install -dm755 $pkgdir/usr/share/pixmaps \
  107.                       "$pkgdir"/usr/share/mimelnk/application
  108.   for mime in $srcdir/${pkgname}-${pkgver}/debian/mime/application/*.desktop
  109.     do install -m644 ${mime} \
  110.                       "$pkgdir"/usr/share/mimelnk/application
  111.   done
  112.   ln -s /usr/share/qgis/images/icons/qgis-icon.png $pkgdir/usr/share/pixmaps/qgis-icon.png
  113.   ln -s /usr/share/qgis/images/icons/qgis-mime-icon.png $pkgdir/usr/share/pixmaps/qgis-mime-icon.png
  114.  
  115.   # enable qgis for python by setting PYTHONPATH
  116.   install -Dm644 ${srcdir}/qgis.sh \
  117.                       "${pkgdir}"/etc/profile.d/qgis.sh
  118. }
RAW Paste Data