%global __python3 /usr/bin/python3.11 %global python3_pkgversion 3.11 # %%if 0%%{?rhel} && 0%%{?rhel} <= 6 # %%{!?__python2: %%global __python2 /usr/bin/python2} # %%{!?python2_sitelib: %%global python2_sitelib %%(%%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} # %%{!?python2_sitearch: %%global python2_sitearch %%(%%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} # %%endif # # # Filter private shared library provides # %%filter_provides_in %%{python2_sitearch}/zope/interface/.*\.so$ # %%filter_setup %if 0%{?fedora} || 0%{?rhel} > 7 %global with_python3 1 %endif Name: python-zope-interface Version: 5.4.0 Release: 1%{?dist} Summary: Zope 3 Interface Infrastructure License: ZPLv2.1 URL: https://pypi.io/project/zope.interface Source0: https://pypi.io/packages/source/z/zope.interface/zope.interface-%{version}.tar.gz %description Interfaces are a mechanism for labeling objects as conforming to a given API or contract. This is a separate distribution of the zope.interface package used in Zope 3. # %%package -n python2-zope-interface # Summary: Zope 3 Interface Infrastructure # %%{?python_provide:%%python_provide python2-zope-interface} # # BuildRequires: gcc # BuildRequires: python2-devel # BuildRequires: python2-setuptools # BuildRequires: python2-nose # BuildRequires: python2-zope-event # # Requires: python2-zope-event # # # since F14 # Obsoletes: python-zope-filesystem <= 1-8 # # %%description -n python2-zope-interface # Interfaces are a mechanism for labeling objects as conforming to a given API # or contract. # # This is a separate distribution of the zope.interface package used in Zope 3. %if 0%{?with_python3} %package -n python%{python3_pkgversion}-zope-interface Summary: Zope 3 Interface Infrastructure %{?python_provide:%python_provide python%{python3_pkgversion}-zope-interface} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-nose BuildRequires: python%{python3_pkgversion}-zope-event Requires: python%{python3_pkgversion}-zope-event %description -n python%{python3_pkgversion}-zope-interface Interfaces are a mechanism for labeling objects as conforming to a given API or contract. This is a separate distribution of the zope.interface package used in Zope 3. %endif %prep %setup -n zope.interface-%{version} -q rm -rf %{modname}.egg-info %build # %%py2_build %if 0%{?with_python3} %py3_build %endif %install # python3 block %if 0%{?with_python3} %py3_install # Will put docs in %%{_docdir} instead %{__rm} -f %{buildroot}%{python3_sitearch}/zope/interface/{,tests/}*.txt # C files don't need to be packaged %{__rm} -f %{buildroot}%{python3_sitearch}/zope/interface/_zope_interface_coptimizations.c %endif # # do it again for python2 # %%py2_install # # # Will put docs in %%{_docdir} instead # %%{__rm} -f %%{buildroot}%%{python2_sitearch}/zope/interface/{,tests/}*.txt # # # C files don't need to be packaged # %%{__rm} -f %%{buildroot}%%{python2_sitearch}/zope/interface/_zope_interface_coptimizations.c # %%check # PYTHONPATH=$(pwd) nosetests-2 # %%if 0%%{?with_python3} # PYTHONPATH=$(pwd) nosetests-3 # %%endif # %%files -n python2-zope-interface # %%doc README.rst CHANGES.rst COPYRIGHT.txt docs/ # %%license LICENSE.txt # %%{python2_sitearch}/zope/interface/ # # Co-own %%{python2_sitearch}/zope/ # %%dir %%{python2_sitearch}/zope/ # %%exclude %%{python2_sitearch}/zope/interface/tests/ # %%exclude %%{python2_sitearch}/zope/interface/common/tests/ # %%{python2_sitearch}/zope.interface-*.egg-info # %%{python2_sitearch}/zope.interface-*-nspkg.pth %if 0%{?with_python3} %files -n python%{python3_pkgversion}-zope-interface %doc README.rst CHANGES.rst COPYRIGHT.txt docs/ %license LICENSE.txt %{python3_sitearch}/zope/interface/ # Co-own %%{python3_sitearch}/zope/ %dir %{python3_sitearch}/zope/ %exclude %{python3_sitearch}/zope/interface/tests/ %exclude %{python3_sitearch}/zope/interface/common/tests/ %{python3_sitearch}/zope.interface-*.egg-info %{python3_sitearch}/zope.interface-*-nspkg.pth %endif %changelog