# Maintainer: Alexandre Ferreira < alex.jorge.m [at] gmail.com >

_realname=jinja
pkgbase=python-${_realname}
pkgname=("python-${_realname}")
pkgver=3.1.6
pkgrel=1
pkgdesc='A simple pythonic template language written in Python'
arch=('i686' 'x86_64')
license=('spdx:BSD-3-Clause')
url='http://jinja.pocoo.org/'
msys2_repository_url="https://github.com/pallets/jinja"
msys2_references=(
  "purl: pkg:pypi/jinja2"
  "cpe: cpe:/a:palletsprojects:jinja"
)
depends=('python-markupsafe')
makedepends=(
  "python-flit-core"
  "python-build"
  "python-installer"
)
source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/pallets/jinja/archive/${pkgver}.tar.gz")
sha256sums=('2074b22a72caa65474902234b320d73463d6d4c223ee49f4b433495758356337')

prepare() {
  cd "${_realname}-${pkgver}"
}

build() {
  cd "${_realname}-${pkgver}"

  python -m build --wheel --skip-dependency-check --no-isolation
}

package() {
  cd "${_realname}-${pkgver}"

  python -m installer --destdir="${pkgdir}" dist/*.whl

  install -Dm644 LICENSE.txt "${pkgdir}/usr/share/licenses/python-${_realname}/LICENSE.txt"
}
