python-psycopg2 package upgrade
This commit is contained in:
parent
0f5d7c68d8
commit
dba8cf1bc6
BIN
2_8_4.tar.gz
Normal file
BIN
2_8_4.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
@ -1,14 +1,21 @@
|
||||
%global selfcheck 0
|
||||
%define release_version %(echo %{version} | awk -F. '{print $1"_"$2"_"$3}')
|
||||
%bcond_without python3
|
||||
%bcond_without python3_debug
|
||||
%bcond_without python2
|
||||
%bcond_without python2_debug
|
||||
%if 0%{?selfcheck}
|
||||
%bcond_without tests
|
||||
%else
|
||||
%bcond_with tests
|
||||
%endif
|
||||
Name: python-psycopg2
|
||||
Version: 2.7.5
|
||||
Release: 3.2
|
||||
Version: 2.8.4
|
||||
Release: 1
|
||||
Summary: PostgreSQL database adapter for the Python programming language
|
||||
License: LGPLv3+ with exceptions
|
||||
URL: http://www.psycopg.org/psycopg/
|
||||
Source0: http://www.psycopg.org/psycopg/tarballs/PSYCOPG-2-7/psycopg2-%{version}.tar.gz
|
||||
|
||||
%bcond_without python2
|
||||
%bcond_without python3
|
||||
%bcond_without check
|
||||
Source0: https://github.com/psycopg/psycopg2/archive/%{release_version}.tar.gz
|
||||
|
||||
%global desc Psycopg is the most popular PostgreSQL adapter for the Python \
|
||||
programming language. Its core is a complete implementation of the Python DB \
|
||||
@ -25,9 +32,10 @@ BuildRequires: gcc,pkgconfig(libpq)
|
||||
%{?with_python2:BuildRequires: python2-debug python2-devel}
|
||||
%{?with_python3:BuildRequires: python3-debug python3-devel}
|
||||
|
||||
%if %{with check}
|
||||
%if %{with tests}
|
||||
BuildRequires: postgresql-test-rpm-macros
|
||||
%endif
|
||||
Conflicts: python-psycopg2-zope < %{version}
|
||||
|
||||
%description
|
||||
%{desc}
|
||||
@ -52,7 +60,6 @@ This sub-package delivers set of tests for the adapter.
|
||||
|
||||
%package -n python2-psycopg2-debug
|
||||
Summary: A PostgreSQL database adapter for Python 2 (debug build)
|
||||
# Require the base package, as we're sharing .py/.pyc files:
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
%{?python_provide:%python_provide python2-psycopg2-debug}
|
||||
|
||||
@ -79,7 +86,6 @@ This sub-package delivers set of tests for the adapter.
|
||||
|
||||
%package -n python3-psycopg2-debug
|
||||
Summary: A PostgreSQL database adapter for Python 3 (debug build)
|
||||
# Require base python 3 package, as we're sharing .py/.pyc files:
|
||||
Requires: python3-psycopg2 = %{version}-%{release}
|
||||
|
||||
%description -n python3-psycopg2-debug
|
||||
@ -90,7 +96,6 @@ build of Python 3.
|
||||
|
||||
%package doc
|
||||
Summary: Documentation for psycopg python PostgreSQL database adapter
|
||||
Group: Documentation
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
%{?with_python2:Provides: python2-psycopg2-doc = %{version}-%{release}}
|
||||
%{?with_python3:Provides: python3-psycopg2-doc = %{version}-%{release}}
|
||||
@ -100,7 +105,7 @@ Documentation and example files for the psycopg python PostgreSQL
|
||||
database adapter.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n psycopg2-%{version}
|
||||
%autosetup -p1 -n psycopg2-%{release_version}
|
||||
|
||||
|
||||
%build
|
||||
@ -108,23 +113,19 @@ for python in %{python_runtimes} ; do
|
||||
$python setup.py build
|
||||
done
|
||||
|
||||
# Fix for wrong-file-end-of-line-encoding problem; upstream also must fix this.
|
||||
for i in `find doc -iname "*.html"`; do sed -i 's/\r//' $i; done
|
||||
for i in `find doc -iname "*.css"`; do sed -i 's/\r//' $i; done
|
||||
|
||||
# Get rid of a "hidden" file that rpmlint complains about
|
||||
rm -f doc/html/.buildinfo
|
||||
|
||||
%check
|
||||
%if %{with check}
|
||||
%if %{with tests}
|
||||
export PGTESTS_LOCALE=C.UTF-8
|
||||
%postgresql_tests_run
|
||||
|
||||
export PSYCOPG2_TESTDB=${PGTESTS_DATABASES##*:}
|
||||
export PSYCOPG2_TESTDB_HOST=$PGHOST
|
||||
export PSYCOPG2_TESTDB_PORT=$PGPORT
|
||||
|
||||
cmd="from psycopg2 import tests; tests.unittest.main(defaultTest='tests.test_suite')"
|
||||
cmd="import tests; tests.unittest.main(defaultTest='tests.test_suite')"
|
||||
|
||||
%if %{with python2}
|
||||
PYTHONPATH=%buildroot%python2_sitearch %__python2 -c "$cmd" --verbose
|
||||
@ -133,15 +134,22 @@ PYTHONPATH=%buildroot%python2_sitearch %__python2 -c "$cmd" --verbose
|
||||
%if %{with python3}
|
||||
PYTHONPATH=%buildroot%python3_sitearch %__python3 -c "$cmd" --verbose
|
||||
%endif
|
||||
%endif # check
|
||||
|
||||
%endif
|
||||
|
||||
%install
|
||||
export CFLAGS=${RPM_OPT_FLAGS} LDFLAGS=${RPM_LD_FLAGS}
|
||||
for python in %{python_runtimes} ; do
|
||||
$python setup.py install --no-compile --root %{buildroot}
|
||||
done
|
||||
cp -r tests/ %{buildroot}%{python2_sitearch}/psycopg2/tests/
|
||||
for i in `find %{buildroot}%{python2_sitearch}/psycopg2/tests/ -iname "*.py"`; do
|
||||
sed -i 's|#!/usr/bin/env python|#!/usr/bin/python2|' $i
|
||||
done
|
||||
|
||||
# This test is skipped on 3.7 and has a syntax error so brp-python-bytecompile would choke on it
|
||||
cp -r tests/ %{buildroot}%{python3_sitearch}/psycopg2/tests/
|
||||
for i in `find %{buildroot}%{python3_sitearch}/psycopg2/tests/ -iname "*.py"`; do
|
||||
sed -i 's|#!/usr/bin/env python|#!/usr/bin/python3|' $i
|
||||
done
|
||||
%{?with_python3:rm -r %{buildroot}%{python3_sitearch}/psycopg2/tests/test_async_keyword.py}
|
||||
|
||||
%if %{with python2}
|
||||
@ -163,7 +171,7 @@ done
|
||||
%files -n python2-psycopg2-debug
|
||||
%license LICENSE
|
||||
%{python2_sitearch}/psycopg2/_psycopg_d.so
|
||||
%endif # python2
|
||||
%endif
|
||||
|
||||
|
||||
%if %{with python3}
|
||||
@ -172,7 +180,7 @@ done
|
||||
%doc AUTHORS NEWS README.rst
|
||||
%dir %{python3_sitearch}/psycopg2
|
||||
%{python3_sitearch}/psycopg2/*.py
|
||||
%{python3_sitearch}/psycopg2/_psycopg.cpython-3?m*.so
|
||||
%{python3_sitearch}/psycopg2/_psycopg.cpython-3?[!d]*.so
|
||||
%dir %{python3_sitearch}/psycopg2/__pycache__
|
||||
%{python3_sitearch}/psycopg2/__pycache__/*.py{c,o}
|
||||
%{python3_sitearch}/psycopg2-%{version}-py3*.egg-info
|
||||
@ -181,18 +189,19 @@ done
|
||||
%files -n python3-psycopg2-tests
|
||||
%{python3_sitearch}/psycopg2/tests
|
||||
|
||||
|
||||
%files -n python3-psycopg2-debug
|
||||
%license LICENSE
|
||||
%{python3_sitearch}/psycopg2/_psycopg.cpython-3?dm*.so
|
||||
%endif # python3
|
||||
|
||||
%{python3_sitearch}/psycopg2/_psycopg.cpython-3?d*.so
|
||||
%endif
|
||||
|
||||
%files doc
|
||||
%license LICENSE
|
||||
%doc doc examples/
|
||||
%doc doc
|
||||
|
||||
%changelog
|
||||
* Sat Jun 20 2020 Jeffery.Gao <gaojianxing@huawei.com> - 2.8.4-1
|
||||
- Upgrade package & fixed build as root errors
|
||||
|
||||
* Tue Mar 10 2020 chenli <chenli147@huawei.com> - 2.7.5-3.2
|
||||
- Fix python2-psycopg2-tests install error
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user