NAME="pypi-docutils"
DESC="Set of Python modules and programs for processing plaintext docs into formats such as HTML, XML, or LaTeX"
VERSION="0.20.1"

FILES=("https://files.pythonhosted.org/packages/source/d/docutils/docutils-${VERSION}.tar.gz")
HASHES=("93bcfe0065cf1d0b6a0bcabeca7a2335")

DEPENDS=("python3")

PACKAGE() {
  tar xf "docutils-${VERSION}.tar.gz"
  cd "docutils-${VERSION}"
  
  python3 -m build --wheel --no-isolation
  python3 -m installer --destdir="${ROOTDIR}" dist/*.whl

  for f in "${ROOTDIR}/usr/bin/rst"*.py; do
    ln -svf "$(basename $f)" "${ROOTDIR}/usr/bin/$(basename $f .py)"
  done

  cd .. && rm -rf "docutils-${VERSION}"
}
