diff --git a/python-psycopg2.spec b/python-psycopg2.spec index 72e085f..a4accf6 100644 --- a/python-psycopg2.spec +++ b/python-psycopg2.spec @@ -1,18 +1,27 @@ %if 0%{?fedora} %bcond_without python3 %bcond_without python2 + %if 0%{?fedora} > 31 + %bcond_with python2_debug + %else + %bcond_without python2_debug + %endif + %bcond_without python3_debug %else %if 0%{?rhel} > 7 %bcond_with python2 %bcond_without python3 + %bcond_with python2_debug + %bcond_without python3_debug %else %bcond_without python2 %bcond_with python3 + %bcond_without python2_debug + %bcond_with python3_debug %endif %endif %bcond_without check -%bcond_without debugrpms %global srcname psycopg2 %global sum A PostgreSQL database adapter for Python @@ -22,8 +31,10 @@ API 2.0 specifications. Several extensions allow access to many of the \ features offered by PostgreSQL. %global python_runtimes \\\ - %{?with_python2:python2 %{?with_debugrpms:python2-debug}} \\\ - %{?with_python3:python3 %{?with_debugrpms:python3-debug}} + %{?with_python2:python2} \\\ + %{?with_python2_debug:python2-debug} \\\ + %{?with_python3:python3} \\\ + %{?with_python3_debug:python3-debug} %{!?with_python2:%{!?with_python3:%{error:one python version needed}}} @@ -38,7 +49,7 @@ features offered by PostgreSQL. Summary: %{sum} Name: python-%{srcname} Version: 2.7.7 -Release: 4%{?dist} +Release: 5%{?dist} # The exceptions allow linking to OpenSSL and PostgreSQL's libpq License: LGPLv3+ with exceptions Url: http://www.psycopg.org/psycopg/ @@ -46,8 +57,10 @@ Url: http://www.psycopg.org/psycopg/ Source0: http://www.psycopg.org/psycopg/tarballs/PSYCOPG-2-7/psycopg2-%{version}.tar.gz patch0: python38.patch -%{?with_python2:BuildRequires: %{?with_debugrpms:/usr/bin/python2-debug} python2-devel} -%{?with_python3:BuildRequires: %{?with_debugrpms:/usr/bin/python3-debug} python3-devel} +%{?with_python2:BuildRequires: python2-devel} +%{?with_python3:BuildRequires: python3-devel} +%{?with_python2_debug:BuildRequires: python2-debug} +%{?with_python3_debug:BuildRequires: python3-debug} BuildRequires: gcc BuildRequires: pkgconfig(libpq) @@ -79,9 +92,10 @@ Requires: python2-%srcname = %version-%release %description -n python2-%{srcname}-tests %desc This sub-package delivers set of tests for the adapter. +%endif # python2 -%if %{with debugrpms} +%if %{with python2_debug} %package -n python2-%{srcname}-debug Summary: A PostgreSQL database adapter for Python 2 (debug build) # Require the base package, as we're sharing .py/.pyc files: @@ -91,8 +105,7 @@ Requires: python2-%{srcname} = %{version}-%{release} %description -n python2-%{srcname}-debug This is a build of the psycopg PostgreSQL database adapter for the debug build of Python 2. -%endif # debugrpms -%endif # python2 +%endif # python2_debug %if %{with python3} @@ -111,9 +124,10 @@ Requires: python3-%srcname = %version-%release %description -n python3-%{srcname}-tests %desc This sub-package delivers set of tests for the adapter. +%endif # python3 -%if %{with debugrpms} +%if %{with python3_debug} %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: @@ -122,8 +136,7 @@ Requires: python3-psycopg2 = %{version}-%{release} %description -n python3-%{srcname}-debug This is a build of the psycopg PostgreSQL database adapter for the debug build of Python 3. -%endif # debugrpms -%endif # python3 +%endif # python3_debug %package doc @@ -219,14 +232,14 @@ cp -pr ZPsycopgDA/* %{buildroot}%{ZPsycopgDAdir} %files -n python2-%{srcname}-tests %{python2_sitearch}/psycopg2/tests +%endif # python2 -%if %{with debugrpms} +%if %{with python2_debug} %files -n python2-%{srcname}-debug %license LICENSE %{python2_sitearch}/psycopg2/_psycopg_d.so -%endif # debugrpms -%endif # python2 +%endif # python2_debug %if %{with python3} @@ -243,14 +256,14 @@ cp -pr ZPsycopgDA/* %{buildroot}%{ZPsycopgDAdir} %files -n python3-%{srcname}-tests %{python3_sitearch}/psycopg2/tests +%endif # python3 -%if %{with debugrpms} +%if %{with python3_debug} %files -n python3-psycopg2-debug %license LICENSE %{python3_sitearch}/psycopg2/_psycopg.cpython-3?d*.so -%endif # debugrpms -%endif # python3 +%endif # python3_debug %files doc @@ -271,6 +284,9 @@ cp -pr ZPsycopgDA/* %{buildroot}%{ZPsycopgDAdir} %changelog +* Mon Sep 09 2019 Miro Hrončok - 2.7.7-5 +- Package python2-psycopg2-debug removed on Fedora 32+ (rhbz#1747670) + * Fri Aug 16 2019 Miro Hrončok - 2.7.7-4 - Rebuilt for Python 3.8