Commit a706092d authored by Christoph Berg's avatar Christoph Berg

Switch to plain pgxs buildsystem.

parent 4553ac19
*~
*.1
*.5
*.7
*.8
*-stamp
Makefile
Makefile.in
ChangeLog
compile
config.h
config.h.in
config.log
config.status
stamp-h1
aclocal.m4
autom4te.cache
configure
m4
INSTALL
META.json
VERSION
libtool
*.o
.deps
.libs
*.tar.*
\#*
.#*
......@@ -2,7 +2,7 @@
"name": "debversion",
"abstract": "A Debian version number data type",
"description": "Debian version numbers, used to version Debian binary and source packages, have a defined format, including specifications for how versions should be compared in order to sort them. This extension implements a debversion type to represent Debian version numbers within the PostgreSQL database. This also includes operators for version comparison and index operator classes for creating indexes on the debversion type. Version comparison uses the algorithm used by the Debian package manager, dpkg, using the implementation from libapt-pkg. This means that columns in tables using the debversion type may be sorted and compared correctly using the same logic as 'dpkg --compare-versions'. It is also possible to create indexes on these columns. The debversion type (internally derived from the 'text' type) includes a full set of operators for version comparison (< <= = <> >= >) including commutator and negator optimisation hints, operator classes for btree and hash indexes and the aggregate functions min() and max()",
"version": "@VERSION@",
"version": "1.0.8",
"maintainer": [
"Debian buildd-tools Developers <buildd-tools-devel@lists.alioth.debian.org>",
"Roger Leigh <rleigh@debian.org>"
......@@ -11,9 +11,9 @@
"provides": {
"debversion": {
"abstract": "A Debian version number data type",
"file": "debversion/debversion--@VERSION@.sql",
"file": "debversion/debversion--1.0.8.sql"
"docfile": "README",
"version": "@VERSION@"
"version": "1.0.8"
}
},
"prereqs": {
......@@ -38,7 +38,7 @@
"type": "git"
}
},
"generated_by": "@RELEASED_BY@",
"generated_by": "Unreleased",
"meta-spec": {
"version": "1.0.0",
"url": "http://pgxn.org/meta/spec.txt"
......
MODULES = debversion
#REGRESS = debversion
EXTENSION = debversion
DATA = \
debversion--unpackaged--1.0.5.sql \
debversion--1.0.5--1.0.6.sql \
debversion--1.0.6--1.0.7.sql \
debversion--1.0.7--1.0.8.sql \
debversion--1.0.8.sql
REGRESS = debversion
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
CXXFLAGS := $(CPPFLAGS)
debversion.so: debversion.o
$(CXX) $(LDFLAGS) -shared -o $@ $^ -lapt-pkg
debversion.o: debversion.cc
$(COMPILE.cc) $(CFLAGS_SL) $(OUTPUT_OPTION) $<
# postgresql-debversion Makefile template
#
#
# Copyright © 2004-2009 Roger Leigh <rleigh@debian.org>
#
# postgresql-debversion 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 3 of
# the License, or (at your option) any later version.
#
# postgresql-debversion 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.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see
# <http://www.gnu.org/licenses/>.
#
#####################################################################
SUBDIRS = debversion
dist-hook:
# Remove junk from the generated tarball.
$(FIND) $(distdir) -name '.*' -print | $(XARGS) xargs $(RM) -rf
$(FIND) $(distdir) -name '#*' -print | $(XARGS) $(RM) -rf
$(FIND) $(distdir) -name '*~' -print | $(XARGS) $(RM) -rf
# Generate ChangeLog
if [ -d .git ]; then \
git log > $(distdir)/ChangeLog; \
fi
EXTRA_DIST = \
bootstrap \
debian \
scripts/debversion_release.m4.in \
test \
META.json \
README.md \
VERSION
DISTCHECK_CONFIGURE_FLAGS = \
--enable-pg-server-libdir=\$${prefix}/postgresql/lib \
--enable-pg-server-sharedir=\$${prefix}/postgresql/share
#!/bin/sh
set -e
# Generate version information from git release tag
./scripts/git-version > VERSION
# To satisfy automake
touch ChangeLog
# Bootstrap autotools
autoreconf --verbose --force --install
rm -rf autom4te.cache
# -*- Autoconf -*-
# Copyright © 2004-2008 Roger Leigh <rleigh@debian.org>
#
# debversion 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 3 of the License, or
# (at your option) any later version.
#
# debversion 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.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see
# <http://www.gnu.org/licenses/>.
#
#####################################################################
#
# Process this file with autoconf to produce a configure script.
#
#####################################################################
dnl m4 magic from Eric Blake <ebb9@byu.net>, prior to automake inclusion
m4_define([sbuild_m4_chomp],
[m4_format([[%.*s]], m4_bregexp(m4_translit([$1], [
]]m4_dquote(_m4_defn([m4_cr_all]))[, [/]]m4_format([%255s], [])[),
[/*$]), [$1])])
m4_define([sbuild_m4_esyscmd_s],
[sbuild_m4_chomp(m4_esyscmd([$1]))])
AC_PREREQ(2.59)
dnl Quoting the first argument results in a bizarrely corrupted package tarname
AC_INIT(sbuild_m4_esyscmd_s([sed -ne '/^Package:/{s/Package:[[:space:]][[:space:]]*//p;q}' VERSION]),
[sbuild_m4_esyscmd_s([sed -ne '/^Version:/{s/Version:[[:space:]][[:space:]]*//p;q}' VERSION])],
[buildd-tools-devel@lists.alioth.debian.org])
dnl For safety, check we are in the right directory by
dnl checking for a known unique file.
AC_CONFIG_SRCDIR([debversion/debversion.cc])
dnl Place auxilliary scripts here.
AC_CONFIG_AUX_DIR([scripts])
dnl Put macro definitions here.
AC_CONFIG_HEADER([config.h])
AC_COPYRIGHT(
[
Copyright © 2004-2009 Roger Leigh <rleigh@debian.org>
Parts of this configure script come from the 'configure.ac' file, and
are not based on freely-redistributable m4 macros; 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 3 of the License, or (at your option) any later version.
This software 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.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
])
dnl Initialise automake stuff.
AM_INIT_AUTOMAKE([1.9 foreign check-news tar-pax])
AM_MAINTAINER_MODE
RELEASE_DATE='sbuild_m4_esyscmd_s([sed -ne '/^Release-Date:/{s/Release-Date:[[:space:]][[:space:]]*//p;q}' VERSION])'
RELEASE_DATE_S='sbuild_m4_esyscmd_s(date --date='sbuild_m4_esyscmd_s([sed -ne '/^Release-Date:/{s/Release-Date:[[:space:]][[:space:]]*//p;q}' VERSION])' '+%s')'
RELEASED_BY='sbuild_m4_esyscmd_s([sed -ne '/^Released-By:/{s/Released-By:[[:space:]][[:space:]]*//p;q}' VERSION])'
AC_DEFINE_UNQUOTED([RELEASE_DATE], ["$RELEASE_DATE_S"], [Package release date.])
AC_SUBST([RELEASE_DATE])
AC_SUBST([RELEASED_BY])
AC_MSG_CHECKING([whether to enable debugging messages])
AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [Enable debugging messages])],
[ case "${enableval}" in
yes) enable_debug="yes" ;;
no) enable_debug="no" ;;
unset) enable_debug="no" ;;
*) AC_MSG_RESULT([unknown])
AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
esac ],
[ enable_debug="no" ])
AC_MSG_RESULT([$enable_debug])
if test "$enable_debug" = "yes"; then
AC_DEFINE_UNQUOTED([DEBVERSION_DEBUG], [1], [Enable debugging])
fi
# Checks for programs.
AC_PROG_CXX
AC_LANG([C++])
AC_DISABLE_STATIC
AC_ENABLE_SHARED
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
AC_PATH_PROG([PG_CONFIG], [pg_config])
if [ ! test -x "$PG_CONFIG" ]; then
AC_MSG_ERROR([pg_config not found but is required by debversion])
fi
AC_MSG_CHECKING([for PostgreSQL server include directory])
pg_server_includedir=`"$PG_CONFIG" --includedir-server`
AC_ARG_ENABLE([pg-server-includedir], [AS_HELP_STRING([--enable-pg-server-includedir], [PostgreSQL server include directory])],
[pg_server_includedir="${enableval}"])
AC_MSG_RESULT([$pg_server_includedir])
AC_SUBST([pg_server_includedir])
AC_MSG_CHECKING([for PostgreSQL server module directory])
pg_server_libdir=`"$PG_CONFIG" --pkglibdir`
AC_ARG_ENABLE([pg-server-libdir], [AS_HELP_STRING([--enable-pg-server-libdir], [PostgreSQL server module directory])],
[pg_server_libdir="${enableval}"])
AC_MSG_RESULT([$pg_server_libdir])
AC_SUBST([pg_server_libdir])
AC_MSG_CHECKING([for PostgreSQL architecture-independent support files directory])
pg_server_sharedir=`"$PG_CONFIG" --sharedir`
AC_ARG_ENABLE([pg-server-sharedir], [AS_HELP_STRING([--enable-pg-server-sharedir], [PostgreSQL architecture-independent support files directory])],
[pg_server_sharedir="${enableval}"])
AC_MSG_RESULT([$pg_server_sharedir])
AC_SUBST([pg_server_sharedir])
pg_extensiondir="$pg_server_sharedir/extension"
AC_SUBST([pg_extensiondir])
AC_MSG_CHECKING([for debVS in -lapt-pkg])
saved_libs="${LIBS}"
LIBS="${LIBS} -lapt-pkg"
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <apt-pkg/debversion.h>],
[int result = debVS.CmpVersion ("1", "2");])],
[AC_MSG_RESULT([yes])
APT_PKG_LIBS="-lapt-pkg"],
[AC_MSG_RESULT([no])
AC_MSG_FAILURE([libapt-pkg (APT) is not installed, but is required by debversion])])
LIBS="${saved_libs}"
AC_SUBST([APT_PKG_LIBS])
if [ ! test -n "$APT_PKG_LIBS" ]; then
AC_MSG_ERROR([libapt_pkg not found but is required by debversion])
fi
dnl Configure which files to generate.
AC_CONFIG_FILES([META.json])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([debversion/debversion.control])
AC_CONFIG_FILES([debversion/Makefile])
dnl Output the generated config.status script.
AC_OUTPUT
postgresql-debversion (1.0.8-4) UNRELEASED; urgency=medium
* Switch to plain pgxs buildsystem.
-- Christoph Berg <myon@debian.org> Wed, 15 Nov 2017 20:51:40 +0100
postgresql-debversion (1.0.8-3) unstable; urgency=medium
* Upload with PostgreSQL 10 support. Closes: #876506.
......
......@@ -3,7 +3,7 @@ Section: database
Priority: extra
Maintainer: Debian PostgreSQL Maintainers <pkg-postgresql-public@lists.alioth.debian.org>
Uploaders: Michael Banck <mbanck@debian.org>, Christoph Berg <myon@debian.org>
Build-Depends: debhelper (>= 9), dh-autoreconf, libapt-pkg-dev, postgresql-server-dev-all
Build-Depends: debhelper (>= 9), libapt-pkg-dev, postgresql-server-dev-all
Standards-Version: 4.1.0
Vcs-Browser: https://anonscm.debian.org/cgit/buildd-tools/postgresql-debversion.git
Vcs-Git: https://anonscm.debian.org/git/buildd-tools/postgresql-debversion.git
......
......@@ -3,7 +3,7 @@ Section: database
Priority: extra
Maintainer: Debian PostgreSQL Maintainers <pkg-postgresql-public@lists.alioth.debian.org>
Uploaders: Michael Banck <mbanck@debian.org>, Christoph Berg <myon@debian.org>
Build-Depends: debhelper (>= 9), dh-autoreconf, libapt-pkg-dev, postgresql-server-dev-all
Build-Depends: debhelper (>= 9), libapt-pkg-dev, postgresql-server-dev-all
Standards-Version: 4.1.0
Vcs-Browser: https://anonscm.debian.org/cgit/buildd-tools/postgresql-debversion.git
Vcs-Git: https://anonscm.debian.org/git/buildd-tools/postgresql-debversion.git
......
debian/install-PGVERSION/usr/lib/postgresql/PGVERSION/lib/debversion.so usr/lib/postgresql/PGVERSION/lib
debian/install-PGVERSION/usr/share/postgresql usr/share
......@@ -3,38 +3,17 @@
# Rebuild debian/control from debian/control.in
include /usr/share/postgresql-common/pgxs_debian_control.mk
SUPPORTED_VERSIONS = $(shell pg_buildext supported-versions)
%:
dh $@ --with autoreconf
override_dh_auto_configure: configure
set -e; for v in $(SUPPORTED_VERSIONS); do \
dh_auto_configure --builddirectory=debian/build-$$v -- \
--enable-extension \
PG_CONFIG=/usr/lib/postgresql/$$v/bin/pg_config; \
for file in debian/*PGVERSION*; do \
sed -e "s:PGVERSION:$$v:g" "$$file" > "$$(echo "$$file" | sed -e "s:PGVERSION:$$v:g")"; \
done; \
done
override_dh_auto_build:
set -e; for v in $(SUPPORTED_VERSIONS); do \
$(MAKE) -C debian/build-$$v all; \
done
+pg_buildext build build-%v
override_dh_auto_clean:
set -e; for v in $(SUPPORTED_VERSIONS); do \
dh_auto_clean --builddirectory=debian/build-$$v; \
rm -rf debian/install-$$v; \
done
rm -f debian/postgresql-*.*-debversion.*
$(MAKE) -C test clean
+pg_buildext clean build-%v
override_dh_auto_install:
set -e; for v in $(SUPPORTED_VERSIONS); do \
$(MAKE) -C debian/build-$$v DESTDIR=$(CURDIR)/debian/install-$$v install; \
done
+pg_buildext install build-%v postgresql-%v-debversion
override_dh_installchangelogs:
dh_installchangelogs NEWS
......
#!/bin/sh
set -ex
for v in $(pg_buildext supported-versions); do
if ! pg_virtualenv -v $v make -C test installcheck; then
cat test/regression.diffs
exit 1
fi
done
pg_buildext installcheck
# debversion extension
comment = 'A Debian version number data type'
default_version = '@VERSION@'
default_version = '1.0.8'
module_pathname = '$libdir/debversion'
relocatable = true
debversion.control
debversion/debversion--1.0.5.sql
*.la
*.lo
# postgresql-debversion Makefile template
#
#
# Copyright © 2004-2011 Roger Leigh <rleigh@debian.org>
#
# postgresql-debversion 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 3 of
# the License, or (at your option) any later version.
#
# postgresql-debversion 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.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see
# <http://www.gnu.org/licenses/>.
#
#####################################################################
pg_server_lib_LTLIBRARIES = \
debversion.la
debversion_la_SOURCES = \
debversion.cc
debversion_la_CFLAGS = -I$(pg_server_includedir)
debversion_la_CXXFLAGS = -I$(pg_server_includedir)
debversion_la_LDFLAGS = -module -avoid-version $(APT_PKG_LIBS)
pg_extension_DATA = \
debversion.control \
debversion--unpackaged--1.0.5.sql \
debversion--1.0.5--1.0.6.sql \
debversion--1.0.6--1.0.7.sql \
debversion--1.0.7--1.0.8.sql \
debversion--$(VERSION).sql
debversion--$(VERSION).sql: debversion.sql.in
cp $< $@
CLEANFILES = \
debversion--$(VERSION).sql
EXTRA_DIST = \
debversion--unpackaged--1.0.5.sql \
debversion--1.0.5--1.0.6.sql \
debversion--1.0.6--1.0.7.sql \
debversion--1.0.7--1.0.8.sql \
debversion.sql.in \
Makefile-pgxs
install-sh
missing
config.guess
config.sub
depcomp
ltmain.sh
# -*- Autoconf -*-
# Copyright © 2001-2002,2006-2007 Roger Leigh <rleigh@debian.org>
#
# postgresql-debversion 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 3 of
# the License, or (at your option) any later version.
#
# postgresql-debversion 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.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see
# <http://www.gnu.org/licenses/>.
#
#####################################################################
# DEBVERSION_RELEASE_DATE
# --------------------
# Hard-code the release date into the generated configure script and
# Makefiles.
AC_DEFUN([DEBVERSION_RELEASE_DATE],
[dnl Set package release date
AC_DEFINE_UNQUOTED([RELEASE_DATE], @RELEASE_UDATE@, [Package release date.])
RELEASE_DATE="@RELEASE_DATE@"
AC_SUBST([RELEASE_DATE])])
#!/bin/sh
set -e
PACKAGE="$(sed -ne '/^Welcome to /{s/Welcome to[[:space:]][[:space:]]*\([[:alnum:]][[:alnum:]-]*\)[[:space:]][[:space:]]*\([[:alnum:]][[:alnum:].-]*\)\..*/\1/p;q}' < NEWS)"
VERSION="$(sed -ne '/^Welcome to /{s/Welcome to[[:space:]][[:space:]]*\([[:alnum:]][[:alnum:]-]*\)[[:space:]][[:space:]]*\([[:alnum:]][[:alnum:].-]*\)\..*/\2/p;q}' < NEWS)"
if [ -z "$PACKAGE" ] || [ -z "$VERSION" ]; then
echo "Error parsing package name and version from NEWS"
exit 1
fi
echo "Tagging ${PACKAGE} version ${VERSION} as 'release/${PACKAGE}-${VERSION}'"
git tag -s "release/${PACKAGE}-${VERSION}" -m "${PACKAGE} version ${VERSION}"
#!/bin/sh
# date needs to use C for date (LC_TIME) formatting, so ensure it's
# not overridden.
export LANGUAGE=C
export LANG=C
export LC_TIME=C
export LC_ALL=C
PACKAGE="$(sed -ne '/^Welcome to /{s/Welcome to[[:space:]][[:space:]]*\([[:alnum:]][[:alnum:]-]*\)[[:space:]][[:space:]]*\([[:alnum:]][[:alnum:].-]*\)\..*/\1/p;q}' < NEWS)"
VERSION="$(sed -ne '/^Welcome to /{s/Welcome to[[:space:]][[:space:]]*\([[:alnum:]][[:alnum:]-]*\)[[:space:]][[:space:]]*\([[:alnum:]][[:alnum:].-]*\)\..*/\2/p;q}' < NEWS)"
TAG="release/${PACKAGE}-${VERSION}"
COMMIT="$(git rev-parse "$TAG^{}" 2>/dev/null)" || COMMIT=""
if [ -n "$COMMIT" ]; then
COMMIT_DATE="$(git log -1 "$COMMIT" --pretty="format:%ai")"
RELEASE_DATE="$(date --date="$COMMIT_DATE" '+%d %b %Y')"
RELEASE_BY="$(git show "$TAG" | sed -ne '/^Tagger:/{s/Tagger:[[:space:]][[:space:]]*//p;q}')"
else
RELEASE_DATE="$(date '+%d %b %Y')"
RELEASE_BY="Unreleased"
fi
echo "Package: $PACKAGE"
echo "Version: $VERSION"
echo "Release-Date: $RELEASE_DATE"
echo "Released-By: $RELEASE_BY"
if [ -n "$COMMIT" ]; then
echo "Git-Tag: $TAG"
fi
EXTENSION = debversion
REGRESS = $(EXTENSION)
PG_CONFIG := pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
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