lfs-buildscripts/CH8Build/CH08.50-python.sh

61 lines
1.2 KiB
Bash
Raw Normal View History

2024-10-06 17:01:29 +08:00
#!/bin/bash
source versions.sh
GLSOURCES="/sources"
2024-10-09 09:50:04 +08:00
pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
2024-10-06 17:01:29 +08:00
[ -d Python-${python_version} ] && rm -rf Python-${python_version}
tar -Jxf ${python_tarball}
cd Python-${python_version}
2024-10-08 02:17:47 +08:00
LDFLAGS="${LDFLAGS} -Wl,-rpath=/opt/openssl/lib" \
2024-10-06 17:01:29 +08:00
./configure --prefix=/usr \
--enable-shared \
2024-10-08 02:17:47 +08:00
--with-openssl=/opt/openssl \
2024-10-06 17:01:29 +08:00
--with-system-expat \
--enable-optimizations
make
if [ $? -ne 0 ]; then
myfail "Failed building Python"
fi
2024-10-09 09:50:04 +08:00
if [ ! -f ${GLSOURCES}/SKIPTESTS ]; then
echo "running Python make test. Could be time consuming."
make test TESTOPTS="--timeout 120" > ${GLSOURCES}/python.check.log 2>&1
fi
2024-10-06 17:01:29 +08:00
make install
if [ $? -ne 0 ]; then
myfail "Failed installing Python"
fi
# this will not be used for RPM packaging
cat > /etc/pip.conf << EOF
[global]
root-user-action = ignore
disable-pip-version-check = true
EOF
install -dm755 /usr/share/doc/python-${python_version}/html
tar --no-same-owner \
-xvf ../python-${python_version}-docs-html.tar.bz2
cp -R --no-preserve=mode python-${python_version}-docs-html/* \
/usr/share/doc/python-${python_version}/html
2024-10-08 14:25:15 +08:00
popd
# cleanup
pushd $GLSOURCES
rm -rf Python-${python_version}
popd