summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
author Alan Aversa <alan_avNOersa@lSPAMavabit.com>2020-05-15 23:57:25 +0700
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2020-05-15 23:57:25 +0700
commit8cf98da01d210e5ad84b137f1cbfc5de025f4d78 (patch)
tree5495e9215750dbe3e10d5320f0e0874d29e5d541 /python
parent9cbe2b356e18afc7a14882ba99638553127d23fe (diff)
downloadslackbuilds-8cf98da01d210e5ad84b137f1cbfc5de025f4d78.tar.gz
slackbuilds-8cf98da01d210e5ad84b137f1cbfc5de025f4d78.tar.xz
python/contextlib2: Added (Context management).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'python')
-rw-r--r--python/contextlib2/README15
-rw-r--r--python/contextlib2/contextlib2.SlackBuild87
-rw-r--r--python/contextlib2/contextlib2.info10
-rw-r--r--python/contextlib2/slack-desc19
4 files changed, 131 insertions, 0 deletions
diff --git a/python/contextlib2/README b/python/contextlib2/README
new file mode 100644
index 0000000000..290f12e994
--- /dev/null
+++ b/python/contextlib2/README
@@ -0,0 +1,15 @@
+contextlib2 is a backport of the standard library’s contextlib module to
+earlier Python versions.
+
+It also serves as a real world proving ground for possible future
+enhancements to the standard library version.
+
+Development
+
+contextlib2 has no runtime dependencies, but requires unittest2 for
+testing on Python 2.x, as well as setuptools and wheel to generate
+universal wheel archives.
+
+Local testing is just a matter of running python test_contextlib2.py.
+
+Python3 is an optional dependency.
diff --git a/python/contextlib2/contextlib2.SlackBuild b/python/contextlib2/contextlib2.SlackBuild
new file mode 100644
index 0000000000..1980b0d9f8
--- /dev/null
+++ b/python/contextlib2/contextlib2.SlackBuild
@@ -0,0 +1,87 @@
+#!/bin/sh
+
+# Slackware build script for contextlib2
+
+# Copyright 2020 Alan Aversa
+# 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.
+
+PRGNAM=contextlib2
+VERSION=${VERSION:-0.6.0.post1}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+if $(python3 -c 'import sys' 2>/dev/null); then
+ python3 setup.py install --root=$PKG
+else
+ python 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
+
+mkdir -p $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
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/python/contextlib2/contextlib2.info b/python/contextlib2/contextlib2.info
new file mode 100644
index 0000000000..d19a47613e
--- /dev/null
+++ b/python/contextlib2/contextlib2.info
@@ -0,0 +1,10 @@
+PRGNAM="contextlib2"
+VERSION="0.6.0.post1"
+HOMEPAGE="https://pypi.org/project/contextlib2/"
+DOWNLOAD="https://files.pythonhosted.org/packages/02/54/669207eb72e3d8ae8b38aa1f0703ee87a0e9f88f30d3c0a47bebdb6de242/contextlib2-0.6.0.post1.tar.gz"
+MD5SUM="d634281c2e61e575d8a68b9c56f8303a"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Alan Aversa"
+EMAIL="alan_avNOersa@lSPAMavabit.com"
diff --git a/python/contextlib2/slack-desc b/python/contextlib2/slack-desc
new file mode 100644
index 0000000000..2a1f672d06
--- /dev/null
+++ b/python/contextlib2/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+contextlib2: contextlib2 (Updated utilities for context management)
+contextlib2:
+contextlib2: This module provides backports of features in the latest version of
+contextlib2: the standard library’s contextlib module to earlier Python versions.
+contextlib2: It also serves as a real world proving ground for potential future
+contextlib2: enhancements to that module.
+contextlib2:
+contextlib2: Like contextlib, this module provides utilities for common tasks
+contextlib2: involving the with statement.
+contextlib2:
+contextlib2: https://contextlib2.readthedocs.io