summaryrefslogtreecommitdiffstats
path: root/python/pycld2/pycld2.SlackBuild
diff options
context:
space:
mode:
author Benjamin Trigona-Harany <bosth@alumni.sfu.ca>2018-03-16 11:06:12 -0700
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2018-03-17 08:51:43 +0700
commitf4969d0692db7f50b5d7c0069f042f8cda4097be (patch)
treed6e08bcd498a87c0f17c88f013c132c87dc3ede1 /python/pycld2/pycld2.SlackBuild
parentcdedb068939b53e61b66b08a0b5949cd24b9ce15 (diff)
downloadslackbuilds-f4969d0692db7f50b5d7c0069f042f8cda4097be.tar.gz
slackbuilds-f4969d0692db7f50b5d7c0069f042f8cda4097be.tar.xz
python/pycld2: Add Python 3 support.
Diffstat (limited to 'python/pycld2/pycld2.SlackBuild')
-rw-r--r--python/pycld2/pycld2.SlackBuild12
1 files changed, 8 insertions, 4 deletions
diff --git a/python/pycld2/pycld2.SlackBuild b/python/pycld2/pycld2.SlackBuild
index b000cc9b40..96de1bb340 100644
--- a/python/pycld2/pycld2.SlackBuild
+++ b/python/pycld2/pycld2.SlackBuild
@@ -33,7 +33,7 @@ TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) ARCH=i486 ;;
+ i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
@@ -50,14 +50,18 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $SRCNAM-$SRCREV
-tar xvf $CWD/$SRCNAM-$SRCREV.tar.gz || tar xvf $CWD/$SRCREV.tar.gz
+tar xvf $CWD/$SRCNAM-$SRCREV.tar.gz
cd $SRCNAM-$SRCREV
# Fix location of header files
sed -i "s/^CLD2_PATH.*$/CLD2_PATH = \'\/usr\/include\/cld2\'/" setup*.py
-/usr/bin/python setup.py install --prefix=/usr --root=$PKG
-/usr/bin/python setup_full.py install --prefix=/usr --root=$PKG
+python setup.py install --prefix=/usr --root=$PKG
+python setup_full.py install --prefix=/usr --root=$PKG
+if $(python3 -c 'import sys' 2>/dev/null); then
+ python3 setup.py install --prefix=/usr --root=$PKG
+ python3 setup_full.py install --prefix=/usr --root=$PKG
+fi
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a README $PKG/usr/doc/$PRGNAM-$VERSION