2010-05-11 22:54:24 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2014-12-31 09:49:04 +01:00
|
|
|
# Slackware build script for PyUSB
|
|
|
|
|
2021-01-02 07:20:15 +01:00
|
|
|
# Copyright 2014-2021 Kyle Guinn <elyk03@gmail.com>
|
2014-12-31 09:49:04 +01:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use of this script, with or without modification, is
|
|
|
|
# permitted provided that the following conditions are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of this script must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
|
|
|
|
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
|
|
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
|
|
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
|
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
2010-05-11 22:54:24 +02:00
|
|
|
|
|
|
|
PRGNAM=pyusb
|
2021-01-23 07:12:28 +01:00
|
|
|
VERSION=${VERSION:-1.1.1}
|
2021-01-02 07:20:15 +01:00
|
|
|
BUILD=${BUILD:-1}
|
2010-05-11 22:54:24 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 07:10:18 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
2014-12-31 09:49:04 +01:00
|
|
|
case "$(uname -m)" in
|
2017-12-13 07:16:53 +01:00
|
|
|
i?86) ARCH=i586 ;;
|
2010-06-04 07:10:18 +02:00
|
|
|
arm*) ARCH=arm ;;
|
2014-12-31 09:49:04 +01:00
|
|
|
*) ARCH=$(uname -m) ;;
|
2010-06-04 07:10:18 +02:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-11 22:54:24 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM-$VERSION
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2017-12-13 07:16:53 +01:00
|
|
|
DOCS="ACKNOWLEDGEMENTS LICENSE README.rst docs/faq.rst docs/tutorial.rst"
|
2010-05-11 22:54:24 +02:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
2019-03-10 03:35:55 +01:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
2010-05-11 22:54:24 +02:00
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2014-12-31 09:49:04 +01:00
|
|
|
chmod -R u+w,go-w,a+rX-st .
|
2010-05-11 22:54:24 +02:00
|
|
|
|
2021-01-02 07:20:15 +01:00
|
|
|
# Can't build the git snapshot. Upstream publishes a modified copy
|
|
|
|
# (with version metadata that setup.py needs), see setuptools-scm.
|
2019-03-10 03:35:55 +01:00
|
|
|
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
|
2010-05-11 22:54:24 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 00:33:23 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|