# Maintainer: ArchStrike <team[at]archstrike[dot]org>

buildarch=1

pkgname=mat
pkgver=0.6.1
pkgrel=3
pkgdesc="Metadata Anonymisation Toolkit"
url="https://mat.boum.org/"
depends=('python2-mutagen' 'python2-pyexiftool-git' 'python2-pdfrw' 'python2-gobject'
         'python2-cairo' 'poppler' 'poppler-glib')
makedepends=('python2' 'python2-setuptools' 'python2-distutils-extra')
license=('custom')
arch=('any')
source=("https://mat.boum.org/files/mat-${pkgver}.tar.xz")
sha512sums=('bde5685a5ea1116cbffa823d7978abfcfc6db04ef47940fdddc8a17e5e8d660777e3b780336e4f9d753e1b1e7127a1cbda1a7e2174ea9351b108fdd1351a00c1')

prepare() {
  cd "${pkgname}-${pkgver}" || exit
  sed -i 's|python$|python2|' libmat/mat.py nautilus/nautilus-mat.py
}

build() {
    cd "${pkgname}-${pkgver}" || exit
    python2 setup.py build
}

package() {
    cd "${pkgname}-${pkgver}" || exit
    python2 setup.py install --root="${pkgdir}" --optimize=1 
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
