File psqlODBC.spec of Package psqlODBC
#
# spec file for package psqlODBC (Version 08.03.0200)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: psqlODBC
BuildRequires: openssl-devel postgresql-devel unixODBC-devel
Url: http://pgfoundry.org/projects/psqlodbc
%define tarname psqlodbc
Summary: ODBC Driver for PostgreSQL
Version: 08.03.0200
Release: 5
License: LGPLv2.1+
Group: Productivity/Databases/Clients
Source0: %tarname-%{version}.tar.bz2
Patch1: psqlODBC-literal.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: /usr/bin/odbcinst
Obsoletes: pg_odbc postgresql-odbc
Provides: pg_odbc postgresql-odbc pg_iface:/usr/lib/pgsql/odbcinst.ini
%description
This package contains the ODBC (Open DataBase Connectivity) driver and
sample configuration files needed for applications to access a
PostgreSQL database using ODBC.
Authors:
--------
Dave Page
Peter Eisentraut
Ludek Finstrle
Bruce Momjian
Anoop Kumar
Hiroshi Saito
%prep
%setup -q -n %tarname-%version
%patch1
%build
# they don't ship configure.in, so we have to patch configure :(
sed -i '/LDFLAGS=/s/\$pg_libs//' configure
export CFLAGS="%optflags -fno-strict-aliasing -I/usr/include/pgsql"
%configure --with-unixodbc
%install
make DESTDIR=%buildroot install
rm -f %buildroot%_libdir/*.la
%clean
rm -rf %buildroot
%post
/sbin/ldconfig
# odbcinst uses reference counting, so we don't
# need to take care for the update case here.
odbcinst -i -l -d %_libdir/psqlodbcw.so -r <<EOF
[PSQL]
Description = PostgreSQL
%ifarch x86_64 ppc64 ia64 s390x
Driver64 = %_libdir/psqlodbcw.so
%else
Driver = %_libdir/psqlodbcw.so
%endif
EOF
%postun
/sbin/ldconfig
# odbcinst uses reference counting, so we don't
# need to take care for the update case here.
odbcinst -u -l -d %_libdir/psqlodbcw.so -n PSQL
%files
%defattr(-,root,root,-)
%doc *.txt docs/*
%_libdir/psql*
%changelog