Created
September 6, 2016 14:14
-
-
Save shanna/9f97a6792c455fb4bfc298e13cc270b8 to your computer and use it in GitHub Desktop.
Postgres install from source on OSX when homebrew won't give you a specific version.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
# Homebrew homebrew/versions was broken when I went to install postgres. | |
# This shell script just documents my install from source. | |
release=9.4.6 | |
prefix=$HOME/local | |
mkdir -p $prefix | |
cd $prefix | |
curl -# https://ftp.postgresql.org/pub/source/v${release}/postgresql-${release}.tar.gz | tar -zxvf - | |
cd postgresql-$release | |
# If this fails you may need to install openssl with homebrew. | |
CFLAGS='-arch x86_64 -I/usr/local/opt/openssl/include' LDFLAGS='-arch x86_64 -L/usr/local/opt/openssl/lib' ./configure --prefix=$HOME/local/postgresql --with-openssl --with-libs=/usr/local/lib --with-includes=/usr/local/include | |
# postgres | |
make | |
make install | |
# postgres-contrib | |
cd contrib | |
make | |
make install | |
cd $prefix | |
rm -rf postgresql-$release | |
echo "Add ${prefix}/postgresql/bin to \$PATH environment variable." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment