Commit 783c8b7f authored by Martin Pitt's avatar Martin Pitt

* Add new package postgresql-server-dev-all:

  - "pb_buildext" tool for easy building of extension packages for multiple
    server versions.
  - pgxs_debian_control.mk debian/rules include for generating
    debian/control.
parent 33ecf052
postgresql-common (110) UNRELEASED; urgency=low
[ Martin Pitt ]
* t/080_start.conf.t: Update for common init.d script.
[ Dimitri Fontaine ]
* Add new package postgresql-server-dev-all:
- "pb_buildext" tool for easy building of extension packages for multiple
server versions.
- pgxs_debian_control.mk debian/rules include for generating
debian/control.
-- Martin Pitt <mpitt@debian.org> Fri, 30 Jul 2010 19:36:52 +0200
postgresql-common (109) unstable; urgency=low
......
......@@ -46,3 +46,19 @@ Description: manager for multiple PostgreSQL client versions
transactions, foreign keys, views, sequences, subqueries, triggers,
outer joins, multiversion concurrency control, and user-defined types
and functions.
Package: postgresql-server-dev-all
Architecture: all
Depends: ${misc:Depends}
Description: extension build tool for multiple PostgreSQL versions
The postgresql-server-dev-all package provides the pg_buildext script for
simplifying packaging of a PostgreSQL extension supporting multiple major
versions of the product.
.
PostgreSQL is a fully featured object-relational database management
system. It supports a large part of the SQL standard and is designed
to be extensible by users in many aspects. Its features include ACID
transactions, foreign keys, views, sequences, subqueries, triggers,
outer joins, multiversion concurrency control, and user-defined types
and functions.
pgxs_debian_control.mk /usr/share/postgresql-common/
pg_buildext /usr/bin
\ No newline at end of file
......@@ -11,6 +11,9 @@ build/postgresql-common::
for p in $(POD1PROGS); do $(POD2MAN) --quotes=none --section 1 $$p > $$p.1; done
for p in $(POD8PROGS); do $(POD2MAN) --quotes=none --section 8 $$p > $$p.8; done
build/postgresql-server-dev-all:: pg_buildext.pod
$(POD2MAN) --quotes=none --section 1 $< > `basename $< .pod`.1
install/postgresql-common::
install -D -m 644 debian/postgresql-common.lintian $(DEB_DESTDIR)/usr/share/lintian/overrides/postgresql-common
......@@ -22,3 +25,5 @@ cleanbuilddir/postgresql-common::
for p in $(POD1PROGS); do rm -f $$p.1; done
for p in $(POD8PROGS); do rm -f $$p.8; done
cleanbuilddir/postgresql-server-dev-all::
rm -f pg_buildext.1
#!/bin/bash
#
# build a PostgreSQL module based on PGXS for give list of supported major
# versions
#
# Author: Dimitri Fontaine <dfontaine@hi-media.com>
action=$1
srcdir=$2
target=$3
opt=$4
function prepare_env() {
if [ ! -d $srcdir ]; then
echo "Error: no such directory '$srcdir'"
exit 1
fi
version=$1
vtarget=`echo $target | sed -e "s:%v:$version:"`
pgc="/usr/lib/postgresql/$version/bin/pg_config"
cflags=`$pgc --cflags`
}
function build() {
prepare_env $1
mkdir -p $vtarget
cd $vtarget
make -f $srcdir/Makefile CFLAGS="$cflags $opt" PG_CONFIG="$pgc" VPATH="$srcdir"
cd -
}
function clean() {
prepare_env $1
make clean PG_CONFIG="$pgc"
rm -rf $vtarget
}
function versions() {
for v in `/usr/share/postgresql-common/supported-versions`
do
grep -q "^$v" $srcdir/debian/pgversions && echo $v
done
}
for v in `versions`
do
case "$action" in
"supported-versions")
echo $v
;;
build|clean)
# be verbose?
$action $v
;;
*)
echo "$0: unsupported $action."
;;
esac
done
exit 0
=head1 NAME
pg_buildext - Build and install a PostgreSQL extension
=head1 SYNOPSIS
B<pg_buildext> I<action> I<srcdir> I<target> I<opts>
=head1 DESCRIPTION
B<pg_buildext> is a script that will build a PostgreSQL extension in a
C<VPATH> way. It only supports the B<build> and B<clean> actions, and will
choose to build the versions known in C<debian/pgversions> and in
C</usr/share/postgresql-common/supported-versions>.
=head1 OPTIONS
=over 4
=item B<action>
Either I<clean> or I<build>.
=item B<srcdir>
Where to find the extension sources, including the C<debian> subdirectory.
=item B<target>
The target directory where to build the sources, it will get created for you
if it does not exist. If the B<target> contains a C<%v> sign, it will get
replaced by the specific version of PostgreSQL being built against.
=item B<opts>
Custom C<CFLAGS> options to use for the build.
=back
=head1 AUTHOR
Dimitri Fontaine L<E<lt>dim@tapoueh.orgE<gt>>
#
# produce a debian/control file from a debian/control.in
#
# In debian/rules, include /usr/share/postgresql-common/pgxs_debian_control.mk
# build: debian/control
#
# Author: Dimitri Fontaine <dfontaine@hi-media.com>
#
debian/control: debian/control.in debian/pgversions
grep-dctrl -vP PGVERSION $< > $@
for v in `pg_buildext supported-versions $(SRCDIR)`; \
do \
grep -q "^$$v" debian/pgversions \
&& grep-dctrl -P PGVERSION $< \
| sed -e "s:PGVERSION:$$v:" >> $@; \
done
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