aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Sudiarto Raharjo <willysr@slackbuilds.org>2019-11-24 08:56:55 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2020-01-26 07:28:16 +0700
commit73d7a5df7bfac851659257eb8d8e693c63e2570e (patch)
tree86564ea33e9845a6477812474fc1b24a8dbe183a
parent3d082f8ed04d7abcdf744fc91b0857b647a7043b (diff)
downloadtemplates-73d7a5df7bfac851659257eb8d8e693c63e2570e.tar.xz
python-template: Add python3 support.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--python-template.SlackBuild9
1 files changed, 7 insertions, 2 deletions
diff --git a/python-template.SlackBuild b/python-template.SlackBuild
index 0472cd6..1381382 100644
--- a/python-template.SlackBuild
+++ b/python-template.SlackBuild
@@ -97,15 +97,20 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-# Your application may need different options; this is only an example
+# Your application may need different options; this is only an example
python setup.py install --root=$PKG
+# Python 3 support.
+if $(python3 -c 'import sys' 2>/dev/null); then
+ python3 setup.py install --root=$PKG
+fi
+
# Strip binaries and libraries.
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
# Compress man pages
-# If the man pages are installed to /usr/share/man instead, you'll need to
+# If the man pages are installed to /usr/share/man instead, you'll need to
# move them manually.
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done