diff options
Diffstat (limited to 'python/pyrfc3339/pyrfc3339.SlackBuild')
-rw-r--r-- | python/pyrfc3339/pyrfc3339.SlackBuild | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/python/pyrfc3339/pyrfc3339.SlackBuild b/python/pyrfc3339/pyrfc3339.SlackBuild index f3b5be8ba0..31e252b362 100644 --- a/python/pyrfc3339/pyrfc3339.SlackBuild +++ b/python/pyrfc3339/pyrfc3339.SlackBuild @@ -1,8 +1,8 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for pyrfc3339 -# Copyright 2015-2018 Willy Sudiarto Raharjo <willysr@slackbuilds.org> +# Copyright 2015-2020 Willy Sudiarto Raharjo <willysr@slackbuilds.org> # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -22,11 +22,14 @@ # 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=pyrfc3339 SRCNAM=pyRFC3339 VERSION=${VERSION:-1.1} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -36,7 +39,14 @@ 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 OUTPUT=${OUTPUT:-/tmp} @@ -55,7 +65,7 @@ else LIBDIRSUFFIX="" fi -set -e +set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT @@ -72,6 +82,11 @@ find -L . \ 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 + 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 @@ -83,4 +98,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 |