# Maintainer: wahibre <wahibre@gmx.com>

_realname=mtn
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=3.4.1
pkgrel=1
pkgdesc="Command line program to save thumbnails (screenshots) of movie or video files into jpeg/png files (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64')
url="https://gitlab.com/movie_thumbnailer/mtn"
license=('GPL2')
source=("${url}/-/archive/v${pkgver}/${_realname}-v${pkgver}.tar.gz")
sha256sums=('34c1105c67b29cc5f11c811bd8e9850eb8e80e421a6ff9bbdd11d37cb863d356')
makedepends=("${MINGW_PACKAGE_PREFIX}-make"
             "${MINGW_PACKAGE_PREFIX}-gcc")
depends=("${MINGW_PACKAGE_PREFIX}-ffmpeg"
         "${MINGW_PACKAGE_PREFIX}-libgd")

build() {
  cd "${srcdir}/${_realname}-v${pkgver}/src"
  mingw32-make
}

package() {
  cd "${srcdir}/${_realname}-v${pkgver}/src"
  mkdir -p ${pkgdir}/${MINGW_PREFIX}/bin/
  install -m 755 ../bin/mtn ${pkgdir}/${MINGW_PREFIX}/bin/
  mkdir -p ${pkgdir}/${MINGW_PREFIX}/share/man/man1
  cp -p ../man/mtn.1 ${pkgdir}/${MINGW_PREFIX}/share/man/man1/
}
