From 5903ee899fc79696fad4552c51971545e7bc12a6 Mon Sep 17 00:00:00 2001 From: Audrius Kažukauskas Date: Sun, 13 Apr 2014 22:46:28 +0700 Subject: python/python3: Install pip and setuptools. Signed-off-by: Willy Sudiarto Raharjo --- python/python3/python3.SlackBuild | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'python/python3/python3.SlackBuild') diff --git a/python/python3/python3.SlackBuild b/python/python3/python3.SlackBuild index 09de0ae176..536568c23d 100644 --- a/python/python3/python3.SlackBuild +++ b/python/python3/python3.SlackBuild @@ -24,7 +24,7 @@ PRGNAM=python3 VERSION=${VERSION:-3.4.0} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -80,6 +80,10 @@ fi # Fix python3 path in cgi.py. sed -i '1s|^#.*/usr/local/bin/python|#!/usr/bin/python3|' Lib/cgi.py +# Isolate ensurepip from site-packages, otherwise pip won't be installed if +# there's Python3 on this system with pip already in site-packages. +sed -i 's/-m ensurepip/-Sm ensurepip/' Makefile.pre.in + chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -100,31 +104,25 @@ find -L . \ --build=$ARCH-slackware-linux make -make altinstall DESTDIR=$PKG - -# Create a few useful symlinks. -( cd $PKG/usr/bin - ln -sf python${PYVER} python3 - ln -sf python${PYVER}*-config python3-config - ln -sf pydoc${PYVER} pydoc3 - ln -sf pyvenv-${PYVER} pyvenv - ln -sf idle${PYVER} idle3 - cd $PKG/usr/man/man1 - ln -sf python${PYVER}.1 python3.1 -) +make install DESTDIR=$PKG + +# Remove to avoid overwriting a copy from Python2. +rm -f $PKG/usr/bin/2to3 # We'll install the python-tools under site-packages: mkdir -p $SITEPK cp -a Tools/* $SITEPK +rm -f $SITEPK/setuptools/*.exe + # Install docs: -mkdir -p $PKG/usr/doc/python3-$VERSION -cp -a README LICENSE Misc $PKG/usr/doc/python3-$VERSION -mv $SITEPK/README $PKG/usr/doc/python3-$VERSION/README.python-tools -( cd $PKG/usr/doc/python3-$VERSION ; ln -sf $TOOLSDIR Tools ) +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a README LICENSE Misc $PKG/usr/doc/$PRGNAM-$VERSION +mv $SITEPK/README $PKG/usr/doc/$PRGNAM-$VERSION/README.python-tools +( cd $PKG/usr/doc/$PRGNAM-$VERSION ; ln -sf $TOOLSDIR Tools ) tar xf $CWD/python-$VERSION-docs-html.tar.bz2 -mv python-$VERSION-docs-html $PKG/usr/doc/python3-$VERSION/html -chown -R root:root $PKG/usr/doc/python3-$VERSION +mv python-$VERSION-docs-html $PKG/usr/doc/$PRGNAM-$VERSION/html +chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION find $PKG | xargs 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