diff --git a/python-zmq.spec b/python-zmq.spec index 766517e..a11fcfd 100644 --- a/python-zmq.spec +++ b/python-zmq.spec @@ -14,6 +14,9 @@ %else %{?filter_setup: %filter_provides_in %{python_sitearch}/.*\.so$ +%if 0%{?fedora} > 12 || 0%{?rhel} > 6 +%filter_provides_in %{python3_sitearch}/.*\.so$ +%endif %filter_setup } %endif @@ -26,7 +29,7 @@ Name: python-zmq Version: 2.1.9 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Software library for fast, message-based applications Group: Development/Libraries @@ -38,6 +41,14 @@ URL: http://www.zeromq.org/bindings:python # cd pyzmq.git # git archive --format=tar --prefix=pyzmq-%%{version}/ %%{checkout} | xz -z --force - > pyzmq-%%{version}.tar.xz Source0: http://cloud.github.com/downloads/zeromq/pyzmq/pyzmq-%{version}.tar.gz + +%if ! ( 0%{?fedora} > 12 || 0%{?rhel} > 5) +# filtering the el5 way +Source10: pythondeps.sh +%global __python_requires %{SOURCE10} +%global __python_provides %{SOURCE10} +%endif + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %if ! ( 0%{?fedora} > 12 || 0%{?rhel} > 5) @@ -98,8 +109,10 @@ Summary: Software library for fast, message-based applications Group: Development/Libraries License: LGPLv3+ %if ! ( 0%{?fedora} > 12 || 0%{?rhel} > 5) +Requires: python26-zmq = %{version}-%{release} %description -n python26-zmq-tests %else +Requires: python-zmq = %{version}-%{release} %description tests %endif The 0MQ lightweight messaging kernel is a library which extends the @@ -132,6 +145,7 @@ This package contains the python bindings. Summary: Software library for fast, message-based applications Group: Development/Libraries License: LGPLv3+ +Requires: python3-zmq = %{version}-%{release} %description -n python3-zmq-tests The 0MQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by @@ -188,7 +202,7 @@ popd # to be the default for now). %if 0%{?with_python3} pushd %{py3dir} -%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT +%{__python3} setup.py install --skip-build --root %{buildroot} # remove tests doesn't work here, do that after running the tests @@ -254,6 +268,10 @@ popd %changelog +* Wed Dec 14 2011 Thomas Spura - 2.1.9-3 +- tests package requires main package +- filter python3 and python26 libs + * Thu Dec 8 2011 Thomas Spura - 2.1.9-2 - use proper buildroot macro - use python2.6 on el5 and below (only build intended for el5) diff --git a/pythondeps.sh b/pythondeps.sh new file mode 100755 index 0000000..10a060a --- /dev/null +++ b/pythondeps.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +[ $# -ge 1 ] || { + cat > /dev/null + exit 0 +} + +case $1 in +-P|--provides) + shift + # Match buildroot/payload paths of the form + # /PATH/OF/BUILDROOT/usr/bin/pythonMAJOR.MINOR + # generating a line of the form + # python(abi) = MAJOR.MINOR + # (Don't match against -config tools e.g. /usr/bin/python2.6-config) + grep "/usr/bin/python.\..$" \ + | sed -e "s|.*/usr/bin/python\(.\..\)|python(abi) = \1|" + ;; +-R|--requires) + shift + # Match buildroot paths of the form + # /PATH/OF/BUILDROOT/usr/lib/pythonMAJOR.MINOR/ and + # /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/ + # generating (uniqely) lines of the form: + # python(abi) = MAJOR.MINOR + grep "/usr/lib[^/]*/python.\../.*" \ + | sed -e "s|.*/usr/lib[^/]*/python\(.\..\)/.*|python(abi) = \1|g" \ + | sort | uniq + ;; +esac + +exit 0