# # Apps Packages for Chakra, part of chakra-project.org # # Maintainer: Adrian Chaves Fernandez (Gallaecio) _pkgname=feedparser pkgbase=python-feedparser pkgname=('python2-feedparser' 'python3-feedparser' 'python3-sgmllib') pkgver=5.1.3 pkgrel=3 pkgdesc="feedparser is a Python library that parses feeds in all known formats, including Atom, RSS, and RDF." arch=('any') url="http://code.google.com/p/feedparser/" license=('MIT') depends=('python2' 'libxml2') makedepends=('python2-setuptools' 'python3-setuptools') replaces=('python-feedparser') provides=('python-feedparser') source=("http://${_pkgname}.googlecode.com/files/${_pkgname}-${pkgver}.tar.bz2" fix-chardet-support-in-python-3.patch) md5sums=('6fb6372a1dc2f56d4d79d740b8f49f25' '8d169c4abcccfcde1681f845a9c6cbd4') prepare() { # http://code.google.com/p/feedparser/issues/detail?id=384 # https://bugs.archlinux.org/task/33254 patch -d "feedparser-$pkgver" -p1 -i \ "$srcdir/fix-chardet-support-in-python-3.patch" chmod 644 feedparser-${pkgver}/feedparser/feedparser.egg-info/* cp -r feedparser-${pkgver} feedparser-${pkgver}-python2 cp -r feedparser-${pkgver} feedparser-${pkgver}-python3 cp -r feedparser-${pkgver} feedparser-${pkgver}-sgmllib (cd feedparser-${pkgver}-python2; sed -i 's#env python$#env python2#' feedparser/feedparser.py) (cd feedparser-${pkgver}-python3; 2to3 -w feedparser/feedparser.py feedparser/feedparsertest.py) } build() { cd feedparser-${pkgver}-sgmllib python3 /usr/lib/python3.4/compileall.py feedparser/sgmllib3.py } package_python2-feedparser() { depends=('python2' 'libxml2' ) pkgdesc="Parse RSS and Atom feeds in Python2" cd "${srcdir}/feedparser-${pkgver}-python2" python2 setup.py install --root="${pkgdir}" install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/license" } package_python3-feedparser() { depends=('libxml2' 'python3-sgmllib') cd "${srcdir}/feedparser-${pkgver}-python3" python3 setup.py install --root="${pkgdir}" install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/license" } package_python3-sgmllib() { depends=('python3') pkgdesc="Port of sgmllib to python-3" license=('PSF') cd "${srcdir}/feedparser-${pkgver}-sgmllib" install -Dm644 feedparser/sgmllib3.py \ "${pkgdir}/usr/lib/python3.4/site-packages/sgmllib.py" install -Dm644 feedparser/__pycache__/sgmllib3.cpython-34.pyc \ "${pkgdir}/usr/lib/python3.4/site-packages/__pycache__/sgmllib.cpython-34.pyc" }