#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=mat2
pkgver=0.13.0.4.gcc5be86
pkgrel=02
pkgdesc='Metadata removal tool, supporting a wide range of commonly used file formats'
url='https://0xacab.org/jvoisin/mat2'
arch=('any')
depends=('python' 'python-mutagen' 'python-cairo' 'python-gobject' 'gdk-pixbuf2' 'poppler-glib' 'librsvg' 'perl-image-exiftool' 'mailcap')
makedepends=('python-setuptools' git)
optdepends=(
  'ffmpeg: video support'
  'bubblewrap: sandboxing support'
)
checkdepends=('ffmpeg')
conflicts=(mat mat2-git)
provides=(mat mat-git mat2-git)
source=("git+https://0xacab.org/jvoisin/${pkgname}.git")

pkgver() {
    cd "${srcdir}/${pkgname}"
    local ver="$(git describe --tags | sed 's|-|\.|g')"
    printf "%s" "${ver//-/.}"
}
build() {
    cd "${srcdir}/${pkgname}"
    export PYTHONHASHSEED=0
    python setup.py build
}

check() {
    cd "${srcdir}/${pkgname}"
    python -m unittest discover -v
}

package() {
    cd "${srcdir}/${pkgname}"
    python setup.py install --skip-build -O1 --root="${pkgdir}"
    install -Dm 644 dolphin/mat2.desktop -t "${pkgdir}/usr/share/kservices5/ServiceMenus"
    install -Dm 644 doc/mat2.1 -t "${pkgdir}/usr/share/man/man1"
    install -Dm 644 doc/*.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}

#---- license gpg-key sha256sums ----

license=('LGPL3')

sha256sums=(SKIP)

