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 postgresql-common (141) UNRELEASED; urgency=low
[ Christoph Berg ] [ 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 * 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. option instead of creating a root.crt symlink in the data directory.
(Related to the fix for #680162 below.) (Related to the fix for #680162 below.)
......
...@@ -8,9 +8,14 @@ ...@@ -8,9 +8,14 @@
set -e set -e
action="$1" action="$1"
srcdir="${2:-`pwd`}" if [ -d "$2" ]; then # compat mode: $2 is source directory
target="$3" srcdir="$2"
opt="$4" shift
else
srcdir="$PWD"
fi
target="$2"
opt="$3"
die() { die() {
echo "`basename $0`: error: $*" >&2 echo "`basename $0`: error: $*" >&2
...@@ -62,19 +67,30 @@ clean() { ...@@ -62,19 +67,30 @@ clean() {
rm -rf $vtarget 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() { versions() {
[ -e /usr/share/postgresql-common/supported-versions ] || [ -e /usr/share/postgresql-common/supported-versions ] ||
die "/usr/share/postgresql-common/supported-versions not found" 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` for v in `/usr/share/postgresql-common/supported-versions`
do do
if grep -q "^$v" $srcdir/debian/pgversions ; then echo $v ; fi if grep -q "^$v" debian/pgversions ; then echo $v ; fi
done done
} }
[ "$srcdir" ] || die "syntax: pg_buildext <action> <srcdir> ..."
[ -d $srcdir ] || die "no such directory '$srcdir'"
VERSIONS=`versions` VERSIONS=`versions`
for v in $VERSIONS for v in $VERSIONS
...@@ -84,7 +100,7 @@ do ...@@ -84,7 +100,7 @@ do
echo $v echo $v
;; ;;
configure|build|install|clean) configure|build|install|clean|loop)
[ "$target" ] || die "syntax: pg_buildext $action <srcdir> <target> ..." [ "$target" ] || die "syntax: pg_buildext $action <srcdir> <target> ..."
# be verbose? # be verbose?
$action $v $action $v
......
...@@ -4,7 +4,7 @@ pg_buildext - Build and install a PostgreSQL extension ...@@ -4,7 +4,7 @@ pg_buildext - Build and install a PostgreSQL extension
=head1 SYNOPSIS =head1 SYNOPSIS
B<pg_buildext> I<action> I<srcdir> I<target> I<opts> B<pg_buildext> I<action> I<target> I<opts>
=head1 DESCRIPTION =head1 DESCRIPTION
...@@ -23,11 +23,6 @@ release). ...@@ -23,11 +23,6 @@ release).
One of B<configure>, B<build>, B<install>, or B<clean>. 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> =item B<target>
The target directory where to build the sources, it will get created for you 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. ...@@ -52,7 +47,7 @@ Custom C<CFLAGS> options to use for the build.
=item B<install> =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> =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