File python-psycopg2.spec of Package python-psycopg2

# spec file for package python-psycopg2
# Copyright (c) 2012 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

Name:           python-psycopg2
Version:        2.6.1
Release:        1.1
License:        LGPL-3.0+ and (LGPL-3.0+ or ZPL-2.0) and 	SUSE-GPL-2.0-with-openssl-exception
Summary:        Python-PostgreSQL Database Adapter
Group:          Development/Languages/Python
BuildRequires:  fdupes
BuildRequires:  postgresql92-devel >= 9.2
BuildRequires:  python-devel >= 2.7
Suggests:       postgresql-server
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

psycopg2 is a PostgreSQL database adapter for the Python programming
language.  psycopg2 was written with the aim of being very small and fast,
and stable as a rock.

psycopg2 is different from the other database adapter because it was
designed for heavily multi-threaded applications that create and destroy
lots of cursors and make a conspicuous number of concurrent INSERTs or
UPDATEs. psycopg2 also provide full asycronous operations and support
for coroutine libraries.

%package doc
Summary:        Documentation for psycopg python PostgreSQL database adapter
Group:          Documentation/HTML
Requires:       %{name} = %{version}

%description doc
Documentation and example files for the psycopg python PostgreSQL database adapter.

%setup -q -n psycopg2-%{version}

CFLAGS="%{optflags} -fno-strict-aliasing" python build
rm -rf doc/src doc/html/.buildinfo # Remove junk

python install --prefix=%{_prefix} --root=%{buildroot}
rm -rf %{buildroot}%{python_sitearch}/psycopg2/tests # Don't package testsuite
%fdupes -s %{buildroot}/%{_mandir}  # Create symlinks for man pages
%fdupes %{buildroot}                # Create hardlinks for the rest


%files doc
%doc examples/

* Fri May 25 2012
- license update: LGPL-3.0+ and (LGPL-3.0+ or ZPL-2.0) and
  See the COPYING file. There are GPL-2.0+ (with openssl linking exceptions
  for pgsql) in the package. Also, the ZPL option is only available for one
  particular subdirectory in the package
