Commit 85f71211 authored by Christoph Berg's avatar Christoph Berg

pg_buildext: Resurrect the previously deprecated "srcdir" mode to allow...

pg_buildext: Resurrect the previously deprecated "srcdir" mode to allow building packages from a subdirectory, and make "loop" support it as well.

On request by Magnus Hagander.
parent 4980815b
......@@ -3,6 +3,8 @@ postgresql-common (181) UNRELEASED; urgency=medium
* debian/postgresql-common.config: Fix deprecation warning debconf message
to use a numerical comparison on the version number.
* pg_buildext: Fix to use a numerical comparison on the version number.
* pg_buildext: Resurrect the previously deprecated "srcdir" mode to allow
building packages from a subdirectory, and make "loop" support it as well.
* t/001_packages.t: PostgreSQL 10 doesn't have a separate contrib package.
* t/020_create_sql_remove.t: Use CREATE EXTENSION, createlang is being
removed.
......
......@@ -36,7 +36,7 @@ shift $(($OPTIND - 1))
[ "${1:-}" ] || die "no action given"
action="$1"
if [ -d "${2:-}" ] && [ "${3:-}" ]; then # compat mode: $2 is source directory
if [ -d "${2:-}" ] && [ "${3:-}" ]; then # optional: $2 is source directory
srcdir="${2:-}"
shift
else
......@@ -80,7 +80,7 @@ install() {
mkdir -p $vtarget
# if a Makefile was created by configure, use it, else the top level Makefile
[ -f $vtarget/Makefile ] || makefile="-f $srcdir/Makefile"
make -C $vtarget ${makefile:-} install DESTDIR="$srcdir/debian/$package" PG_CONFIG="$pgc" VPATH="$srcdir" srcdir="$srcdir" USE_PGXS=1
make -C $vtarget ${makefile:-} install DESTDIR="$PWD/debian/$package" PG_CONFIG="$pgc" VPATH="$srcdir" srcdir="$srcdir" USE_PGXS=1
}
clean() {
......@@ -98,11 +98,11 @@ loop() {
package=$(echo $target | sed -e "s:%v:$1:g")
echo "# $1: make clean"
make clean PG_CONFIG="$pgc" USE_PGXS=1
make -C "$srcdir" clean PG_CONFIG="$pgc" USE_PGXS=1
echo "# $1: make"
make PG_CONFIG="$pgc" USE_PGXS=1
make -C "$srcdir" PG_CONFIG="$pgc" USE_PGXS=1
echo "# $1: make install"
make install DESTDIR="$PWD/debian/$package" PG_CONFIG="$pgc" USE_PGXS=1
make -C "$srcdir" install DESTDIR="$PWD/debian/$package" PG_CONFIG="$pgc" USE_PGXS=1
echo "### done $1 ###"
}
......@@ -249,7 +249,7 @@ do
;;
configure|build|install|clean|loop)
[ "$target" ] || die "syntax: pg_buildext $action <target> [<opt>]"
[ "$target" ] || die "syntax: pg_buildext $action <target> [<srcdir>] [<opt>]"
echo "### $action $v ###"
$action $v
;;
......
......@@ -4,7 +4,7 @@ pg_buildext - Build and install a PostgreSQL extension
=head1 SYNOPSIS
B<pg_buildext> [I<options>] I<action> [I<options>]
B<pg_buildext> [I<options>] I<action> [I<src-dir>] [I<arguments>]
=head1 DESCRIPTION
......@@ -82,27 +82,27 @@ B<updatecontrol> needs to be run manually.
Update C<debian/control> from C<debian/control.in>, and C<debian/tests/control>
from C<debian/tests/control.in> if the latter exists.
=item B<configure> I<build-dir> [I<extra-configure-options>]
=item B<configure> [I<src-dir>] I<build-dir> [I<extra-configure-options>]
For every supported version, call B<../configure> from the I<build-dir>
directory. (Most PostgreSQL extensions do not have a configure script.)
=item B<build> I<build-dir> [I<extra-cflags>]
=item B<build> [I<src-dir>] I<build-dir> [I<extra-cflags>]
Build the extension in the I<build-dir> directory.
=item B<install> I<build-dir> I<package-pattern>
=item B<install> [I<src-dir>] I<build-dir> I<package-pattern>
Invoke B<make install> from the I<build-dir> directory.
The third parameter specifies the package name to use. Most packages
use B<postgresql-%v-pkgname>. Make will be
called with DESTDIR="$(CURDIR)/debian/I<package>".
=item B<clean> I<build-dir>
=item B<clean> [I<src-dir>] I<build-dir>
Clean the build directory.
=item B<loop> I<package-pattern>
=item B<loop> [I<src-dir>] I<package-pattern>
As a variant to calling B<build> and B<install> separately for VPATH builds,
loop over the supported PostgreSQL versions in the top source directory. This
......@@ -110,7 +110,7 @@ should be used if the package does not support VPATH builds. As it also invokes
B<make install>, it should be placed were installation happens in debian/rules,
rather than where build would normally be called.
=item B<installcheck> [I<build-dir>]
=item B<installcheck> [I<src-dir>] [I<build-dir>]
Use B<pg_virtualenv make installcheck> to run the extension regression tests.
This is meant to be run from C<debian/tests/control> using B<autopkgtest>. If
......@@ -226,6 +226,14 @@ configure the list of supported versions on your system.
=back
=head1 SOURCE DIRECTORY
If the package source code is not in the top level directory (i.e. the directory
which has C<debian/> as subdirectory), use the I<src-dir> argument. Example:
override_dh_auto_build:
+pg_buildext build $(CURDIR)/postgresql-module build-%v
=head1 ENVIRONMENT
B<pg_buildext> sets B<PG_VIRTUALENV_UNSHARE=-n> for the installcheck actions by
......@@ -234,9 +242,6 @@ in parallel to share port 5432. Override by setting to a different value.
=head1 COMPATIBILITY
Earlier B<pg_buildext> versions required a "source dir" argument after the
action. This is now deprecated, but still accepted (and ignored).
B<pg_buildext loop> was introduced in postgresql-server-dev-all (>= 141~).
The usage of "all" or "X.Y+" in debian/pgversions was introduced in
......
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