# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgname=python-feedgen
pkgver=1.0.0
pkgrel=1
pkgdesc='Python module to generate ATOM feeds, RSS feeds and Podcasts'
url='https://lkiesow.github.io/python-feedgen'
arch=('any')
license=('BSD')
depends=('python' 'python-dateutil' 'python-lxml')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-sphinx' 'python-wheel')
source=(https://github.com/lkiesow/python-feedgen/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha512sums=('f21704f7f4714e51c9b7b1d98f71db041426e01039f4d85439ee0623b77575293f3efd6fdb7b6609f67e0a868863b15169f91cef3a3c16542182ecf9409eb524')
b2sums=('e7594c3665555d79772afd0191089d846f294580259ec56829b6cc5a52c5de70b8e3d186e8d865e88ffa5bb52b7a2038c49e332b362de2670a67b6c28d7b8815')

build() {
  cd ${pkgname}-${pkgver}
  python -m build --wheel --no-isolation
  make -j1 -C doc man text
}

check() {
  cd ${pkgname}-${pkgver}
  python -m unittest discover tests
}

package() {
  cd ${pkgname}-${pkgver}
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm 644 readme.rst SECURITY.rst  -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 license.bsd license.lgpl -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -d "${pkgdir}/usr/share/doc/${pkgname}"
  cp -r doc/_build/text/* "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 doc/_build/man/pyFeedGen.tex.1 "${pkgdir}/usr/share/man/man1/${pkgname}.1"
}

# vim: ts=2 sw=2 et:
