From 59eef3f660c6b2038fe196035f7f0edd14d4e30e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Audrius=20Ka=C5=BEukauskas?= Date: Sat, 7 Jan 2017 19:48:57 +0200 Subject: python/python3: Fix incorrect permissions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Audrius Kažukauskas --- python/python3/python3.SlackBuild | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'python/python3/python3.SlackBuild') 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 +# Copyright 2012-2017 Audrius Kažukauskas # 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 -- cgit v1.2.3