# Maintainer: Butui Hu <hot123tea123@gmail.com>

_pkgname=PyPDF2
pkgname=python-pypdf2
pkgver=2.12.1
epoch=1
pkgrel=8
pkgdesc='A utility to read and write PDFs with Python (legacy PyPDF2 2.x)'
arch=('any')
url='https://pypi.org/project/PyPDF2'
license=('BSD-3-Clause')
depends=(
  python
)
optdepends=(
  python-pillow
  python-pycryptodome
)
makedepends=(
  python-build
  python-flit-core
  python-installer
  python-wheel
)
source=("${_pkgname}-${pkgver}.tar.gz::https://files.pythonhosted.org/packages/source/${_pkgname::1}/${_pkgname}/${_pkgname}-${pkgver}.tar.gz")
sha512sums=('6b03f307aa06ff062a7580deb10ef0d201891a4d8858ab72f7773c7b10e0783585ba834c359e13f244b99f743129094094ca024c958df6159eec2d7a2a2cde3d')

build() {
  cd "${_pkgname}-${pkgver}"
  python -m build --wheel --no-isolation
}

package() {
  cd "${_pkgname}-${pkgver}"
  python -m installer --destdir="${pkgdir}" dist/*.whl
  install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
# vim:set ts=2 sw=2 et:
