- Remove configure.ac.patch (was only applied for 1110 anyway)

- Add 0001-build-adjust-configure-for-postgresql-10-11.patch

OBS-URL: https://build.opensuse.org/package/show/server:database/libdbi-drivers?expand=0&rev=23
This commit is contained in:
Jan Engelhardt 2019-03-21 15:01:53 +00:00 committed by Git OBS Bridge
parent 147a5da203
commit a29fb305df
5 changed files with 132 additions and 25 deletions

View File

@ -0,0 +1,120 @@
From 7a8e24ec1cf763226f4be31ba1018d888d4989f3 Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@inai.de>
Date: Thu, 21 Mar 2019 14:21:27 +0100
Subject: [PATCH] build: adjust configure for postgresql 10/11
The openSUSE PostgreSQL 11 no longer ships the pg_config program.
Instead, there exists a .pc file (likewise in pg10), so make use of
that, by default.
The old --with-pgsql-inc and --with-pgsql-lib option are going away
and replaced by the standardized mechanisms pkg-config.m4 has in
store for when there is no .pc file or an unusual location:
./configure --with-pgsql pgsql_CFLAGS="-I/opt/pgsql/include" \
pgsql_LIBS="-L/opt/pgsql/lib -lpq"
---
acinclude.m4 | 66 ++++++---------------------------------
drivers/pgsql/Makefile.am | 4 +--
2 files changed, 12 insertions(+), 58 deletions(-)
diff --git a/acinclude.m4 b/acinclude.m4
index 85eec28..e99318f 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -154,64 +154,18 @@ AC_SUBST(MYSQL_TEST)
AC_DEFUN([AC_CHECK_PGSQL],
[
-AM_CONDITIONAL(HAVE_PGSQL, false)
-ac_pgsql="no"
-ac_pgsql_incdir="no"
-ac_pgsql_libdir="no"
-# exported variables
-PGSQL_LIBS=""
-PGSQL_LDFLAGS=""
-PGSQL_INCLUDE=""
-PGSQL_TEST=""
+AC_ARG_WITH([pgsql], [AS_HELP_STRING([--without-pgsql], [Build without pgsql output plugin [default=test]])],
+ [ac_pgsql="$withval"], [ac_pgsql=auto])
+enable_pgsql=no
+AS_IF([test "$ac_pgsql" = "auto"], [
+ PKG_CHECK_MODULES([pgsql], [libpq], [enable_pgsql=yes], [:])
+], [test "$ac_pgsql" != "no"], [
+ PKG_CHECK_MODULES([pgsql], [libpq], [enable_pgsql=yes])
+])
-AC_MSG_CHECKING(for PostgreSQL support)
-
-AC_ARG_WITH(pgsql,
- [ --with-pgsql Include PostgreSQL support.],
- [ ac_pgsql="$withval" ])
-AC_ARG_WITH(pgsql-incdir,
- [ --with-pgsql-incdir Specifies where the PostgreSQL include files are.],
- [ ac_pgsql_incdir="$withval" ])
-AC_ARG_WITH(pgsql-libdir,
- [ --with-pgsql-libdir Specifies where the PostgreSQL libraries are.],
- [ ac_pgsql_libdir="$withval" ])
-
-if test "$ac_pgsql" = "yes"; then
- AC_MSG_RESULT([yes])
- if test "$ac_pgsql_incdir" = "no" || test "$ac_pgsql_libdir" = "no"; then
- AC_CHECK_PROG([PG_CONFIG], [pg_config], [yes], [no])
- if test "$PG_CONFIG" = "no"; then
- AC_MSG_ERROR([cannot auto-configure PostgreSQL without pg_config])
- fi
- fi
- if test "$ac_pgsql_incdir" = "no"; then
- PGSQL_INCLUDE="-I"`pg_config --includedir`
- else
- PGSQL_INCLUDE=-I$ac_pgsql_incdir
- fi
- if test "$ac_pgsql_libdir" = "no"; then
- PGSQL_LDFLAGS=`pg_config --libdir`
- else
- PGSQL_LDFLAGS=-L$ac_pgsql_libdir
- fi
-
- PGSQL_LIBS=-lpq
- PGSQL_TEST="test_pgsql.sh"
-
-
- AM_CONDITIONAL(HAVE_PGSQL, true)
-
- AC_SUBST(PGSQL_LIBS)
- AC_SUBST(PGSQL_INCLUDE)
- AC_MSG_CHECKING(for PostgreSQL includes)
- AC_MSG_RESULT($PGSQL_INCLUDE)
- AC_SUBST(PGSQL_LDFLAGS)
- AC_MSG_CHECKING(for PostgreSQL libraries)
- AC_MSG_RESULT($PGSQL_LDFLAGS)
-else
- AC_MSG_RESULT(no)
-fi
+AM_CONDITIONAL([HAVE_PGSQL], [test "$enable_pgsql" = yes])
+AS_IF([test "$enable_pgsql" = yes], [PGSQL_TEST="test_pgsql.sh"])
AC_SUBST(PGSQL_TEST)
])
diff --git a/drivers/pgsql/Makefile.am b/drivers/pgsql/Makefile.am
index 058a9b5..f482eac 100644
--- a/drivers/pgsql/Makefile.am
+++ b/drivers/pgsql/Makefile.am
@@ -28,11 +28,11 @@ pgsql_sources =
endif
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include @DBI_INCLUDE@ @PGSQL_INCLUDE@
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include @DBI_INCLUDE@ ${pgsql_CFLAGS}
driver_LTLIBRARIES = $(pgsql_ltlibs)
libdbdpgsql_la_LDFLAGS = $(pgsql_ldflags)
-libdbdpgsql_la_LIBADD = @PGSQL_LDFLAGS@ @PGSQL_LIBS@ @LIBADD_LIBDBI@
+libdbdpgsql_la_LIBADD = ${pgsql_LIBS} @LIBADD_LIBDBI@
libdbdpgsql_la_SOURCES = $(pgsql_sources)
libdbdpgsql_la_DEPENDENCIES = dbd_pgsql.h
--
2.21.0

