Compare commits

...

No commits in common. "c8-stream-2.7" and "c8s" have entirely different histories.

1 changed files with 36 additions and 28 deletions

View File

@ -1,14 +1,22 @@
%bcond_with python36_module
%if 0%{?fedora} %if 0%{?fedora}
%bcond_without python2 %bcond_without python3
%bcond_without python3 %if 0%{?fedora} > 29
%bcond_with python2
%else
%bcond_without python2
%endif
%else %else
%bcond_with python2 %if 0%{?rhel} > 7
%bcond_without python3 %bcond_with python2
%bcond_without python3
%else
%bcond_without python2
%bcond_with python3
%endif
%endif %endif
%bcond_without check %bcond_without check
%bcond_with debugrpms
%global srcname psycopg2 %global srcname psycopg2
%global sum A PostgreSQL database adapter for Python %global sum A PostgreSQL database adapter for Python
@ -17,10 +25,10 @@ programming language. At its core it fully implements the Python DB \
API 2.0 specifications. Several extensions allow access to many of the \ API 2.0 specifications. Several extensions allow access to many of the \
features offered by PostgreSQL. features offered by PostgreSQL.
%global python_runtimes %{?with_python2:python2 python2-debug} \\\ %global python_runtimes %{?with_python2:python2 %{?with_debugrpms:python2-debug}} \\\
%{?with_python3:python3.6 python3.6-debug} %{?with_python3:python3 %{?with_debugrpms:python3-debug}}
%{!?with_python2:%{!?with_python3:%{error:one python version eneeded}}} %{!?with_python2:%{!?with_python3:%{error:one python version needed}}}
# Python 2.5+ is not supported by Zope, so it does not exist in # Python 2.5+ is not supported by Zope, so it does not exist in
# recent Fedora releases. That's why zope subpackage is disabled. # recent Fedora releases. That's why zope subpackage is disabled.
@ -41,15 +49,10 @@ Url: http://www.psycopg.org/psycopg/
Source0: http://www.psycopg.org/psycopg/tarballs/PSYCOPG-2-7/psycopg2-%{version}.tar.gz Source0: http://www.psycopg.org/psycopg/tarballs/PSYCOPG-2-7/psycopg2-%{version}.tar.gz
%{?with_python2:BuildRequires: python2-debug python2-devel} %{?with_python2:BuildRequires: %{?with_debugrpms:/usr/bin/python2-debug} python2-devel}
%if %{with python36_module} %{?with_python3:BuildRequires: %{?with_debugrpms:/usr/bin/python3-debug} python3-devel}
%{?with_python3:BuildRequires: python36-debug python36-devel}
%{?with_python3:BuildRequires: python36-rpm-macros}
%else
%{?with_python3:BuildRequires: python3-debug python3-devel}
%endif
BuildRequires: gcc BuildRequires: gcc
BuildRequires: pkgconfig(libpq) BuildRequires: pkgconfig(libpq)
# For testsuite # For testsuite
@ -63,6 +66,7 @@ Conflicts: python-psycopg2-zope < %{version}
%{desc} %{desc}
%if %{with python2}
%package -n python2-%{srcname} %package -n python2-%{srcname}
%{?python_provide:%python_provide python2-%{srcname}} %{?python_provide:%python_provide python2-%{srcname}}
Summary: %{sum} 2 Summary: %{sum} 2
@ -80,6 +84,7 @@ Requires: python2-%srcname = %version-%release
This sub-package delivers set of tests for the adapter. This sub-package delivers set of tests for the adapter.
%if %{with debugrpms}
%package -n python2-%{srcname}-debug %package -n python2-%{srcname}-debug
Summary: A PostgreSQL database adapter for Python 2 (debug build) Summary: A PostgreSQL database adapter for Python 2 (debug build)
# Require the base package, as we're sharing .py/.pyc files: # Require the base package, as we're sharing .py/.pyc files:
@ -89,6 +94,8 @@ Requires: python2-%{srcname} = %{version}-%{release}
%description -n python2-%{srcname}-debug %description -n python2-%{srcname}-debug
This is a build of the psycopg PostgreSQL database adapter for the debug This is a build of the psycopg PostgreSQL database adapter for the debug
build of Python 2. build of Python 2.
%endif # debugrpms
%endif # python2
%if %{with python3} %if %{with python3}
@ -109,6 +116,7 @@ Requires: python3-%srcname = %version-%release
This sub-package delivers set of tests for the adapter. This sub-package delivers set of tests for the adapter.
%if %{with debugrpms}
%package -n python3-psycopg2-debug %package -n python3-psycopg2-debug
Summary: A PostgreSQL database adapter for Python 3 (debug build) Summary: A PostgreSQL database adapter for Python 3 (debug build)
# Require base python 3 package, as we're sharing .py/.pyc files: # Require base python 3 package, as we're sharing .py/.pyc files:
@ -117,6 +125,7 @@ Requires: python3-psycopg2 = %{version}-%{release}
%description -n python3-%{srcname}-debug %description -n python3-%{srcname}-debug
This is a build of the psycopg PostgreSQL database adapter for the debug This is a build of the psycopg PostgreSQL database adapter for the debug
build of Python 3. build of Python 3.
%endif # debugrpms
%endif # python3 %endif # python3
@ -150,6 +159,7 @@ Zope Database Adapter for PostgreSQL, called ZPsycopgDA
%build %build
export CFLAGS=${RPM_OPT_FLAGS} LDFLAGS=${RPM_LD_FLAGS}
for python in %{python_runtimes} ; do for python in %{python_runtimes} ; do
$python setup.py build $python setup.py build
done done
@ -187,6 +197,7 @@ PYTHONPATH=%buildroot%python3_sitearch %__python3 -c "$cmd" --verbose
%install %install
export CFLAGS=${RPM_OPT_FLAGS} LDFLAGS=${RPM_LD_FLAGS}
for python in %{python_runtimes} ; do for python in %{python_runtimes} ; do
$python setup.py install --no-compile --root %{buildroot} $python setup.py install --no-compile --root %{buildroot}
done done
@ -215,9 +226,11 @@ cp -pr ZPsycopgDA/* %{buildroot}%{ZPsycopgDAdir}
%{python2_sitearch}/psycopg2/tests %{python2_sitearch}/psycopg2/tests
%if %{with debugrpms}
%files -n python2-%{srcname}-debug %files -n python2-%{srcname}-debug
%license LICENSE %license LICENSE
%{python2_sitearch}/psycopg2/_psycopg_d.so %{python2_sitearch}/psycopg2/_psycopg_d.so
%endif # debugrpms
%endif # python2 %endif # python2
@ -237,9 +250,11 @@ cp -pr ZPsycopgDA/* %{buildroot}%{ZPsycopgDAdir}
%{python3_sitearch}/psycopg2/tests %{python3_sitearch}/psycopg2/tests
%if %{with debugrpms}
%files -n python3-psycopg2-debug %files -n python3-psycopg2-debug
%license LICENSE %license LICENSE
%{python3_sitearch}/psycopg2/_psycopg.cpython-3?dm*.so %{python3_sitearch}/psycopg2/_psycopg.cpython-3?dm*.so
%endif # debugrpms
%endif # python3 %endif # python3
@ -261,18 +276,11 @@ cp -pr ZPsycopgDA/* %{buildroot}%{ZPsycopgDAdir}
%changelog %changelog
* Thu Apr 25 2019 Tomas Orsava <torsava@redhat.com> - 2.7.5-7 * Fri Oct 05 2018 Pavel Raiskup <praiskup@redhat.com> - 2.7.5-7
- Bumping due to problems with modular RPM upgrade path - bump the NVR to beat the NVR from module
- Resolves: rhbz#1695587
* Wed Sep 26 2018 Tomas Orsava <torsava@redhat.com> - 2.7.5-6 * Wed Oct 03 2018 Pavel Raiskup <praiskup@redhat.com> - 2.7.5-5
- Use the fully versioned binaries during build - sync with Fedora Rawide
- Related: rhbz#1619153
* Mon Sep 17 2018 Tomas Orsava <torsava@redhat.com> - 2.7.5-5
- Require python2-psycopg2 instead of python-psycopg2 from the
python2-psycopg2-debug subpackage
- Resolves: rhbz#1628242
* Thu Aug 02 2018 Pavel Raiskup <praiskup@redhat.com> - 2.7.5-4 * Thu Aug 02 2018 Pavel Raiskup <praiskup@redhat.com> - 2.7.5-4
- re-enable testsuite - re-enable testsuite