description="Port of sgmllib to Python3"
url="https://github.com/kurtmckee/feedparser"

packager="Great-OS Team"
maintainer="Great-OS Team"

name=python-sgmllib
version=5.2.1
release=4

PKGMK_KEEP_SOURCES="no"
source=(https://github.com/kurtmckee/feedparser/archive/$version.tar.gz)

build() {
  cd feedparser-$version

  _pythonlib=($(python3 -V))
  _pythonver=${_pythonlib[1]:0:4}

  python3 /usr/lib/python${_pythonver}/compileall.py feedparser/sgmllib3.py

  install -Dm644 feedparser/sgmllib3.py \
      "$PKG/usr/lib/python${_pythonver}/site-packages/sgmllib.py"

  install -Dm644 feedparser/__pycache__/sgmllib3.cpython-${_pythonver//./}.pyc \
      "$PKG/usr/lib/python${_pythonver}/site-packages/__pycache__/sgmllib.cpython-${_pythonver//./}.pyc" 
}
