From 815869375b6346add3b76d74dab2e8e177c0e0d0 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Wed, 1 Feb 2017 17:05:47 +0000 Subject: [PATCH] Merge back manylinux build script from the psycopg2-wheels project --- .../{wheels-build.sh => build-manylinux.sh} | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) rename scripts/{wheels-build.sh => build-manylinux.sh} (66%) diff --git a/scripts/wheels-build.sh b/scripts/build-manylinux.sh similarity index 66% rename from scripts/wheels-build.sh rename to scripts/build-manylinux.sh index ede3024b..4ceb1330 100755 --- a/scripts/wheels-build.sh +++ b/scripts/build-manylinux.sh @@ -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