On several systems the prerequisites for compiling PostgreSQL and BDR can be installed using simple commands.
Debian and Ubuntu: First add the apt.postgresql.org repository to your sources.list if you have not already done so. Then install the pre-requisites for building PostgreSQL with:
sudo apt-get update sudo apt-get build-dep postgresql-9.4
RHEL or CentOS 6.x or 7.x: install the appropriate repository RPM for your system from yum.postgresql.org. Then install the prerequisites for building PostgreSQL with:
sudo yum check-update sudo yum groupinstall "Development Tools" sudo yum install yum-utils openjade docbook-dtds docbook-style-dsssl docbook-style-xsl sudo yum-builddep postgresql94
There are two ways to get the BDR source code: with git, or by downloading tarballs of released versions.
Use git if you expect to update often, you want to keep track of development or if you want to contribute changes to BDR. There is no reason not to use git if you're familiar with it.
Instructions for getting the sources can be found at https://www.2ndquadrant.com/en/resources/bdr/.
For more information on using git see git-scm.org.
Official BDR release source code is uploaded as tarballs to the BDR website along with a tarball checksum and a matching GnuPG signature. See http://2ndquadrant.com/bdr for the download information. See Verifying digital signatures for information on verifying digital signatures.
You will need to download both the patched PostgreSQL source (postgresql-bdr-[...].tar.gz) and the associated BDR release (bdr-[...].tar.gz).
You may optionally verify the package checksums from the .md5 files and/or verify the GnuPG signatures per Verifying digital signatures.
After you unpack the source code archives using tar xf the installation process is the same as if you were installing from a git clone.
Installing BDR from source consists out of two steps: First compile and install PostgreSQL with the BDR additions; secondly compile and install the BDR plugin.
The patched PostgreSQL required for BDR can be compiled using the normal documented procedures. That will usually be something like:
cd /path/to/bdr-pg-source/ ./configure --prefix=/path/to/install --enable-debug --with-openssl make -j4 -s install-world
To then install BDR execute its configure script with the pg_config installed by the patched PostgreSQL in the PATH environment variable, e.g.:
cd /path/to/bdr-plugin-source/ PATH=/path/to/postgres/install/bin:"$PATH" ./configure make -j4 -s all make -s install