From d9ae81c68603d7a360a184d028124191fd7c73bd Mon Sep 17 00:00:00 2001
From: "Darryl L. Pierce" <dpierce@redhat.com>
Date: Tue, 26 Feb 2013 10:52:47 -0500
Subject: [PATCH] Rebased on Proton 0.4.

---
 .gitignore                                    |  1 +
 ...-building-proton-on-non-x86-platform.patch | 31 ----------------
 ...ns-a-default-value-to-scanned-in-cod.patch | 31 ----------------
 ...N-246-Copying-nested-data-fails-in-s.patch | 36 -------------------
 qpid-proton.spec                              | 28 ++++++---------
 sources                                       |  2 +-
 6 files changed, 12 insertions(+), 117 deletions(-)
 delete mode 100644 01-PROTON-202-Fixes-building-proton-on-non-x86-platform.patch
 delete mode 100644 02-PROTON-202-Assigns-a-default-value-to-scanned-in-cod.patch
 delete mode 100644 03-PROTON-230-PROTON-246-Copying-nested-data-fails-in-s.patch

diff --git a/.gitignore b/.gitignore
index 06a2b33..f9e5562 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 /qpid-proton-c-0.3.tar.gz
+/qpid-proton-0.4.tar.gz
diff --git a/01-PROTON-202-Fixes-building-proton-on-non-x86-platform.patch b/01-PROTON-202-Fixes-building-proton-on-non-x86-platform.patch
deleted file mode 100644
index e9a3f6f..0000000
--- a/01-PROTON-202-Fixes-building-proton-on-non-x86-platform.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From d50d9bfe0b84dcdcb8f2f627b50719a7d61d6dab Mon Sep 17 00:00:00 2001
-From: mcpierce <mcpierce@13f79535-47bb-0310-9956-ffa450edef68>
-Date: Fri, 25 Jan 2013 14:56:42 +0000
-Subject: [PATCH] PROTON-202: Fixes building proton on non-x86 platforms.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Submitted by: Dan Horák <dan@danny.cz>
-
-git-svn-id: https://svn.apache.org/repos/asf/qpid/proton/trunk@1438546 13f79535-47bb-0310-9956-ffa450edef68
----
- proton-c/src/codec/codec.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/proton-c/src/codec/codec.c b/proton-c/src/codec/codec.c
-index 5e57f81..d72acc0 100644
---- a/proton-c/src/codec/codec.c
-+++ b/proton-c/src/codec/codec.c
-@@ -1353,7 +1353,7 @@ int pn_data_vscan(pn_data_t *data, const char *fmt, va_list ap)
-   while (*fmt) {
-     char code = *(fmt++);
- 
--    bool found;
-+    bool found = false;
-     pn_type_t type;
- 
-     bool scanned;
--- 
-1.8.1
-
diff --git a/02-PROTON-202-Assigns-a-default-value-to-scanned-in-cod.patch b/02-PROTON-202-Assigns-a-default-value-to-scanned-in-cod.patch
deleted file mode 100644
index 3acb504..0000000
--- a/02-PROTON-202-Assigns-a-default-value-to-scanned-in-cod.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From d586bcc02c7b2a2d2ef073075b945540e231a76b Mon Sep 17 00:00:00 2001
-From: mcpierce <mcpierce@13f79535-47bb-0310-9956-ffa450edef68>
-Date: Mon, 28 Jan 2013 11:30:42 +0000
-Subject: [PATCH] PROTON-202: Assigns a default value to scanned in codec.c
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Submitted by: Dan Horák <dan@danny.cz>
-
-git-svn-id: https://svn.apache.org/repos/asf/qpid/proton/trunk@1439349 13f79535-47bb-0310-9956-ffa450edef68
----
- proton-c/src/codec/codec.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/proton-c/src/codec/codec.c b/proton-c/src/codec/codec.c
-index d72acc0..a91b644 100644
---- a/proton-c/src/codec/codec.c
-+++ b/proton-c/src/codec/codec.c
-@@ -1356,7 +1356,7 @@ int pn_data_vscan(pn_data_t *data, const char *fmt, va_list ap)
-     bool found = false;
-     pn_type_t type;
- 
--    bool scanned;
-+    bool scanned = false;
-     bool suspend = resume_count > 0;
- 
-     switch (code) {
--- 
-1.8.1
-
diff --git a/03-PROTON-230-PROTON-246-Copying-nested-data-fails-in-s.patch b/03-PROTON-230-PROTON-246-Copying-nested-data-fails-in-s.patch
deleted file mode 100644
index 64f12f5..0000000
--- a/03-PROTON-230-PROTON-246-Copying-nested-data-fails-in-s.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 595eefb5154017ec151bb551cf973735488654d2 Mon Sep 17 00:00:00 2001
-From: astitcher <astitcher@13f79535-47bb-0310-9956-ffa450edef68>
-Date: Thu, 21 Feb 2013 17:33:55 +0000
-Subject: [PATCH] PROTON-230, PROTON-246: Copying nested data fails in some
- cases
-
-git-svn-id: https://svn.apache.org/repos/asf/qpid/proton/trunk@1448733 13f79535-47bb-0310-9956-ffa450edef68
----
- proton-c/src/codec/codec.c | 7 +++----
- 1 file changed, 3 insertions(+), 4 deletions(-)
-
-diff --git a/proton-c/src/codec/codec.c b/proton-c/src/codec/codec.c
-index ee646ab..843abab 100644
---- a/proton-c/src/codec/codec.c
-+++ b/proton-c/src/codec/codec.c
-@@ -2949,14 +2949,13 @@ int pn_data_appendn(pn_data_t *data, pn_data_t *src, int limit)
-         pn_data_exit(data);
-         pn_data_exit(src);
-         level--;
-+        continue;
-       }
- 
--      if (pn_data_next(src)) {
--        break;
--      } else {
-+      if (!pn_data_next(src)) {
-         stop = true;
--        break;
-       }
-+      break;
-     }
- 
-     if (stop) break;
--- 
-1.8.1.2
-
diff --git a/qpid-proton.spec b/qpid-proton.spec
index 3090891..bb6a70b 100644
--- a/qpid-proton.spec
+++ b/qpid-proton.spec
@@ -1,13 +1,13 @@
 %global proton_datadir %{_datadir}/proton-%{version}
 
 Name:           qpid-proton
-Version:        0.3
-Release:        4%{?dist}
+Version:        0.4
+Release:        1%{?dist}
 Summary:        A high performance, lightweight messaging library
 
 License:        ASL 2.0
 URL:            http://qpid.apache.org/proton/
-Source0:        http://www.apache.org/dist/qpid/proton/%{version}/qpid-proton-c-%{version}.tar.gz
+Source0:        http://www.apache.org/dist/qpid/proton/%{version}/%{name}-%{version}.tar.gz
 
 BuildRequires:  cmake >= 2.6
 BuildRequires:  swig
@@ -19,13 +19,6 @@ BuildRequires:  python-devel
 BuildRequires:  epydoc
 
 
-# BZ#901526
-Patch1: 01-PROTON-202-Fixes-building-proton-on-non-x86-platform.patch
-Patch2: 02-PROTON-202-Assigns-a-default-value-to-scanned-in-cod.patch
-# PROTON-230, PROTON-246
-Patch3: 03-PROTON-230-PROTON-246-Copying-nested-data-fails-in-s.patch
-
-
 %description
 Proton is a high performance, lightweight messaging library. It can be used in
 the widest range of messaging applications including brokers, client libraries,
@@ -84,11 +77,7 @@ Summary: Documentation for the Python language bindings for Qpid Proton
 
 
 %prep
-%setup -q -n qpid-proton-c-%{version}
-
-%patch1 -p2
-%patch2 -p2
-%patch3 -p2
+%setup -q -n %{name}-%{version}
 
 
 %build
@@ -101,14 +90,14 @@ make all docs %{?_smp_mflags}
 
 chmod +x %{buildroot}%{python_sitearch}/_cproton.so
 
-install -m 644 docs/man/proton.1 %{buildroot}%{_mandir}/man1/proton.1
-
 # clean up files that are not shipped
 rm -rf %{buildroot}%{_libdir}/php
+rm -rf %{buildroot}%{_libdir}/java
+rm -rf %{buildroot}%{_libdir}/libproton-jni.so
 rm -rf %{buildroot}%{_datarootdir}/php
+rm -rf %{buildroot}%{_datarootdir}/java
 rm -rf %{buildroot}%{_sysconfdir}/php.d
 
-
 %post -p /sbin/ldconfig
 
 
@@ -128,6 +117,9 @@ rm -rf %{buildroot}%{_sysconfdir}/php.d
 
 
 %changelog
+* Tue Feb 26 2013 Darryl L. Pierce <dpierce@redhat.com> - 0.4-1
+- Rebased on Proton 0.4.
+
 * Thu Feb 21 2013 Darryl L. Pierce <dpierce@redhat.com> - 0.3-4
 - Fixes copying nested data.
 - PROTON-246, PROTON-230
diff --git a/sources b/sources
index 2a86305..b090d36 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-094f003b8c35a5ca7c90168b2e18a589  qpid-proton-c-0.3.tar.gz
+73d1a18017010934b2780ccc820f0773  qpid-proton-0.4.tar.gz