Skip to content

Instantly share code, notes, and snippets.

@langner
Last active June 13, 2017 07:10
Show Gist options
  • Save langner/12a032a8793c2df80f5d to your computer and use it in GitHub Desktop.
Save langner/12a032a8793c2df80f5d to your computer and use it in GitHub Desktop.
Script that builds postgresql-9.1 packages on Ubuntu with increased NAMEDATALEN patch (use with patch https://gist.github.com/langner/5c7bc1d74a8b957cab26)
#!/bin/bash
# Create work directory and empty it.
ROOTDIR="postgresql-namedatalen"
mkdir -p $ROOTDIR
cd $ROOTDIR
rm -rf *
# Get the sources and determine current version.
PKGNAME="postgresql-9.1"
apt-get source $PKGNAME
DIRNAME=`find . -maxdepth 1 -type d -name "$PKGNAME*"`
VERSION=${DIRNAME//\.\/${PKGNAME}-/}
# Apply out patch and change version.
# The patch: https://gist.github.com/langner/5c7bc1d74a8b957cab26
cd $DIRNAME
PATCH=namedatalen.256.patch
quilt import $PATH
quilt push
dch -v $VERSION-namedatalen256 "Increase NAMEDATALEN to 256"
# Do the actual build.
debuild -uc -us
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment