summaryrefslogtreecommitdiffstats
path: root/python-psutil
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2021-03-02 12:43:47 +0000
committer Eric Hameleers <alien@slackware.com>2021-03-02 12:43:47 +0000
commitd8598a498c3936619e280bd24080f292033965ad (patch)
tree0fe456cd906c08088c6bebaf10ac33b2c6bf95a6 /python-psutil
parent37a41fa1768538b04309b96d64c0f6c82c2d392b (diff)
downloadasb-d8598a498c3936619e280bd24080f292033965ad.tar.gz
asb-d8598a498c3936619e280bd24080f292033965ad.tar.xz
python-psuti: update to 5.6.7 adding python3 support
Diffstat (limited to 'python-psutil')
-rwxr-xr-xpython-psutil/build/python-psutil.SlackBuild48
1 files changed, 26 insertions, 22 deletions
diff --git a/python-psutil/build/python-psutil.SlackBuild b/python-psutil/build/python-psutil.SlackBuild
index 987c9794..55b09316 100755
--- a/python-psutil/build/python-psutil.SlackBuild
+++ b/python-psutil/build/python-psutil.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
# $Id$
-# Copyright 2012 Eric Hameleers, Eindhoven, NL
+# Copyright 2012, 2021 Eric Hameleers, Eindhoven, NL
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for
@@ -26,15 +26,17 @@
# ===========================
# By: Eric Hameleers <alien@slackware.com>
# For: python-psutil
-# Descr: cross-platform process and system utilities module for
-# URL: http://code.google.com/p/psutil/
+# Descr: python interface to process and system info
+# URL: https://github.com/giampaolo/psutil
# Needs:
# Changelog:
-# 0.6.1-1: 20/Oct/2012 by Eric Hameleers <alien@slackware.com>
+# 0.6.1-1: 20/oct/2012 by Eric Hameleers <alien@slackware.com>
# * Initial build.
+# 5.6.7-1: 02/mar/2021 by Eric Hameleers <alien@slackware.com>
+# * Update with python3 support.
#
# Run 'sh python-psutil.SlackBuild' to build a Slackware package.
-# The package (.tgz) and .txt file as well as build logs are created in /tmp .
+# The package (.txz) and .txt file as well as build logs are created in /tmp .
# Install it using 'installpkg'.
#
# -----------------------------------------------------------------------------
@@ -43,12 +45,12 @@
PRGNAM=python-psutil
SRCNAM=psutil
-VERSION=${VERSION:-0.6.1}
+VERSION=${VERSION:-5.6.7}
BUILD=${BUILD:-1}
-NUMJOBS=${NUMJOBS:" -j4 "}
+NUMJOBS=${NUMJOBS:-" -j$(nproc) "}
TAG=${TAG:-alien}
-DOCS="CREDITS HISTORY INSTALL LICENSE PKG-INFO README"
+DOCS="CREDITS HISTORY* INSTALL* LICENSE PKG-INFO README*"
# Where do we look for sources?
SRCDIR=$(cd $(dirname $0); pwd)
@@ -59,24 +61,21 @@ PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
SOURCE="$SRCDIR/${SRCNAM}-${VERSION}.tar.gz"
-SRCURL="http://psutil.googlecode.com/files/${SRCNAM}-${VERSION}.tar.gz"
+SRCURL="https://pypi.io/packages/source/p/${SRCNAM}/${SRCNAM}-${VERSION}.tar.gz"
##
## --- with a little luck, you won't have to edit below this point --- ##
##
# Automatically determine the architecture we're building on:
-MARCH=$( uname -m )
if [ -z "$ARCH" ]; then
- case "$MARCH" in
- i?86) export ARCH=i486 ;;
- armv7hl) export ARCH=$MARCH ;;
- armv6hl) export ARCH=$MARCH ;;
- armv5hl) export ARCH=$MARCH ;;
- arm*) export ARCH=arm ;;
+ case "$(uname -m)" in
+ i?86) ARCH=i586 ;;
+ arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;;
# Unless $ARCH is already set, use uname -m for all other archs:
- *) export ARCH=$MARCH ;;
+ *) ARCH=$(uname -m) ;;
esac
+ export ARCH
fi
# Exit the script on errors:
@@ -138,7 +137,14 @@ chown -R root:root .
chmod -R u+w,go+r-w,a+X-s .
echo Building ...
-python setup.py install --root=$PKG 2>&1 | tee $OUTPUT/install-$PRGNAM.log
+# Python2 support:
+if $(python2 -c 'import sys' 2>/dev/null); then
+ python2 setup.py install --root=$PKG 2>&1 | tee $OUTPUT/install-${PRGNAM}_python2.log
+fi
+# Python3 support:
+if $(python3 -c 'import sys' 2>/dev/null); then
+ python3 setup.py install --root=$PKG 2>&1 | tee $OUTPUT/install-${PRGNAM}_python3.log
+fi
# Add documentation:
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
@@ -160,16 +166,14 @@ find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
# Add a package description:
mkdir -p $PKG/install
cat $SRCDIR/slack-desc > $PKG/install/slack-desc
-#cat $SRCDIR/slack-required > $PKG/install/slack-required
# Build the package:
cd $PKG
-makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-tgz} 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
+makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-txz} 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
cd $OUTPUT
-md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-tgz} > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-tgz}.md5
+md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-txz} > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-txz}.md5
cd -
cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txt
-#cat $PKG/install/slack-required > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.dep
# Restore the original umask:
umask ${_UMASK_}