diff --git a/.gitignore b/.gitignore index bce9dd9..1f3ee7d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /qpid-proton-0.6.tar.gz /qpid-proton-0.7.tar.gz /qpid-proton-0.8.tar.gz +/qpid-proton-0.9.tar.gz diff --git a/0001-NO-JIRA-Fix-install-of-Perl-bindings.patch b/0001-NO-JIRA-Fix-install-of-Perl-bindings.patch new file mode 100644 index 0000000..11fdf61 --- /dev/null +++ b/0001-NO-JIRA-Fix-install-of-Perl-bindings.patch @@ -0,0 +1,32 @@ +From fc37fa00539906cac2f0639c166fb233e826fe7e Mon Sep 17 00:00:00 2001 +From: "Darryl L. Pierce" +Date: Mon, 16 Mar 2015 09:15:22 -0400 +Subject: [PATCH 1/2] NO-JIRA: Fix install of Perl bindings + +--- + proton-c/bindings/perl/CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/proton-c/bindings/perl/CMakeLists.txt b/proton-c/bindings/perl/CMakeLists.txt +index 9891c09..55cf032 100644 +--- a/proton-c/bindings/perl/CMakeLists.txt ++++ b/proton-c/bindings/perl/CMakeLists.txt +@@ -56,13 +56,13 @@ swig_link_libraries(cproton_perl ${BINDING_DEPS} ${PERL_LIBRARY}) + + if ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8)) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cproton_perl.so +- DESTINATION ${PERL_VENDORARCH_DIR} ++ DESTINATION ${PERL_VENDORARCH_DIR}/auto/cproton_perl + COMPONENT Perl + ) + else() + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcproton_perl.so + RENAME cproton_perl.so +- DESTINATION ${PERL_VENDORARCH_DIR} ++ DESTINATION ${PERL_VENDORARCH_DIR}/auto/cproton_perl + COMPONENT Perl + ) + endif ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8)) +-- +2.1.0 + diff --git a/0001-PROTON-731-Installing-Python-requires-Proton-be-inst.patch b/0001-PROTON-731-Installing-Python-requires-Proton-be-inst.patch deleted file mode 100644 index 26de0c0..0000000 --- a/0001-PROTON-731-Installing-Python-requires-Proton-be-inst.patch +++ /dev/null @@ -1,40 +0,0 @@ -From a0670dd53c9d3b444656917e0b663364f6f20aa5 Mon Sep 17 00:00:00 2001 -From: "Darryl L. Pierce" -Date: Mon, 27 Oct 2014 15:01:52 -0400 -Subject: [PATCH] PROTON-731: Installing Python requires Proton be installed - already. - -The CHECK_SYSINSTALL_PYTHON variable was not being set, so it's now -being set by default but can be overridden from the command line. - -Also changed the PYTHON_SITEARCH_PACKAGES variable a cache done that can -also be overridden from the command line as well. ---- - proton-c/bindings/python/CMakeLists.txt | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/proton-c/bindings/python/CMakeLists.txt b/proton-c/bindings/python/CMakeLists.txt -index b8cdb57..ff8c706 100644 ---- a/proton-c/bindings/python/CMakeLists.txt -+++ b/proton-c/bindings/python/CMakeLists.txt -@@ -22,6 +22,8 @@ - - set(CMAKE_SWIG_FLAGS "-threads") - -+set(CHECK_SYSINSTALL_PYTHON ON CACHE INTERNAL "") -+ - include_directories (${PYTHON_INCLUDE_PATH}) - if (BUILD_WITH_CXX) - SET_SOURCE_FILES_PROPERTIES(cproton.i PROPERTIES CPLUSPLUS ON) -@@ -74,7 +76,7 @@ if (CHECK_SYSINSTALL_PYTHON) - - else () - # install the bindings using the CMAKE path variables: -- set (PYTHON_SITEARCH_PACKAGES ${BINDINGS_DIR}/python) -+ set (PYTHON_SITEARCH_PACKAGES ${BINDINGS_DIR}/python CACHE INTERNAL "") - - install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile cproton.py - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})") --- -1.9.3 - diff --git a/0002-PROTON-582-Added-in-missing-is_float-method-to-Perl-.patch b/0002-PROTON-582-Added-in-missing-is_float-method-to-Perl-.patch new file mode 100644 index 0000000..f11448d --- /dev/null +++ b/0002-PROTON-582-Added-in-missing-is_float-method-to-Perl-.patch @@ -0,0 +1,73 @@ +From ba8cee70089adfe64c2429a20eb5bee90d96b606 Mon Sep 17 00:00:00 2001 +From: "Darryl L. Pierce" +Date: Tue, 17 Mar 2015 09:04:31 -0400 +Subject: [PATCH 2/2] PROTON-582: Added in missing is_float method to Perl + bindings. + +--- + examples/perl/messenger/send.pl | 2 +- + proton-c/bindings/perl/lib/qpid/proton/Data.pm | 4 ++-- + proton-c/bindings/perl/lib/qpid/proton/Message.pm | 2 +- + proton-c/bindings/perl/lib/qpid/proton/utils.pm | 7 +++++++ + 4 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/examples/perl/messenger/send.pl b/examples/perl/messenger/send.pl +index b622b68..27893ce 100755 +--- a/examples/perl/messenger/send.pl ++++ b/examples/perl/messenger/send.pl +@@ -59,7 +59,7 @@ foreach (@messages) + { + $msg->set_address($address); + $msg->set_subject($subject); +- $msg->set_content($content); ++ $msg->set_body($content); + # try a few different body types + my $body_type = int(rand(6)); + $msg->set_property("sent", "" . localtime(time)); +diff --git a/proton-c/bindings/perl/lib/qpid/proton/Data.pm b/proton-c/bindings/perl/lib/qpid/proton/Data.pm +index 156e09a..494a8f3 100644 +--- a/proton-c/bindings/perl/lib/qpid/proton/Data.pm ++++ b/proton-c/bindings/perl/lib/qpid/proton/Data.pm +@@ -1165,8 +1165,8 @@ sub put_list_helper { + $self->enter; + + for my $value (@{$array}) { +- if (qpid::proton::is_num($value)) { +- if (qpid::proton::is_float($value)) { ++ if (qpid::proton::utils::is_num($value)) { ++ if (qpid::proton::utils::is_float($value)) { + $self->put_float($value); + } else { + $self->put_int($value); +diff --git a/proton-c/bindings/perl/lib/qpid/proton/Message.pm b/proton-c/bindings/perl/lib/qpid/proton/Message.pm +index b36caa7..0251b89 100644 +--- a/proton-c/bindings/perl/lib/qpid/proton/Message.pm ++++ b/proton-c/bindings/perl/lib/qpid/proton/Message.pm +@@ -438,7 +438,7 @@ sub set_body { + # be, which is going to be a best guess + if (!defined($body_type)) { + if (qpid::proton::utils::is_num($body)) { +- if (qpid::proton::is_float($body)) { ++ if (qpid::proton::utils::is_float($body)) { + $body_type = qpid::proton::FLOAT; + } else { + $body_type = qpid::proton::INT; +diff --git a/proton-c/bindings/perl/lib/qpid/proton/utils.pm b/proton-c/bindings/perl/lib/qpid/proton/utils.pm +index 5652535..0ab4e3e 100644 +--- a/proton-c/bindings/perl/lib/qpid/proton/utils.pm ++++ b/proton-c/bindings/perl/lib/qpid/proton/utils.pm +@@ -28,4 +28,11 @@ sub is_num { + $_[0] ^ $_[0] ? 0 : 1 + } + ++sub is_float { ++ my $val = $_[0]; ++ ++ return 1 if ($val - int($val)); ++ return 0; ++} ++ + 1; +-- +2.1.0 + diff --git a/qpid-proton.spec b/qpid-proton.spec index 0dcd4a9..0fa2815 100644 --- a/qpid-proton.spec +++ b/qpid-proton.spec @@ -1,7 +1,8 @@ %global proton_datadir %{_datadir}/proton-%{version} +%global gem_name qpid_proton Name: qpid-proton -Version: 0.8 +Version: 0.9 Release: 1%{?dist} Summary: A high performance, lightweight messaging library @@ -9,7 +10,8 @@ License: ASL 2.0 URL: http://qpid.apache.org/proton/ Source0: http://www.apache.org/dist/qpid/proton/%{version}/%{name}-%{version}.tar.gz -Patch0001: 0001-PROTON-731-Installing-Python-requires-Proton-be-inst.patch +Patch0001: 0001-NO-JIRA-Fix-install-of-Perl-bindings.patch +Patch0002: 0002-PROTON-582-Added-in-missing-is_float-method-to-Perl-.patch %if (0%{?fedora} || 0%{?rhel} == 7) BuildRequires: cmake >= 2.6 @@ -29,6 +31,9 @@ BuildRequires: openssl-devel BuildRequires: python BuildRequires: python-devel BuildRequires: epydoc +BuildRequires: perl(ExtUtils::MakeMaker) +BuildRequires: perl(Test::Exception) +BuildRequires: perl(Test::More) @@ -58,7 +63,6 @@ Provides: qpid-proton = %{version}-%{release} %doc %{proton_datadir}/README %doc %{proton_datadir}/TODO %{_mandir}/man1/* -%{_bindir}/proton %{_bindir}/proton-dump %{_libdir}/libqpid-proton.so.* @@ -86,7 +90,7 @@ Provides: qpid-proton-devel = %{version}-%{release} %{_libdir}/libqpid-proton.so %{_libdir}/pkgconfig/libqpid-proton.pc %{_libdir}/cmake/Proton -%{_datadir}/proton/examples +%{proton_datadir}/examples @@ -118,7 +122,7 @@ Requires: python %defattr(-,root,root,-) %{python_sitearch}/_cproton.so %{python_sitearch}/cproton.* -%{python_sitearch}/proton.* +%{python_sitearch}/proton @@ -137,10 +141,33 @@ BuildArch: noarch +%package -n perl-qpid-proton +Summary: Perl language bindings for Qpid Proton messaging framework + +# Remove with Proton 0.11 +Obsoletes: perl-qpid_proton < %{version} +Provides: perl-qpid_proton = %{version}-%{release} + +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) +Requires: qpid-proton-c = %{version}-%{release} + + +%description -n perl-qpid-proton +%{summary}. + + +%files -n perl-qpid-proton +%doc LICENSE TODO README +%{perl_vendorarch}/* + + + %prep %setup -q -n %{name}-%{version} %patch0001 -p1 +%patch0002 -p1 + %build @@ -151,17 +178,22 @@ BuildArch: noarch -DNOBUILD_RUBY=1 \ -DNOBUILD_PHP=1 \ -DSYSINSTALL_PYTHON=1 \ - -DSYSINSTALL_PERL=0 \ + -DSYSINSTALL_PERL=1 \ -DCHECK_SYSINSTALL_PYTHON=0 \ . make all docs %{?_smp_mflags} + %install %make_install +CPROTON_BUILD=$PWD . ./config.sh + chmod +x %{buildroot}%{python_sitearch}/_cproton.so + + # clean up files that are not shipped rm -rf %{buildroot}%{_exec_prefix}/bindings rm -rf %{buildroot}%{_libdir}/java @@ -169,7 +201,19 @@ rm -rf %{buildroot}%{_libdir}/libproton-jni.so rm -rf %{buildroot}%{_datarootdir}/java rm -rf %{buildroot}%{_libdir}/proton.cmake + +%check +# check perl bindings +pushd proton-c/bindings/perl +make test +popd + %changelog +* Mon Apr 6 2015 Darryl L. Pierce - 0.9-1 +- Rebased on Proton 0.9. +- Removed the proton binary from qpid-proton-c. +- Added the perl-qpid-proton subpackage. + * Tue Nov 18 2014 Darryl L. Pierce - 0.8-1 - Rebased on Proton 0.8. diff --git a/sources b/sources index 4071aca..3d30f82 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -48bfbd7ba5a639760bb28380f4d68208 qpid-proton-0.8.tar.gz +aa42b8465d35cf902931daabbe4ef489 qpid-proton-0.9.tar.gz