Commit 1d7dce17 authored by Christoph Berg's avatar Christoph Berg

pg_buildext: Deprecate <srcdir> parameter. The docs do not mention it

anymore, but the script will still accept it.

Also, add a (yet undocumented) "loop" action.
parent b5661ab6
postgresql-common (141) UNRELEASED; urgency=low
[ Christoph Berg ]
* pg_buildext: Deprecate <srcdir> parameter. The docs do not mention it
anymore, but the script will still accept it.
* pg_createcluster: For 9.2 and higher, use the new ssl_ca_file
option instead of creating a root.crt symlink in the data directory.
(Related to the fix for #680162 below.)
......
......@@ -8,9 +8,14 @@
set -e
action="$1"
srcdir="${2:-`pwd`}"
target="$3"
opt="$4"
if [ -d "$2" ]; then # compat mode: $2 is source directory
srcdir="$2"
shift
else
srcdir="$PWD"
fi
target="$2"
opt="$3"
die() {
echo "`basename $0`: error: $*" >&2
......@@ -62,19 +67,30 @@ clean() {
rm -rf $vtarget
}
loop() {
echo "### $1 ###"
prepare_env $1
package=$(echo $target | sed -e "s:%v:$version:g")
echo "# $1: make clean"
make clean DESTDIR="$PWD/debian/$package" PG_CONFIG="$pgc" USE_PGXS=1
echo "# $1: make"
make CFLAGS="$cflags" DESTDIR="$PWD/debian/$package" PG_CONFIG="$pgc" USE_PGXS=1
echo "# $1: make install"
make install DESTDIR="$PWD/debian/$package" PG_CONFIG="$pgc" USE_PGXS=1
echo "### done $1 ###"
}
versions() {
[ -e /usr/share/postgresql-common/supported-versions ] ||
die "/usr/share/postgresql-common/supported-versions not found"
[ -e $srcdir/debian/pgversions ] || die "$srcdir/debian/pgversions not found"
[ -e debian/pgversions ] || die "debian/pgversions not found"
for v in `/usr/share/postgresql-common/supported-versions`
do
if grep -q "^$v" $srcdir/debian/pgversions ; then echo $v ; fi
if grep -q "^$v" debian/pgversions ; then echo $v ; fi
done
}
[ "$srcdir" ] || die "syntax: pg_buildext <action> <srcdir> ..."
[ -d $srcdir ] || die "no such directory '$srcdir'"
VERSIONS=`versions`
for v in $VERSIONS
......@@ -84,7 +100,7 @@ do
echo $v
;;
configure|build|install|clean)
configure|build|install|clean|loop)
[ "$target" ] || die "syntax: pg_buildext $action <srcdir> <target> ..."
# be verbose?
$action $v
......
......@@ -4,7 +4,7 @@ pg_buildext - Build and install a PostgreSQL extension
=head1 SYNOPSIS
B<pg_buildext> I<action> I<srcdir> I<target> I<opts>
B<pg_buildext> I<action> I<target> I<opts>
=head1 DESCRIPTION
......@@ -23,11 +23,6 @@ release).
One of B<configure>, B<build>, B<install>, or B<clean>.
=item B<srcdir>
Where to find the extension sources, including the C<debian> subdirectory.
(Usually C<$(CURDIR)>.) If not specified, defaults to the current directory.
=item B<target>
The target directory where to build the sources, it will get created for you
......@@ -52,7 +47,7 @@ Custom C<CFLAGS> options to use for the build.
=item B<install>
Package name to install for. Make will be called with DESTDIR="I<srcdir>/debian/I<package>".
Package name to install for. Make will be called with DESTDIR="$(CURDIR)/debian/I<package>".
=item B<clean>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment