From 00a116916efb7d7d55b91a5781bd26fdc948c1cf Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Wed, 14 Oct 2020 16:29:20 -0700 Subject: [PATCH] RHEL 9.0.0 Alpha bootstrap The content of this branch was automatically imported from Fedora ELN with the following as its source: https://src.fedoraproject.org/rpms/postgresql-odbc#601c20f8d9769d8ea7b520541930d0f8a5985ca6 --- .gitignore | 3 + acinclude.m4 | 452 ++++++++++++++++++ ...9.05.0400-revert-money-testsuite-fix.patch | 30 ++ ...sql-odbc-09.06.0200-revert-money-fix.patch | 95 ++++ postgresql-odbc.spec | 404 ++++++++++++++++ sources | 1 + 6 files changed, 985 insertions(+) create mode 100644 acinclude.m4 create mode 100644 postgresql-odbc-09.05.0400-revert-money-testsuite-fix.patch create mode 100644 postgresql-odbc-09.06.0200-revert-money-fix.patch create mode 100644 postgresql-odbc.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..3bbfc34 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,3 @@ +/psqlodbc-10.03.0000.tar.gz +/psqlodbc-12.01.0000.tar.gz +/psqlodbc-12.02.0000.tar.gz diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..a005193 --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,452 @@ +# Macros that test various C library quirks +# $PostgreSQL: pgsql/config/c-library.m4,v 1.31 2005/02/24 01:34:45 tgl Exp $ + + +# PGAC_VAR_INT_TIMEZONE +# --------------------- +# Check if the global variable `timezone' exists. If so, define +# HAVE_INT_TIMEZONE. +AC_DEFUN([PGAC_VAR_INT_TIMEZONE], +[AC_CACHE_CHECK(for int timezone, pgac_cv_var_int_timezone, +[AC_TRY_LINK([#include +int res;], + [#ifndef __CYGWIN__ +res = timezone / 60; +#else +res = _timezone / 60; +#endif], + [pgac_cv_var_int_timezone=yes], + [pgac_cv_var_int_timezone=no])]) +if test x"$pgac_cv_var_int_timezone" = xyes ; then + AC_DEFINE(HAVE_INT_TIMEZONE,, [Define to 1 if you have the global variable 'int timezone'.]) +fi])# PGAC_VAR_INT_TIMEZONE + + +# PGAC_STRUCT_TIMEZONE +# ------------------ +# Figure out how to get the current timezone. If `struct tm' has a +# `tm_zone' member, define `HAVE_TM_ZONE'. Also, if the +# external array `tzname' is found, define `HAVE_TZNAME'. +# This is the same as the standard macro AC_STRUCT_TIMEZONE, except that +# tzname[] is checked for regardless of whether we find tm_zone. +AC_DEFUN([PGAC_STRUCT_TIMEZONE], +[AC_REQUIRE([AC_STRUCT_TM])dnl +AC_CHECK_MEMBERS([struct tm.tm_zone],,,[#include +#include <$ac_cv_struct_tm> +]) +if test "$ac_cv_member_struct_tm_tm_zone" = yes; then + AC_DEFINE(HAVE_TM_ZONE, 1, + [Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use + `HAVE_STRUCT_TM_TM_ZONE' instead.]) +fi +AC_CACHE_CHECK(for tzname, ac_cv_var_tzname, +[AC_TRY_LINK( +[#include +#ifndef tzname /* For SGI. */ +extern char *tzname[]; /* RS6000 and others reject char **tzname. */ +#endif +], +[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)]) +if test $ac_cv_var_tzname = yes; then + AC_DEFINE(HAVE_TZNAME, 1, + [Define to 1 if you have the external array `tzname'.]) +fi +])# PGAC_STRUCT_TIMEZONE + + +# PGAC_FUNC_GETTIMEOFDAY_1ARG +# --------------------------- +# Check if gettimeofday() has only one arguments. (Normal is two.) +# If so, define GETTIMEOFDAY_1ARG. +AC_DEFUN([PGAC_FUNC_GETTIMEOFDAY_1ARG], +[AC_CACHE_CHECK(whether gettimeofday takes only one argument, +pgac_cv_func_gettimeofday_1arg, +[AC_TRY_COMPILE([#include ], +[struct timeval *tp; +struct timezone *tzp; +gettimeofday(tp,tzp);], +[pgac_cv_func_gettimeofday_1arg=no], +[pgac_cv_func_gettimeofday_1arg=yes])]) +if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then + AC_DEFINE(GETTIMEOFDAY_1ARG,, [Define to 1 if gettimeofday() takes only 1 argument.]) +fi +AH_VERBATIM(GETTIMEOFDAY_1ARG_, +[@%:@ifdef GETTIMEOFDAY_1ARG +@%:@ define gettimeofday(a,b) gettimeofday(a) +@%:@endif])dnl +])# PGAC_FUNC_GETTIMEOFDAY_1ARG + + +# PGAC_FUNC_GETPWUID_R_5ARG +# --------------------------- +# Check if getpwuid_r() takes a fifth argument (later POSIX standard, not draft version) +# If so, define GETPWUID_R_5ARG +AC_DEFUN([PGAC_FUNC_GETPWUID_R_5ARG], +[AC_CACHE_CHECK(whether getpwuid_r takes a fifth argument, +pgac_func_getpwuid_r_5arg, +[AC_TRY_COMPILE([#include +#include ], +[uid_t uid; +struct passwd *space; +char *buf; +size_t bufsize; +struct passwd **result; +getpwuid_r(uid, space, buf, bufsize, result);], +[pgac_func_getpwuid_r_5arg=yes], +[pgac_func_getpwuid_r_5arg=no])]) +if test x"$pgac_func_getpwuid_r_5arg" = xyes ; then + AC_DEFINE(GETPWUID_R_5ARG,, [Define to 1 if getpwuid_r() takes a 5th argument.]) +fi +])# PGAC_FUNC_GETPWUID_R_5ARG + + +# PGAC_FUNC_STRERROR_R_INT +# --------------------------- +# Check if strerror_r() returns an int (SUSv3) rather than a char * (GNU libc) +# If so, define STRERROR_R_INT +AC_DEFUN([PGAC_FUNC_STRERROR_R_INT], +[AC_CACHE_CHECK(whether strerror_r returns int, +pgac_func_strerror_r_int, +[AC_TRY_COMPILE([#include ], +[#ifndef _AIX +int strerror_r(int, char *, size_t); +#else +/* Older AIX has 'int' for the third argument so we don't test the args. */ +int strerror_r(); +#endif], +[pgac_func_strerror_r_int=yes], +[pgac_func_strerror_r_int=no])]) +if test x"$pgac_func_strerror_r_int" = xyes ; then + AC_DEFINE(STRERROR_R_INT,, [Define to 1 if strerror_r() returns a int.]) +fi +])# PGAC_FUNC_STRERROR_R_INT + + +# PGAC_UNION_SEMUN +# ---------------- +# Check if `union semun' exists. Define HAVE_UNION_SEMUN if so. +# If it doesn't then one could define it as +# union semun { int val; struct semid_ds *buf; unsigned short *array; } +AC_DEFUN([PGAC_UNION_SEMUN], +[AC_CHECK_TYPES([union semun], [], [], +[#include +#include +#include ])])# PGAC_UNION_SEMUN + + +# PGAC_STRUCT_SOCKADDR_UN +# ----------------------- +# If `struct sockaddr_un' exists, define HAVE_UNIX_SOCKETS. +# (Requires test for !) +AC_DEFUN([PGAC_STRUCT_SOCKADDR_UN], +[AC_CHECK_TYPES([struct sockaddr_un], [AC_DEFINE(HAVE_UNIX_SOCKETS, 1, [Define to 1 if you have unix sockets.])], [], +[#include +#ifdef HAVE_SYS_UN_H +#include +#endif +])])# PGAC_STRUCT_SOCKADDR_UN + + +# PGAC_STRUCT_SOCKADDR_STORAGE +# ---------------------------- +# If `struct sockaddr_storage' exists, define HAVE_STRUCT_SOCKADDR_STORAGE. +# If it is missing then one could define it. +AC_DEFUN([PGAC_STRUCT_SOCKADDR_STORAGE], +[AC_CHECK_TYPES([struct sockaddr_storage], [], [], +[#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +])])# PGAC_STRUCT_SOCKADDR_STORAGE + +# PGAC_STRUCT_SOCKADDR_STORAGE_MEMBERS +# -------------------------------------- +# Check the members of `struct sockaddr_storage'. We need to know about +# ss_family and ss_len. (Some platforms follow RFC 2553 and call them +# __ss_family and __ss_len.) We also check struct sockaddr's sa_len; +# if we have to define our own `struct sockaddr_storage', this tells us +# whether we need to provide an ss_len field. +AC_DEFUN([PGAC_STRUCT_SOCKADDR_STORAGE_MEMBERS], +[AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family, + struct sockaddr_storage.__ss_family, + struct sockaddr_storage.ss_len, + struct sockaddr_storage.__ss_len, + struct sockaddr.sa_len], [], [], +[#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +])])# PGAC_STRUCT_SOCKADDR_STORAGE_MEMBERS + + +# PGAC_STRUCT_ADDRINFO +# ----------------------- +# If `struct addrinfo' exists, define HAVE_STRUCT_ADDRINFO. +AC_DEFUN([PGAC_STRUCT_ADDRINFO], +[AC_CHECK_TYPES([struct addrinfo], [], [], +[#include +#include +#include +])])# PGAC_STRUCT_ADDRINFO + + +# PGAC_FUNC_POSIX_SIGNALS +# ----------------------- +# Check to see if the machine has the POSIX signal interface. Define +# HAVE_POSIX_SIGNALS if so. Also set the output variable HAVE_POSIX_SIGNALS +# to yes or no. +# +# Note that this test only compiles a test program, it doesn't check +# whether the routines actually work. If that becomes a problem, make +# a fancier check. +AC_DEFUN([PGAC_FUNC_POSIX_SIGNALS], +[AC_CACHE_CHECK(for POSIX signal interface, pgac_cv_func_posix_signals, +[AC_TRY_LINK([#include +], +[struct sigaction act, oact; +sigemptyset(&act.sa_mask); +act.sa_flags = SA_RESTART; +sigaction(0, &act, &oact);], +[pgac_cv_func_posix_signals=yes], +[pgac_cv_func_posix_signals=no])]) +if test x"$pgac_cv_func_posix_signals" = xyes ; then + AC_DEFINE(HAVE_POSIX_SIGNALS,, [Define to 1 if you have the POSIX signal interface.]) +fi +HAVE_POSIX_SIGNALS=$pgac_cv_func_posix_signals +AC_SUBST(HAVE_POSIX_SIGNALS)])# PGAC_FUNC_POSIX_SIGNALS + + +# PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT +# --------------------------------------- +# Determine which format snprintf uses for long long int. We handle +# %lld, %qd, %I64d. The result is in shell variable +# LONG_LONG_INT_FORMAT. +# +# MinGW uses '%I64d', though gcc throws an warning with -Wall, +# while '%lld' doesn't generate a warning, but doesn't work. +# +AC_DEFUN([PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT], +[AC_MSG_CHECKING([snprintf format for long long int]) +AC_CACHE_VAL(pgac_cv_snprintf_long_long_int_format, +[for pgac_format in '%lld' '%qd' '%I64d'; do +AC_TRY_RUN([#include +typedef long long int ac_int64; +#define INT64_FORMAT "$pgac_format" + +ac_int64 a = 20000001; +ac_int64 b = 40000005; + +int does_int64_snprintf_work() +{ + ac_int64 c; + char buf[100]; + + if (sizeof(ac_int64) != 8) + return 0; /* doesn't look like the right size */ + + c = a * b; + snprintf(buf, 100, INT64_FORMAT, c); + if (strcmp(buf, "800000140000005") != 0) + return 0; /* either multiply or snprintf is busted */ + return 1; +} +main() { + exit(! does_int64_snprintf_work()); +}], +[pgac_cv_snprintf_long_long_int_format=$pgac_format; break], +[], +[pgac_cv_snprintf_long_long_int_format=cross; break]) +done])dnl AC_CACHE_VAL + +LONG_LONG_INT_FORMAT='' + +case $pgac_cv_snprintf_long_long_int_format in + cross) AC_MSG_RESULT([cannot test (not on host machine)]);; + ?*) AC_MSG_RESULT([$pgac_cv_snprintf_long_long_int_format]) + LONG_LONG_INT_FORMAT=$pgac_cv_snprintf_long_long_int_format;; + *) AC_MSG_RESULT(none);; +esac])# PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT + + +# PGAC_FUNC_PRINTF_ARG_CONTROL +# --------------------------------------- +# Determine if printf supports %1$ argument selection, e.g. %5$ selects +# the fifth argument after the printf print string. +# This is not in the C99 standard, but in the Single Unix Specification (SUS). +# It is used in our language translation strings. +# +AC_DEFUN([PGAC_FUNC_PRINTF_ARG_CONTROL], +[AC_MSG_CHECKING([whether printf supports argument control]) +AC_CACHE_VAL(pgac_cv_printf_arg_control, +[AC_TRY_RUN([#include +#include + +int main() +{ + char buf[100]; + + /* can it swap arguments? */ + snprintf(buf, 100, "%2\$d %1\$d", 3, 4); + if (strcmp(buf, "4 3") != 0) + return 1; + return 0; +}], +[pgac_cv_printf_arg_control=yes], +[pgac_cv_printf_arg_control=no], +[pgac_cv_printf_arg_control=cross]) +])dnl AC_CACHE_VAL +AC_MSG_RESULT([$pgac_cv_printf_arg_control]) +])# PGAC_FUNC_PRINTF_ARG_CONTROL + +# $PostgreSQL: pgsql/config/general.m4,v 1.9 2006/11/30 22:21:23 tgl Exp $ + +# This file defines new macros to process configure command line +# arguments, to replace the brain-dead AC_ARG_WITH and AC_ARG_ENABLE. +# The flaw in these is particularly that they only differentiate +# between "given" and "not given" and do not provide enough help to +# process arguments that only accept "yes/no", that require an +# argument (other than "yes/no"), etc. +# +# The point of this implementation is to reduce code size and +# redundancy in configure.in and to improve robustness and consistency +# in the option evaluation code. + + +# Convert type and name to shell variable name (e.g., "enable_long_strings") +m4_define([pgac_arg_to_variable], + [$1[]_[]patsubst($2, -, _)]) + + +# PGAC_ARG(TYPE, NAME, HELP-STRING, +# [ACTION-IF-YES], [ACTION-IF-NO], [ACTION-IF-ARG], +# [ACTION-IF-OMITTED]) +# ---------------------------------------------------------- +# This is the base layer. TYPE is either "with" or "enable", depending +# on what you like. NAME is the rest of the option name, HELP-STRING +# as usual. ACTION-IF-YES is executed if the option is given without +# an argument (or "yes", which is the same); similar for ACTION-IF-NO. + +AC_DEFUN([PGAC_ARG], +[ +pgac_args="$pgac_args pgac_arg_to_variable([$1],[$2])" +m4_case([$1], + +enable, [ +AC_ARG_ENABLE([$2], [$3], [ + case [$]enableval in + yes) + m4_default([$4], :) + ;; + no) + m4_default([$5], :) + ;; + *) + $6 + ;; + esac +], +[$7])[]dnl AC_ARG_ENABLE +], + +with, [ +AC_ARG_WITH([$2], [$3], [ + case [$]withval in + yes) + m4_default([$4], :) + ;; + no) + m4_default([$5], :) + ;; + *) + $6 + ;; + esac +], +[$7])[]dnl AC_ARG_WITH +], + +[m4_fatal([first argument of $0 must be 'enable' or 'with', not '$1'])] +) +])# PGAC_ARG + +# PGAC_ARG_CHECK() +# ---------------- +# Checks if the user passed any --with/without/enable/disable +# arguments that were not defined. Just prints out a warning message, +# so this should be called near the end, so the user will see it. + +AC_DEFUN([PGAC_ARG_CHECK], +[for pgac_var in `set | sed 's/=.*//' | $EGREP 'with_|enable_'`; do + for pgac_arg in $pgac_args with_gnu_ld; do + if test "$pgac_var" = "$pgac_arg"; then + continue 2 + fi + done + pgac_txt=`echo $pgac_var | sed 's/_/-/g'` + AC_MSG_WARN([option ignored: --$pgac_txt]) +done])# PGAC_ARG_CHECK + +# PGAC_ARG_BOOL(TYPE, NAME, DEFAULT, HELP-STRING, +# [ACTION-IF-YES], [ACTION-IF-NO]) +# ----------------------------------------------- +# Accept a boolean option, that is, one that only takes yes or no. +# ("no" is equivalent to "disable" or "without"). DEFAULT is what +# should be done if the option is omitted; it should be "yes" or "no". +# (Consequently, one of ACTION-IF-YES and ACTION-IF-NO will always +# execute.) + +AC_DEFUN([PGAC_ARG_BOOL], +[PGAC_ARG([$1], [$2], [$4], [$5], [$6], + [AC_MSG_ERROR([no argument expected for --$1-$2 option])], + [m4_case([$3], + yes, [pgac_arg_to_variable([$1], [$2])=yes +$5], + no, [pgac_arg_to_variable([$1], [$2])=no +$6], + [m4_fatal([third argument of $0 must be 'yes' or 'no', not '$3'])])])[]dnl +])# PGAC_ARG_BOOL + + +# PGAC_ARG_REQ(TYPE, NAME, HELP-STRING, [ACTION-IF-GIVEN], [ACTION-IF-NOT-GIVEN]) +# ------------------------------------------------------------------------------- +# This option will require an argument; "yes" or "no" will not be +# accepted. + +AC_DEFUN([PGAC_ARG_REQ], +[PGAC_ARG([$1], [$2], [$3], + [AC_MSG_ERROR([argument required for --$1-$2 option])], + [AC_MSG_ERROR([argument required for --$1-$2 option])], + [$4], + [$5])])# PGAC_ARG_REQ + + +# PGAC_ARG_OPTARG(TYPE, NAME, HELP-STRING, [DEFAULT-ACTION], [ARG-ACTION] +# [ACTION-ENABLED], [ACTION-DISABLED]) +# ----------------------------------------------------------------------- +# This will create an option that behaves as follows: If omitted, or +# called with "no", then set the enable_variable to "no" and do +# nothing else. If called with "yes", then execute DEFAULT-ACTION. If +# called with argument, set enable_variable to "yes" and execute +# ARG-ACTION. Additionally, execute ACTION-ENABLED if we ended up with +# "yes" either way, else ACTION-DISABLED. +# +# The intent is to allow enabling a feature, and optionally pass an +# additional piece of information. + +AC_DEFUN([PGAC_ARG_OPTARG], +[PGAC_ARG([$1], [$2], [$3], [$4], [], + [pgac_arg_to_variable([$1], [$2])=yes +$5], + [pgac_arg_to_variable([$1], [$2])=no]) +dnl Add this code only if there's a ACTION-ENABLED or ACTION-DISABLED. +m4_ifval([$6[]$7], +[ +if test "[$]pgac_arg_to_variable([$1], [$2])" = yes; then + m4_default([$6], :) +m4_ifval([$7], +[else + $7 +])[]dnl +fi +])[]dnl +])# PGAC_ARG_OPTARG diff --git a/postgresql-odbc-09.05.0400-revert-money-testsuite-fix.patch b/postgresql-odbc-09.05.0400-revert-money-testsuite-fix.patch new file mode 100644 index 0000000..4e2fa93 --- /dev/null +++ b/postgresql-odbc-09.05.0400-revert-money-testsuite-fix.patch @@ -0,0 +1,30 @@ +Revert "Fix regression test failures in param-convesrions-test." + +As we have applied a downstream patch for reverting the money type patch, +we need to also revert upstream test cases that are not supposed to be passing +in the first place. +This reverts commit eb480e19ee71b19de7f61013bdb4d5abd1cd98e4. + +Related discussion: +http://www.postgresql.org/message-id/3259874.lgiBp3an9Y@nb.usersys.redhat.com +--- + +diff --git a/test/expected/param-conversions.out b/test/expected/param-conversions.out +index 777cc94..449a398 100644 +--- a/test/expected/param-conversions.out ++++ b/test/expected/param-conversions.out +@@ -72,12 +72,12 @@ Error while executing the query + + Testing "SELECT 1.3 > ?" with SQL_C_CHAR -> SQL_FLOAT param "3', 'injected, BAD!', '1"... + SQLExecDirect failed +-22P02=ERROR: invalid input syntax for type numeric: "3', 'injected, BAD!', '1"; ++22P02=ERROR: invalid input syntax for type double precision: "3', 'injected, BAD!', '1"; + Error while executing the query + + Testing "SELECT 1.4 > ?" with SQL_C_CHAR -> SQL_FLOAT param "4 \'bad', '1"... + SQLExecDirect failed +-22P02=ERROR: invalid input syntax for type numeric: "4 \'bad', '1"; ++22P02=ERROR: invalid input syntax for type double precision: "4 \'bad', '1"; + Error while executing the query + + Testing "SELECT 1-?" with SQL_C_CHAR -> SQL_INTEGER param "-1"... diff --git a/postgresql-odbc-09.06.0200-revert-money-fix.patch b/postgresql-odbc-09.06.0200-revert-money-fix.patch new file mode 100644 index 0000000..0fc8263 --- /dev/null +++ b/postgresql-odbc-09.06.0200-revert-money-fix.patch @@ -0,0 +1,95 @@ +From 56ca20671a9fb87d7c6ca011207e9628349c9301 Mon Sep 17 00:00:00 2001 +From: Pavel Raiskup +Date: Mon, 13 Mar 2017 10:38:54 +0100 +Subject: [PATCH] Revert "Fix the bug about MONEY type." + +This reverts commit d5374bcc4d58556eb5cc70241c44dcad4d9b441e. + +Proposed upstream: +http://www.postgresql.org/message-id/3259874.lgiBp3an9Y@nb.usersys.redhat.com +--- + convert.c | 45 ++++++++------------------------------------- + pgtypes.c | 4 ++++ + 2 files changed, 12 insertions(+), 37 deletions(-) + +diff --git a/convert.c b/convert.c +index f118e30..00904d8 100644 +--- a/convert.c ++++ b/convert.c +@@ -5363,50 +5363,21 @@ cleanup: + static BOOL + convert_money(const char *s, char *sout, size_t soutmax) + { +- char in, decp = 0; + size_t i = 0, + out = 0; +- int num_in = -1, period_in = -1, comma_in = -1; + + for (i = 0; s[i]; i++) + { +- switch (in = s[i]) ++ if (s[i] == '$' || s[i] == ',' || s[i] == ')') ++ ; /* skip these characters */ ++ else + { +- case '.': +- if (period_in < 0) +- period_in = i; +- break; +- case ',': +- if (comma_in < 0) +- comma_in = i; +- break; +- default: +- if ('0' <= in && '9' >= in) +- num_in = i; +- break; +- } +- } +- if (period_in > comma_in) +- { +- if ( period_in >= num_in - 2) +- decp = '.'; +- } +- else if (comma_in >= 0 && +- comma_in >= num_in - 2) +- decp = ','; +- for (i = 0; s[i] && out + 1 < soutmax; i++) +- { +- switch (in = s[i]) +- { +- case '(': +- case '-': ++ if (out + 1 >= soutmax) ++ return FALSE; /* sout is too short */ ++ if (s[i] == '(') + sout[out++] = '-'; +- break; +- default: +- if (in >= '0' && in <= '9') +- sout[out++] = in; +- else if (in == decp) +- sout[out++] = '.'; ++ else ++ sout[out++] = s[i]; + } + } + sout[out] = '\0'; +diff --git a/pgtypes.c b/pgtypes.c +index a58925c..d42179c 100644 +--- a/pgtypes.c ++++ b/pgtypes.c +@@ -1273,6 +1273,10 @@ sqltype_to_pgcast(const ConnectionClass *conn, SQLSMALLINT fSqlType) + case SQL_DATE: + pgCast = "::date"; + break; ++ case SQL_DOUBLE: ++ case SQL_FLOAT: ++ pgCast = "::float8"; ++ break; + case SQL_DECIMAL: + case SQL_NUMERIC: + pgCast = "::numeric"; +-- +2.9.3 + diff --git a/postgresql-odbc.spec b/postgresql-odbc.spec new file mode 100644 index 0000000..a6cbb89 --- /dev/null +++ b/postgresql-odbc.spec @@ -0,0 +1,404 @@ +%bcond_without check + +%global upstream_name psqlodbc + +Name: postgresql-odbc +Summary: PostgreSQL ODBC driver +Version: 12.02.0000 +Release: 2%{?dist} +License: LGPLv2+ +URL: https://odbc.postgresql.org/ + +Source0: http://ftp.postgresql.org/pub/odbc/versions/src/%{upstream_name}-%{version}.tar.gz + +Patch0: postgresql-odbc-09.06.0200-revert-money-fix.patch +Patch1: postgresql-odbc-09.05.0400-revert-money-testsuite-fix.patch + +BuildRequires: gcc +BuildRequires: unixODBC-devel +BuildRequires: pkgconfig(libpq) + +%if %{with check} +BuildRequires: postgresql-test-rpm-macros +%endif + +Provides: %upstream_name = %version-%release + +# This spec file and ancillary files are licensed in accordance with +# the psqlodbc license. + +%description +This package includes the driver needed for applications to access a +PostgreSQL system via ODBC (Open Database Connectivity). + + +%prep +%autosetup -p1 -n %{upstream_name}-%{version} + +cat <README.rpmdist +The upstream psqlodbc testsuite is distributed in '%{name}-tests' +(sub)package. +EOF + +%build +%configure --with-unixodbc --disable-dependency-tracking +# GCC 10 defaults to -fno-common +# https://gcc.gnu.org/gcc-10/changes.html (see C section) +make %{?_smp_mflags} CFLAGS="%{optflags} -fcommon" + + +%install +make DESTDIR=$RPM_BUILD_ROOT install + +%global testsuitedir %{_libdir}/%{name} +install -d -m 755 $RPM_BUILD_ROOT/%{testsuitedir} +cp -R test $RPM_BUILD_ROOT/%{testsuitedir} +sed -i 's~^drvr=.*~drvr=%{_libdir}/psqlodbc~' $RPM_BUILD_ROOT/%{testsuitedir}/test/odbcini-gen.sh + +# Provide the old library name "psqlodbc.so" as a symlink, +# and remove the rather useless .la file +pushd ${RPM_BUILD_ROOT}%{_libdir} + ln -s psqlodbcw.so psqlodbc.so + rm psqlodbcw.la psqlodbca.la +popd + +%if %{with check} +%check +%postgresql_tests_run + +# GCC 10 defaults to -fno-common +# https://gcc.gnu.org/gcc-10/changes.html (see C section) +cd test && make installcheck %{_smp_mflags} CFLAGS="%{optflags} -fcommon" || { + echo "=== trying to find all regression.diffs files in build directory ===" + find -name regression.diffs | while read line; do + cat "$line" + done + false +} +%endif + + +%ldconfig_scriptlets + + +%package tests +Summary: Testsuite files for psqlodbc +Requires: postgresql-test +Requires: %{name} = %{version}-%{release} +# Those are requires to successful testsuite run +Requires: gcc make unixODBC-devel + + +%description tests +The postgresql-odbc-tests package contains files needed for various tests for +the PostgreSQL unixODBC driver. + + +%files +%{_libdir}/psqlodbc.so +%{_libdir}/psqlodbca.so +%{_libdir}/psqlodbcw.so +%doc license.txt readme.txt docs/* README.rpmdist + + +%files tests +%doc license.txt +%dir %{testsuitedir} +%defattr(-,postgres,postgres) +%{testsuitedir}/test + + +%changelog +* Tue Jul 28 2020 Fedora Release Engineering - 12.02.0000-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jun 02 2020 Ondrej Dubaj - 12.02.0000-1 +- Rebase to upstream release 12.02.0000 + +* Mon Mar 09 2020 Patrik Novotný - 12.01.0000-1 +- Rebase to upstream release 12.01.0000 + +* Thu Jan 30 2020 Fedora Release Engineering - 10.03.0000-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jul 26 2019 Fedora Release Engineering - 10.03.0000-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Feb 02 2019 Fedora Release Engineering - 10.03.0000-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 10.03.0000-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon May 21 2018 Pavel Raiskup - 10.03.0000-1 +- update to new upstream release, per announcement: + https://www.postgresql.org/message-id/20180519131632.8E59CB40E51%40winpg.jp + +* Fri Apr 13 2018 Pavel Raiskup - 10.02.0000-2 +- BR postgresql-test-rpm-macros +- add %%bcond for check section + +* Mon Apr 02 2018 Pavel Raiskup - 10.02.0000-1 +- update to new upstream release, per announcement: + https://www.postgresql.org/message-id/20180330143925.88CEDB40E51%40winpg.jp + +* Fri Feb 09 2018 Fedora Release Engineering - 10.01.0000-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Dec 27 2017 Pavel Raiskup - 10.01.0000-1 +- update to new upstream release, per announcement: + https://www.postgresql.org/message-id/20171227144219.0ABC4B4C417%40winpg.jp + +* Mon Oct 23 2017 Pavel Raiskup - 10.00.0000-1 +- update to new upstream release, per announcement: + https://www.postgresql.org/message-id/20171013143455.9D0E5B4C412%40winpg.jp + +* Tue Sep 05 2017 Pavel Raiskup - 09.06.0500-1 +- update to new upstream release, per: + https://www.postgresql.org/message-id/20170905143318.95448B4C411@winpg.jp + +* Thu Jul 27 2017 Pavel Raiskup - 09.06.0410-1 + https://odbc.postgresql.org/docs/release.html + +* Thu Jul 27 2017 Fedora Release Engineering - 09.06.0310-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri May 12 2017 Pavel Raiskup - 09.06.0310-1 +- rebase to latest upstream version, per release notes: + https://odbc.postgresql.org/docs/release.html + +* Tue May 09 2017 Pavel Raiskup - 09.06.0300-1 +- rebase to latest upstream version, per release notes: + https://odbc.postgresql.org/docs/release.html + +* Mon Mar 13 2017 Pavel Raiskup - 09.06.0200-1 +- rebase to latest upstream version, per release notes: + https://odbc.postgresql.org/docs/release.html + +* Mon Feb 06 2017 Pavel Raiskup - 09.06.0100-1 +- rebase to latest upstream version, per release notes: + https://odbc.postgresql.org/docs/release.html + +* Thu Oct 20 2016 Pavel Raiskup - 09.05.0400-4 +- provide 'psqlodbc', we possibly should rename the package in future + +* Wed Oct 05 2016 Pavel Raiskup - 09.05.0400-3 +- depend on postgresql-setup 5.0 (in postgresql-devel package) + +* Mon Aug 29 2016 Petr Kubat - 09.05.0400-2 +- once again revert upstream commit d5374bcc4d +- also revert its accompanying testsuite commit eb480e19ee + +* Thu Aug 11 2016 Petr Kubat - 09.05.0400-1 +- rebase to latest upstream version, per release notes: + https://odbc.postgresql.org/docs/release.html + +* Tue Jul 26 2016 Pavel Raiskup - 09.05.0300-2 +- backport upstream fixes for testsuite failures (rhbz#1350486) + +* Sat Jun 18 2016 Pavel Raiskup - 09.05.0300-1 +- rebase to latest upstream version, per release notes: + https://odbc.postgresql.org/docs/release.html + +* Mon May 02 2016 Pavel Raiskup - 09.05.0210-1 +- rebase to latest upstream version, per release notes: + https://odbc.postgresql.org/docs/release.html +- revert one upstream commit to fix testsuite issues +- disable one armv7hl related issue during self-testing (rhbz#1330031) + +* Thu Apr 14 2016 Pavel Raiskup - 09.05.0200-2 +- enable testsuite during build + +* Tue Apr 12 2016 Pavel Raiskup - 09.05.0200-1 +- rebase to latest upstream version, per release notes: + https://odbc.postgresql.org/docs/release.html + +* Thu Feb 04 2016 Fedora Release Engineering - 09.05.0100-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Mon Jan 11 2016 Pavel Raiskup - 09.05.0100-1 +- rebase to latest upstream version, per release notes: + http://psqlodbc.projects.pgfoundry.org/docs/release.html + +* Thu Jun 18 2015 Fedora Release Engineering - 09.03.0400-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Wed Nov 19 2014 Pavel Raiskup - 09.03.0400-3 +- fix testsuite requirements + +* Wed Nov 19 2014 Pavel Raiskup - 09.03.0400-2 +- install the testsuite + +* Wed Oct 29 2014 Pavel Raiskup - 09.03.0400-1 +- rebase to latest upstream version, per release notes: + http://psqlodbc.projects.pgfoundry.org/docs/release.html + +* Sun Aug 17 2014 Fedora Release Engineering - 09.03.0300-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 09.03.0300-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Mon May 19 2014 Pavel Raiskup - 09.03.0300-2 +- run upstream testsuite when '%%runselftest' defined + +* Mon May 19 2014 Pavel Raiskup - 09.03.0300-1 +- rebase to latest upstream version, per release notes: + http://psqlodbc.projects.pgfoundry.org/docs/release.html + +* Wed Apr 23 2014 Pavel Raiskup - 09.03.0210-1 +- rebase to latest upstream version (#1090345), per release notes: + http://psqlodbc.projects.pgfoundry.org/docs/release.html + +* Thu Dec 19 2013 Pavel Raiskup - 09.03.0100-1 +- rebase to latest upstream version + +* Mon Nov 18 2013 Pavel Raiskup - 09.02.0100-1 +- rebase to latest upstream version + +* Sun Aug 04 2013 Fedora Release Engineering - 09.01.0200-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Feb 14 2013 Fedora Release Engineering - 09.01.0200-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Fri Nov 16 2012 Tom Lane 09.01.0200-2 +- Update tarball URL in specfile (no actual package change) + +* Mon Aug 20 2012 Tom Lane 09.01.0200-1 +- Update to version 09.01.0200 +- Minor specfile cleanup per suggestions from Tom Callaway +Related: #845110 + +* Sat Jul 21 2012 Fedora Release Engineering - 09.01.0100-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Jan 10 2012 Tom Lane 09.01.0100-1 +- Update to version 09.01.0100 + +* Wed Feb 09 2011 Fedora Release Engineering - 09.00.0200-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Dec 29 2010 Tom Lane 09.00.0200-1 +- Update to version 09.00.0200 + +* Wed Jan 20 2010 Tom Lane 08.04.0200-2 +- Correct Source0: tag and comment to reflect how to get the tarball + +* Wed Dec 30 2009 Tom Lane 08.04.0200-1 +- Update to version 08.04.0200 + +* Fri Aug 28 2009 Tom Lane 08.04.0100-2 +- Rebuild with new openssl + +* Tue Aug 18 2009 Tom Lane 08.04.0100-1 +- Update to version 08.04.0100 + +* Sun Jul 26 2009 Fedora Release Engineering - 08.03.0200-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Feb 26 2009 Fedora Release Engineering - 08.03.0200-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Fri Feb 20 2009 Tom Lane 08.03.0200-2 +- Rebuild for unixODBC 2.2.14. + +* Tue Aug 5 2008 Tom Lane 08.03.0200-1 +- Update to version 08.03.0200 + +* Tue Feb 12 2008 Tom Lane 08.03.0100-1 +- Update to version 08.03.0100 +- Since it looks like upstream has decided to stick with psqlodbcw.so + permanently, allow the library to have that name. But continue to + provide psqlodbc.so as a symlink. + +* Fri Nov 2 2007 Tom Lane 08.02.0500-1 +- Update to version 08.02.0500 + +* Thu Aug 2 2007 Tom Lane 08.02.0200-2 +- Update License tag to match code. + +* Wed Apr 25 2007 Tom Lane 08.02.0200-1 +- Update to version 08.02.0200 + +* Mon Dec 11 2006 Tom Lane 08.01.0200-4 +- Rebuild for new Postgres libraries + +* Wed Jul 12 2006 Jesse Keating - 08.01.0200-3.1 +- rebuild + +* Sat Jun 10 2006 Tom Lane 08.01.0200-3 +- Fix BuildRequires: for mock build environment + +* Wed Mar 22 2006 Tom Lane 08.01.0200-2 +- Change library name back to psqlodbc.so, because it appears that upstream + will revert to that name in next release; no point in thrashing the name. +- Include documentation files unaccountably omitted before (bug #184158) + +* Fri Feb 10 2006 Jesse Keating - 08.01.0200-1.2 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 08.01.0200-1.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Fri Feb 3 2006 Tom Lane 08.01.0200-1 +- Update to version 08.01.0200. +- Upstream now calls the library psqlodbcw.so ... add a symlink to avoid + breaking existing odbc configuration files. + +* Wed Dec 14 2005 Tom Lane 08.01.0102-1 +- Update to version 08.01.0102. +- Add buildrequires postgresql-devel (bz #174505) + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Mon Nov 7 2005 Tom Lane 08.01.0100-1 +- Update to version 08.01.0100. + +* Wed Mar 2 2005 Tom Lane 08.00.0100-1 +- Update to version 08.00.0100. + +* Fri Nov 12 2004 Tom Lane 7.3-9 +- back-port 64-bit fixes from current upstream (bug #139004) + +* Tue Sep 21 2004 Tom Lane 7.3-8 +- rebuilt + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Wed Mar 10 2004 Tom Lane +- Correct License: annotation. + +* Tue Mar 02 2004 Elliot Lee +- rebuilt + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Fri Nov 21 2003 David Jee 7.3-5 +- rebuild + +* Wed Nov 05 2003 David Jee 7.3-4 +- import new community version 07.03.0200 + +* Mon Sep 15 2003 Andrew Overholt 7.3-3 +- autotools fixes (courtesy Alex Oliva and + Owen Taylor ) + +* Tue Jul 08 2003 Andrew Overholt 7.3-3 +- allow use with unixODBC (courtesy Troels Arvin) [Bug #97998] + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Mon Jun 02 2003 Andrew Overholt 7.3-1 +- sync to new community version (07.03.0100 => v7.3, r1) + +* Thu Jan 23 2003 Tim Powers 1-2 +- rebuild + +* Tue Jan 14 2003 Andrew Overholt +- 1-1 +- initial build (just took old package sections) diff --git a/sources b/sources new file mode 100644 index 0000000..c94fcaf --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (psqlodbc-12.02.0000.tar.gz) = 3e1d09282db555fbfe8b549735cb8690a1a10ebfab7459876557fab00b418681100e79c24604d25dbd6362ffe9a4b47dbba5d84d551893b3c51458120b378e97