#!/bin/sh

set -e

trap "rm -rf /tmp/pg-repack-tablespace" 0 2 3 15
mkdir /tmp/pg-repack-tablespace
if [ "$(id -u)" = "0" ]; then
	chown postgres:postgres /tmp/pg-repack-tablespace
fi

pg_buildext installcheck