View File

@ -1,14 +1,14 @@
<services>
<service name="tar_scm" mode="localonly">
<service name="tar_scm" mode="disabled">
<param name="scm">git</param>
<param name="url">git://git.code.sf.net/p/libdbi-drivers/libdbi-drivers</param>
<param name="revision">master</param>
<param name="parent-tag">libdbi-drivers-0.9.0</param>
<param name="versionformat">0.9.0.g@TAG_OFFSET@</param>
</service>
<service name="recompress" mode="localonly">
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="localonly"/>
<service name="set_version" mode="disabled"/>
</services>

View File

@ -1,11 +0,0 @@
--- libdbi-drivers/configure.ac.orig 2016-02-04 10:12:56.049468401 +0100
+++ libdbi-drivers/configure.ac 2016-02-04 10:13:10.336666283 +0100
@@ -3,7 +3,7 @@
AC_CONFIG_SRCDIR([drivers/sqlite/dbd_sqlite.c])
AM_MAINTAINER_MODE
-AM_INIT_AUTOMAKE([foreign dist-zip subdir-objects serial-tests])
+AM_INIT_AUTOMAKE([foreign dist-zip subdir-objects])
AM_CONFIG_HEADER(config.h)
AC_LIBTOOL_WIN32_DLL
AC_CONFIG_MACRO_DIR([m4])

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Mar 21 13:22:03 UTC 2019 - Jan Engelhardt <jengelh@inai.de>
- Remove configure.ac.patch (was only applied for 1110 anyway)
- Add 0001-build-adjust-configure-for-postgresql-10-11.patch
-------------------------------------------------------------------
Mon Mar 19 11:05:34 UTC 2018 - mpluskal@suse.com

View File

@ -31,8 +31,7 @@ URL: http://libdbi-drivers.sf.net/
#Source: http://downloads.sf.net/libdbi-drivers/%name-%version.tar.gz
Source: %name-%version.tar.xz
Patch1: configure.ac.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Patch1: 0001-build-adjust-configure-for-postgresql-10-11.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gettext
@ -103,10 +102,7 @@ libdbi database independent abstraction layer. Switching a program's driver
does not require recompilation or rewriting source code.
%prep
%setup -q
%if 0%{?suse_version} == 1110
%patch -P 1 -p1
%endif
%autosetup -p1
chmod a-x COPYING
# Fake the __DATE__ so we do not needelessly rebuild
@ -132,7 +128,7 @@ export CFLAGS="%optflags -O0 -ggdb3"
make %{?_smp_mflags}
%install
make install DESTDIR="%buildroot"
%make_install
find "%buildroot" -type f -name "*.la" -delete
%check
@ -140,26 +136,22 @@ make check || :
%if %build_freetds
%files dbd-freetds
%defattr(-,root,root)
%doc COPYING
%dir %_libdir/dbd
%_libdir/dbd/libdbdfreetds.so
%endif
%files dbd-mysql
%defattr(-,root,root)
%doc COPYING
%dir %_libdir/dbd
%_libdir/dbd/libdbdmysql.so
%files dbd-pgsql
%defattr(-,root,root)
%doc COPYING
%dir %_libdir/dbd
%_libdir/dbd/libdbdpgsql.so
%files dbd-sqlite3
%defattr(-,root,root)
%doc COPYING
%dir %_libdir/dbd
%_libdir/dbd/libdbdsqlite3.so