python/feedparser: Added python3 support

Signed-off-by: Christoph Willing <chris.willing@linux.com>
This commit is contained in:
Christoph Willing 2019-06-26 17:12:43 +10:00 committed by Willy Sudiarto Raharjo
parent 6f309be790
commit a77e44b2cc
No known key found for this signature in database
GPG key ID: 887B8374D7333381
4 changed files with 42 additions and 4 deletions

View file

@ -0,0 +1,23 @@
--- setup.py.orig 2015-07-24 15:00:04.000000000 +1000
+++ setup.py 2019-06-24 21:34:06.883000000 +1000
@@ -35,6 +35,9 @@
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Text Processing :: Markup :: XML',
],
--- feedparser/feedparser.py.orig 2015-07-24 15:00:04.000000000 +1000
+++ feedparser/feedparser.py 2019-06-24 22:15:09.636000000 +1000
@@ -130,6 +130,8 @@
#ACCEPTABLE_URI_SCHEMES = ()
# ---------- required modules (should come with any Python distribution) ----------
+from __future__ import absolute_import, unicode_literals
+
import cgi
import codecs
import copy

View file

@ -1 +1,3 @@
feedparser is a Python utility to parse RSS and Atom feeds.
feedparser is a Python utility library to parse RSS and Atom feeds.
A python3 version is included if python3 is detected at buildtime.

View file

@ -2,7 +2,7 @@
# Slackware build script for feedparser
# Modified by Luis Henrique <lmello.009@gmail.com>
# Maintained 2014-2016 by Christoph Willing <chris.willing@linux.com>
# Maintained 2014-2019 by Christoph Willing <chris.willing@linux.com>
# Copyright 2008-2009 Chess Griffin <chess@chessgriffin.com>
# All rights reserved.
@ -64,7 +64,7 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xf $CWD/$VERSION.tar.gz || tar xf $CWD/$PRGNAM-$VERSION.tar.gz
tar xf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
@ -75,6 +75,19 @@ find -L . \
python setup.py build
python setup.py install --root $PKG
if $(python3 -c 'import sys' 2>/dev/null); then
# Python3 doesn't have sgmllib so we provide it here for building
# and later installation as part of the feedparser package.
cp feedparser/sgmllib3.py feedparser/sgmllib.py
PYTHONPATH=$(pwd)/feedparser:$PYTHONPATH
patch -p0 < $CWD/001_py37.diff
python3 setup.py build
python3 setup.py install --root $PKG
PYSITEDIR=$(python3 -c "import site; print(site.getsitepackages()[0])")
install -m 0644 feedparser/sgmllib.py $PKG/$PYSITEDIR
fi
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

View file

@ -1,7 +1,7 @@
PRGNAM="feedparser"
VERSION="5.2.1"
HOMEPAGE="https://github.com/kurtmckee/feedparser"
DOWNLOAD="https://github.com/kurtmckee/feedparser/archive/5.2.1.tar.gz"
DOWNLOAD="https://github.com/kurtmckee/feedparser/archive/5.2.1/feedparser-5.2.1.tar.gz"
MD5SUM="885d800496ffd538920960b9dbc45faf"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""