Merge back manylinux build script from the psycopg2-wheels project

This commit is contained in:
Daniele Varrazzo 2017-02-01 17:05:47 +00:00
parent 8341792c5b
commit 815869375b

View File

@ -4,8 +4,8 @@
#
# Run this script with something like:
#
# docker run -t --rm -v `pwd`:/psycopg quay.io/pypa/manylinux1_x86_64 /psycopg/scripts/wheels-build.sh
# docker run -t --rm -v `pwd`:/psycopg quay.io/pypa/manylinux1_i686 linux32 /psycopg/scripts/wheels-build.sh
# docker run -t --rm -v `pwd`:/psycopg2 quay.io/pypa/manylinux1_x86_64 /psycopg2/scripts/build-manylinux.sh
# docker run -t --rm -v `pwd`:/psycopg2 quay.io/pypa/manylinux1_i686 linux32 /psycopg2/scripts/build-manylinux.sh
#
# (Note: -t is requrired for sudo)
@ -15,21 +15,25 @@ set -e -x
# This doesn't work:
# rpm -Uvh "http://yum.postgresql.org/9.5/redhat/rhel-5-x86_64/pgdg-redhat95-9.5-3.noarch.rpm"
wget -O "/tmp/pgdg.rpm" "https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-5-x86_64/pgdg-centos95-9.5-3.noarch.rpm"
rpm -Uvh "/tmp/pgdg.rpm"
rpm -Uv "/tmp/pgdg.rpm"
yum install -y postgresql95-devel postgresql95-server sudo
# Make pg_config available
export PGPATH=/usr/pgsql-9.5/bin/
export PATH="$PGPATH:$PATH"
# Find psycopg version
export VERSION=$(grep -e ^PSYCOPG_VERSION /psycopg2/setup.py | sed "s/.*'\(.*\)'/\1/")
export WHEELSDIR="/psycopg2/wheels/psycopg2-$VERSION"
# Create the wheel packages
for PYBIN in /opt/python/*/bin; do
"${PYBIN}/pip" wheel /psycopg/ -w wheels/
"${PYBIN}/pip" wheel /psycopg2/ -w "$WHEELSDIR"
done
# Bundle external shared libraries into the wheels
for WHL in wheels/*.whl; do
auditwheel repair "$WHL" -w /psycopg/wheels
for WHL in "$WHEELSDIR"/*.whl; do
auditwheel repair "$WHL" -w "$WHEELSDIR"
done
# Create a test cluster
@ -42,6 +46,6 @@ export PSYCOPG2_TESTDB_USER=postgres
# Install packages and test
for PYBIN in /opt/python/*/bin; do
"${PYBIN}/pip" install psycopg2 --no-index -f /psycopg/wheels
"${PYBIN}/pip" install psycopg2 --no-index -f "$WHEELSDIR"
"${PYBIN}/python" -c "from psycopg2 import tests; tests.unittest.main(defaultTest='tests.test_suite')"
done