Cleanup spec and use py_build macros

This commit is contained in:
Thomas Spura 2015-10-14 11:18:31 +02:00
parent ee162bc7dd
commit 5cfd6bba0d
1 changed files with 11 additions and 31 deletions

View File

@ -159,22 +159,12 @@ chmod -x examples/pubsub/topics_sub.py
#find examples -name '.*' | xargs rm -v #find examples -name '.*' | xargs rm -v
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
rm -r %{py3dir}/examples
2to3 --write --nobackups %{py3dir}/zmq/green
%endif
%build %build
CFLAGS="%{optflags}" %{__python2} setupegg.py build %py2_build
%if 0%{?with_python3} %if 0%{?with_python3}
pushd %{py3dir} %py3_build
CFLAGS="%{optflags}" %{__python3} setup.py build
popd
%endif # with_python3 %endif # with_python3
@ -185,15 +175,13 @@ popd
# overwritten with every setup.py install (and we want the python2 version # overwritten with every setup.py install (and we want the python2 version
# to be the default for now). # to be the default for now).
%if 0%{?with_python3} %if 0%{?with_python3}
pushd %{py3dir} %py3_install
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
chrpath --delete %{buildroot}%{python3_sitearch}%{RPATH}/*.so chrpath --delete %{buildroot}%{python3_sitearch}%{RPATH}/*.so
%endif # with_python3 %endif # with_python3
%{__python} setupegg.py install -O1 --skip-build --root %{buildroot} %py2_install
chrpath --delete %{buildroot}%{python_sitearch}%{RPATH}/*.so chrpath --delete %{buildroot}%{python_sitearch}%{RPATH}/*.so
@ -201,36 +189,28 @@ chrpath --delete %{buildroot}%{python_sitearch}%{RPATH}/*.so
%check %check
%if 0%{?run_tests} %if 0%{?run_tests}
rm zmq/__* rm zmq/__*
PYTHONPATH=%{buildroot}%{python_sitearch} \ PYTHONPATH=%{buildroot}%{python2_sitearch} \
%{__python} setup.py test %{__python2} setup.py test
%if 0%{?with_python3} %if 0%{?with_python3}
# there is no python3-nose yet #rm zmq/__*
pushd %{py3dir} PYTHONPATH=%{buildroot}%{python3_sitearch} \
rm zmq/__* %{__python3} setup.py test
# Temporarily disable the testsuite for now as it currently hangs in koji:
# http://koji.fedoraproject.org/koji/taskinfo?taskID=10191201
#PYTHONPATH=%{buildroot}%{python3_sitearch} \
# %{__python3} setup.py test
popd
%endif %endif
%endif %endif
%files -n python2-%{modname} %files -n python2-%{modname}
%defattr(-,root,root,-)
%doc README.md COPYING.* examples/ %doc README.md COPYING.* examples/
%{python2_sitearch}/%{srcname}-*.egg-info %{python2_sitearch}/%{srcname}-*.egg-info
%{python2_sitearch}/zmq %{python2_sitearch}/zmq
%exclude %{python2_sitearch}/zmq/tests %exclude %{python2_sitearch}/zmq/tests
%files -n python2-%{modname}-tests %files -n python2-%{modname}-tests
%defattr(-,root,root,-)
%{python2_sitearch}/zmq/tests %{python2_sitearch}/zmq/tests
%if 0%{?with_python3} %if 0%{?with_python3}
%files -n python%{python3_pkgversion}-zmq %files -n python%{python3_pkgversion}-zmq
%defattr(-,root,root,-)
%doc README.md COPYING.* %doc README.md COPYING.*
# examples/ # examples/
%{python3_sitearch}/%{srcname}-*.egg-info %{python3_sitearch}/%{srcname}-*.egg-info
@ -238,14 +218,14 @@ chrpath --delete %{buildroot}%{python_sitearch}%{RPATH}/*.so
%exclude %{python3_sitearch}/zmq/tests %exclude %{python3_sitearch}/zmq/tests
%files -n python%{python3_pkgversion}-zmq-tests %files -n python%{python3_pkgversion}-zmq-tests
%defattr(-,root,root,-)
%{python3_sitearch}/zmq/tests %{python3_sitearch}/zmq/tests
%endif %endif
%changelog %changelog
* Wed Oct 14 2015 Thomas Spura <tomspur@fedoraproject.org> - 14.7.0-2 * Wed Oct 14 2015 Thomas Spura <tomspur@fedoraproject.org> - 14.7.0-2
- Use python_provide macro - Use python_provide and py_build macros
- Cleanup spec
* Mon Jun 29 2015 Ralph Bean <rbean@redhat.com> - 14.7.0-2 * Mon Jun 29 2015 Ralph Bean <rbean@redhat.com> - 14.7.0-2
- Support python34 on EPEL7. - Support python34 on EPEL7.