diff --git a/psycopg2-2.7.5.tar.gz b/psycopg2-2.7.5.tar.gz deleted file mode 100644 index 9e1d892bcc04a31204851ff63b92be37fe1b27ed..0000000000000000000000000000000000000000 Binary files a/psycopg2-2.7.5.tar.gz and /dev/null differ diff --git a/psycopg2-2.8.3.tar.gz b/psycopg2-2.8.3.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..a52c96f64a309c81869da68aea673a46e7fe7657 Binary files /dev/null and b/psycopg2-2.8.3.tar.gz differ diff --git a/python-psycopg2.spec b/python-psycopg2.spec index 1e75dc3e93891b3a37bb7fb7ce1e2e2aa3ba5e44..bd576251c6d7c39b7fcb691536ff4189a4505b2e 100644 --- a/python-psycopg2.spec +++ b/python-psycopg2.spec @@ -1,12 +1,13 @@ +%define debug_package %{nil} + Name: python-psycopg2 -Version: 2.7.5 -Release: 3.3 +Version: 2.8.3 +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 @@ -15,14 +16,10 @@ programming language. Its core is a complete implementation of the Python DB \ API 2.0 specifications. Several extensions allow access to many of the \ features offered by PostgreSQL. -%global python_runtimes %{?with_python2:python2 python2-debug} \\\ - %{?with_python3:python3 python3-debug} - -%{!?with_python2:%{!?with_python3:%{error:one python version eneeded}}} +%global python_runtimes %{?with_python3:python3 python3-debug} -BuildRequires: gcc,pkgconfig(libpq) +BuildRequires: gcc,postgresql-devel -%{?with_python2:BuildRequires: python2-debug python2-devel} %{?with_python3:BuildRequires: python3-debug python3-devel} %if %{with check} @@ -33,34 +30,6 @@ BuildRequires: postgresql-test-rpm-macros %{desc} -%package -n python2-psycopg2 -%{?python_provide:%python_provide python2-psycopg2} -Summary: %{summary} - -%description -n python2-psycopg2 -%{desc} - - -%package -n python2-psycopg2-tests -Summary: A testsuite for %{summary} -Requires: python2-psycopg2 = %version-%release - -%description -n python2-psycopg2-tests -%desc -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} - -%description -n python2-psycopg2-debug -This is a build of the psycopg PostgreSQL database adapter for the debug -build of Python 2. - -%if %{with python3} %package -n python3-psycopg2 Summary: %{summary} %{?python_provide:%python_provide python3-psycopg2} @@ -85,14 +54,12 @@ Requires: python3-psycopg2 = %{version}-%{release} %description -n python3-psycopg2-debug This is a build of the psycopg PostgreSQL database adapter for the debug build of Python 3. -%endif # python3 %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}} %description doc @@ -124,55 +91,31 @@ 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 -%endif - -%if %{with python3} PYTHONPATH=%buildroot%python3_sitearch %__python3 -c "$cmd" --verbose %endif -%endif # check - %install for python in %{python_runtimes} ; do $python setup.py install --no-compile --root %{buildroot} done -# This test is skipped on 3.7 and has a syntax error so brp-python-bytecompile would choke on it -%{?with_python3:rm -r %{buildroot}%{python3_sitearch}/psycopg2/tests/test_async_keyword.py} - -%if %{with python2} -%files -n python2-psycopg2 -%license LICENSE -%doc AUTHORS NEWS README.rst -%dir %{python2_sitearch}/psycopg2 -%{python2_sitearch}/psycopg2/*.py -%{python2_sitearch}/psycopg2/*.pyc -%{python2_sitearch}/psycopg2/_psycopg.so -%{python2_sitearch}/psycopg2/*.pyo -%{python2_sitearch}/psycopg2-%{version}-py2*.egg-info - - -%files -n python2-psycopg2-tests -%{python2_sitearch}/psycopg2/tests - -%files -n python2-psycopg2-debug -%license LICENSE -%{python2_sitearch}/psycopg2/_psycopg_d.so -%endif # python2 +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 python3} %files -n python3-psycopg2 %license LICENSE %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*.so + %dir %{python3_sitearch}/psycopg2/__pycache__ %{python3_sitearch}/psycopg2/__pycache__/*.py{c,o} %{python3_sitearch}/psycopg2-%{version}-py3*.egg-info @@ -181,18 +124,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*.so %files doc %license LICENSE -%doc doc examples/ +%doc doc + %changelog +* Wed Jan 26 2022 zhangy1317 - 2.8.3-1 +- Remove python2 and update to 2.8.3 + * Fri Aug 21 2020 xinghe - 2.7.5-3.3 - add release version for rebuild