diff options
Diffstat (limited to 'python/pyusb/pyusb.SlackBuild')
-rw-r--r-- | python/pyusb/pyusb.SlackBuild | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/python/pyusb/pyusb.SlackBuild b/python/pyusb/pyusb.SlackBuild index e8a591e571..2b51a49d86 100644 --- a/python/pyusb/pyusb.SlackBuild +++ b/python/pyusb/pyusb.SlackBuild @@ -1,8 +1,8 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for PyUSB -# Copyright 2014-2019 Kyle Guinn <elyk03@gmail.com> +# Copyright 2014-2021 Kyle Guinn <elyk03@gmail.com> # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -22,10 +22,13 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=pyusb -VERSION=${VERSION:-1.0.2} -BUILD=${BUILD:-2} +VERSION=${VERSION:-1.2.1} +BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$(uname -m)" in @@ -35,9 +38,16 @@ if [ -z "$ARCH" ]; then esac fi -CWD=$(pwd) +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + TMP=${TMP:-/tmp/SBo} -PKG=$TMP/package-$PRGNAM-$VERSION +PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} DOCS="ACKNOWLEDGEMENTS LICENSE README.rst docs/faq.rst docs/tutorial.rst" @@ -53,11 +63,11 @@ cd $PRGNAM-$VERSION chown -R root:root . chmod -R u+w,go-w,a+rX-st . -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 +# Can't build the git snapshot. Upstream publishes a modified copy +# (with version metadata that setup.py needs), see setuptools-scm. +python2 setup.py install --root=$PKG +rm -rf build +python3 setup.py install --root=$PKG mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION @@ -67,4 +77,4 @@ mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |