Create explicit python2 subpackage.

epel8
Ralph Bean 9 years ago
parent 3c68e82397
commit 7da96d1546

@ -8,6 +8,7 @@
%filter_provides_in %{python2_sitearch}/zope/interface/.*\.so$ %filter_provides_in %{python2_sitearch}/zope/interface/.*\.so$
%filter_setup %filter_setup
%{!?py2ver: %global py2ver %(%{?__python2} -c 'import sys; print(sys.version[0:3])' 2>/dev/null)}
%if 0%{?fedora} %if 0%{?fedora}
%global with_python3 1 %global with_python3 1
%{!?py3ver: %global py3ver %(%{?__python3} -c 'import sys; print(sys.version[0:3])' 2>/dev/null)} %{!?py3ver: %global py3ver %(%{?__python3} -c 'import sys; print(sys.version[0:3])' 2>/dev/null)}
@ -16,30 +17,35 @@
Name: python-zope-interface Name: python-zope-interface
Version: 4.1.3 Version: 4.1.3
Release: 1%{?dist} Release: 2%{?dist}
Summary: Zope 3 Interface Infrastructure Summary: Zope 3 Interface Infrastructure
Group: Development/Libraries Group: Development/Libraries
License: ZPLv2.1 License: ZPLv2.1
URL: http://pypi.python.org/pypi/zope.interface URL: http://pypi.python.org/pypi/zope.interface
Source0: http://pypi.python.org/packages/source/z/zope.interface/zope.interface-%{version}.tar.gz Source0: http://pypi.python.org/packages/source/z/zope.interface/zope.interface-%{version}.tar.gz
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-nose
BuildRequires: python-zope-event
# since F14
Obsoletes: python-zope-filesystem <= 1-8
%if 0%{?with_python3} %description
BuildRequires: python3-devel Interfaces are a mechanism for labeling objects as conforming to a given API
BuildRequires: python3-setuptools or contract.
BuildRequires: python3-nose
BuildRequires: python3-zope-event
%endif
Requires: python-zope-event This is a separate distribution of the zope.interface package used in Zope 3.
%package -n python2-zope-interface
Summary: Zope 3 Interface Infrastructure
Group: Development/Libraries
%{?python_provide:%python_provide python2-zope-interface}
%description 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 Interfaces are a mechanism for labeling objects as conforming to a given API
or contract. or contract.
@ -49,6 +55,12 @@ This is a separate distribution of the zope.interface package used in Zope 3.
%package -n python3-zope-interface %package -n python3-zope-interface
Summary: Zope 3 Interface Infrastructure Summary: Zope 3 Interface Infrastructure
Group: Development/Libraries Group: Development/Libraries
%{?python_provide:%python_provide python3-zope-interface}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-nose
BuildRequires: python3-zope-event
Requires: python3-zope-event Requires: python3-zope-event
@ -64,37 +76,28 @@ This is a separate distribution of the zope.interface package used in Zope 3.
rm -rf %{modname}.egg-info rm -rf %{modname}.egg-info
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build %build
CFLAGS="%{optflags}" %{__python2} setup.py build %py2_build
%if 0%{?with_python3} %if 0%{?with_python3}
pushd %{py3dir} %py3_build
CFLAGS="%{optflags}" %{__python3} setup.py build
popd
%endif %endif
%install %install
# python3 block # python3 block
%if 0%{?with_python3} %if 0%{?with_python3}
pushd %{py3dir} %py3_install
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
# Will put docs in %%{_docdir} instead # Will put docs in %%{_docdir} instead
%{__rm} -f %{buildroot}%{python3_sitearch}/zope/interface/{,tests/}*.txt %{__rm} -f %{buildroot}%{python3_sitearch}/zope/interface/{,tests/}*.txt
# C files don't need to be packaged # C files don't need to be packaged
%{__rm} -f %{buildroot}%{python3_sitearch}/zope/interface/_zope_interface_coptimizations.c %{__rm} -f %{buildroot}%{python3_sitearch}/zope/interface/_zope_interface_coptimizations.c
popd
%endif %endif
# do it again for python2 # do it again for python2
%{__python2} setup.py install -O1 --skip-build --root %{buildroot} %py2_install
# Will put docs in %%{_docdir} instead # Will put docs in %%{_docdir} instead
%{__rm} -f %{buildroot}%{python2_sitearch}/zope/interface/{,tests/}*.txt %{__rm} -f %{buildroot}%{python2_sitearch}/zope/interface/{,tests/}*.txt
@ -103,17 +106,14 @@ popd
%{__rm} -f %{buildroot}%{python2_sitearch}/zope/interface/_zope_interface_coptimizations.c %{__rm} -f %{buildroot}%{python2_sitearch}/zope/interface/_zope_interface_coptimizations.c
%check %check
PYTHONPATH=$(pwd) nosetests PYTHONPATH=$(pwd) nosetests-%{py2ver}
%if 0%{?with_python3} %if 0%{?with_python3}
pushd %{py3dir}
PYTHONPATH=$(pwd) nosetests-%{py3ver} PYTHONPATH=$(pwd) nosetests-%{py3ver}
popd
%endif %endif
%files %files -n python2-zope-interface
%defattr(-,root,root,-) %doc README.rst CHANGES.rst COPYRIGHT.txt docs/
%doc README.rst LICENSE.txt CHANGES.rst COPYRIGHT.txt docs/ %license LICENSE.txt
%{python2_sitearch}/zope/interface/ %{python2_sitearch}/zope/interface/
# Co-own %%{python2_sitearch}/zope/ # Co-own %%{python2_sitearch}/zope/
%dir %{python2_sitearch}/zope/ %dir %{python2_sitearch}/zope/
@ -124,7 +124,8 @@ popd
%if 0%{?with_python3} %if 0%{?with_python3}
%files -n python3-zope-interface %files -n python3-zope-interface
%doc README.rst LICENSE.txt CHANGES.rst COPYRIGHT.txt docs/ %doc README.rst CHANGES.rst COPYRIGHT.txt docs/
%license LICENSE.txt
%{python3_sitearch}/zope/interface/ %{python3_sitearch}/zope/interface/
# Co-own %%{python3_sitearch}/zope/ # Co-own %%{python3_sitearch}/zope/
%dir %{python3_sitearch}/zope/ %dir %{python3_sitearch}/zope/
@ -135,6 +136,10 @@ popd
%endif %endif
%changelog %changelog
* Tue Jun 28 2016 Ralph Bean <rbean@redhat.com> - 4.1.3-2
- Modernize python macros.
- Provide an explicit python2 subpackage.
* Mon Oct 05 2015 Ralph Bean <rbean@redhat.com> - 4.1.3-1 * Mon Oct 05 2015 Ralph Bean <rbean@redhat.com> - 4.1.3-1
- new version - new version

Loading…
Cancel
Save