[mingw-postgresql] Enable more features, add patch to fix RHBZ 996529
mooninite
mooninite at fedoraproject.org
Fri Aug 16 01:54:36 UTC 2013
commit 0086e91fe0fc8b907c24fe486a6f2ea0a8b0afe2
Author: Michael Cronenworth <mike at cchtml.com>
Date: Thu Aug 15 20:54:03 2013 -0500
Enable more features, add patch to fix RHBZ 996529
mingw-postgresql.spec | 45 ++++++++++++-
postgresql-mingw-errno.patch | 152 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 194 insertions(+), 3 deletions(-)
---
diff --git a/mingw-postgresql.spec b/mingw-postgresql.spec
index 0bcc6a3..55dcb2a 100644
--- a/mingw-postgresql.spec
+++ b/mingw-postgresql.spec
@@ -2,27 +2,37 @@
Name: mingw-postgresql
Version: 9.2.4
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: MinGW Windows PostgreSQL library
License: PostgreSQL
URL: http://www.postgresql.org/
Source0: ftp://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2
+# Use Windows error codes in checking connection state, sent upstream
+Patch100: postgresql-mingw-errno.patch
BuildArch: noarch
BuildRequires: mingw32-filesystem >= 95
BuildRequires: mingw32-gcc
BuildRequires: mingw32-binutils
+BuildRequires: mingw32-gettext
+BuildRequires: mingw32-libxml2
+BuildRequires: mingw32-libxslt
BuildRequires: mingw32-openssl
+BuildRequires: mingw32-tcl
BuildRequires: mingw32-readline
BuildRequires: mingw32-zlib
BuildRequires: mingw64-filesystem >= 95
BuildRequires: mingw64-gcc
BuildRequires: mingw64-binutils
+BuildRequires: mingw64-gettext
+BuildRequires: mingw64-libxml2
+BuildRequires: mingw64-libxslt
BuildRequires: mingw64-openssl
BuildRequires: mingw64-readline
+BuildRequires: mingw64-tcl
BuildRequires: mingw64-zlib
BuildRequires: bison flex pkgconfig
@@ -55,11 +65,34 @@ database management system (DBMS).
%prep
%setup -q -n postgresql-%{version}
+%patch100 -p1 -b .mingw-errno
%build
-%mingw_configure \
- --with-openssl
+mkdir build_win32
+pushd build_win32
+%mingw32_configure \
+ --with-openssl \
+ --enable-thread-safety \
+ --enable-integer-datetimes \
+ --enable-nls \
+ --with-ldap \
+ --with-libxml \
+ --with-libxslt \
+ --with-tcl --with-tclconfig=/usr/i686-w64-mingw32/sys-root/mingw/lib
+popd
+mkdir build_win64
+pushd build_win64
+%mingw64_configure \
+ --with-openssl \
+ --enable-thread-safety \
+ --enable-integer-datetimes \
+ --enable-nls \
+ --with-ldap \
+ --with-libxml \
+ --with-libxslt \
+ --with-tcl --with-tclconfig=/usr/x86_64-w64-mingw32/sys-root/mingw/lib
+popd
# Make DLL definition file visible during each arch build
ln -s %{_builddir}/%{buildsubdir}/src/interfaces/libpq/libpqdll.def ./build_win32/src/interfaces/libpq/
ln -s %{_builddir}/%{buildsubdir}/src/interfaces/libpq/libpqdll.def ./build_win64/src/interfaces/libpq/
@@ -92,6 +125,8 @@ rm $RPM_BUILD_ROOT%{mingw32_bindir}/pgevent.dll
rm $RPM_BUILD_ROOT%{mingw64_bindir}/pgevent.dll
# remove server support files
+rm -rf $RPM_BUILD_ROOT%{mingw32_bindir}/pltcl*
+rm -rf $RPM_BUILD_ROOT%{mingw64_bindir}/pltcl*
rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}
rm -rf $RPM_BUILD_ROOT%{mingw64_datadir}
@@ -156,6 +191,10 @@ mv $RPM_BUILD_ROOT%{mingw64_libdir}/libpq.a $RPM_BUILD_ROOT%{mingw64_libdir}/lib
%changelog
+* Thu Aug 15 2013 Michael Cronenworth <mike at cchtml.com> - 9.2.4-3
+- Enable NLS, LDAP, TCL, and XML features.
+- Patch for Windows error checking (RHBZ# 996529)
+
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 9.2.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
diff --git a/postgresql-mingw-errno.patch b/postgresql-mingw-errno.patch
new file mode 100644
index 0000000..9e42469
--- /dev/null
+++ b/postgresql-mingw-errno.patch
@@ -0,0 +1,152 @@
+--- postgresql-9.2.4/src/interfaces/libpq/fe-connect.c.orig 2013-08-15 09:08:59.850609595 -0500
++++ postgresql-9.2.4/src/interfaces/libpq/fe-connect.c 2013-08-15 09:42:59.001463906 -0500
+@@ -1778,10 +1778,16 @@
+ if (connect(conn->sock, addr_cur->ai_addr,
+ addr_cur->ai_addrlen) < 0)
+ {
++#ifndef WIN32
+ if (SOCK_ERRNO == EINPROGRESS ||
+ SOCK_ERRNO == EWOULDBLOCK ||
+ SOCK_ERRNO == EINTR ||
++#else
++ if (SOCK_ERRNO == WSAEINPROGRESS ||
++ SOCK_ERRNO == WSAEWOULDBLOCK ||
++ SOCK_ERRNO == WSAEINTR ||
+ SOCK_ERRNO == 0)
++#endif
+ {
+ /*
+ * This is fine - we're in non-blocking mode, and
+--- postgresql-9.2.4/src/interfaces/libpq/fe-misc.c.orig 2013-04-01 13:20:36.000000000 -0500
++++ postgresql-9.2.4/src/interfaces/libpq/fe-misc.c 2013-08-15 10:08:03.190928760 -0500
+@@ -656,7 +656,11 @@
+ conn->inBufSize - conn->inEnd);
+ if (nread < 0)
+ {
++#ifndef WIN32
+ if (SOCK_ERRNO == EINTR)
++#else
++ if (SOCK_ERRNO == WSAEINTR)
++#endif
+ goto retry3;
+ /* Some systems return EAGAIN/EWOULDBLOCK for no data */
+ #ifdef EAGAIN
+@@ -664,12 +668,20 @@
+ return someread;
+ #endif
+ #if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN))
++#ifndef WIN32
+ if (SOCK_ERRNO == EWOULDBLOCK)
++#else
++ if (SOCK_ERRNO == WSAEWOULDBLOCK)
++#endif
+ return someread;
+ #endif
+ /* We might get ECONNRESET here if using TCP and backend died */
+ #ifdef ECONNRESET
++#ifndef WIN32
+ if (SOCK_ERRNO == ECONNRESET)
++#else
++ if (SOCK_ERRNO == WSAECONNRESET)
++#endif
+ goto definitelyFailed;
+ #endif
+ /* pqsecure_read set the error message for us */
+@@ -749,7 +761,11 @@
+ conn->inBufSize - conn->inEnd);
+ if (nread < 0)
+ {
++#ifndef WIN32
+ if (SOCK_ERRNO == EINTR)
++#else
++ if (SOCK_ERRNO == WSAEINTR)
++#endif
+ goto retry4;
+ /* Some systems return EAGAIN/EWOULDBLOCK for no data */
+ #ifdef EAGAIN
+@@ -757,12 +773,20 @@
+ return 0;
+ #endif
+ #if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN))
++#ifndef WIN32
+ if (SOCK_ERRNO == EWOULDBLOCK)
++#else
++ if (SOCK_ERRNO == WSAEWOULDBLOCK)
++#endif
+ return 0;
+ #endif
+ /* We might get ECONNRESET here if using TCP and backend died */
+ #ifdef ECONNRESET
++#ifndef WIN32
+ if (SOCK_ERRNO == ECONNRESET)
++#else
++ if (SOCK_ERRNO == WSAECONNRESET)
++#endif
+ goto definitelyFailed;
+ #endif
+ /* pqsecure_read set the error message for us */
+@@ -838,10 +862,18 @@
+ break;
+ #endif
+ #if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN))
++#ifndef WIN32
+ case EWOULDBLOCK:
++#else
++ case WSAEWOULDBLOCK:
++#endif
+ break;
+ #endif
++#ifndef WIN32
+ case EINTR:
++#else
++ case WSAEINTR:
++#endif
+ continue;
+
+ default:
+--- postgresql-9.2.4/src/interfaces/libpq/fe-secure.c.orig 2013-08-15 10:10:44.039355056 -0500
++++ postgresql-9.2.4/src/interfaces/libpq/fe-secure.c 2013-08-15 10:22:57.767650717 -0500
+@@ -433,12 +433,20 @@
+ #if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN))
+ case EWOULDBLOCK:
+ #endif
++#ifndef WIN32
+ case EINTR:
++#else
++ case WSAEWOULDBLOCK:
++ case WSAEINTR:
++#endif
+ /* no error message, caller is expected to retry */
+ break;
+
+ #ifdef ECONNRESET
+ case ECONNRESET:
++#ifdef WIN32
++ case WSAECONNRESET:
++#endif
+ printfPQExpBuffer(&conn->errorMessage,
+ libpq_gettext(
+ "server closed the connection unexpectedly\n"
+@@ -617,7 +625,12 @@
+ #if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN))
+ case EWOULDBLOCK:
+ #endif
++#ifndef WIN32
+ case EINTR:
++#else
++ case WSAEWOULDBLOCK:
++ case WSAEINTR:
++#endif
+ /* no error message, caller is expected to retry */
+ break;
+
+@@ -629,6 +642,9 @@
+ #ifdef ECONNRESET
+ case ECONNRESET:
+ #endif
++#ifdef WIN32
++ case WSAECONNRESET:
++#endif
+ printfPQExpBuffer(&conn->errorMessage,
+ libpq_gettext(
+ "server closed the connection unexpectedly\n"
More information about the scm-commits
mailing list