* Fri May 25 2012
- python3 package added
- minor spec improvement
* Fri Apr  6 2012
- Update to 2.4.5:
  * The close() methods on connections and cursors don't raise exceptions
    if called on already closed objects.
  * Fixed fetchmany() with no argument in cursor subclasses
    (ticket #84).
  * Use lo_creat() instead of lo_create() when possible for better
    interaction with pgpool-II (ticket #88).
  * Error and its subclasses are picklable, useful for multiprocessing
    interaction (ticket #90).
  * Better efficiency and formatting of timezone offset objects thanks
    to Menno Smits (tickets #94, #95).
  * Fixed 'rownumber' during iteration on cursor subclasses.
    Regression introduced in 2.4.4 (ticket #100).
  * Added support for 'inet' arrays.
  * Fixed 'commit()' concurrency problem (ticket #103).
  * Codebase cleaned up using the GCC Python plugin's static analysis
    tool, which has revealed several unchecked return values, possible
    NULL dereferences, reference counting problems. Many thanks to David
    Malcolm for the useful tool and the assistance provided using it.
* Tue Mar 27 2012
- Can't hurt to suggest postgresql-server
* Mon Mar 12 2012
- Simplify macro usage
- Remove outdated SUSE version checks
* Mon Feb 13 2012
- patch license to follow standard
* Thu Jan 12 2012
- Update to 2.4.4:
  * register_composite() also works with the types implicitly defined after a
    table row, not only with the ones created by CREATE TYPE.
  * Values for the isolation level symbolic constants restored to what they
    were before release 2.4.2 to avoid breaking apps using the values instead
    of the constants.
  * Named DictCursor/RealDictCursor honour itersize (ticket #80).
  * Fixed rollback on error on Zope (ticket #73).
  * Raise DatabaseError instead of Error with empty libpq errors, consistently
    with other disconnection-related errors: regression introduced in release
    2.4.1 (ticket #82).
- Version 2.4.3:
  * connect() supports all the keyword arguments supported by the database
  * Added new_array_type() function for easy creation of array typecasters.
  * Added support for arrays of hstores and composite types (ticket #66).
  * Fixed segfault in case of transaction started with connection lost (and
    possibly other events).
  * Fixed adaptation of Decimal type in sub-interpreters, such as in certain
    mod_wsgi configurations (ticket #52).
  * Rollback connections in transaction or in error before putting them back
    into a pool. Also discard broken connections (ticket #62).
  * Lazy import of the slow uuid module, thanks to Marko Kreen.
  * Fixed NamedTupleCursor.executemany() (ticket #65).
  * Fixed --static-libpq setup option (ticket #64).
  * Fixed interaction between RealDictCursor and named cursors (ticket #67).
  * Dropped limit on the columns length in COPY operations (ticket #68).
  * Fixed reference leak with arguments referenced more than once in queries
    (ticket #81).
  * Fixed typecasting of arrays containing consecutive backslashes.
  * errorcodes map updated to PostgreSQL 9.1.
* Wed Sep 21 2011
- Update to version 2.4.2:
  * connection.h: added codec attribute to avoid repeated codec name
    lookups during unicode query/params manipulations.
  * bumped to version 2.3.2.dev0
  * psycopg/connection_int.c: applied patch from Marti Raudsepp to close
    ticket #24. Fixed segfault in connection when DateStyle not available
    (e.g.  pgbouncer appars not passing it to the client)
  * psycopg/utils.c: Added psycopg_strdup function.
  - See ChangeLog for more...
- Don't package testsuite
- Fix non-executable script rpmlint warning
* Mon Feb 28 2011
- Spec file changes:
  * Added LICENSE and NEWS files
  * Added ZPL license to preamble (psycopg2 is dual-licensed)
  * Use upstream description
  * Fixed SLE build errors
  * Repacked tarball to bzip2
- Update to version 2.4
  * Added support for Python 3.1 and 3.2. The conversion has also
    brought several improvements:
  * Improvements to the named cusors and data handling
  * Fixed adaptation of None in composite types (ticket #26). Bug
    report by Karsten Hilbert.
  * Fixed several reference leaks in less common code paths.
  * Fixed segfault when a large object is closed and its connection no
    more available.
  * Added missing icon to ZPsycopgDA package, not available in Zope
    2.12.9 (ticket #30). Bug report and patch by Pumukel.
  * Fixed conversion of negative infinity (ticket #40). Bug report and
    patch by Marti Raudsepp.
* Mon Dec 27 2010
- Update to version 2.3.2
* Wed Oct 27 2010
- Update to 2.2.2:
    Bux fixes:
  * the call to logging.basicConfig() in has been dropped:
    it was messing with some projects using logging (and a library
    should not initialize the logging system anyway.)
  * psycopg now correctly handles time zones with seconds in the
    UTC offset. The old register_tstz_w_secs() function is deprecated
    and will raise a warning if called.
  * Exceptions raised by the column iterator are propagated.
  * Exceptions raised by executemany() interators are propagated.
* Tue Aug 25 2009
- Add --optimize=2 to build .pyo files, correct License and Url
* Tue Aug 18 2009
- Update to 2.0.12:
  * psycopg/lobject_int.c: fixed problem with writing large data using
    lo_write: apparently the large objects code does not like non-blocking
  * fixed version detection for PostgreSQL rc, as
    suggested by Sok Ann Yap.
  * ZPsycopgDA/ applied serialization error retry from Brian
  * Implemented connection.reset() method to reset the connection to
    well-know default parameters. This is much faster than closing and
    reopening the connection. (Suggested by a bug report by Glenn
  * psycopg/cursor_type.c: unified size macro definitions in COPY TO
    and COPY FROM operations: now the buffer for column names is 8192
    bytes that should be enough even for very large tables.
  * Applied patch from Robert Munro to fix version check
    in ZPsycopgDA.
- Release 2.0.11:
  * lib/ fixed crash in fetchone() when prefetching using
    a RealDictCursor.
  * psycopg/cursor_ext.c: now raise correct exception when fetching
    using a custom row factory results in an error.
  * lib/ applied DictRow "diet" patch from Marko Kreen.
  * applied patch from Elvis Pranskevichus to make
    PostgreSQL version detection more robust.
* Mon Apr 27 2009
- update to 2.0.10
* Thu Nov 20 2008
- Update to 2.0.8
* Wed Nov  5 2008
- use --record-rpm as setup option, not --record. The latter didn't
  pick up all files on Factory.
* Wed Jun 13 2007
- Update to version 2.0.6 see
  for details.
* Wed Oct 19 2005
- Initial release