From cb65bcb7b49978bef2eb8cf45f55033f59d126e4 Mon Sep 17 00:00:00 2001 From: stevetraylen Date: May 14 2010 19:47:50 +0000 Subject: Correct .spec file this time. --- diff --git a/stomppy.spec b/stomppy.spec index 48fdba6..12d02c9 100644 --- a/stomppy.spec +++ b/stomppy.spec @@ -1,22 +1,31 @@ +%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5) %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +%endif + +%if 0%{?fedora} > 12 +%global with_python3 1 +%endif %global beta 2 Name: stomppy Version: 3.0.1 -Release: %{?beta:0.}1%{?beta:.beta%{beta}}%{?dist} +Release: %{?beta:0.}2%{?beta:.beta%{beta}}%{?dist} Summary: Python stomp client for messaging Group: Development/Libraries License: ASL 2.0 URL: http://code.google.com/p/stomppy/ Source0: http://stomppy.googlecode.com/files/stomp.py-%{version}%{?beta:-beta%{beta}}.tar.gz -Patch1: %{name}-rm-bang-python.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch -BuildRequires: python-devel +BuildRequires: python2-devel +%if 0%{?with_python3} +BuildRequires: python3-devel +%endif # if with_python3 +# Needs python-ssl for python 2.3 and 2.4. %if 0%{?el4}%{?el5} Requires: python-ssl %endif @@ -27,19 +36,54 @@ stomp.py is a Python client library for accessing messaging servers (such as ActiveMQ or JBoss Messaging) using the STOMP protocol. It can also be run as a standalone, command-line client for testing. +%if 0%{?with_python3} +%package -n python3-stomppy +Summary: Python stomp client for messaging for python3 +Group: Development/Libraries + +%description -n python3-stomppy +stomp.py is a Python client library for accessing messaging servers +(such as ActiveMQ or JBoss Messaging) using the STOMP protocol. It can also +be run as a standalone, command-line client for testing. + +This module is for the python3. +%endif + + + %prep %setup -q -n stomp.py-%{version} -#%patch1 -p1 # Remove dos line feeds from tests. -#%{__sed} -i 's/\r//' test/testlistener.py -#%{__sed} -i 's/\r//' test/rabbitmq.py -#%{__sed} -i 's/\r//' test/basic.py +sed -i 's/\r//' README +chmod 644 README + +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif # with_python3 + %build %{__python} setup.py build +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif # with_python3 + + + %install rm -rf $RPM_BUILD_ROOT +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +rm -rf %{buildroot}%{python3_sitelib}/test +popd +%endif # with_python3 + + %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT%{python_sitelib}/test @@ -51,10 +95,23 @@ rm -rf $RPM_BUILD_ROOT %{python_sitelib}/* %doc LICENSE CHANGELOG README +%if 0%{?with_python3} +%files -n python3-stomppy +%defattr(-,root,root,-) +%{python3_sitelib}/* +%doc LICENSE CHANGELOG README +%endif # with_python3 + + %changelog -* Thu May 13 2010 Steve Traylen - 3.0.2-0.1.beta2 +* Fri May 14 2010 Steve Traylen - 3.0.1-0.2.beta2 +- Build with correct file this time. + +* Thu May 13 2010 Steve Traylen - 3.0.1-0.1.beta2 - Update to 3.0.2beta2 - Add new CHANGELOG and README files. +- Add python3 support. +- Remove python-rm-bang-python.patch, no longer a file to patch even. * Wed Sep 30 2009 Steve Traylen - 2.0.4-1 - Update to 2.0.4