Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
pkg-scripts/system/python-2.7.16-0.build.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
52 lines (38 sloc)
1.1 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# to build system python: | |
# umask 022 | |
# sudo mkdir -p /usr/local/system/python-2.7.16-0 | |
# sudo chown build:build /usr/local/system/python-2.7.16-0 | |
# sudo -u build ./python-2.7.16-0.build.sh 2>&1 | tee python-2.7.16-0.build.log | |
# sudo chown -R bin:bin /usr/local/system/python-2.7.16-0 | |
PKG=python | |
VERSION=2.7.16 | |
BUILD=0 | |
URL=https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz | |
PREFIX=/usr/local/system/$PKG-$VERSION-$BUILD | |
set -xe | |
umask 022 | |
BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp | |
test -d $BUILD_TMPDIR && rm -rf $BUILD_TMPDIR | |
mkdir -p $BUILD_TMPDIR/home | |
export TMPDIR=$BUILD_TMPDIR | |
export HOME=$BUILD_TMPDIR/home | |
exec </dev/null | |
mkdir -p $PREFIX | |
cat >$PREFIX/profile <<-EOF | |
PATH=$PREFIX/bin:\$PATH | |
EOF | |
. $PREFIX/profile | |
export MAKEFLAGS="-j $(nproc)" | |
BUILDDIR=$PREFIX/build | |
mkdir -p $BUILDDIR | |
cd $BUILDDIR | |
test -e Python-$VERSION.tgz || wget $URL | |
test -d Python-$VERSION || tar xf Python-$VERSION.tgz | |
cd Python-$VERSION | |
./configure --prefix=$PREFIX --enable-shared LDFLAGS=-Wl,-rpath,$PREFIX/lib | |
make | |
make install | |
python -m ensurepip | |
pip install --upgrade pip | |
exit |