aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Willing <chris.willing@linux.com>2019-06-26 17:12:43 +1000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2019-06-29 08:17:48 +0700
commita77e44b2ccd6aea42ec48a1e5f0196375d4bb690 (patch)
tree3d7fffcd59e0bc3950b9cb097dc373c71538887c
parent6f309be790ab3a703370e092fb760fdf3ee897da (diff)
python/feedparser: Added python3 support
Signed-off-by: Christoph Willing <chris.willing@linux.com>
-rw-r--r--python/feedparser/001_py37.diff23
-rw-r--r--python/feedparser/README4
-rw-r--r--python/feedparser/feedparser.SlackBuild17
-rw-r--r--python/feedparser/feedparser.info2
4 files changed, 42 insertions, 4 deletions
diff --git a/python/feedparser/001_py37.diff b/python/feedparser/001_py37.diff
new file mode 100644
index 000000000000..5182a5b2b8c8
--- /dev/null
+++ b/python/feedparser/001_py37.diff
@@ -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
diff --git a/python/feedparser/README b/python/feedparser/README
index 1d9eefaa3801..dc062ac5d695 100644
--- a/python/feedparser/README
+++ b/python/feedparser/README
@@ -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.
diff --git a/python/feedparser/feedparser.SlackBuild b/python/feedparser/feedparser.SlackBuild
index 8f657c6a38ac..3231c591958b 100644
--- a/python/feedparser/feedparser.SlackBuild
+++ b/python/feedparser/feedparser.SlackBuild
@@ -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
diff --git a/python/feedparser/feedparser.info b/python/feedparser/feedparser.info
index 7ba4b29c8991..fe8c8895d9f5 100644
--- a/python/feedparser/feedparser.info
+++ b/python/feedparser/feedparser.info
@@ -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=""