14
0

- convert to singlespec

- update to 2.7.1
- drop doc subpackage, html docs available from http://pythonhosted.org/psycopg2/

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-psycopg2?expand=0&rev=44
This commit is contained in:
Jan Matejek
2017-06-23 16:40:37 +00:00
committed by Git OBS Bridge
parent 1baa471796
commit bb806b3800
4 changed files with 55 additions and 35 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-psycopg2
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,23 +16,22 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-psycopg2
Version: 2.6.2
Version: 2.7.1
Release: 0
Summary: Python-PostgreSQL Database Adapter
License: LGPL-3.0+ and (LGPL-3.0+ or ZPL-2.0) and SUSE-GPL-2.0-with-openssl-exception
Group: Development/Languages/Python
Url: http://initd.org/psycopg/
Source: http://pypi.python.org/packages/source/p/psycopg2/psycopg2-%{version}.tar.gz
Source: https://files.pythonhosted.org/packages/source/p/psycopg2/psycopg2-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: fdupes
BuildRequires: postgresql-devel
BuildRequires: python-Sphinx
BuildRequires: python-devel
BuildRequires: postgresql-devel >= 9.1
BuildRequires: python-rpm-macros
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)")}
%endif
%python_subpackages
%description
psycopg2 is a PostgreSQL database adapter for the Python programming
@@ -45,40 +44,23 @@ 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.
%prep
%setup -q -n psycopg2-%{version}
# use the year from source gzip header instead of current one to make reproducible rpms
year=$(perl -e 'sysread(STDIN, $h, 8); print (1900+(gmtime(unpack("l",substr($h,4))))[5])' < %{S:0})
sed -i "s/^year =.*/year=$year/" doc/src/conf.py
%build
CFLAGS="%{optflags} -fno-strict-aliasing" python setup.py build
rm -rf doc/build # Remove junk
sphinx-build doc/src doc/build/html
export CFLAGS="%{optflags} -fno-strict-aliasing"
%python_build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
rm -rf %{buildroot}%{python_sitearch}/psycopg2/tests # Don't package testsuite
rm doc/build/html/.doctrees/environment.pickle
%python_install
%python_expand 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
%files %{python_files}
%defattr(-,root,root,-)
%doc AUTHORS LICENSE NEWS README.rst
%{python_sitearch}/psycopg2/
%{python_sitearch}/psycopg2-%{version}-py%{py_ver}.egg-info
%files doc
%defattr(-,root,root)
%doc doc/build/html examples/
%{python_sitearch}/psycopg2-%{version}-py%{python_version}.egg-info
%changelog