python/python3: Fix incorrect permissions.

Signed-off-by: Audrius Kažukauskas <audrius@neutrino.lt>
This commit is contained in:
Audrius Kažukauskas 2017-01-07 19:48:57 +02:00
parent d8f7205827
commit 59eef3f660

View file

@ -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