[python-txamqp/el6/master] Initial build

Silas Sewell silas at fedoraproject.org
Mon Apr 25 01:43:42 UTC 2011


commit 88404ab6e72d8f29458e7f8d3f987ec341146ac9
Author: Silas Sewell <silas at sewell.ch>
Date:   Sun Apr 24 21:43:23 2011 -0400

    Initial build

 .gitignore                        |    1 +
 python-txamqp-0.3.spec-path.patch |   53 +++++++++++++++++++++++
 python-txamqp.spec                |   85 +++++++++++++++++++++++++++++++++++++
 sources                           |    1 +
 4 files changed, 140 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..6f20cdc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/python-txamqp_0.3.orig.tar.gz
diff --git a/python-txamqp-0.3.spec-path.patch b/python-txamqp-0.3.spec-path.patch
new file mode 100644
index 0000000..75574cf
--- /dev/null
+++ b/python-txamqp-0.3.spec-path.patch
@@ -0,0 +1,53 @@
+diff -up python-txamqp-0.3/src/examples/simple/README.orig python-txamqp-0.3/src/examples/simple/README
+--- python-txamqp-0.3/src/examples/simple/README.orig 2010-07-14 22:28:07.674394596 -0600
++++ python-txamqp-0.3/src/examples/simple/README  2010-07-14 22:31:10.529021852 -0600
+@@ -13,10 +13,10 @@ Running
+ 1. Open two consoles:
+    a) In one of them run the txconsumer.py script:
+       $ python txconsumer.py host port vhost username password path_to_spec
+-      e.g. txconsumer.py localhost 5672 / guest guest ../../specs/standard/amqp0-8.xml
++      e.g. txconsumer.py localhost 5672 / guest guest /usr/share/amqp/amqp.0-8.xml
+    b) In the other one run the txpublisher.py script:
+       $ python txpublisher.py host port vhost username password path_to_spec content [count]
+-      e.g. txpublisher.py localhost 5672 / guest guest ../../specs/standard/amqp0-8.xml hello 1000
++      e.g. txpublisher.py localhost 5672 / guest guest /usr/share/amqp/amqp.0-8.xml hello 1000
+ 
+ Where:
+ - host: The host where the AMQP broker is located.
+@@ -29,9 +29,9 @@ Where:
+     is 'guest').
+ - path_to_spec: The path to the AMQP spec that you want to use. Keep in mind
+     that depending on the broker you use, you will need a different spec:
+-    - RabbitMQ 1.5.3: $TXAMQP_PATH/src/specs/standard/amqp0-8.xml
+-    - OpenAMQ 1.3c5: $TXAMQP_PATH/src/specs/standard/amqp0-9.xml
+-    - Qpid M3 (Java): $TXAMQP_PATH/src/specs/qpid/amqp.0-8.xml
++    - RabbitMQ 1.5.3: /usr/share/amqp/amqp.0-8.xml
++    - OpenAMQ 1.3c5: /usr/share/amqp/amqp.0-9.xml
++    - Qpid M3 (Java): /usr/share/amqp/amqp.0-8.xml
+ 
+ 2. You should see messages being sent from the second console and received
+    in the first one.
+diff -up python-txamqp-0.3/src/examples/simple/txconsumer.py.orig python-txamqp-0.3/src/examples/simple/txconsumer.py
+--- python-txamqp-0.3/src/examples/simple/txconsumer.py.orig  2010-07-14 22:12:35.941144143 -0600
++++ python-txamqp-0.3/src/examples/simple/txconsumer.py 2010-07-14 22:29:49.279394418 -0600
+@@ -44,7 +44,7 @@ if __name__ == "__main__":
+     import sys
+     if len(sys.argv) < 7:
+         print "%s host port vhost username password path_to_spec" % sys.argv[0]
+-        print "e.g. %s localhost 5672 / guest guest ../../specs/standard/amqp0-8.xml" % sys.argv[0]
++        print "e.g. python %s localhost 5672 / guest guest /usr/share/amqp/amqp.0-8.xml" % sys.argv[0]
+         sys.exit(1)
+ 
+     host = sys.argv[1]
+diff -up python-txamqp-0.3/src/examples/simple/txpublisher.py.orig python-txamqp-0.3/src/examples/simple/txpublisher.py
+--- python-txamqp-0.3/src/examples/simple/txpublisher.py.orig 2010-07-14 22:13:28.569168756 -0600
++++ python-txamqp-0.3/src/examples/simple/txpublisher.py  2010-07-14 22:30:01.131145004 -0600
+@@ -45,7 +45,7 @@ if __name__ == "__main__":
+     import sys
+     if len(sys.argv) < 8:
+         print "%s host port vhost username password path_to_spec content [count]" % sys.argv[0]
+-        print "e.g. %s localhost 5672 / guest guest ../../specs/standard/amqp0-8.xml hello 1000" % sys.argv[0]
++        print "e.g. python %s localhost 5672 / guest guest /usr/share/amqp/amqp.0-8.xml hello 1000" % sys.argv[0]
+         sys.exit(1)
+ 
+     host = sys.argv[1]
diff --git a/python-txamqp.spec b/python-txamqp.spec
new file mode 100644
index 0000000..c4a241d
--- /dev/null
+++ b/python-txamqp.spec
@@ -0,0 +1,85 @@
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+
+%global with_thrift %{?_with_thrift: 1} %{?!_with_thrift: 0}
+
+%global upstream_name txamqp
+
+Name:           python-%{upstream_name}
+Version:        0.3
+Release:        1%{?dist}
+Summary:        A Python library for communicating with AMQP peers and brokers using Twisted
+
+Group:          Development/Languages
+License:        ASL 2.0
+URL:            https://launchpad.net/txamqp
+Source0:        http://launchpad.net/txamqp/trunk/%{version}/+download/python-txamqp_%{version}.orig.tar.gz
+Patch0:         python-txamqp-0.3.spec-path.patch
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildArch:      noarch
+BuildRequires:  python-devel
+BuildRequires:  python-setuptools
+Requires:       python-twisted-core
+Requires:       amqp
+
+%description
+txAMQP is a Python library for communicating with AMQP peers and brokers using
+Twisted.
+
+This project contains all the necessary code to connect, send and receive
+messages to/from an AMQP-compliant peer or broker (Qpid, OpenAMQ, RabbitMQ)
+using Twisted.
+
+%if %{with_thrift}
+%package        thrift
+Summary:        Contributed Thrift libraries for Twisted
+Group:          Development/Languages
+
+Requires:       thrift-python
+
+%description    thrift
+txAMQP also includes support for using Thrift RPC over AMQP in Twisted
+applications.
+%endif
+
+%prep
+%setup -q
+%patch0 -p1
+# Fix non-executable-script error
+sed -i '/^#!\/usr\/bin\/env python/,+1 d' src/txamqp/codec.py
+
+%build
+%{__python} setup.py build
+
+%install
+rm -rf %{buildroot}
+%{__python} setup.py install -O1 --skip-build --root %{buildroot}
+# Remove thrift if we're not including it
+%if !%{with_thrift}
+rm -rf %{buildroot}%{python_sitelib}/%{upstream_name}/contrib/thrift
+%endif
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+# Request LICENSE in https://bugs.launchpad.net/txamqp/+bug/605699 (nextrelease)
+%doc doc/CHANGES doc/README doc/THANKS src/examples/simple
+%dir %{python_sitelib}/%{upstream_name}
+%{python_sitelib}/%{upstream_name}/*.py*
+%{python_sitelib}/%{upstream_name}/test
+%dir %{python_sitelib}/%{upstream_name}/contrib
+%{python_sitelib}/%{upstream_name}/contrib/*.py*
+%{python_sitelib}/txAMQP-%{version}-*.egg-info
+
+%if %{with_thrift}
+%files thrift
+%defattr(-,root,root,-)
+%doc doc/README src/examples/thrift
+%{python_sitelib}/%{upstream_name}/contrib/thrift
+%endif
+
+%changelog
+* Sun Sep 12 2010 Silas Sewell <silas at sewell.ch> - 0.3-1
+- Initial build
diff --git a/sources b/sources
index e69de29..2b4a8e0 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+984aa9c7195549c12a0aaae92b6fe503  python-txamqp_0.3.orig.tar.gz


More information about the scm-commits mailing list