summaryrefslogtreecommitdiffstats
path: root/python/python-mysqlclient/python-mysqlclient.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'python/python-mysqlclient/python-mysqlclient.SlackBuild')
-rw-r--r--python/python-mysqlclient/python-mysqlclient.SlackBuild26
1 files changed, 16 insertions, 10 deletions
diff --git a/python/python-mysqlclient/python-mysqlclient.SlackBuild b/python/python-mysqlclient/python-mysqlclient.SlackBuild
index 748bd20645..d6552ee2ef 100644
--- a/python/python-mysqlclient/python-mysqlclient.SlackBuild
+++ b/python/python-mysqlclient/python-mysqlclient.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for python-mysqlclient
@@ -22,12 +22,15 @@
# 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=python-mysqlclient
VERSION=${VERSION:-1.3.13}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
-SRCNAM=mysqlclient-python
+SRCNAM=mysqlclient
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -37,7 +40,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}
@@ -72,11 +82,7 @@ find -L . \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
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
+python3 setup.py install --root=$PKG
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a doc/ HISTORY.rst INSTALL.rst LICENSE README.md \
@@ -87,4 +93,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