From d7f60ae945d81ac8f0a8799b77d0337a11586887 Mon Sep 17 00:00:00 2001 From: Aditya Date: Thu, 12 Jan 2023 14:30:17 +0530 Subject: [PATCH] Add 8.50 - Build python --- scripts/chapter8/8.50-python.sh | 42 +++++++++++++++++++++++++++++++++ scripts/main.sh | 11 +++++++++ 2 files changed, 53 insertions(+) create mode 100644 scripts/chapter8/8.50-python.sh diff --git a/scripts/chapter8/8.50-python.sh b/scripts/chapter8/8.50-python.sh new file mode 100644 index 0000000..b98ad91 --- /dev/null +++ b/scripts/chapter8/8.50-python.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +cd /sources +tar xf Python-3.10.6.tar.xz +cd Python-3.10.6 + +./configure --prefix=/usr \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + --enable-optimizations + +if [ $? -ne 0 ] +then + exit 1 +fi + +make -j5 + +if [ $? -ne 0 ] +then + exit 1 +fi + +make install + +cat > /etc/pip.conf << EOF +[global] +root-user-action = ignore +disable-pip-version-check = true +EOF + +install -v -dm755 /usr/share/doc/python-3.10.6/html + +tar --strip-components=1 \ + --no-same-owner \ + --no-same-permissions \ + -C /usr/share/doc/python-3.10.6/html \ + -xvf ../python-3.10.6-docs-html.tar.bz2 + +cd /sources +rm -rf Python-3.10.6 diff --git a/scripts/main.sh b/scripts/main.sh index 0033146..2b3a28d 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -1139,3 +1139,14 @@ then stop_script "chapter8/8.49-libffi.sh" fi +# Chapter 8.50 +echo "Building Python" +su -c "bash $SCRIPT/chapter8/8.50-python.sh" + +# Exit on error +check_exit_code +if [ $exit_status -ne 0 ] +then + stop_script "chapter8/8.50-python.sh" +fi +