# Maintainer: Fincer <fincer89 at hotmail dot com>
pkgname=photoscan-pro
pkgver=1.3.0
ver=1_3_0
pkgrel=1
pkgdesc='Generate high resolution georeferenced orthophotos and textured polygonal models (trial version).'
arch=('x86_64')
url='http://www.agisoft.com/'
license=('custom: "commercial"')
depends=('libpng12' 'qt5-svg' 'qt5-base' 'python')
install=photoscan-pro.install
  architecture=_amd64
  source=("http://download.agisoft.com/photoscan-pro_$ver$_$architecture.tar.gz" "$pkgname.runtime" "$pkgname.png" "$pkgname.desktop"
  qtfix.patch)
md5sums=('82aaed64f623dc91d6129014412c8c7a'
         '2f29afffc98fa39ae0f5c47fe7195833'
         '9ffa07f3059edce837d43de8c2a50e1b'
         '72403a878fd2f555ce5d3bef507740e6'
         '4cb2792c78ac526aaf1fa5c233a74fb0')

prepare(){
  cd "$srcdir/$pkgname"
  patch -Np1 -i $srcdir/qtfix.patch #qtfix126.patch is for Photoscan Pro version 1.2.6 (Linux AMD64)
}
         
package(){
  install -dm755 $pkgdir/opt/
  cp -r $srcdir/$pkgname $pkgdir/opt/$pkgname
  install -Dm755 $srcdir/$pkgname.runtime $pkgdir/usr/bin/photoscanpro
  install -Dm644 "$srcdir/$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
  install -Dm644 "$srcdir/$pkgname.png" "$pkgdir/usr/share/pixmaps/$pkgname.png"
  chmod 755 -R $pkgdir/opt/$pkgname
}
