aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorKyle Guinn <elyk03@gmail.com>2019-03-09 20:35:55 -0600
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2019-03-16 06:53:33 +0700
commite48c5df4d7200807fcd01ffbc5f0cd410cc3bf96 (patch)
tree7f33ac160f807032a84bf771312d8dfc913aecc8 /python
parentddca1e03e00010e98716e677256f8c07570e1238 (diff)
python/pyusb: Add optional python3 support.
Signed-off-by: Kyle Guinn <elyk03@gmail.com>
Diffstat (limited to 'python')
-rw-r--r--python/pyusb/pyusb.SlackBuild12
1 files changed, 8 insertions, 4 deletions
diff --git a/python/pyusb/pyusb.SlackBuild b/python/pyusb/pyusb.SlackBuild
index 0ee6f6c24b27d..e8a591e57102e 100644
--- a/python/pyusb/pyusb.SlackBuild
+++ b/python/pyusb/pyusb.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for PyUSB
-# Copyright 2014-2017 Kyle Guinn <elyk03@gmail.com>, USA
+# Copyright 2014-2019 Kyle Guinn <elyk03@gmail.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -24,7 +24,7 @@
PRGNAM=pyusb
VERSION=${VERSION:-1.0.2}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -48,12 +48,16 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar -xzvf $CWD/$PRGNAM-$VERSION.tar.gz
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R u+w,go-w,a+rX-st .
-python ./setup.py install --root=$PKG
+python2 ./setup.py install --root=$PKG
+if python3 -c 'import sys' 2>/dev/null; then
+ rm -rf build
+ python3 ./setup.py install --root=$PKG
+fi
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION