esac
if [ "$ID" == "centos" ]; then
+ if [[ ! -f "${LIBPQ_BUILD_PREFIX}/openssl.cnf" ]]; then
# Build openssl if needed
openssl_tag="OpenSSL_${openssl_version//./_}"
openssl_dir="openssl-${openssl_tag}"
- if [ ! -d "${openssl_dir}" ]; then curl -sL \
+ if [ ! -d "${openssl_dir}" ]; then
+ curl -fsSL \
https://github.com/openssl/openssl/archive/${openssl_tag}.tar.gz \
| tar xzf -
- cd "${openssl_dir}"
+ pushd "${openssl_dir}"
./config --prefix=${LIBPQ_BUILD_PREFIX} --openssldir=${LIBPQ_BUILD_PREFIX} \
zlib -fPIC shared
make depend
make
else
- cd "${openssl_dir}"
+ pushd "${openssl_dir}"
fi
# Install openssl
make install_sw
- cd ..
+ popd
+ fi
fi
if [ "$ID" == "centos" ]; then
+ if [[ ! -f "${LIBPQ_BUILD_PREFIX}/lib/libsasl2.so" ]]; then
# Build libsasl2 if needed
# The system package (cyrus-sasl-devel) causes an amazing error on i686:
sasl_tag="cyrus-sasl-${sasl_version}"
sasl_dir="cyrus-sasl-${sasl_tag}"
if [ ! -d "${sasl_dir}" ]; then
- curl -sL \
+ curl -fsSL \
https://github.com/cyrusimap/cyrus-sasl/archive/${sasl_tag}.tar.gz \
| tar xzf -
- cd "${sasl_dir}"
+ pushd "${sasl_dir}"
autoreconf -i
./configure --prefix=${LIBPQ_BUILD_PREFIX} \
CPPFLAGS=-I${LIBPQ_BUILD_PREFIX}/include/ LDFLAGS=-L${LIBPQ_BUILD_PREFIX}/lib
make
else
- cd "${sasl_dir}"
+ pushd "${sasl_dir}"
fi
# Install libsasl2
# requires missing nroff to build
touch saslauthd/saslauthd.8
make install
- cd ..
+ popd
+ fi
fi
if [ "$ID" == "centos" ]; then
+ if [[ ! -f "${LIBPQ_BUILD_PREFIX}/lib/libldap.so" ]]; then
# Build openldap if needed
ldap_tag="${ldap_version}"
ldap_dir="openldap-${ldap_tag}"
if [ ! -d "${ldap_dir}" ]; then
- curl -sL \
+ curl -fsSL \
https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-${ldap_tag}.tgz \
| tar xzf -
- cd "${ldap_dir}"
+ pushd "${ldap_dir}"
./configure --prefix=${LIBPQ_BUILD_PREFIX} --enable-backends=no --enable-null \
CPPFLAGS=-I${LIBPQ_BUILD_PREFIX}/include/ LDFLAGS=-L${LIBPQ_BUILD_PREFIX}/lib
make -C libraries/liblber/
make -C libraries/libldap/
else
- cd "${ldap_dir}"
+ pushd "${ldap_dir}"
fi
# Install openldap
make -C libraries/libldap/ install
make -C include/ install
chmod +x ${LIBPQ_BUILD_PREFIX}/lib/{libldap,liblber}*.so*
- cd ..
+ popd
+ fi
fi
postgres_tag="REL_${postgres_version//./_}"
postgres_dir="postgres-${postgres_tag}"
if [ ! -d "${postgres_dir}" ]; then
- curl -sL \
+ curl -fsSL \
https://github.com/postgres/postgres/archive/${postgres_tag}.tar.gz \
| tar xzf -
- cd "${postgres_dir}"
+ pushd "${postgres_dir}"
# Match the default unix socket dir default with what defined on Ubuntu and
# Red Hat, which seems the most common location
make -C src/bin/pg_config
make -C src/include
else
- cd "${postgres_dir}"
+ pushd "${postgres_dir}"
fi
# Install libpq
make -C src/interfaces/libpq install
make -C src/bin/pg_config install
make -C src/include install
-cd ..
+popd
find ${LIBPQ_BUILD_PREFIX} -name \*.so.\* -type f -exec strip --strip-unneeded {} \;