Commit c042fbc9 authored by Christoph Berg's avatar Christoph Berg

* pg_buildext: Support "X.Y+" and "all" in debian/pgversions so packages do

  not need to hardcode the versions they support, as that's usually not
  necessary.
  - "pg_buildext" tool for easy building of extension packages for multiple
parent a443e1c9
......@@ -4,6 +4,9 @@ postgresql-common (148) UNRELEASED; urgency=low
PG_SUPPORTED_VERSIONS=$FLAVOR for debian/supported-versions so we don't
pick up configuration from the build environment.
* debian/supported-versions: Wheezy uses "7" in /etc/os-release.
* pg_buildext: Support "X.Y+" and "all" in debian/pgversions so packages do
not need to hardcode the versions they support, as that's usually not
necessary.
* t: Move $delay to TestLib.pm and increase to 500ms.
-- Christoph Berg <myon@debian.org> Sat, 20 Jul 2013 15:03:02 +0200
......@@ -842,7 +845,7 @@ postgresql-common (110) unstable; urgency=low
[ Dimitri Fontaine ]
* Add new package postgresql-server-dev-all:
- "pb_buildext" tool for easy building of extension packages for multiple
- "pg_buildext" tool for easy building of extension packages for multiple
server versions.
- pgxs_debian_control.mk debian/rules include for generating
debian/control.
......
#!/bin/sh
#
# build a PostgreSQL module based on PGXS for give list of supported major
# build a PostgreSQL module based on PGXS for given list of supported major
# versions
#
# Author: Dimitri Fontaine <dfontaine@hi-media.com>
# (C) 2010 Dimitri Fontaine <dfontaine@hi-media.com>
# (C) 2011-2013 Christoph Berg <myon@debian.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
set -e
......@@ -85,10 +96,23 @@ versions() {
[ -e /usr/share/postgresql-common/supported-versions ] ||
die "/usr/share/postgresql-common/supported-versions not found"
[ -e debian/pgversions ] || die "debian/pgversions not found"
for v in `/usr/share/postgresql-common/supported-versions`
do
if grep -q "^$v" debian/pgversions ; then echo $v ; fi
done
supported_versions=$(/usr/share/postgresql-common/supported-versions)
while read version; do
case $version in
all) echo "$supported_versions" ;;
[1-9]*+)
for sup_version in $supported_versions; do
if expr $(echo "$version" | tr -d +) '<=' $sup_version > /dev/null; then echo "$sup_version"; fi
done ;;
[1-9]*)
for sup_version in $supported_versions; do
if [ "$version" = "$sup_version" ]; then echo "$sup_version"; fi
done ;;
'#'*) ;;
'') ;;
*) echo "Syntax error in debian/pgversions: $version" >&2 ;;
esac
done < debian/pgversions
}
VERSIONS=`versions`
......
......@@ -57,6 +57,36 @@ B<clean> does not take extra options.
=back
=head1 SUPPORTED VERSIONS
B<pg_buildext> reads C<debian/pgversions> to decide which PostgreSQL to build
modules/extensions for. This file contains one PostgreSQL version number per
line, in the following formats:
=over 4
=item B<all>
Support all versions. This is recommended unless there are known incompatibilities.
=item I<X.Y>
Support this version.
=item I<X.Y>B<+>
Support this and all greater versions.
=item B<#>I<...>
Comment.
=back
For a version to be used, it must also be listed in the output of
C</usr/share/postgresql-common/supported-versions>. See this file for how to
configure the list of supported versions on your system.
=head1 USAGE
As B<pg_buildext> invokes B<make> for the B<build>, B<install>, and 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