summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAudrius Kažukauskas <audrius@neutrino.lt>2017-01-07 19:48:57 +0200
committerAudrius Kažukauskas <audrius@neutrino.lt>2017-01-07 19:48:57 +0200
commit59eef3f660c6b2038fe196035f7f0edd14d4e30e (patch)
treee8f7bacbf2aa14cf12ea7d30761f3715101e9026 /python
parentd8f7205827f7706a228be67b57d6d7e8bab4afd0 (diff)
downloadslackbuilds-59eef3f660c6b2038fe196035f7f0edd14d4e30e.tar.gz
python/python3: Fix incorrect permissions.
Signed-off-by: Audrius Kažukauskas <audrius@neutrino.lt>
Diffstat (limited to 'python')
-rw-r--r--python/python3/python3.SlackBuild30
1 files changed, 18 insertions, 12 deletions
diff --git a/python/python3/python3.SlackBuild b/python/python3/python3.SlackBuild
index faa3cfa2e1..62f93e34a2 100644
--- a/python/python3/python3.SlackBuild
+++ b/python/python3/python3.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for python3
-# Copyright 2012-2016 Audrius Kažukauskas <audrius@neutrino.lt>
+# Copyright 2012-2017 Audrius Kažukauskas <audrius@neutrino.lt>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,8 +23,10 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=python3
+SRCNAM=Python
VERSION=${VERSION:-3.6.0}
-BUILD=${BUILD:-2}
+BRANCH_VERSION=$(echo $VERSION | cut -f 1,2 -d . )
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -52,28 +54,25 @@ else
LIBDIRSUFFIX=""
fi
-PYVER=$(cut -d. -f1,2 <<< "$VERSION")
-
set -eu
# Location for Python site-packages.
-SITEPK=$PKG/usr/lib${LIBDIRSUFFIX}/python${PYVER}/site-packages
+SITEPK=$PKG/usr/lib${LIBDIRSUFFIX}/python${BRANCH_VERSION}/site-packages
# Same as above without $PKG.
-TOOLSDIR=/usr/lib${LIBDIRSUFFIX}/python${PYVER}/site-packages
+TOOLSDIR=/usr/lib${LIBDIRSUFFIX}/python${BRANCH_VERSION}/site-packages
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf Python-$VERSION
-tar xvf $CWD/Python-$VERSION.tar.xz
-cd Python-$VERSION
+rm -rf $SRCNAM-$VERSION
+tar xvf $CWD/$SRCNAM-$VERSION.tar.xz
+cd $SRCNAM-$VERSION
patch -p1 -i $CWD/patches/python3.readline.set_pre_input_hook.diff
# We don't want a large libpython*.a.
patch -p1 -i $CWD/patches/python3.no-static-library.diff
-# patch for comment style
-# fix build on pygobject3-python3
+# Change comment style from C++ to C, which fixes building pygobject3-python3.
patch -p1 -i $CWD/patches/python3.fix-comment-style.patch
if [ "$ARCH" = "x86_64" ]; then
@@ -112,7 +111,7 @@ make install DESTDIR=$PKG
# Restore original ensurepip behaviour.
sed -i 's| "--ignore-installed",||' \
- $PKG/usr/lib${LIBDIRSUFFIX}/python${PYVER}/ensurepip/__init__.py
+ $PKG/usr/lib${LIBDIRSUFFIX}/python${BRANCH_VERSION}/ensurepip/__init__.py
# Remove to avoid overwriting a copy from Python2.
rm -f $PKG/usr/bin/2to3
@@ -138,6 +137,13 @@ if [ -e "$CWD/python-$VERSION-docs-html.tar.bz2" ]; then
chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION/html
fi
+# Fix possible incorrect permissions.
+( cd $PKG
+ find . -type d -exec chmod 755 "{}" \;
+ find . -perm 640 -exec chmod 644 "{}" \;
+ find . -perm 750 -exec chmod 755 "{}" \;
+)
+
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