# Maintainer : Felix Yan <felixonmars@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Alex Anthony <alex.anthony28991@gmail.com>

pkgname=python-markupsafe
pkgver=2.1.5
pkgrel=1.1
pkgdesc="Implements a XML/HTML/XHTML Markup safe string for Python"
arch=('x86_64' 'aarch64')
url="https://pypi.python.org/pypi/MarkupSafe"
license=('BSD')
depends=('python')
makedepends=('git' 'python-setuptools')
checkdepends=('python-pytest')
source=("git+https://github.com/pallets/markupsafe.git#tag=$pkgver")
sha512sums=('449daf8db6f1356f865cdb814be7a11c02a3c6dc130207193c6e300f0055d877378aaee0eb3634b3ce052960c927fb56669c5546b773906b12280c41c3f1fbfc')

build() {
  cd markupsafe
  python setup.py build
}

check() {
  cd markupsafe
  PYTHONPATH=src pytest
}

package() {
  cd markupsafe
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE.rst -t "$pkgdir"/usr/share/licenses/$pkgname/
}
