# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py-feedparser
_pkgname=feedparser
pkgver=5.2.1
pkgrel=2
pkgdesc="A Python feed parser for RSS and Atom"
url="https://github.com/kurtmckee/feedparser"
arch="noarch"
license="BSD"
makedepends="python2-dev py-setuptools python3-dev"
subpackages="py3-${pkgname/py-/}:_py3 py2-${pkgname/py-/}:_py2"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

build() {
	cd "$builddir"
	python2 setup.py build || return 1
	python3 setup.py build || return 1
}

package() {
	mkdir -p "$pkgdir"
}

_py() {
	local python=$1
	pkgdesc="$pkgdesc - $python"
	install_if="$pkgname=$pkgver-r$pkgrel $python"
	cd "$builddir"
	$python setup.py install --prefix=/usr --root="$subpkgdir"
}

_py2() {
	_py python2
	replaces="$pkgname"
}

_py3() {
	_py python3
}

md5sums="d552f7a2a55e8e33b2a3fe1082505b42  feedparser-5.2.1.tar.gz"
sha256sums="bd030652c2d08532c034c27fcd7c85868e7fa3cb2b17f230a44a6bbc92519bf9  feedparser-5.2.1.tar.gz"
sha512sums="1fd0c4324e2eff8ef4b15e3793c767290bca562af4a5056fdbdfa12411095530c87a113bb1b9757e532ff63aecb399b18f1e6b753884798eb6b8d3fdf575af81  feedparser-5.2.1.tar.gz"
