From ce3866b8d64322e75a3bf36fe971b1eb18811aed Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 27 Jul 2017 22:42:07 +0000 Subject: [PATCH 01/60] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- zeromq.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 5f47fc8..1ef2967 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.1.6 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Software library for fast, message-based applications Group: System Environment/Libraries @@ -131,6 +131,9 @@ make check V=1 %changelog +* Thu Jul 27 2017 Fedora Release Engineering - 4.1.6-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Mon May 15 2017 Fedora Release Engineering - 4.1.6-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild From 85bad0539d2b71ed9d87514028bc9f1c20c4901b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 3 Aug 2017 11:10:21 +0000 Subject: [PATCH 02/60] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild --- zeromq.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 1ef2967..67826b8 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.1.6 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Software library for fast, message-based applications Group: System Environment/Libraries @@ -131,6 +131,9 @@ make check V=1 %changelog +* Thu Aug 03 2017 Fedora Release Engineering - 4.1.6-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + * Thu Jul 27 2017 Fedora Release Engineering - 4.1.6-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From 015e3956e4223135493ceed266123eef980bee6e Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 2 Oct 2017 09:08:17 +0200 Subject: [PATCH 03/60] rebuild for libsodium --- zeromq.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 67826b8..8ee7f05 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.1.6 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Software library for fast, message-based applications Group: System Environment/Libraries @@ -131,6 +131,9 @@ make check V=1 %changelog +* Mon Oct 02 2017 Remi Collet - 4.1.6-6 +- rebuild for libsodium + * Thu Aug 03 2017 Fedora Release Engineering - 4.1.6-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild From 2cefe819576e5715631d9b53143baeb292d0442c Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Sat, 3 Feb 2018 17:43:00 +0100 Subject: [PATCH 04/60] Switch to %ldconfig_scriptlets Signed-off-by: Igor Gnatenko --- zeromq.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zeromq.spec b/zeromq.spec index 8ee7f05..8062540 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.1.6 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Software library for fast, message-based applications Group: System Environment/Libraries @@ -108,10 +108,7 @@ rm %{buildroot}%{_libdir}/libzmq.la make check V=1 -%post -p /sbin/ldconfig - - -%postun -p /sbin/ldconfig +%ldconfig_scriptlets %files @@ -131,6 +128,9 @@ make check V=1 %changelog +* Sat Feb 03 2018 Igor Gnatenko - 4.1.6-7 +- Switch to %%ldconfig_scriptlets + * Mon Oct 02 2017 Remi Collet - 4.1.6-6 - rebuild for libsodium From 1b73cea19e5ba0758c614e8beac558b692dfd782 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 9 Feb 2018 22:26:52 +0000 Subject: [PATCH 05/60] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zeromq.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 8062540..72c8d8a 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.1.6 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Software library for fast, message-based applications Group: System Environment/Libraries @@ -128,6 +128,9 @@ make check V=1 %changelog +* Fri Feb 09 2018 Fedora Release Engineering - 4.1.6-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Sat Feb 03 2018 Igor Gnatenko - 4.1.6-7 - Switch to %%ldconfig_scriptlets From 3eaf98a78b757afb2ab141deb80dabbdaf1987ef Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 14 Feb 2018 00:52:39 +0100 Subject: [PATCH 06/60] Remove BuildRoot definition None of currently supported distributions need that. It was needed last for EL5 which is EOL now Signed-off-by: Igor Gnatenko --- zeromq.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 72c8d8a..05e6666 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -21,7 +21,6 @@ BuildRequires: libsodium-devel BuildRequires: glib2-devel %if ! (0%{?fedora} > 12 || 0%{?rhel} > 5) BuildRequires: e2fsprogs-devel -BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) %else BuildRequires: libuuid-devel %endif From 2e18705528cce7ba46965e3a9c9431777f5d8196 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 14 Jul 2018 09:49:31 +0000 Subject: [PATCH 07/60] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zeromq.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 05e6666..1de23a3 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.1.6 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Software library for fast, message-based applications Group: System Environment/Libraries @@ -127,6 +127,9 @@ make check V=1 %changelog +* Sat Jul 14 2018 Fedora Release Engineering - 4.1.6-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Fri Feb 09 2018 Fedora Release Engineering - 4.1.6-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From 23d1f54267313a406692bcda16ec84fb6a00ae4f Mon Sep 17 00:00:00 2001 From: Pavel Zhukov Date: Tue, 28 Aug 2018 15:40:35 +0200 Subject: [PATCH 08/60] Add gcc-c++ build requirement. Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1606788 --- zeromq.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 1de23a3..8b95d8c 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.1.6 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Software library for fast, message-based applications Group: System Environment/Libraries @@ -17,6 +17,7 @@ BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool BuildRequires: libsodium-devel +BuildRequires: gcc-c++ BuildRequires: glib2-devel %if ! (0%{?fedora} > 12 || 0%{?rhel} > 5) @@ -127,6 +128,9 @@ make check V=1 %changelog +* Tue Aug 28 2018 Pavel Zhukov - 4.1.6-10 +- Add gcc-c++ BR + * Sat Jul 14 2018 Fedora Release Engineering - 4.1.6-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From 7a004a7f33527d3d4f58ebf572ee33801503bcd2 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 21 Jan 2019 05:06:02 -0500 Subject: [PATCH 09/60] Remove some old stuff. --- zeromq.spec | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/zeromq.spec b/zeromq.spec index 8b95d8c..ff23ee8 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -5,10 +5,8 @@ Version: 4.1.6 Release: 10%{?dist} Summary: Software library for fast, message-based applications -Group: System Environment/Libraries License: LGPLv3+ URL: http://www.zeromq.org -# VCS: git:http://github.com/zeromq/zeromq2.git Source0: https://github.com/zeromq/zeromq4-1/releases/download/v%{version}/zeromq-%{version}.tar.gz Source1: https://raw.githubusercontent.com/zeromq/cppzmq/master/zmq.hpp Source2: https://raw.githubusercontent.com/zeromq/cppzmq/master/LICENSE @@ -20,11 +18,7 @@ BuildRequires: libsodium-devel BuildRequires: gcc-c++ BuildRequires: glib2-devel -%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5) -BuildRequires: e2fsprogs-devel -%else BuildRequires: libuuid-devel -%endif %if %{with pgm} BuildRequires: openpgm-devel BuildRequires: krb5-devel @@ -43,7 +37,6 @@ This package contains the ZeroMQ shared library. %package devel Summary: Development files for %{name} -Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} @@ -54,7 +47,6 @@ developing applications that use %{name}. %package -n cppzmq-devel Summary: Development files for cppzmq -Group: Development/Libraries License: MIT Requires: %{name}-devel%{?_isa} = %{version}-%{release} @@ -68,36 +60,24 @@ developing applications that use the C++ header files of %{name}. %setup -q cp -a %{SOURCE2} . -# zeromq.x86_64: W: file-not-utf8 /usr/share/doc/zeromq/ChangeLog -iconv -f iso8859-1 -t utf-8 ChangeLog > ChangeLog.conv && mv -f ChangeLog.conv ChangeLog - # Don't turn warnings into errors sed -i "s/libzmq_werror=\"yes\"/libzmq_werror=\"no\"/g" \ - configure - -# Sed version number of openpgm into configure -%global openpgm_pc $(basename %{_libdir}/pkgconfig/openpgm*.pc .pc) -sed -i "s/openpgm-[0-9].[0-9]/%{openpgm_pc}/g" \ - configure* + configure.ac %build autoreconf -fi -# Don't turn warnings into errors -sed -i "s/libzmq_werror=\"yes\"/libzmq_werror=\"no\"/g" \ - configure %configure \ %if %{with pgm} --with-pgm \ --with-libgssapi_krb5 \ %endif --disable-static -make %{?_smp_mflags} V=1 +%make_build %install -rm -rf %{buildroot} -make install DESTDIR=%{buildroot} INSTALL="install -p" +%make_install install -m 644 -p %{SOURCE1} %{buildroot}%{_includedir}/ # remove *.la From dc326129809968a1c86773992089c31038fd0d25 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 21 Jan 2019 05:45:12 -0500 Subject: [PATCH 10/60] Backport patch to fix test failure. --- 1260.patch | 25 +++++++++++++++++++++++++ zeromq.spec | 9 +++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 1260.patch diff --git a/1260.patch b/1260.patch new file mode 100644 index 0000000..bc70ec5 --- /dev/null +++ b/1260.patch @@ -0,0 +1,25 @@ +From 32b2d3034b04a54118bc95c3f83ea5af78f9de41 Mon Sep 17 00:00:00 2001 +From: Nikolay Amiantov +Date: Thu, 20 Nov 2014 05:08:45 +0300 +Subject: [PATCH] Fix test_filter_ipc for cleared supplementary groups + +This should fix part of [https://github.com/zeromq/libzmq/issues/1129]. +--- + tests/test_filter_ipc.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/test_filter_ipc.cpp b/tests/test_filter_ipc.cpp +index 00518f710..83035949b 100644 +--- a/tests/test_filter_ipc.cpp ++++ b/tests/test_filter_ipc.cpp +@@ -122,8 +122,8 @@ int main (void) + // Get the group and supplimental groups of the process owner + gid_t groups[100]; + int ngroups = getgroups(100, groups); +- assert (ngroups != -1 && ngroups != 0); +- gid_t group = getgid(), supgroup = groups[0], notgroup = groups[ngroups - 1] + 1; ++ assert (ngroups != -1); ++ gid_t group = getgid(), supgroup = group, notgroup = group + 1; + for (int i = 0; i < ngroups; i++) { + if (supgroup == group && group != groups[i]) + supgroup = groups[i]; diff --git a/zeromq.spec b/zeromq.spec index ff23ee8..3c22a49 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.1.6 -Release: 10%{?dist} +Release: 11%{?dist} Summary: Software library for fast, message-based applications License: LGPLv3+ @@ -10,6 +10,7 @@ URL: http://www.zeromq.org Source0: https://github.com/zeromq/zeromq4-1/releases/download/v%{version}/zeromq-%{version}.tar.gz Source1: https://raw.githubusercontent.com/zeromq/cppzmq/master/zmq.hpp Source2: https://raw.githubusercontent.com/zeromq/cppzmq/master/LICENSE +Patch0001: https://github.com/zeromq/libzmq/pull/1260.patch BuildRequires: autoconf BuildRequires: automake @@ -57,7 +58,7 @@ developing applications that use the C++ header files of %{name}. %prep -%setup -q +%autosetup -p1 cp -a %{SOURCE2} . # Don't turn warnings into errors @@ -108,6 +109,10 @@ make check V=1 %changelog +* Mon Jan 21 2019 Elliott Sales de Andrade - 4.1.6-11 +- Backport patch to fix test failures in build +- Cleanup spec a little + * Tue Aug 28 2018 Pavel Zhukov - 4.1.6-10 - Add gcc-c++ BR From 689cc9f6d7af68c47eb7fabed3b3f652a9015b96 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 21 Jan 2019 17:34:51 -0500 Subject: [PATCH 11/60] Use explicit soname version. --- zeromq.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 3c22a49..32f789c 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -96,7 +96,7 @@ make check V=1 %doc AUTHORS ChangeLog MAINTAINERS NEWS %license COPYING COPYING.LESSER %{_bindir}/curve_keygen -%{_libdir}/libzmq.so.* +%{_libdir}/libzmq.so.5* %files devel %{_libdir}/libzmq.so @@ -112,6 +112,7 @@ make check V=1 * Mon Jan 21 2019 Elliott Sales de Andrade - 4.1.6-11 - Backport patch to fix test failures in build - Cleanup spec a little +- Use explicit soname version in file list * Tue Aug 28 2018 Pavel Zhukov - 4.1.6-10 - Add gcc-c++ BR From 6a4c51171535057c592da573fd7d7f554499eb56 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 21 Jan 2019 19:40:05 -0500 Subject: [PATCH 12/60] Backport another patch to fix s390x. --- 1574.patch | 27 +++++++++++++++++++++++++++ zeromq.spec | 6 ++++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 1574.patch diff --git a/1574.patch b/1574.patch new file mode 100644 index 0000000..cbce755 --- /dev/null +++ b/1574.patch @@ -0,0 +1,27 @@ +From 25a50ca0d5d3ea076c63c23692e4cb9868bfb55d Mon Sep 17 00:00:00 2001 +From: KIU Shueng Chuan +Date: Tue, 8 Sep 2015 17:26:31 +0800 +Subject: [PATCH] avoid dereferencing uint32_t on unaligned address + +--- + src/socket_base.cpp | 21 +++++---------------- + 1 file changed, 5 insertions(+), 16 deletions(-) + +diff --git a/src/socket_base.cpp b/src/socket_base.cpp +index a980015fc..ea178a868 100644 +--- a/src/socket_base.cpp ++++ b/src/socket_base.cpp +@@ -1361,8 +1361,11 @@ void zmq::socket_base_t::monitor_event (int event_, int value_, const std::strin + zmq_msg_t msg; + zmq_msg_init_size (&msg, 6); + uint8_t *data = (uint8_t *) zmq_msg_data (&msg); +- *(uint16_t *) (data + 0) = (uint16_t) event_; +- *(uint32_t *) (data + 2) = (uint32_t) value_; ++ // Avoid dereferencing uint32_t on unaligned address ++ uint16_t event = (uint16_t) event_; ++ uint32_t value = (uint32_t) value_; ++ memcpy (data + 0, &event, sizeof(event)); ++ memcpy (data + 2, &value, sizeof(value)); + zmq_sendmsg (monitor_socket, &msg, ZMQ_SNDMORE); + + // Send address in second frame diff --git a/zeromq.spec b/zeromq.spec index 32f789c..a2ff707 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -11,6 +11,7 @@ Source0: https://github.com/zeromq/zeromq4-1/releases/download/v%{version Source1: https://raw.githubusercontent.com/zeromq/cppzmq/master/zmq.hpp Source2: https://raw.githubusercontent.com/zeromq/cppzmq/master/LICENSE Patch0001: https://github.com/zeromq/libzmq/pull/1260.patch +Patch0002: https://github.com/zeromq/libzmq/pull/1574.patch BuildRequires: autoconf BuildRequires: automake @@ -86,7 +87,8 @@ rm %{buildroot}%{_libdir}/libzmq.la %check -make check V=1 +make check V=1 || ( cat test-suite.log && exit 1 ) + %ldconfig_scriptlets @@ -110,7 +112,7 @@ make check V=1 %changelog * Mon Jan 21 2019 Elliott Sales de Andrade - 4.1.6-11 -- Backport patch to fix test failures in build +- Backport patches to fix test failures in build - Cleanup spec a little - Use explicit soname version in file list From 5652a7377f6eafd2324e7bdd6909b4c7f26f66b8 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 22 Jan 2019 00:28:36 -0500 Subject: [PATCH 13/60] Update to latest version of libzmq and cppzmq. --- .gitignore | 1 + 1260.patch | 25 - 1574.patch | 27 - sources | 2 +- zeromq.spec | 39 +- zmq.hpp | 1733 ++++++++++++++++++++++++++++++--------------------- 6 files changed, 1054 insertions(+), 773 deletions(-) delete mode 100644 1260.patch delete mode 100644 1574.patch diff --git a/.gitignore b/.gitignore index 2ba455d..5f933d7 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /x86_64/ /i?86/ /tarballs/ +/libzmq-4.3.1.tar.gz diff --git a/1260.patch b/1260.patch deleted file mode 100644 index bc70ec5..0000000 --- a/1260.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 32b2d3034b04a54118bc95c3f83ea5af78f9de41 Mon Sep 17 00:00:00 2001 -From: Nikolay Amiantov -Date: Thu, 20 Nov 2014 05:08:45 +0300 -Subject: [PATCH] Fix test_filter_ipc for cleared supplementary groups - -This should fix part of [https://github.com/zeromq/libzmq/issues/1129]. ---- - tests/test_filter_ipc.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/tests/test_filter_ipc.cpp b/tests/test_filter_ipc.cpp -index 00518f710..83035949b 100644 ---- a/tests/test_filter_ipc.cpp -+++ b/tests/test_filter_ipc.cpp -@@ -122,8 +122,8 @@ int main (void) - // Get the group and supplimental groups of the process owner - gid_t groups[100]; - int ngroups = getgroups(100, groups); -- assert (ngroups != -1 && ngroups != 0); -- gid_t group = getgid(), supgroup = groups[0], notgroup = groups[ngroups - 1] + 1; -+ assert (ngroups != -1); -+ gid_t group = getgid(), supgroup = group, notgroup = group + 1; - for (int i = 0; i < ngroups; i++) { - if (supgroup == group && group != groups[i]) - supgroup = groups[i]; diff --git a/1574.patch b/1574.patch deleted file mode 100644 index cbce755..0000000 --- a/1574.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 25a50ca0d5d3ea076c63c23692e4cb9868bfb55d Mon Sep 17 00:00:00 2001 -From: KIU Shueng Chuan -Date: Tue, 8 Sep 2015 17:26:31 +0800 -Subject: [PATCH] avoid dereferencing uint32_t on unaligned address - ---- - src/socket_base.cpp | 21 +++++---------------- - 1 file changed, 5 insertions(+), 16 deletions(-) - -diff --git a/src/socket_base.cpp b/src/socket_base.cpp -index a980015fc..ea178a868 100644 ---- a/src/socket_base.cpp -+++ b/src/socket_base.cpp -@@ -1361,8 +1361,11 @@ void zmq::socket_base_t::monitor_event (int event_, int value_, const std::strin - zmq_msg_t msg; - zmq_msg_init_size (&msg, 6); - uint8_t *data = (uint8_t *) zmq_msg_data (&msg); -- *(uint16_t *) (data + 0) = (uint16_t) event_; -- *(uint32_t *) (data + 2) = (uint32_t) value_; -+ // Avoid dereferencing uint32_t on unaligned address -+ uint16_t event = (uint16_t) event_; -+ uint32_t value = (uint32_t) value_; -+ memcpy (data + 0, &event, sizeof(event)); -+ memcpy (data + 2, &value, sizeof(value)); - zmq_sendmsg (monitor_socket, &msg, ZMQ_SNDMORE); - - // Send address in second frame diff --git a/sources b/sources index c7d0911..02cfb10 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c89db4dbc0b90c34c9f4983cbff6d321 zeromq-4.1.6.tar.gz +SHA512 (libzmq-4.3.1.tar.gz) = 64855a73331a194c43b01aa86a985a149eba4ed32b9f6483d2a7415cfd8bba557aab5b7b33d160cd177141de02360b73c20e4696a19c2cd798eb5f82eeb72840 diff --git a/zeromq.spec b/zeromq.spec index a2ff707..c181069 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -1,26 +1,26 @@ %bcond_without pgm +# TODO: Split into a separate package? +%global cppzmq_version 4.3.0 + Name: zeromq -Version: 4.1.6 -Release: 11%{?dist} +Version: 4.3.1 +Release: 1%{?dist} Summary: Software library for fast, message-based applications License: LGPLv3+ URL: http://www.zeromq.org -Source0: https://github.com/zeromq/zeromq4-1/releases/download/v%{version}/zeromq-%{version}.tar.gz -Source1: https://raw.githubusercontent.com/zeromq/cppzmq/master/zmq.hpp -Source2: https://raw.githubusercontent.com/zeromq/cppzmq/master/LICENSE -Patch0001: https://github.com/zeromq/libzmq/pull/1260.patch -Patch0002: https://github.com/zeromq/libzmq/pull/1574.patch +Source0: https://github.com/zeromq/libzmq/archive/v%{version}/libzmq-%{version}.tar.gz +Source1: https://github.com/zeromq/cppzmq/raw/v%{cppzmq_version}/zmq.hpp +Source2: https://github.com/zeromq/cppzmq/raw/v%{cppzmq_version}/LICENSE BuildRequires: autoconf BuildRequires: automake +BuildRequires: gcc-c++ BuildRequires: libtool BuildRequires: libsodium-devel -BuildRequires: gcc-c++ +BuildRequires: libunwind-devel -BuildRequires: glib2-devel -BuildRequires: libuuid-devel %if %{with pgm} BuildRequires: openpgm-devel BuildRequires: krb5-devel @@ -49,6 +49,7 @@ developing applications that use %{name}. %package -n cppzmq-devel Summary: Development files for cppzmq +Version: %{cppzmq_version} License: MIT Requires: %{name}-devel%{?_isa} = %{version}-%{release} @@ -59,12 +60,14 @@ developing applications that use the C++ header files of %{name}. %prep -%autosetup -p1 +%autosetup -p1 -n libzmq-%{version} cp -a %{SOURCE2} . -# Don't turn warnings into errors -sed -i "s/libzmq_werror=\"yes\"/libzmq_werror=\"no\"/g" \ - configure.ac +# Remove bundled code. +rm -rf external/wepoll + +# Fix permissions. +chmod -x src/xsub.hpp %build @@ -74,6 +77,9 @@ autoreconf -fi --with-pgm \ --with-libgssapi_krb5 \ %endif + --with-libsodium \ + --enable-libunwind \ + --disable-Werror \ --disable-static %make_build @@ -95,7 +101,7 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %files -%doc AUTHORS ChangeLog MAINTAINERS NEWS +%doc README.md AUTHORS NEWS %license COPYING COPYING.LESSER %{_bindir}/curve_keygen %{_libdir}/libzmq.so.5* @@ -111,6 +117,9 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Tue Jan 22 2019 Elliott Sales de Andrade - 4.3.1-1 +- Update to latest version of libzmq and cppzmq + * Mon Jan 21 2019 Elliott Sales de Andrade - 4.1.6-11 - Backport patches to fix test failures in build - Cleanup spec a little diff --git a/zmq.hpp b/zmq.hpp index 28dc67b..97bca4e 100644 --- a/zmq.hpp +++ b/zmq.hpp @@ -1,4 +1,5 @@ /* + Copyright (c) 2016-2017 ZeroMQ community Copyright (c) 2009-2011 250bpm s.r.o. Copyright (c) 2011 Botond Ballo Copyright (c) 2007-2009 iMatix Corporation @@ -25,59 +26,81 @@ #ifndef __ZMQ_HPP_INCLUDED__ #define __ZMQ_HPP_INCLUDED__ +#if (__cplusplus >= 201402L) +#define ZMQ_DEPRECATED(msg) [[deprecated(msg)]] +#elif defined(_MSC_VER) +#define ZMQ_DEPRECATED(msg) __declspec(deprecated(msg)) +#elif defined(__GNUC__) +#define ZMQ_DEPRECATED(msg) __attribute__((deprecated(msg))) +#endif + #if (__cplusplus >= 201103L) - #define ZMQ_CPP11 - #define ZMQ_NOTHROW noexcept - #define ZMQ_EXPLICIT explicit -#elif (defined(_MSC_VER) && (_MSC_VER >= 1900)) - #define ZMQ_CPP11 - #define ZMQ_NOTHROW noexcept - #define ZMQ_EXPLICIT explicit +#define ZMQ_CPP11 +#define ZMQ_NOTHROW noexcept +#define ZMQ_EXPLICIT explicit +#elif (defined(_MSC_VER) && (_MSC_VER >= 1900)) +#define ZMQ_CPP11 +#define ZMQ_NOTHROW noexcept +#define ZMQ_EXPLICIT explicit #else - #define ZMQ_CPP03 - #define ZMQ_NOTHROW - #define ZMQ_EXPLICIT +#define ZMQ_CPP03 +#define ZMQ_NOTHROW +#define ZMQ_EXPLICIT #endif #include -#include #include #include -#include + +#include #include -#include +#include #include +#include +#include +#include + +/* Version macros for compile-time API version detection */ +#define CPPZMQ_VERSION_MAJOR 4 +#define CPPZMQ_VERSION_MINOR 3 +#define CPPZMQ_VERSION_PATCH 0 + +#define CPPZMQ_VERSION \ + ZMQ_MAKE_VERSION(CPPZMQ_VERSION_MAJOR, CPPZMQ_VERSION_MINOR, \ + CPPZMQ_VERSION_PATCH) #ifdef ZMQ_CPP11 #include #include +#include +#include +#include #endif // Detect whether the compiler supports C++11 rvalue references. -#if (defined(__GNUC__) && (__GNUC__ > 4 || \ - (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) && \ - defined(__GXX_EXPERIMENTAL_CXX0X__)) - #define ZMQ_HAS_RVALUE_REFS - #define ZMQ_DELETED_FUNCTION = delete +#if (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) \ + && defined(__GXX_EXPERIMENTAL_CXX0X__)) +#define ZMQ_HAS_RVALUE_REFS +#define ZMQ_DELETED_FUNCTION = delete #elif defined(__clang__) - #if __has_feature(cxx_rvalue_references) - #define ZMQ_HAS_RVALUE_REFS - #endif +#if __has_feature(cxx_rvalue_references) +#define ZMQ_HAS_RVALUE_REFS +#endif - #if __has_feature(cxx_deleted_functions) - #define ZMQ_DELETED_FUNCTION = delete - #else - #define ZMQ_DELETED_FUNCTION - #endif -#elif defined(_MSC_VER) && (_MSC_VER >= 1900) - #define ZMQ_HAS_RVALUE_REFS - #define ZMQ_DELETED_FUNCTION = delete -#elif defined(_MSC_VER) && (_MSC_VER >= 1600) - #define ZMQ_HAS_RVALUE_REFS - #define ZMQ_DELETED_FUNCTION +#if __has_feature(cxx_deleted_functions) +#define ZMQ_DELETED_FUNCTION = delete #else - #define ZMQ_DELETED_FUNCTION +#define ZMQ_DELETED_FUNCTION +#endif +#elif defined(_MSC_VER) && (_MSC_VER >= 1900) +#define ZMQ_HAS_RVALUE_REFS +#define ZMQ_DELETED_FUNCTION = delete +#elif defined(_MSC_VER) && (_MSC_VER >= 1600) +#define ZMQ_HAS_RVALUE_REFS +#define ZMQ_DELETED_FUNCTION +#else +#define ZMQ_DELETED_FUNCTION #endif #if ZMQ_VERSION >= ZMQ_MAKE_VERSION(3, 3, 0) @@ -87,726 +110,1026 @@ #if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 1, 0) #define ZMQ_HAS_PROXY_STEERABLE /* Socket event data */ -typedef struct { - uint16_t event; // id of the event as bitfield - int32_t value ; // value is either error code, fd or reconnect interval +typedef struct +{ + uint16_t event; // id of the event as bitfield + int32_t value; // value is either error code, fd or reconnect interval } zmq_event_t; #endif // Avoid using deprecated message receive function when possible #if ZMQ_VERSION < ZMQ_MAKE_VERSION(3, 2, 0) -# define zmq_msg_recv(msg, socket, flags) zmq_recvmsg(socket, msg, flags) +#define zmq_msg_recv(msg, socket, flags) zmq_recvmsg(socket, msg, flags) #endif // In order to prevent unused variable warnings when building in non-debug // mode use this macro to make assertions. #ifndef NDEBUG -# define ZMQ_ASSERT(expression) assert(expression) +#define ZMQ_ASSERT(expression) assert(expression) #else -# define ZMQ_ASSERT(expression) (void)(expression) +#define ZMQ_ASSERT(expression) (void) (expression) #endif namespace zmq { +typedef zmq_free_fn free_fn; +typedef zmq_pollitem_t pollitem_t; - typedef zmq_free_fn free_fn; - typedef zmq_pollitem_t pollitem_t; - - class error_t : public std::exception - { - public: - - error_t () : errnum (zmq_errno ()) {} +class error_t : public std::exception +{ + public: + error_t() : errnum(zmq_errno()) {} #ifdef ZMQ_CPP11 - virtual const char *what () const noexcept - { - return zmq_strerror (errnum); - } + virtual const char *what() const noexcept { return zmq_strerror(errnum); } #else - virtual const char *what() const throw () - { - return zmq_strerror(errnum); - } + virtual const char *what() const throw() { return zmq_strerror(errnum); } #endif - int num () const - { - return errnum; - } + int num() const { return errnum; } - private: + private: + int errnum; +}; - int errnum; - }; +inline int poll(zmq_pollitem_t const *items_, size_t nitems_, long timeout_ = -1) +{ + int rc = zmq_poll(const_cast(items_), + static_cast(nitems_), timeout_); + if (rc < 0) + throw error_t(); + return rc; +} - inline int poll (zmq_pollitem_t const* items_, size_t nitems_, long timeout_ = -1) +#ifdef ZMQ_CPP11 +inline int +poll(zmq_pollitem_t const *items, size_t nitems, std::chrono::milliseconds timeout) +{ + return poll(items, nitems, static_cast(timeout.count())); +} + +inline int poll(std::vector const &items, + std::chrono::milliseconds timeout) +{ + return poll(items.data(), items.size(), static_cast(timeout.count())); +} + +inline int poll(std::vector const &items, long timeout_ = -1) +{ + return poll(items.data(), items.size(), timeout_); +} +#endif + + +inline void proxy(void *frontend, void *backend, void *capture) +{ + int rc = zmq_proxy(frontend, backend, capture); + if (rc != 0) + throw error_t(); +} + +#ifdef ZMQ_HAS_PROXY_STEERABLE +inline void +proxy_steerable(void *frontend, void *backend, void *capture, void *control) +{ + int rc = zmq_proxy_steerable(frontend, backend, capture, control); + if (rc != 0) + throw error_t(); +} +#endif + +inline void version(int *major_, int *minor_, int *patch_) +{ + zmq_version(major_, minor_, patch_); +} + +#ifdef ZMQ_CPP11 +inline std::tuple version() +{ + std::tuple v; + zmq_version(&std::get<0>(v), &std::get<1>(v), &std::get<2>(v)); + return v; +} +#endif + +class message_t +{ + friend class socket_t; + + public: + inline message_t() { - int rc = zmq_poll (const_cast(items_), static_cast(nitems_), timeout_); - if (rc < 0) - throw error_t (); + int rc = zmq_msg_init(&msg); + if (rc != 0) + throw error_t(); + } + + inline explicit message_t(size_t size_) + { + int rc = zmq_msg_init_size(&msg, size_); + if (rc != 0) + throw error_t(); + } + + template message_t(T first, T last) : msg() + { + typedef typename std::iterator_traits::difference_type size_type; + typedef typename std::iterator_traits::value_type value_t; + + size_type const size_ = std::distance(first, last) * sizeof(value_t); + int const rc = zmq_msg_init_size(&msg, size_); + if (rc != 0) + throw error_t(); + value_t *dest = data(); + while (first != last) { + *dest = *first; + ++dest; + ++first; + } + } + + inline message_t(const void *data_, size_t size_) + { + int rc = zmq_msg_init_size(&msg, size_); + if (rc != 0) + throw error_t(); + memcpy(data(), data_, size_); + } + + inline message_t(void *data_, size_t size_, free_fn *ffn_, void *hint_ = NULL) + { + int rc = zmq_msg_init_data(&msg, data_, size_, ffn_, hint_); + if (rc != 0) + throw error_t(); + } + +#if defined(ZMQ_BUILD_DRAFT_API) && defined(ZMQ_CPP11) + template + message_t(const T &msg_) : message_t(std::begin(msg_), std::end(msg_)) + { + } +#endif + +#ifdef ZMQ_HAS_RVALUE_REFS + inline message_t(message_t &&rhs) : msg(rhs.msg) + { + int rc = zmq_msg_init(&rhs.msg); + if (rc != 0) + throw error_t(); + } + + inline message_t &operator=(message_t &&rhs) ZMQ_NOTHROW + { + std::swap(msg, rhs.msg); + return *this; + } +#endif + + inline ~message_t() ZMQ_NOTHROW + { + int rc = zmq_msg_close(&msg); + ZMQ_ASSERT(rc == 0); + } + + inline void rebuild() + { + int rc = zmq_msg_close(&msg); + if (rc != 0) + throw error_t(); + rc = zmq_msg_init(&msg); + if (rc != 0) + throw error_t(); + } + + inline void rebuild(size_t size_) + { + int rc = zmq_msg_close(&msg); + if (rc != 0) + throw error_t(); + rc = zmq_msg_init_size(&msg, size_); + if (rc != 0) + throw error_t(); + } + + inline void rebuild(const void *data_, size_t size_) + { + int rc = zmq_msg_close(&msg); + if (rc != 0) + throw error_t(); + rc = zmq_msg_init_size(&msg, size_); + if (rc != 0) + throw error_t(); + memcpy(data(), data_, size_); + } + + inline void rebuild(void *data_, size_t size_, free_fn *ffn_, void *hint_ = NULL) + { + int rc = zmq_msg_close(&msg); + if (rc != 0) + throw error_t(); + rc = zmq_msg_init_data(&msg, data_, size_, ffn_, hint_); + if (rc != 0) + throw error_t(); + } + + inline void move(message_t const *msg_) + { + int rc = zmq_msg_move(&msg, const_cast(&(msg_->msg))); + if (rc != 0) + throw error_t(); + } + + inline void copy(message_t const *msg_) + { + int rc = zmq_msg_copy(&msg, const_cast(&(msg_->msg))); + if (rc != 0) + throw error_t(); + } + + inline bool more() const ZMQ_NOTHROW + { + int rc = zmq_msg_more(const_cast(&msg)); + return rc != 0; + } + + inline void *data() ZMQ_NOTHROW { return zmq_msg_data(&msg); } + + inline const void *data() const ZMQ_NOTHROW + { + return zmq_msg_data(const_cast(&msg)); + } + + inline size_t size() const ZMQ_NOTHROW + { + return zmq_msg_size(const_cast(&msg)); + } + + template T *data() ZMQ_NOTHROW { return static_cast(data()); } + + template T const *data() const ZMQ_NOTHROW + { + return static_cast(data()); + } + + ZMQ_DEPRECATED("from 4.3.0, use operator== instead") + inline bool equal(const message_t *other) const ZMQ_NOTHROW + { + return *this == *other; + } + + inline bool operator==(const message_t &other) const ZMQ_NOTHROW + { + const size_t my_size = size(); + return my_size == other.size() && 0 == memcmp(data(), other.data(), my_size); + } + + inline bool operator!=(const message_t &other) const ZMQ_NOTHROW + { + return !(*this == other); + } + +#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 1, 0) + inline const char *gets(const char *property_) + { + const char *value = zmq_msg_gets(&msg, property_); + if (value == NULL) + throw error_t(); + return value; + } +#endif + +#if defined(ZMQ_BUILD_DRAFT_API) && ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 0) + inline uint32_t routing_id() const + { + return zmq_msg_routing_id(const_cast(&msg)); + } + + inline void set_routing_id(uint32_t routing_id) + { + int rc = zmq_msg_set_routing_id(&msg, routing_id); + if (rc != 0) + throw error_t(); + } + + inline const char* group() const + { + return zmq_msg_group(const_cast(&msg)); + } + + inline void set_group(const char* group) + { + int rc = zmq_msg_set_group(&msg, group); + if (rc != 0) + throw error_t(); + } +#endif + + /** Dump content to string. Ascii chars are readable, the rest is printed as hex. + * Probably ridiculously slow. + */ + inline std::string str() const + { + // Partly mutuated from the same method in zmq::multipart_t + std::stringstream os; + + const unsigned char *msg_data = this->data(); + unsigned char byte; + size_t size = this->size(); + int is_ascii[2] = {0, 0}; + + os << "zmq::message_t [size " << std::dec << std::setw(3) + << std::setfill('0') << size << "] ("; + // Totally arbitrary + if (size >= 1000) { + os << "... too big to print)"; + } else { + while (size--) { + byte = *msg_data++; + + is_ascii[1] = (byte >= 33 && byte < 127); + if (is_ascii[1] != is_ascii[0]) + os << " "; // Separate text/non text + + if (is_ascii[1]) { + os << byte; + } else { + os << std::hex << std::uppercase << std::setw(2) + << std::setfill('0') << static_cast(byte); + } + is_ascii[0] = is_ascii[1]; + } + os << ")"; + } + return os.str(); + } + + private: + // The underlying message + zmq_msg_t msg; + + // Disable implicit message copying, so that users won't use shared + // messages (less efficient) without being aware of the fact. + message_t(const message_t &) ZMQ_DELETED_FUNCTION; + void operator=(const message_t &) ZMQ_DELETED_FUNCTION; +}; + +class context_t +{ + friend class socket_t; + + public: + inline context_t() + { + ptr = zmq_ctx_new(); + if (ptr == NULL) + throw error_t(); + } + + + inline explicit context_t(int io_threads_, + int max_sockets_ = ZMQ_MAX_SOCKETS_DFLT) + { + ptr = zmq_ctx_new(); + if (ptr == NULL) + throw error_t(); + + int rc = zmq_ctx_set(ptr, ZMQ_IO_THREADS, io_threads_); + ZMQ_ASSERT(rc == 0); + + rc = zmq_ctx_set(ptr, ZMQ_MAX_SOCKETS, max_sockets_); + ZMQ_ASSERT(rc == 0); + } + +#ifdef ZMQ_HAS_RVALUE_REFS + inline context_t(context_t &&rhs) ZMQ_NOTHROW : ptr(rhs.ptr) { rhs.ptr = NULL; } + inline context_t &operator=(context_t &&rhs) ZMQ_NOTHROW + { + std::swap(ptr, rhs.ptr); + return *this; + } +#endif + + inline int setctxopt(int option_, int optval_) + { + int rc = zmq_ctx_set(ptr, option_, optval_); + ZMQ_ASSERT(rc == 0); return rc; } - inline int poll(zmq_pollitem_t const* items, size_t nitems) + inline int getctxopt(int option_) { return zmq_ctx_get(ptr, option_); } + + inline ~context_t() ZMQ_NOTHROW { close(); } + + inline void close() ZMQ_NOTHROW { - return poll(items, nitems, -1); + if (ptr == NULL) + return; + + int rc = zmq_ctx_destroy(ptr); + ZMQ_ASSERT(rc == 0); + ptr = NULL; } - #ifdef ZMQ_CPP11 - inline int poll(zmq_pollitem_t const* items, size_t nitems, std::chrono::milliseconds timeout) - { - return poll(items, nitems, timeout.count() ); - } + // Be careful with this, it's probably only useful for + // using the C api together with an existing C++ api. + // Normally you should never need to use this. + inline ZMQ_EXPLICIT operator void *() ZMQ_NOTHROW { return ptr; } - inline int poll(std::vector const& items, std::chrono::milliseconds timeout) - { - return poll(items.data(), items.size(), timeout.count() ); - } + inline ZMQ_EXPLICIT operator void const *() const ZMQ_NOTHROW { return ptr; } - inline int poll(std::vector const& items, long timeout_ = -1) - { - return poll(items.data(), items.size(), timeout_); - } - #endif + inline operator bool() const ZMQ_NOTHROW { return ptr != NULL; } + private: + void *ptr; + context_t(const context_t &) ZMQ_DELETED_FUNCTION; + void operator=(const context_t &) ZMQ_DELETED_FUNCTION; +}; - inline void proxy (void *frontend, void *backend, void *capture) - { - int rc = zmq_proxy (frontend, backend, capture); - if (rc != 0) - throw error_t (); - } - -#ifdef ZMQ_HAS_PROXY_STEERABLE - inline void proxy_steerable (void *frontend, void *backend, void *capture, void *control) - { - int rc = zmq_proxy_steerable (frontend, backend, capture, control); - if (rc != 0) - throw error_t (); - } +#ifdef ZMQ_CPP11 +enum class socket_type : int +{ + req = ZMQ_REQ, + rep = ZMQ_REP, + dealer = ZMQ_DEALER, + router = ZMQ_ROUTER, + pub = ZMQ_PUB, + sub = ZMQ_SUB, + xpub = ZMQ_XPUB, + xsub = ZMQ_XSUB, + push = ZMQ_PUSH, + pull = ZMQ_PULL, +#if defined(ZMQ_BUILD_DRAFT_API) && ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 0) + server = ZMQ_SERVER, + client = ZMQ_CLIENT, + radio = ZMQ_RADIO, + dish = ZMQ_DISH, #endif - - inline void version (int *major_, int *minor_, int *patch_) - { - zmq_version (major_, minor_, patch_); - } - - #ifdef ZMQ_CPP11 - inline std::tuple version() - { - std::tuple v; - zmq_version(&std::get<0>(v), &std::get<1>(v), &std::get<2>(v) ); - return v; - } - #endif - - class message_t - { - friend class socket_t; - - public: - - inline message_t () - { - int rc = zmq_msg_init (&msg); - if (rc != 0) - throw error_t (); - } - - inline explicit message_t (size_t size_) - { - int rc = zmq_msg_init_size (&msg, size_); - if (rc != 0) - throw error_t (); - } - - template message_t(I first, I last): - msg() - { - typedef typename std::iterator_traits::difference_type size_type; - typedef typename std::iterator_traits::value_type value_t; - - size_type const size_ = std::distance(first, last)*sizeof(value_t); - int const rc = zmq_msg_init_size (&msg, size_); - if (rc != 0) - throw error_t (); - value_t* dest = data(); - while (first != last) - { - *dest = *first; - ++dest; ++first; - } - } - - inline message_t (const void *data_, size_t size_) - { - int rc = zmq_msg_init_size (&msg, size_); - if (rc != 0) - throw error_t (); - memcpy(data(), data_, size_); - } - - inline message_t (void *data_, size_t size_, free_fn *ffn_, - void *hint_ = NULL) - { - int rc = zmq_msg_init_data (&msg, data_, size_, ffn_, hint_); - if (rc != 0) - throw error_t (); - } - -#ifdef ZMQ_HAS_RVALUE_REFS - inline message_t (message_t &&rhs): msg (rhs.msg) - { - int rc = zmq_msg_init (&rhs.msg); - if (rc != 0) - throw error_t (); - } - - inline message_t &operator = (message_t &&rhs) ZMQ_NOTHROW - { - std::swap (msg, rhs.msg); - return *this; - } -#endif - - inline ~message_t () ZMQ_NOTHROW - { - int rc = zmq_msg_close (&msg); - ZMQ_ASSERT (rc == 0); - } - - inline void rebuild () - { - int rc = zmq_msg_close (&msg); - if (rc != 0) - throw error_t (); - rc = zmq_msg_init (&msg); - if (rc != 0) - throw error_t (); - } - - inline void rebuild (size_t size_) - { - int rc = zmq_msg_close (&msg); - if (rc != 0) - throw error_t (); - rc = zmq_msg_init_size (&msg, size_); - if (rc != 0) - throw error_t (); - } - - inline void rebuild (const void *data_, size_t size_) - { - int rc = zmq_msg_close (&msg); - if (rc != 0) - throw error_t (); - rc = zmq_msg_init_size (&msg, size_); - if (rc != 0) - throw error_t (); - memcpy(data(), data_, size_); - } - - inline void rebuild (void *data_, size_t size_, free_fn *ffn_, - void *hint_ = NULL) - { - int rc = zmq_msg_close (&msg); - if (rc != 0) - throw error_t (); - rc = zmq_msg_init_data (&msg, data_, size_, ffn_, hint_); - if (rc != 0) - throw error_t (); - } - - inline void move (message_t const *msg_) - { - int rc = zmq_msg_move (&msg, const_cast(&(msg_->msg))); - if (rc != 0) - throw error_t (); - } - - inline void copy (message_t const *msg_) - { - int rc = zmq_msg_copy (&msg, const_cast(&(msg_->msg))); - if (rc != 0) - throw error_t (); - } - - inline bool more () const ZMQ_NOTHROW - { - int rc = zmq_msg_more (const_cast(&msg) ); - return rc != 0; - } - - inline void *data () ZMQ_NOTHROW - { - return zmq_msg_data (&msg); - } - - inline const void* data () const ZMQ_NOTHROW - { - return zmq_msg_data (const_cast(&msg)); - } - - inline size_t size () const ZMQ_NOTHROW - { - return zmq_msg_size (const_cast(&msg)); - } - - template T* data() ZMQ_NOTHROW - { - return static_cast( data() ); - } - - template T const* data() const ZMQ_NOTHROW - { - return static_cast( data() ); - } - - inline bool equal(const message_t* other) const ZMQ_NOTHROW - { - if (size() != other->size()) - return false; - std::string a(data(), size()); - std::string b(other->data(), other->size()); - return a == b; - } - - private: - // The underlying message - zmq_msg_t msg; - - // Disable implicit message copying, so that users won't use shared - // messages (less efficient) without being aware of the fact. - message_t (const message_t&) ZMQ_DELETED_FUNCTION; - void operator = (const message_t&) ZMQ_DELETED_FUNCTION; - }; - - class context_t - { - friend class socket_t; - - public: - inline context_t () - { - ptr = zmq_ctx_new (); - if (ptr == NULL) - throw error_t (); - } - - - inline explicit context_t (int io_threads_, int max_sockets_ = ZMQ_MAX_SOCKETS_DFLT) - { - ptr = zmq_ctx_new (); - if (ptr == NULL) - throw error_t (); - - int rc = zmq_ctx_set (ptr, ZMQ_IO_THREADS, io_threads_); - ZMQ_ASSERT (rc == 0); - - rc = zmq_ctx_set (ptr, ZMQ_MAX_SOCKETS, max_sockets_); - ZMQ_ASSERT (rc == 0); - } - -#ifdef ZMQ_HAS_RVALUE_REFS - inline context_t (context_t &&rhs) ZMQ_NOTHROW : ptr (rhs.ptr) - { - rhs.ptr = NULL; - } - inline context_t &operator = (context_t &&rhs) ZMQ_NOTHROW - { - std::swap (ptr, rhs.ptr); - return *this; - } -#endif - - inline ~context_t () ZMQ_NOTHROW - { - close(); - } - - inline void close() ZMQ_NOTHROW - { - if (ptr == NULL) - return; - - int rc = zmq_ctx_destroy (ptr); - ZMQ_ASSERT (rc == 0); - ptr = NULL; - } - - // Be careful with this, it's probably only useful for - // using the C api together with an existing C++ api. - // Normally you should never need to use this. - inline ZMQ_EXPLICIT operator void* () ZMQ_NOTHROW - { - return ptr; - } - - inline ZMQ_EXPLICIT operator void const* () const ZMQ_NOTHROW - { - return ptr; - } - private: - - void *ptr; - - context_t (const context_t&) ZMQ_DELETED_FUNCTION; - void operator = (const context_t&) ZMQ_DELETED_FUNCTION; - }; - - #ifdef ZMQ_CPP11 - enum class socket_type: int - { - req = ZMQ_REQ, - rep = ZMQ_REP, - dealer = ZMQ_DEALER, - router = ZMQ_ROUTER, - pub = ZMQ_PUB, - sub = ZMQ_SUB, - xpub = ZMQ_XPUB, - xsub = ZMQ_XSUB, - push = ZMQ_PUSH, - pull = ZMQ_PULL, -#if ZMQ_VERSION_MAJOR < 4 - pair = ZMQ_PAIR -#else - pair = ZMQ_PAIR, - stream = ZMQ_STREAM -#endif - }; - #endif - - class socket_t - { - friend class monitor_t; - public: - inline socket_t(context_t& context_, int type_) - { - init(context_, type_); - } - - #ifdef ZMQ_CPP11 - inline socket_t(context_t& context_, socket_type type_) - { - init(context_, static_cast(type_)); - } - #endif - -#ifdef ZMQ_HAS_RVALUE_REFS - inline socket_t(socket_t&& rhs) ZMQ_NOTHROW : ptr(rhs.ptr) - { - rhs.ptr = NULL; - } - inline socket_t& operator=(socket_t&& rhs) ZMQ_NOTHROW - { - std::swap(ptr, rhs.ptr); - return *this; - } -#endif - - inline ~socket_t () ZMQ_NOTHROW - { - close(); - } - - inline operator void* () ZMQ_NOTHROW - { - return ptr; - } - - inline operator void const* () const ZMQ_NOTHROW - { - return ptr; - } - - inline void close() ZMQ_NOTHROW - { - if(ptr == NULL) - // already closed - return ; - int rc = zmq_close (ptr); - ZMQ_ASSERT (rc == 0); - ptr = 0 ; - } - - template void setsockopt(int option_, T const& optval) - { - setsockopt(option_, &optval, sizeof(T) ); - } - - inline void setsockopt (int option_, const void *optval_, - size_t optvallen_) - { - int rc = zmq_setsockopt (ptr, option_, optval_, optvallen_); - if (rc != 0) - throw error_t (); - } - - inline void getsockopt (int option_, void *optval_, - size_t *optvallen_) const - { - int rc = zmq_getsockopt (ptr, option_, optval_, optvallen_); - if (rc != 0) - throw error_t (); - } - - template T getsockopt(int option_) const - { - T optval; - size_t optlen = sizeof(T); - getsockopt(option_, &optval, &optlen ); - return optval; - } - - inline void bind(std::string const& addr) - { - bind(addr.c_str()); - } - - inline void bind (const char *addr_) - { - int rc = zmq_bind (ptr, addr_); - if (rc != 0) - throw error_t (); - } - - inline void unbind(std::string const& addr) - { - unbind(addr.c_str()); - } - - inline void unbind (const char *addr_) - { - int rc = zmq_unbind (ptr, addr_); - if (rc != 0) - throw error_t (); - } - - inline void connect(std::string const& addr) - { - connect(addr.c_str()); - } - - inline void connect (const char *addr_) - { - int rc = zmq_connect (ptr, addr_); - if (rc != 0) - throw error_t (); - } - - inline void disconnect(std::string const& addr) - { - disconnect(addr.c_str()); - } - - inline void disconnect (const char *addr_) - { - int rc = zmq_disconnect (ptr, addr_); - if (rc != 0) - throw error_t (); - } - - inline bool connected() const ZMQ_NOTHROW - { - return(ptr != NULL); - } - - inline size_t send (const void *buf_, size_t len_, int flags_ = 0) - { - int nbytes = zmq_send (ptr, buf_, len_, flags_); - if (nbytes >= 0) - return (size_t) nbytes; - if (zmq_errno () == EAGAIN) - return 0; - throw error_t (); - } - - inline bool send (message_t &msg_, int flags_ = 0) - { - int nbytes = zmq_msg_send (&(msg_.msg), ptr, flags_); - if (nbytes >= 0) - return true; - if (zmq_errno () == EAGAIN) - return false; - throw error_t (); - } - - template bool send(I first, I last, int flags_=0) - { - zmq::message_t msg(first, last); - return send(msg, flags_); - } - -#ifdef ZMQ_HAS_RVALUE_REFS - inline bool send (message_t &&msg_, int flags_ = 0) - { - return send(msg_, flags_); - } -#endif - - inline size_t recv (void *buf_, size_t len_, int flags_ = 0) - { - int nbytes = zmq_recv (ptr, buf_, len_, flags_); - if (nbytes >= 0) - return (size_t) nbytes; - if (zmq_errno () == EAGAIN) - return 0; - throw error_t (); - } - - inline bool recv (message_t *msg_, int flags_ = 0) - { - int nbytes = zmq_msg_recv (&(msg_->msg), ptr, flags_); - if (nbytes >= 0) - return true; - if (zmq_errno () == EAGAIN) - return false; - throw error_t (); - } - - private: - inline void init(context_t& context_, int type_) - { - ctxptr = context_.ptr; - ptr = zmq_socket (context_.ptr, type_ ); - if (ptr == NULL) - throw error_t (); - } - - void *ptr; - void *ctxptr; - - socket_t (const socket_t&) ZMQ_DELETED_FUNCTION; - void operator = (const socket_t&) ZMQ_DELETED_FUNCTION; - }; - - class monitor_t - { - public: - monitor_t() : socketPtr(NULL) {} - virtual ~monitor_t() {} - - void monitor(socket_t &socket, std::string const& addr, int events = ZMQ_EVENT_ALL) - { - monitor(socket, addr.c_str(), events); - } - - void monitor(socket_t &socket, const char *addr_, int events = ZMQ_EVENT_ALL) - { - int rc = zmq_socket_monitor(socket.ptr, addr_, events); - if (rc != 0) - throw error_t (); - - socketPtr = socket.ptr; - void *s = zmq_socket (socket.ctxptr, ZMQ_PAIR); - assert (s); - - rc = zmq_connect (s, addr_); - assert (rc == 0); - - on_monitor_started(); - - while (true) { - zmq_msg_t eventMsg; - zmq_msg_init (&eventMsg); - rc = zmq_msg_recv (&eventMsg, s, 0); - if (rc == -1 && zmq_errno() == ETERM) - break; - assert (rc != -1); #if ZMQ_VERSION_MAJOR >= 4 - const char* data = static_cast(zmq_msg_data(&eventMsg)); - zmq_event_t msgEvent; - memcpy(&msgEvent.event, data, sizeof(uint16_t)); data += sizeof(uint16_t); - memcpy(&msgEvent.value, data, sizeof(int32_t)); - zmq_event_t* event = &msgEvent; -#else - zmq_event_t* event = static_cast(zmq_msg_data(&eventMsg)); + stream = ZMQ_STREAM, #endif - + pair = ZMQ_PAIR +}; +#endif + +class socket_t +{ + friend class monitor_t; + + public: + inline socket_t(context_t &context_, int type_) { init(context_, type_); } + +#ifdef ZMQ_CPP11 + inline socket_t(context_t &context_, socket_type type_) + { + init(context_, static_cast(type_)); + } +#endif + +#ifdef ZMQ_HAS_RVALUE_REFS + inline socket_t(socket_t &&rhs) ZMQ_NOTHROW : ptr(rhs.ptr), ctxptr(rhs.ctxptr) + { + rhs.ptr = NULL; + rhs.ctxptr = NULL; + } + inline socket_t &operator=(socket_t &&rhs) ZMQ_NOTHROW + { + std::swap(ptr, rhs.ptr); + return *this; + } +#endif + + inline ~socket_t() ZMQ_NOTHROW { close(); } + + inline operator void *() ZMQ_NOTHROW { return ptr; } + + inline operator void const *() const ZMQ_NOTHROW { return ptr; } + + inline void close() ZMQ_NOTHROW + { + if (ptr == NULL) + // already closed + return; + int rc = zmq_close(ptr); + ZMQ_ASSERT(rc == 0); + ptr = 0; + } + + template void setsockopt(int option_, T const &optval) + { + setsockopt(option_, &optval, sizeof(T)); + } + + inline void setsockopt(int option_, const void *optval_, size_t optvallen_) + { + int rc = zmq_setsockopt(ptr, option_, optval_, optvallen_); + if (rc != 0) + throw error_t(); + } + + inline void getsockopt(int option_, void *optval_, size_t *optvallen_) const + { + int rc = zmq_getsockopt(ptr, option_, optval_, optvallen_); + if (rc != 0) + throw error_t(); + } + + template T getsockopt(int option_) const + { + T optval; + size_t optlen = sizeof(T); + getsockopt(option_, &optval, &optlen); + return optval; + } + + inline void bind(std::string const &addr) { bind(addr.c_str()); } + + inline void bind(const char *addr_) + { + int rc = zmq_bind(ptr, addr_); + if (rc != 0) + throw error_t(); + } + + inline void unbind(std::string const &addr) { unbind(addr.c_str()); } + + inline void unbind(const char *addr_) + { + int rc = zmq_unbind(ptr, addr_); + if (rc != 0) + throw error_t(); + } + + inline void connect(std::string const &addr) { connect(addr.c_str()); } + + inline void connect(const char *addr_) + { + int rc = zmq_connect(ptr, addr_); + if (rc != 0) + throw error_t(); + } + + inline void disconnect(std::string const &addr) { disconnect(addr.c_str()); } + + inline void disconnect(const char *addr_) + { + int rc = zmq_disconnect(ptr, addr_); + if (rc != 0) + throw error_t(); + } + + inline bool connected() const ZMQ_NOTHROW { return (ptr != NULL); } + + inline size_t send(const void *buf_, size_t len_, int flags_ = 0) + { + int nbytes = zmq_send(ptr, buf_, len_, flags_); + if (nbytes >= 0) + return (size_t) nbytes; + if (zmq_errno() == EAGAIN) + return 0; + throw error_t(); + } + + inline bool send(message_t &msg_, int flags_ = 0) + { + int nbytes = zmq_msg_send(&(msg_.msg), ptr, flags_); + if (nbytes >= 0) + return true; + if (zmq_errno() == EAGAIN) + return false; + throw error_t(); + } + + template bool send(T first, T last, int flags_ = 0) + { + zmq::message_t msg(first, last); + return send(msg, flags_); + } + +#ifdef ZMQ_HAS_RVALUE_REFS + inline bool send(message_t &&msg_, int flags_ = 0) { return send(msg_, flags_); } +#endif + + inline size_t recv(void *buf_, size_t len_, int flags_ = 0) + { + int nbytes = zmq_recv(ptr, buf_, len_, flags_); + if (nbytes >= 0) + return (size_t) nbytes; + if (zmq_errno() == EAGAIN) + return 0; + throw error_t(); + } + + inline bool recv(message_t *msg_, int flags_ = 0) + { + int nbytes = zmq_msg_recv(&(msg_->msg), ptr, flags_); + if (nbytes >= 0) + return true; + if (zmq_errno() == EAGAIN) + return false; + throw error_t(); + } + +#if defined(ZMQ_BUILD_DRAFT_API) && ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 0) + inline void join(const char* group) + { + int rc = zmq_join(ptr, group); + if (rc != 0) + throw error_t(); + } + + inline void leave(const char* group) + { + int rc = zmq_leave(ptr, group); + if (rc != 0) + throw error_t(); + } +#endif + + private: + inline void init(context_t &context_, int type_) + { + ctxptr = context_.ptr; + ptr = zmq_socket(context_.ptr, type_); + if (ptr == NULL) + throw error_t(); + } + + void *ptr; + void *ctxptr; + + socket_t(const socket_t &) ZMQ_DELETED_FUNCTION; + void operator=(const socket_t &) ZMQ_DELETED_FUNCTION; +}; + +class monitor_t +{ + public: + monitor_t() : socketPtr(NULL), monitor_socket(NULL) {} + + virtual ~monitor_t() + { + if (socketPtr) + zmq_socket_monitor(socketPtr, NULL, 0); + + if (monitor_socket) + zmq_close(monitor_socket); + } + + +#ifdef ZMQ_HAS_RVALUE_REFS + monitor_t(monitor_t &&rhs) ZMQ_NOTHROW : socketPtr(rhs.socketPtr), + monitor_socket(rhs.monitor_socket) + { + rhs.socketPtr = NULL; + rhs.monitor_socket = NULL; + } + + socket_t &operator=(socket_t &&rhs) ZMQ_DELETED_FUNCTION; +#endif + + + void + monitor(socket_t &socket, std::string const &addr, int events = ZMQ_EVENT_ALL) + { + monitor(socket, addr.c_str(), events); + } + + void monitor(socket_t &socket, const char *addr_, int events = ZMQ_EVENT_ALL) + { + init(socket, addr_, events); + while (true) { + check_event(-1); + } + } + + void init(socket_t &socket, std::string const &addr, int events = ZMQ_EVENT_ALL) + { + init(socket, addr.c_str(), events); + } + + void init(socket_t &socket, const char *addr_, int events = ZMQ_EVENT_ALL) + { + int rc = zmq_socket_monitor(socket.ptr, addr_, events); + if (rc != 0) + throw error_t(); + + socketPtr = socket.ptr; + monitor_socket = zmq_socket(socket.ctxptr, ZMQ_PAIR); + assert(monitor_socket); + + rc = zmq_connect(monitor_socket, addr_); + assert(rc == 0); + + on_monitor_started(); + } + + bool check_event(int timeout = 0) + { + assert(monitor_socket); + + zmq_msg_t eventMsg; + zmq_msg_init(&eventMsg); + + zmq::pollitem_t items[] = { + {monitor_socket, 0, ZMQ_POLLIN, 0}, + }; + + zmq::poll(&items[0], 1, timeout); + + if (items[0].revents & ZMQ_POLLIN) { + int rc = zmq_msg_recv(&eventMsg, monitor_socket, 0); + if (rc == -1 && zmq_errno() == ETERM) + return false; + assert(rc != -1); + + } else { + zmq_msg_close(&eventMsg); + return false; + } + +#if ZMQ_VERSION_MAJOR >= 4 + const char *data = static_cast(zmq_msg_data(&eventMsg)); + zmq_event_t msgEvent; + memcpy(&msgEvent.event, data, sizeof(uint16_t)); + data += sizeof(uint16_t); + memcpy(&msgEvent.value, data, sizeof(int32_t)); + zmq_event_t *event = &msgEvent; +#else + zmq_event_t *event = static_cast(zmq_msg_data(&eventMsg)); +#endif + #ifdef ZMQ_NEW_MONITOR_EVENT_LAYOUT - zmq_msg_t addrMsg; - zmq_msg_init (&addrMsg); - rc = zmq_msg_recv (&addrMsg, s, 0); - if (rc == -1 && zmq_errno() == ETERM) - break; - assert (rc != -1); - const char* str = static_cast(zmq_msg_data (&addrMsg)); - std::string address(str, str + zmq_msg_size(&addrMsg)); - zmq_msg_close (&addrMsg); + zmq_msg_t addrMsg; + zmq_msg_init(&addrMsg); + int rc = zmq_msg_recv(&addrMsg, monitor_socket, 0); + if (rc == -1 && zmq_errno() == ETERM) { + zmq_msg_close(&eventMsg); + return false; + } + + assert(rc != -1); + const char *str = static_cast(zmq_msg_data(&addrMsg)); + std::string address(str, str + zmq_msg_size(&addrMsg)); + zmq_msg_close(&addrMsg); #else - // Bit of a hack, but all events in the zmq_event_t union have the same layout so this will work for all event types. - std::string address = event->data.connected.addr; + // Bit of a hack, but all events in the zmq_event_t union have the same layout so this will work for all event types. + std::string address = event->data.connected.addr; #endif #ifdef ZMQ_EVENT_MONITOR_STOPPED - if (event->event == ZMQ_EVENT_MONITOR_STOPPED) - break; + if (event->event == ZMQ_EVENT_MONITOR_STOPPED) { + zmq_msg_close(&eventMsg); + return false; + } + #endif - switch (event->event) { - case ZMQ_EVENT_CONNECTED: - on_event_connected(*event, address.c_str()); - break; - case ZMQ_EVENT_CONNECT_DELAYED: - on_event_connect_delayed(*event, address.c_str()); - break; - case ZMQ_EVENT_CONNECT_RETRIED: - on_event_connect_retried(*event, address.c_str()); - break; - case ZMQ_EVENT_LISTENING: - on_event_listening(*event, address.c_str()); - break; - case ZMQ_EVENT_BIND_FAILED: - on_event_bind_failed(*event, address.c_str()); - break; - case ZMQ_EVENT_ACCEPTED: - on_event_accepted(*event, address.c_str()); - break; - case ZMQ_EVENT_ACCEPT_FAILED: - on_event_accept_failed(*event, address.c_str()); - break; - case ZMQ_EVENT_CLOSED: - on_event_closed(*event, address.c_str()); - break; - case ZMQ_EVENT_CLOSE_FAILED: - on_event_close_failed(*event, address.c_str()); - break; - case ZMQ_EVENT_DISCONNECTED: - on_event_disconnected(*event, address.c_str()); - break; - default: - on_event_unknown(*event, address.c_str()); - break; - } - zmq_msg_close (&eventMsg); - } - zmq_close (s); - socketPtr = NULL; + switch (event->event) { + case ZMQ_EVENT_CONNECTED: + on_event_connected(*event, address.c_str()); + break; + case ZMQ_EVENT_CONNECT_DELAYED: + on_event_connect_delayed(*event, address.c_str()); + break; + case ZMQ_EVENT_CONNECT_RETRIED: + on_event_connect_retried(*event, address.c_str()); + break; + case ZMQ_EVENT_LISTENING: + on_event_listening(*event, address.c_str()); + break; + case ZMQ_EVENT_BIND_FAILED: + on_event_bind_failed(*event, address.c_str()); + break; + case ZMQ_EVENT_ACCEPTED: + on_event_accepted(*event, address.c_str()); + break; + case ZMQ_EVENT_ACCEPT_FAILED: + on_event_accept_failed(*event, address.c_str()); + break; + case ZMQ_EVENT_CLOSED: + on_event_closed(*event, address.c_str()); + break; + case ZMQ_EVENT_CLOSE_FAILED: + on_event_close_failed(*event, address.c_str()); + break; + case ZMQ_EVENT_DISCONNECTED: + on_event_disconnected(*event, address.c_str()); + break; +#ifdef ZMQ_BUILD_DRAFT_API +#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 3) + case ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL: + on_event_handshake_failed_no_detail(*event, address.c_str()); + break; + case ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL: + on_event_handshake_failed_protocol(*event, address.c_str()); + break; + case ZMQ_EVENT_HANDSHAKE_FAILED_AUTH: + on_event_handshake_failed_auth(*event, address.c_str()); + break; + case ZMQ_EVENT_HANDSHAKE_SUCCEEDED: + on_event_handshake_succeeded(*event, address.c_str()); + break; +#elif ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 1) + case ZMQ_EVENT_HANDSHAKE_FAILED: + on_event_handshake_failed(*event, address.c_str()); + break; + case ZMQ_EVENT_HANDSHAKE_SUCCEED: + on_event_handshake_succeed(*event, address.c_str()); + break; +#endif +#endif + default: + on_event_unknown(*event, address.c_str()); + break; } + zmq_msg_close(&eventMsg); + + return true; + } #ifdef ZMQ_EVENT_MONITOR_STOPPED - void abort() - { - if (socketPtr) - zmq_socket_monitor(socketPtr, NULL, 0); - } + void abort() + { + if (socketPtr) + zmq_socket_monitor(socketPtr, NULL, 0); + + socketPtr = NULL; + } #endif - virtual void on_monitor_started() {} - virtual void on_event_connected(const zmq_event_t &event_, const char* addr_) { (void)event_; (void)addr_; } - virtual void on_event_connect_delayed(const zmq_event_t &event_, const char* addr_) { (void)event_; (void)addr_; } - virtual void on_event_connect_retried(const zmq_event_t &event_, const char* addr_) { (void)event_; (void)addr_; } - virtual void on_event_listening(const zmq_event_t &event_, const char* addr_) { (void)event_; (void)addr_; } - virtual void on_event_bind_failed(const zmq_event_t &event_, const char* addr_) { (void)event_; (void)addr_; } - virtual void on_event_accepted(const zmq_event_t &event_, const char* addr_) { (void)event_; (void)addr_; } - virtual void on_event_accept_failed(const zmq_event_t &event_, const char* addr_) { (void)event_; (void)addr_; } - virtual void on_event_closed(const zmq_event_t &event_, const char* addr_) { (void)event_; (void)addr_; } - virtual void on_event_close_failed(const zmq_event_t &event_, const char* addr_) { (void)event_; (void)addr_; } - virtual void on_event_disconnected(const zmq_event_t &event_, const char* addr_) { (void)event_; (void)addr_; } - virtual void on_event_unknown(const zmq_event_t &event_, const char* addr_) { (void)event_; (void)addr_; } - private: - void* socketPtr; - }; + virtual void on_monitor_started() {} + virtual void on_event_connected(const zmq_event_t &event_, const char *addr_) + { + (void) event_; + (void) addr_; + } + virtual void on_event_connect_delayed(const zmq_event_t &event_, + const char *addr_) + { + (void) event_; + (void) addr_; + } + virtual void on_event_connect_retried(const zmq_event_t &event_, + const char *addr_) + { + (void) event_; + (void) addr_; + } + virtual void on_event_listening(const zmq_event_t &event_, const char *addr_) + { + (void) event_; + (void) addr_; + } + virtual void on_event_bind_failed(const zmq_event_t &event_, const char *addr_) + { + (void) event_; + (void) addr_; + } + virtual void on_event_accepted(const zmq_event_t &event_, const char *addr_) + { + (void) event_; + (void) addr_; + } + virtual void on_event_accept_failed(const zmq_event_t &event_, const char *addr_) + { + (void) event_; + (void) addr_; + } + virtual void on_event_closed(const zmq_event_t &event_, const char *addr_) + { + (void) event_; + (void) addr_; + } + virtual void on_event_close_failed(const zmq_event_t &event_, const char *addr_) + { + (void) event_; + (void) addr_; + } + virtual void on_event_disconnected(const zmq_event_t &event_, const char *addr_) + { + (void) event_; + (void) addr_; + } +#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 3) + virtual void on_event_handshake_failed_no_detail(const zmq_event_t &event_, + const char *addr_) + { + (void) event_; + (void) addr_; + } + virtual void on_event_handshake_failed_protocol(const zmq_event_t &event_, + const char *addr_) + { + (void) event_; + (void) addr_; + } + virtual void on_event_handshake_failed_auth(const zmq_event_t &event_, + const char *addr_) + { + (void) event_; + (void) addr_; + } + virtual void on_event_handshake_succeeded(const zmq_event_t &event_, + const char *addr_) + { + (void) event_; + (void) addr_; + } +#elif ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 1) + virtual void on_event_handshake_failed(const zmq_event_t &event_, + const char *addr_) + { + (void) event_; + (void) addr_; + } + virtual void on_event_handshake_succeed(const zmq_event_t &event_, + const char *addr_) + { + (void) event_; + (void) addr_; + } +#endif + virtual void on_event_unknown(const zmq_event_t &event_, const char *addr_) + { + (void) event_; + (void) addr_; + } + + private: + monitor_t(const monitor_t &) ZMQ_DELETED_FUNCTION; + void operator=(const monitor_t &) ZMQ_DELETED_FUNCTION; + + void *socketPtr; + void *monitor_socket; +}; + +#if defined(ZMQ_BUILD_DRAFT_API) && defined(ZMQ_CPP11) && defined(ZMQ_HAVE_POLLER) +template class poller_t +{ + public: + void add(zmq::socket_t &socket, short events, T *user_data) + { + if (0 + != zmq_poller_add(poller_ptr.get(), static_cast(socket), + user_data, events)) { + throw error_t(); + } + } + + void remove(zmq::socket_t &socket) + { + if (0 != zmq_poller_remove(poller_ptr.get(), static_cast(socket))) { + throw error_t(); + } + } + + void modify(zmq::socket_t &socket, short events) + { + if (0 + != zmq_poller_modify(poller_ptr.get(), static_cast(socket), + events)) { + throw error_t(); + } + } + + size_t wait_all(std::vector &poller_events, + const std::chrono::microseconds timeout) + { + int rc = zmq_poller_wait_all(poller_ptr.get(), poller_events.data(), + static_cast(poller_events.size()), + static_cast(timeout.count())); + if (rc > 0) + return static_cast(rc); + +#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 3) + if (zmq_errno() == EAGAIN) +#else + if (zmq_errno() == ETIMEDOUT) +#endif + return 0; + + throw error_t(); + } + + private: + std::unique_ptr> poller_ptr{ + []() { + auto poller_new = zmq_poller_new(); + if (poller_new) + return poller_new; + throw error_t(); + }(), + [](void *ptr) { + int rc = zmq_poller_destroy(&ptr); + ZMQ_ASSERT(rc == 0); + }}; +}; +#endif // defined(ZMQ_BUILD_DRAFT_API) && defined(ZMQ_CPP11) && defined(ZMQ_HAVE_POLLER) + +inline std::ostream &operator<<(std::ostream &os, const message_t &msg) +{ + return os << msg.str(); } -#endif +} // namespace zmq + +#endif // __ZMQ_HPP_INCLUDED__ From 5aea20bcd5c67f99e1c1c36a05673b9ff2447f94 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 22 Jan 2019 01:38:29 -0500 Subject: [PATCH 14/60] Split cppzmq into its own package. --- LICENSE | 17 - zeromq.spec | 24 +- zmq.hpp | 1135 --------------------------------------------------- 3 files changed, 1 insertion(+), 1175 deletions(-) delete mode 100644 LICENSE delete mode 100644 zmq.hpp diff --git a/LICENSE b/LICENSE deleted file mode 100644 index ae98bd8..0000000 --- a/LICENSE +++ /dev/null @@ -1,17 +0,0 @@ - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. diff --git a/zeromq.spec b/zeromq.spec index c181069..8bf63e3 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -1,8 +1,5 @@ %bcond_without pgm -# TODO: Split into a separate package? -%global cppzmq_version 4.3.0 - Name: zeromq Version: 4.3.1 Release: 1%{?dist} @@ -11,8 +8,6 @@ Summary: Software library for fast, message-based applications License: LGPLv3+ URL: http://www.zeromq.org Source0: https://github.com/zeromq/libzmq/archive/v%{version}/libzmq-%{version}.tar.gz -Source1: https://github.com/zeromq/cppzmq/raw/v%{cppzmq_version}/zmq.hpp -Source2: https://github.com/zeromq/cppzmq/raw/v%{cppzmq_version}/LICENSE BuildRequires: autoconf BuildRequires: automake @@ -47,21 +42,8 @@ The %{name}-devel package contains libraries and header files for developing applications that use %{name}. -%package -n cppzmq-devel -Summary: Development files for cppzmq -Version: %{cppzmq_version} -License: MIT -Requires: %{name}-devel%{?_isa} = %{version}-%{release} - - -%description -n cppzmq-devel -The cppzmq-devel package contains libraries and header files for -developing applications that use the C++ header files of %{name}. - - %prep %autosetup -p1 -n libzmq-%{version} -cp -a %{SOURCE2} . # Remove bundled code. rm -rf external/wepoll @@ -86,7 +68,6 @@ autoreconf -fi %install %make_install -install -m 644 -p %{SOURCE1} %{buildroot}%{_includedir}/ # remove *.la rm %{buildroot}%{_libdir}/libzmq.la @@ -111,14 +92,11 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %{_libdir}/pkgconfig/libzmq.pc %{_includedir}/zmq*.h -%files -n cppzmq-devel -%license LICENSE -%{_includedir}/zmq.hpp - %changelog * Tue Jan 22 2019 Elliott Sales de Andrade - 4.3.1-1 - Update to latest version of libzmq and cppzmq +- Split cppzmq subpackage into its own package * Mon Jan 21 2019 Elliott Sales de Andrade - 4.1.6-11 - Backport patches to fix test failures in build diff --git a/zmq.hpp b/zmq.hpp deleted file mode 100644 index 97bca4e..0000000 --- a/zmq.hpp +++ /dev/null @@ -1,1135 +0,0 @@ -/* - Copyright (c) 2016-2017 ZeroMQ community - Copyright (c) 2009-2011 250bpm s.r.o. - Copyright (c) 2011 Botond Ballo - Copyright (c) 2007-2009 iMatix Corporation - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ - -#ifndef __ZMQ_HPP_INCLUDED__ -#define __ZMQ_HPP_INCLUDED__ - -#if (__cplusplus >= 201402L) -#define ZMQ_DEPRECATED(msg) [[deprecated(msg)]] -#elif defined(_MSC_VER) -#define ZMQ_DEPRECATED(msg) __declspec(deprecated(msg)) -#elif defined(__GNUC__) -#define ZMQ_DEPRECATED(msg) __attribute__((deprecated(msg))) -#endif - -#if (__cplusplus >= 201103L) -#define ZMQ_CPP11 -#define ZMQ_NOTHROW noexcept -#define ZMQ_EXPLICIT explicit -#elif (defined(_MSC_VER) && (_MSC_VER >= 1900)) -#define ZMQ_CPP11 -#define ZMQ_NOTHROW noexcept -#define ZMQ_EXPLICIT explicit -#else -#define ZMQ_CPP03 -#define ZMQ_NOTHROW -#define ZMQ_EXPLICIT -#endif - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -/* Version macros for compile-time API version detection */ -#define CPPZMQ_VERSION_MAJOR 4 -#define CPPZMQ_VERSION_MINOR 3 -#define CPPZMQ_VERSION_PATCH 0 - -#define CPPZMQ_VERSION \ - ZMQ_MAKE_VERSION(CPPZMQ_VERSION_MAJOR, CPPZMQ_VERSION_MINOR, \ - CPPZMQ_VERSION_PATCH) - -#ifdef ZMQ_CPP11 -#include -#include -#include -#include -#include -#endif - -// Detect whether the compiler supports C++11 rvalue references. -#if (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) \ - && defined(__GXX_EXPERIMENTAL_CXX0X__)) -#define ZMQ_HAS_RVALUE_REFS -#define ZMQ_DELETED_FUNCTION = delete -#elif defined(__clang__) -#if __has_feature(cxx_rvalue_references) -#define ZMQ_HAS_RVALUE_REFS -#endif - -#if __has_feature(cxx_deleted_functions) -#define ZMQ_DELETED_FUNCTION = delete -#else -#define ZMQ_DELETED_FUNCTION -#endif -#elif defined(_MSC_VER) && (_MSC_VER >= 1900) -#define ZMQ_HAS_RVALUE_REFS -#define ZMQ_DELETED_FUNCTION = delete -#elif defined(_MSC_VER) && (_MSC_VER >= 1600) -#define ZMQ_HAS_RVALUE_REFS -#define ZMQ_DELETED_FUNCTION -#else -#define ZMQ_DELETED_FUNCTION -#endif - -#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(3, 3, 0) -#define ZMQ_NEW_MONITOR_EVENT_LAYOUT -#endif - -#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 1, 0) -#define ZMQ_HAS_PROXY_STEERABLE -/* Socket event data */ -typedef struct -{ - uint16_t event; // id of the event as bitfield - int32_t value; // value is either error code, fd or reconnect interval -} zmq_event_t; -#endif - -// Avoid using deprecated message receive function when possible -#if ZMQ_VERSION < ZMQ_MAKE_VERSION(3, 2, 0) -#define zmq_msg_recv(msg, socket, flags) zmq_recvmsg(socket, msg, flags) -#endif - - -// In order to prevent unused variable warnings when building in non-debug -// mode use this macro to make assertions. -#ifndef NDEBUG -#define ZMQ_ASSERT(expression) assert(expression) -#else -#define ZMQ_ASSERT(expression) (void) (expression) -#endif - -namespace zmq -{ -typedef zmq_free_fn free_fn; -typedef zmq_pollitem_t pollitem_t; - -class error_t : public std::exception -{ - public: - error_t() : errnum(zmq_errno()) {} -#ifdef ZMQ_CPP11 - virtual const char *what() const noexcept { return zmq_strerror(errnum); } -#else - virtual const char *what() const throw() { return zmq_strerror(errnum); } -#endif - int num() const { return errnum; } - - private: - int errnum; -}; - -inline int poll(zmq_pollitem_t const *items_, size_t nitems_, long timeout_ = -1) -{ - int rc = zmq_poll(const_cast(items_), - static_cast(nitems_), timeout_); - if (rc < 0) - throw error_t(); - return rc; -} - -#ifdef ZMQ_CPP11 -inline int -poll(zmq_pollitem_t const *items, size_t nitems, std::chrono::milliseconds timeout) -{ - return poll(items, nitems, static_cast(timeout.count())); -} - -inline int poll(std::vector const &items, - std::chrono::milliseconds timeout) -{ - return poll(items.data(), items.size(), static_cast(timeout.count())); -} - -inline int poll(std::vector const &items, long timeout_ = -1) -{ - return poll(items.data(), items.size(), timeout_); -} -#endif - - -inline void proxy(void *frontend, void *backend, void *capture) -{ - int rc = zmq_proxy(frontend, backend, capture); - if (rc != 0) - throw error_t(); -} - -#ifdef ZMQ_HAS_PROXY_STEERABLE -inline void -proxy_steerable(void *frontend, void *backend, void *capture, void *control) -{ - int rc = zmq_proxy_steerable(frontend, backend, capture, control); - if (rc != 0) - throw error_t(); -} -#endif - -inline void version(int *major_, int *minor_, int *patch_) -{ - zmq_version(major_, minor_, patch_); -} - -#ifdef ZMQ_CPP11 -inline std::tuple version() -{ - std::tuple v; - zmq_version(&std::get<0>(v), &std::get<1>(v), &std::get<2>(v)); - return v; -} -#endif - -class message_t -{ - friend class socket_t; - - public: - inline message_t() - { - int rc = zmq_msg_init(&msg); - if (rc != 0) - throw error_t(); - } - - inline explicit message_t(size_t size_) - { - int rc = zmq_msg_init_size(&msg, size_); - if (rc != 0) - throw error_t(); - } - - template message_t(T first, T last) : msg() - { - typedef typename std::iterator_traits::difference_type size_type; - typedef typename std::iterator_traits::value_type value_t; - - size_type const size_ = std::distance(first, last) * sizeof(value_t); - int const rc = zmq_msg_init_size(&msg, size_); - if (rc != 0) - throw error_t(); - value_t *dest = data(); - while (first != last) { - *dest = *first; - ++dest; - ++first; - } - } - - inline message_t(const void *data_, size_t size_) - { - int rc = zmq_msg_init_size(&msg, size_); - if (rc != 0) - throw error_t(); - memcpy(data(), data_, size_); - } - - inline message_t(void *data_, size_t size_, free_fn *ffn_, void *hint_ = NULL) - { - int rc = zmq_msg_init_data(&msg, data_, size_, ffn_, hint_); - if (rc != 0) - throw error_t(); - } - -#if defined(ZMQ_BUILD_DRAFT_API) && defined(ZMQ_CPP11) - template - message_t(const T &msg_) : message_t(std::begin(msg_), std::end(msg_)) - { - } -#endif - -#ifdef ZMQ_HAS_RVALUE_REFS - inline message_t(message_t &&rhs) : msg(rhs.msg) - { - int rc = zmq_msg_init(&rhs.msg); - if (rc != 0) - throw error_t(); - } - - inline message_t &operator=(message_t &&rhs) ZMQ_NOTHROW - { - std::swap(msg, rhs.msg); - return *this; - } -#endif - - inline ~message_t() ZMQ_NOTHROW - { - int rc = zmq_msg_close(&msg); - ZMQ_ASSERT(rc == 0); - } - - inline void rebuild() - { - int rc = zmq_msg_close(&msg); - if (rc != 0) - throw error_t(); - rc = zmq_msg_init(&msg); - if (rc != 0) - throw error_t(); - } - - inline void rebuild(size_t size_) - { - int rc = zmq_msg_close(&msg); - if (rc != 0) - throw error_t(); - rc = zmq_msg_init_size(&msg, size_); - if (rc != 0) - throw error_t(); - } - - inline void rebuild(const void *data_, size_t size_) - { - int rc = zmq_msg_close(&msg); - if (rc != 0) - throw error_t(); - rc = zmq_msg_init_size(&msg, size_); - if (rc != 0) - throw error_t(); - memcpy(data(), data_, size_); - } - - inline void rebuild(void *data_, size_t size_, free_fn *ffn_, void *hint_ = NULL) - { - int rc = zmq_msg_close(&msg); - if (rc != 0) - throw error_t(); - rc = zmq_msg_init_data(&msg, data_, size_, ffn_, hint_); - if (rc != 0) - throw error_t(); - } - - inline void move(message_t const *msg_) - { - int rc = zmq_msg_move(&msg, const_cast(&(msg_->msg))); - if (rc != 0) - throw error_t(); - } - - inline void copy(message_t const *msg_) - { - int rc = zmq_msg_copy(&msg, const_cast(&(msg_->msg))); - if (rc != 0) - throw error_t(); - } - - inline bool more() const ZMQ_NOTHROW - { - int rc = zmq_msg_more(const_cast(&msg)); - return rc != 0; - } - - inline void *data() ZMQ_NOTHROW { return zmq_msg_data(&msg); } - - inline const void *data() const ZMQ_NOTHROW - { - return zmq_msg_data(const_cast(&msg)); - } - - inline size_t size() const ZMQ_NOTHROW - { - return zmq_msg_size(const_cast(&msg)); - } - - template T *data() ZMQ_NOTHROW { return static_cast(data()); } - - template T const *data() const ZMQ_NOTHROW - { - return static_cast(data()); - } - - ZMQ_DEPRECATED("from 4.3.0, use operator== instead") - inline bool equal(const message_t *other) const ZMQ_NOTHROW - { - return *this == *other; - } - - inline bool operator==(const message_t &other) const ZMQ_NOTHROW - { - const size_t my_size = size(); - return my_size == other.size() && 0 == memcmp(data(), other.data(), my_size); - } - - inline bool operator!=(const message_t &other) const ZMQ_NOTHROW - { - return !(*this == other); - } - -#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 1, 0) - inline const char *gets(const char *property_) - { - const char *value = zmq_msg_gets(&msg, property_); - if (value == NULL) - throw error_t(); - return value; - } -#endif - -#if defined(ZMQ_BUILD_DRAFT_API) && ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 0) - inline uint32_t routing_id() const - { - return zmq_msg_routing_id(const_cast(&msg)); - } - - inline void set_routing_id(uint32_t routing_id) - { - int rc = zmq_msg_set_routing_id(&msg, routing_id); - if (rc != 0) - throw error_t(); - } - - inline const char* group() const - { - return zmq_msg_group(const_cast(&msg)); - } - - inline void set_group(const char* group) - { - int rc = zmq_msg_set_group(&msg, group); - if (rc != 0) - throw error_t(); - } -#endif - - /** Dump content to string. Ascii chars are readable, the rest is printed as hex. - * Probably ridiculously slow. - */ - inline std::string str() const - { - // Partly mutuated from the same method in zmq::multipart_t - std::stringstream os; - - const unsigned char *msg_data = this->data(); - unsigned char byte; - size_t size = this->size(); - int is_ascii[2] = {0, 0}; - - os << "zmq::message_t [size " << std::dec << std::setw(3) - << std::setfill('0') << size << "] ("; - // Totally arbitrary - if (size >= 1000) { - os << "... too big to print)"; - } else { - while (size--) { - byte = *msg_data++; - - is_ascii[1] = (byte >= 33 && byte < 127); - if (is_ascii[1] != is_ascii[0]) - os << " "; // Separate text/non text - - if (is_ascii[1]) { - os << byte; - } else { - os << std::hex << std::uppercase << std::setw(2) - << std::setfill('0') << static_cast(byte); - } - is_ascii[0] = is_ascii[1]; - } - os << ")"; - } - return os.str(); - } - - private: - // The underlying message - zmq_msg_t msg; - - // Disable implicit message copying, so that users won't use shared - // messages (less efficient) without being aware of the fact. - message_t(const message_t &) ZMQ_DELETED_FUNCTION; - void operator=(const message_t &) ZMQ_DELETED_FUNCTION; -}; - -class context_t -{ - friend class socket_t; - - public: - inline context_t() - { - ptr = zmq_ctx_new(); - if (ptr == NULL) - throw error_t(); - } - - - inline explicit context_t(int io_threads_, - int max_sockets_ = ZMQ_MAX_SOCKETS_DFLT) - { - ptr = zmq_ctx_new(); - if (ptr == NULL) - throw error_t(); - - int rc = zmq_ctx_set(ptr, ZMQ_IO_THREADS, io_threads_); - ZMQ_ASSERT(rc == 0); - - rc = zmq_ctx_set(ptr, ZMQ_MAX_SOCKETS, max_sockets_); - ZMQ_ASSERT(rc == 0); - } - -#ifdef ZMQ_HAS_RVALUE_REFS - inline context_t(context_t &&rhs) ZMQ_NOTHROW : ptr(rhs.ptr) { rhs.ptr = NULL; } - inline context_t &operator=(context_t &&rhs) ZMQ_NOTHROW - { - std::swap(ptr, rhs.ptr); - return *this; - } -#endif - - inline int setctxopt(int option_, int optval_) - { - int rc = zmq_ctx_set(ptr, option_, optval_); - ZMQ_ASSERT(rc == 0); - return rc; - } - - inline int getctxopt(int option_) { return zmq_ctx_get(ptr, option_); } - - inline ~context_t() ZMQ_NOTHROW { close(); } - - inline void close() ZMQ_NOTHROW - { - if (ptr == NULL) - return; - - int rc = zmq_ctx_destroy(ptr); - ZMQ_ASSERT(rc == 0); - ptr = NULL; - } - - // Be careful with this, it's probably only useful for - // using the C api together with an existing C++ api. - // Normally you should never need to use this. - inline ZMQ_EXPLICIT operator void *() ZMQ_NOTHROW { return ptr; } - - inline ZMQ_EXPLICIT operator void const *() const ZMQ_NOTHROW { return ptr; } - - inline operator bool() const ZMQ_NOTHROW { return ptr != NULL; } - - private: - void *ptr; - - context_t(const context_t &) ZMQ_DELETED_FUNCTION; - void operator=(const context_t &) ZMQ_DELETED_FUNCTION; -}; - -#ifdef ZMQ_CPP11 -enum class socket_type : int -{ - req = ZMQ_REQ, - rep = ZMQ_REP, - dealer = ZMQ_DEALER, - router = ZMQ_ROUTER, - pub = ZMQ_PUB, - sub = ZMQ_SUB, - xpub = ZMQ_XPUB, - xsub = ZMQ_XSUB, - push = ZMQ_PUSH, - pull = ZMQ_PULL, -#if defined(ZMQ_BUILD_DRAFT_API) && ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 0) - server = ZMQ_SERVER, - client = ZMQ_CLIENT, - radio = ZMQ_RADIO, - dish = ZMQ_DISH, -#endif -#if ZMQ_VERSION_MAJOR >= 4 - stream = ZMQ_STREAM, -#endif - pair = ZMQ_PAIR -}; -#endif - -class socket_t -{ - friend class monitor_t; - - public: - inline socket_t(context_t &context_, int type_) { init(context_, type_); } - -#ifdef ZMQ_CPP11 - inline socket_t(context_t &context_, socket_type type_) - { - init(context_, static_cast(type_)); - } -#endif - -#ifdef ZMQ_HAS_RVALUE_REFS - inline socket_t(socket_t &&rhs) ZMQ_NOTHROW : ptr(rhs.ptr), ctxptr(rhs.ctxptr) - { - rhs.ptr = NULL; - rhs.ctxptr = NULL; - } - inline socket_t &operator=(socket_t &&rhs) ZMQ_NOTHROW - { - std::swap(ptr, rhs.ptr); - return *this; - } -#endif - - inline ~socket_t() ZMQ_NOTHROW { close(); } - - inline operator void *() ZMQ_NOTHROW { return ptr; } - - inline operator void const *() const ZMQ_NOTHROW { return ptr; } - - inline void close() ZMQ_NOTHROW - { - if (ptr == NULL) - // already closed - return; - int rc = zmq_close(ptr); - ZMQ_ASSERT(rc == 0); - ptr = 0; - } - - template void setsockopt(int option_, T const &optval) - { - setsockopt(option_, &optval, sizeof(T)); - } - - inline void setsockopt(int option_, const void *optval_, size_t optvallen_) - { - int rc = zmq_setsockopt(ptr, option_, optval_, optvallen_); - if (rc != 0) - throw error_t(); - } - - inline void getsockopt(int option_, void *optval_, size_t *optvallen_) const - { - int rc = zmq_getsockopt(ptr, option_, optval_, optvallen_); - if (rc != 0) - throw error_t(); - } - - template T getsockopt(int option_) const - { - T optval; - size_t optlen = sizeof(T); - getsockopt(option_, &optval, &optlen); - return optval; - } - - inline void bind(std::string const &addr) { bind(addr.c_str()); } - - inline void bind(const char *addr_) - { - int rc = zmq_bind(ptr, addr_); - if (rc != 0) - throw error_t(); - } - - inline void unbind(std::string const &addr) { unbind(addr.c_str()); } - - inline void unbind(const char *addr_) - { - int rc = zmq_unbind(ptr, addr_); - if (rc != 0) - throw error_t(); - } - - inline void connect(std::string const &addr) { connect(addr.c_str()); } - - inline void connect(const char *addr_) - { - int rc = zmq_connect(ptr, addr_); - if (rc != 0) - throw error_t(); - } - - inline void disconnect(std::string const &addr) { disconnect(addr.c_str()); } - - inline void disconnect(const char *addr_) - { - int rc = zmq_disconnect(ptr, addr_); - if (rc != 0) - throw error_t(); - } - - inline bool connected() const ZMQ_NOTHROW { return (ptr != NULL); } - - inline size_t send(const void *buf_, size_t len_, int flags_ = 0) - { - int nbytes = zmq_send(ptr, buf_, len_, flags_); - if (nbytes >= 0) - return (size_t) nbytes; - if (zmq_errno() == EAGAIN) - return 0; - throw error_t(); - } - - inline bool send(message_t &msg_, int flags_ = 0) - { - int nbytes = zmq_msg_send(&(msg_.msg), ptr, flags_); - if (nbytes >= 0) - return true; - if (zmq_errno() == EAGAIN) - return false; - throw error_t(); - } - - template bool send(T first, T last, int flags_ = 0) - { - zmq::message_t msg(first, last); - return send(msg, flags_); - } - -#ifdef ZMQ_HAS_RVALUE_REFS - inline bool send(message_t &&msg_, int flags_ = 0) { return send(msg_, flags_); } -#endif - - inline size_t recv(void *buf_, size_t len_, int flags_ = 0) - { - int nbytes = zmq_recv(ptr, buf_, len_, flags_); - if (nbytes >= 0) - return (size_t) nbytes; - if (zmq_errno() == EAGAIN) - return 0; - throw error_t(); - } - - inline bool recv(message_t *msg_, int flags_ = 0) - { - int nbytes = zmq_msg_recv(&(msg_->msg), ptr, flags_); - if (nbytes >= 0) - return true; - if (zmq_errno() == EAGAIN) - return false; - throw error_t(); - } - -#if defined(ZMQ_BUILD_DRAFT_API) && ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 0) - inline void join(const char* group) - { - int rc = zmq_join(ptr, group); - if (rc != 0) - throw error_t(); - } - - inline void leave(const char* group) - { - int rc = zmq_leave(ptr, group); - if (rc != 0) - throw error_t(); - } -#endif - - private: - inline void init(context_t &context_, int type_) - { - ctxptr = context_.ptr; - ptr = zmq_socket(context_.ptr, type_); - if (ptr == NULL) - throw error_t(); - } - - void *ptr; - void *ctxptr; - - socket_t(const socket_t &) ZMQ_DELETED_FUNCTION; - void operator=(const socket_t &) ZMQ_DELETED_FUNCTION; -}; - -class monitor_t -{ - public: - monitor_t() : socketPtr(NULL), monitor_socket(NULL) {} - - virtual ~monitor_t() - { - if (socketPtr) - zmq_socket_monitor(socketPtr, NULL, 0); - - if (monitor_socket) - zmq_close(monitor_socket); - } - - -#ifdef ZMQ_HAS_RVALUE_REFS - monitor_t(monitor_t &&rhs) ZMQ_NOTHROW : socketPtr(rhs.socketPtr), - monitor_socket(rhs.monitor_socket) - { - rhs.socketPtr = NULL; - rhs.monitor_socket = NULL; - } - - socket_t &operator=(socket_t &&rhs) ZMQ_DELETED_FUNCTION; -#endif - - - void - monitor(socket_t &socket, std::string const &addr, int events = ZMQ_EVENT_ALL) - { - monitor(socket, addr.c_str(), events); - } - - void monitor(socket_t &socket, const char *addr_, int events = ZMQ_EVENT_ALL) - { - init(socket, addr_, events); - while (true) { - check_event(-1); - } - } - - void init(socket_t &socket, std::string const &addr, int events = ZMQ_EVENT_ALL) - { - init(socket, addr.c_str(), events); - } - - void init(socket_t &socket, const char *addr_, int events = ZMQ_EVENT_ALL) - { - int rc = zmq_socket_monitor(socket.ptr, addr_, events); - if (rc != 0) - throw error_t(); - - socketPtr = socket.ptr; - monitor_socket = zmq_socket(socket.ctxptr, ZMQ_PAIR); - assert(monitor_socket); - - rc = zmq_connect(monitor_socket, addr_); - assert(rc == 0); - - on_monitor_started(); - } - - bool check_event(int timeout = 0) - { - assert(monitor_socket); - - zmq_msg_t eventMsg; - zmq_msg_init(&eventMsg); - - zmq::pollitem_t items[] = { - {monitor_socket, 0, ZMQ_POLLIN, 0}, - }; - - zmq::poll(&items[0], 1, timeout); - - if (items[0].revents & ZMQ_POLLIN) { - int rc = zmq_msg_recv(&eventMsg, monitor_socket, 0); - if (rc == -1 && zmq_errno() == ETERM) - return false; - assert(rc != -1); - - } else { - zmq_msg_close(&eventMsg); - return false; - } - -#if ZMQ_VERSION_MAJOR >= 4 - const char *data = static_cast(zmq_msg_data(&eventMsg)); - zmq_event_t msgEvent; - memcpy(&msgEvent.event, data, sizeof(uint16_t)); - data += sizeof(uint16_t); - memcpy(&msgEvent.value, data, sizeof(int32_t)); - zmq_event_t *event = &msgEvent; -#else - zmq_event_t *event = static_cast(zmq_msg_data(&eventMsg)); -#endif - -#ifdef ZMQ_NEW_MONITOR_EVENT_LAYOUT - zmq_msg_t addrMsg; - zmq_msg_init(&addrMsg); - int rc = zmq_msg_recv(&addrMsg, monitor_socket, 0); - if (rc == -1 && zmq_errno() == ETERM) { - zmq_msg_close(&eventMsg); - return false; - } - - assert(rc != -1); - const char *str = static_cast(zmq_msg_data(&addrMsg)); - std::string address(str, str + zmq_msg_size(&addrMsg)); - zmq_msg_close(&addrMsg); -#else - // Bit of a hack, but all events in the zmq_event_t union have the same layout so this will work for all event types. - std::string address = event->data.connected.addr; -#endif - -#ifdef ZMQ_EVENT_MONITOR_STOPPED - if (event->event == ZMQ_EVENT_MONITOR_STOPPED) { - zmq_msg_close(&eventMsg); - return false; - } - -#endif - - switch (event->event) { - case ZMQ_EVENT_CONNECTED: - on_event_connected(*event, address.c_str()); - break; - case ZMQ_EVENT_CONNECT_DELAYED: - on_event_connect_delayed(*event, address.c_str()); - break; - case ZMQ_EVENT_CONNECT_RETRIED: - on_event_connect_retried(*event, address.c_str()); - break; - case ZMQ_EVENT_LISTENING: - on_event_listening(*event, address.c_str()); - break; - case ZMQ_EVENT_BIND_FAILED: - on_event_bind_failed(*event, address.c_str()); - break; - case ZMQ_EVENT_ACCEPTED: - on_event_accepted(*event, address.c_str()); - break; - case ZMQ_EVENT_ACCEPT_FAILED: - on_event_accept_failed(*event, address.c_str()); - break; - case ZMQ_EVENT_CLOSED: - on_event_closed(*event, address.c_str()); - break; - case ZMQ_EVENT_CLOSE_FAILED: - on_event_close_failed(*event, address.c_str()); - break; - case ZMQ_EVENT_DISCONNECTED: - on_event_disconnected(*event, address.c_str()); - break; -#ifdef ZMQ_BUILD_DRAFT_API -#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 3) - case ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL: - on_event_handshake_failed_no_detail(*event, address.c_str()); - break; - case ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL: - on_event_handshake_failed_protocol(*event, address.c_str()); - break; - case ZMQ_EVENT_HANDSHAKE_FAILED_AUTH: - on_event_handshake_failed_auth(*event, address.c_str()); - break; - case ZMQ_EVENT_HANDSHAKE_SUCCEEDED: - on_event_handshake_succeeded(*event, address.c_str()); - break; -#elif ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 1) - case ZMQ_EVENT_HANDSHAKE_FAILED: - on_event_handshake_failed(*event, address.c_str()); - break; - case ZMQ_EVENT_HANDSHAKE_SUCCEED: - on_event_handshake_succeed(*event, address.c_str()); - break; -#endif -#endif - default: - on_event_unknown(*event, address.c_str()); - break; - } - zmq_msg_close(&eventMsg); - - return true; - } - -#ifdef ZMQ_EVENT_MONITOR_STOPPED - void abort() - { - if (socketPtr) - zmq_socket_monitor(socketPtr, NULL, 0); - - socketPtr = NULL; - } -#endif - virtual void on_monitor_started() {} - virtual void on_event_connected(const zmq_event_t &event_, const char *addr_) - { - (void) event_; - (void) addr_; - } - virtual void on_event_connect_delayed(const zmq_event_t &event_, - const char *addr_) - { - (void) event_; - (void) addr_; - } - virtual void on_event_connect_retried(const zmq_event_t &event_, - const char *addr_) - { - (void) event_; - (void) addr_; - } - virtual void on_event_listening(const zmq_event_t &event_, const char *addr_) - { - (void) event_; - (void) addr_; - } - virtual void on_event_bind_failed(const zmq_event_t &event_, const char *addr_) - { - (void) event_; - (void) addr_; - } - virtual void on_event_accepted(const zmq_event_t &event_, const char *addr_) - { - (void) event_; - (void) addr_; - } - virtual void on_event_accept_failed(const zmq_event_t &event_, const char *addr_) - { - (void) event_; - (void) addr_; - } - virtual void on_event_closed(const zmq_event_t &event_, const char *addr_) - { - (void) event_; - (void) addr_; - } - virtual void on_event_close_failed(const zmq_event_t &event_, const char *addr_) - { - (void) event_; - (void) addr_; - } - virtual void on_event_disconnected(const zmq_event_t &event_, const char *addr_) - { - (void) event_; - (void) addr_; - } -#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 3) - virtual void on_event_handshake_failed_no_detail(const zmq_event_t &event_, - const char *addr_) - { - (void) event_; - (void) addr_; - } - virtual void on_event_handshake_failed_protocol(const zmq_event_t &event_, - const char *addr_) - { - (void) event_; - (void) addr_; - } - virtual void on_event_handshake_failed_auth(const zmq_event_t &event_, - const char *addr_) - { - (void) event_; - (void) addr_; - } - virtual void on_event_handshake_succeeded(const zmq_event_t &event_, - const char *addr_) - { - (void) event_; - (void) addr_; - } -#elif ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 1) - virtual void on_event_handshake_failed(const zmq_event_t &event_, - const char *addr_) - { - (void) event_; - (void) addr_; - } - virtual void on_event_handshake_succeed(const zmq_event_t &event_, - const char *addr_) - { - (void) event_; - (void) addr_; - } -#endif - virtual void on_event_unknown(const zmq_event_t &event_, const char *addr_) - { - (void) event_; - (void) addr_; - } - - private: - monitor_t(const monitor_t &) ZMQ_DELETED_FUNCTION; - void operator=(const monitor_t &) ZMQ_DELETED_FUNCTION; - - void *socketPtr; - void *monitor_socket; -}; - -#if defined(ZMQ_BUILD_DRAFT_API) && defined(ZMQ_CPP11) && defined(ZMQ_HAVE_POLLER) -template class poller_t -{ - public: - void add(zmq::socket_t &socket, short events, T *user_data) - { - if (0 - != zmq_poller_add(poller_ptr.get(), static_cast(socket), - user_data, events)) { - throw error_t(); - } - } - - void remove(zmq::socket_t &socket) - { - if (0 != zmq_poller_remove(poller_ptr.get(), static_cast(socket))) { - throw error_t(); - } - } - - void modify(zmq::socket_t &socket, short events) - { - if (0 - != zmq_poller_modify(poller_ptr.get(), static_cast(socket), - events)) { - throw error_t(); - } - } - - size_t wait_all(std::vector &poller_events, - const std::chrono::microseconds timeout) - { - int rc = zmq_poller_wait_all(poller_ptr.get(), poller_events.data(), - static_cast(poller_events.size()), - static_cast(timeout.count())); - if (rc > 0) - return static_cast(rc); - -#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 3) - if (zmq_errno() == EAGAIN) -#else - if (zmq_errno() == ETIMEDOUT) -#endif - return 0; - - throw error_t(); - } - - private: - std::unique_ptr> poller_ptr{ - []() { - auto poller_new = zmq_poller_new(); - if (poller_new) - return poller_new; - throw error_t(); - }(), - [](void *ptr) { - int rc = zmq_poller_destroy(&ptr); - ZMQ_ASSERT(rc == 0); - }}; -}; -#endif // defined(ZMQ_BUILD_DRAFT_API) && defined(ZMQ_CPP11) && defined(ZMQ_HAVE_POLLER) - -inline std::ostream &operator<<(std::ostream &os, const message_t &msg) -{ - return os << msg.str(); -} - -} // namespace zmq - -#endif // __ZMQ_HPP_INCLUDED__ From 9e5b263a81c62e1794d0297c1e01a16c891fb3fb Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 3 Feb 2019 13:09:55 +0000 Subject: [PATCH 15/60] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zeromq.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 8bf63e3..bbc948a 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.3.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Software library for fast, message-based applications License: LGPLv3+ @@ -94,6 +94,9 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Sun Feb 03 2019 Fedora Release Engineering - 4.3.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Tue Jan 22 2019 Elliott Sales de Andrade - 4.3.1-1 - Update to latest version of libzmq and cppzmq - Split cppzmq subpackage into its own package From 3fa0303d29b0dbd2807ec8fdf05a378e9c0f544a Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sat, 16 Feb 2019 16:32:57 -0500 Subject: [PATCH 16/60] Disable libunwind on unsupported arches. --- zeromq.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index bbc948a..4eceec7 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.3.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Software library for fast, message-based applications License: LGPLv3+ @@ -14,7 +14,9 @@ BuildRequires: automake BuildRequires: gcc-c++ BuildRequires: libtool BuildRequires: libsodium-devel +%ifarch %{arm} aarch64 hppa ia64 mips ppc %{power64} %{ix86} x86_64 BuildRequires: libunwind-devel +%endif %if %{with pgm} BuildRequires: openpgm-devel @@ -60,7 +62,9 @@ autoreconf -fi --with-libgssapi_krb5 \ %endif --with-libsodium \ +%ifarch %{arm} aarch64 hppa ia64 mips ppc %{power64} %{ix86} x86_64 --enable-libunwind \ +%endif --disable-Werror \ --disable-static %make_build @@ -94,6 +98,9 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Sat Feb 16 2019 Elliott Sales de Andrade - 4.3.1-3 +- Disable libunwind on unsupported arches (#1676262) + * Sun Feb 03 2019 Fedora Release Engineering - 4.3.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From 8b1b433149364e846c6ea11acb14d966867fa871 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jul 2019 04:58:52 +0000 Subject: [PATCH 17/60] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zeromq.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 4eceec7..926c06b 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.3.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Software library for fast, message-based applications License: LGPLv3+ @@ -98,6 +98,9 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Sat Jul 27 2019 Fedora Release Engineering - 4.3.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Sat Feb 16 2019 Elliott Sales de Andrade - 4.3.1-3 - Disable libunwind on unsupported arches (#1676262) From a31484cb1d294349d8bca4da42668bdac8d5a7ca Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 8 Sep 2019 03:33:08 -0400 Subject: [PATCH 18/60] Update to latest version. --- .gitignore | 1 + sources | 2 +- zeromq.spec | 10 +++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 5f933d7..9833261 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ /i?86/ /tarballs/ /libzmq-4.3.1.tar.gz +/libzmq-4.3.2.tar.gz diff --git a/sources b/sources index 02cfb10..3ae9ba4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libzmq-4.3.1.tar.gz) = 64855a73331a194c43b01aa86a985a149eba4ed32b9f6483d2a7415cfd8bba557aab5b7b33d160cd177141de02360b73c20e4696a19c2cd798eb5f82eeb72840 +SHA512 (libzmq-4.3.2.tar.gz) = 3c0a2dfc60c2265311f6ba16c47fab37e71312949b4cf2aa8855530431763bb6b8844c7d72c4b112c21125f0590c663d2a3192249b14611df64a2c6d3e5ac1c7 diff --git a/zeromq.spec b/zeromq.spec index 926c06b..0dbeacd 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -1,12 +1,12 @@ %bcond_without pgm Name: zeromq -Version: 4.3.1 -Release: 4%{?dist} +Version: 4.3.2 +Release: 1%{?dist} Summary: Software library for fast, message-based applications License: LGPLv3+ -URL: http://www.zeromq.org +URL: https://zeromq.org Source0: https://github.com/zeromq/libzmq/archive/v%{version}/libzmq-%{version}.tar.gz BuildRequires: autoconf @@ -98,6 +98,10 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Sun Sep 08 2019 Elliott Sales de Andrade - 4.3.2-1 +- Update to latest version +- Fix CVE-2019-13132 (#1729830) + * Sat Jul 27 2019 Fedora Release Engineering - 4.3.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From f3609faa1b92febbc997a52ca60720aab8396256 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 31 Jan 2020 05:17:34 +0000 Subject: [PATCH 19/60] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zeromq.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 0dbeacd..fb7a66b 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.3.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Software library for fast, message-based applications License: LGPLv3+ @@ -98,6 +98,9 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Fri Jan 31 2020 Fedora Release Engineering - 4.3.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Sun Sep 08 2019 Elliott Sales de Andrade - 4.3.2-1 - Update to latest version - Fix CVE-2019-13132 (#1729830) From d99d0bd41ba1176eccf389d5e016bc29fd6a6648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Wed, 15 Apr 2020 09:22:57 -0400 Subject: [PATCH 20/60] - libunwind is available on all Fedora arches --- zeromq.spec | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/zeromq.spec b/zeromq.spec index fb7a66b..5db07ce 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.3.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Software library for fast, message-based applications License: LGPLv3+ @@ -14,9 +14,7 @@ BuildRequires: automake BuildRequires: gcc-c++ BuildRequires: libtool BuildRequires: libsodium-devel -%ifarch %{arm} aarch64 hppa ia64 mips ppc %{power64} %{ix86} x86_64 BuildRequires: libunwind-devel -%endif %if %{with pgm} BuildRequires: openpgm-devel @@ -62,9 +60,7 @@ autoreconf -fi --with-libgssapi_krb5 \ %endif --with-libsodium \ -%ifarch %{arm} aarch64 hppa ia64 mips ppc %{power64} %{ix86} x86_64 --enable-libunwind \ -%endif --disable-Werror \ --disable-static %make_build @@ -98,6 +94,9 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Wed Apr 15 2020 Dan Horák - 4.3.2-3 +- libunwind is available on all Fedora arches + * Fri Jan 31 2020 Fedora Release Engineering - 4.3.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From 862d0b3419618fea2ae69b399c1533f7994aed19 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Jul 2020 15:21:52 +0000 Subject: [PATCH 21/60] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zeromq.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 5db07ce..67d5304 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.3.2 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Software library for fast, message-based applications License: LGPLv3+ @@ -94,6 +94,9 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Wed Jul 29 2020 Fedora Release Engineering - 4.3.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Wed Apr 15 2020 Dan Horák - 4.3.2-3 - libunwind is available on all Fedora arches From 4f02baed80a9f5afcbc36c1eae407fc4fa41b7d7 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 1 Aug 2020 09:49:32 +0000 Subject: [PATCH 22/60] - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zeromq.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 67d5304..492739a 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.3.2 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Software library for fast, message-based applications License: LGPLv3+ @@ -94,6 +94,10 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Sat Aug 01 2020 Fedora Release Engineering - 4.3.2-5 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Wed Jul 29 2020 Fedora Release Engineering - 4.3.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From 4f322ac6af1af84e2a80852e395f6b55528a53d2 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Tue, 15 Sep 2020 22:53:58 +0200 Subject: [PATCH 23/60] Upstream upgrade Fixes #1876738 and #1876689 --- .gitignore | 4 ++-- sources | 2 +- zeromq.spec | 13 ++++++++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 9833261..e364447 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,11 @@ /zeromq-*.tar.* /zeromq-*.src.rpm /zeromq-*.*.*/ +/libzmq-*.*.*/ /clog .build-*.*.log /noarch/ /x86_64/ /i?86/ /tarballs/ -/libzmq-4.3.1.tar.gz -/libzmq-4.3.2.tar.gz +/libzmq-*.*.*.tar.gz diff --git a/sources b/sources index 3ae9ba4..90451a8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libzmq-4.3.2.tar.gz) = 3c0a2dfc60c2265311f6ba16c47fab37e71312949b4cf2aa8855530431763bb6b8844c7d72c4b112c21125f0590c663d2a3192249b14611df64a2c6d3e5ac1c7 +SHA512 (libzmq-4.3.3.tar.gz) = 99c9813e8b852997abaacf74f477feee7f1a4d87998c24fd6abcbb200eda3becdc2d051db7ace2ee82bc948d8801e2895ea9be7fe9784d982225e6b883044c81 diff --git a/zeromq.spec b/zeromq.spec index 492739a..f29ee5a 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -1,13 +1,13 @@ %bcond_without pgm Name: zeromq -Version: 4.3.2 -Release: 5%{?dist} +Version: 4.3.3 +Release: 1%{?dist} Summary: Software library for fast, message-based applications License: LGPLv3+ URL: https://zeromq.org -Source0: https://github.com/zeromq/libzmq/archive/v%{version}/libzmq-%{version}.tar.gz +Source0: https://github.com/%{name}/libzmq/archive/v%{version}/libzmq-%{version}.tar.gz BuildRequires: autoconf BuildRequires: automake @@ -86,6 +86,9 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %license COPYING COPYING.LESSER %{_bindir}/curve_keygen %{_libdir}/libzmq.so.5* +%{_mandir}/man3/zmq_* +%{_mandir}/man7/zmq_* +%{_mandir}/man7/zmq.* %files devel %{_libdir}/libzmq.so @@ -94,6 +97,10 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Tue Sep 15 2020 Denis Arnaud - 4.3.3-1 +- Upstream upgrade +- Fixes #1876738 and #1876689 + * Sat Aug 01 2020 Fedora Release Engineering - 4.3.2-5 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From 29fbd797d14e3e0c38bb9a72624a60b04f60f4b6 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Tue, 15 Sep 2020 23:11:38 +0200 Subject: [PATCH 24/60] Added dependencies for the man pages --- zeromq.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zeromq.spec b/zeromq.spec index f29ee5a..3753aea 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -13,6 +13,8 @@ BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc-c++ BuildRequires: libtool +BuildRequires: asciidoc +BuildRequires: xmlto BuildRequires: libsodium-devel BuildRequires: libunwind-devel From deb7fbd467537704d28c8133d7769b9f469354a8 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Wed, 16 Sep 2020 00:30:40 +0200 Subject: [PATCH 25/60] No check for s390x --- zeromq.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 3753aea..2308c48 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -76,8 +76,9 @@ rm %{buildroot}%{_libdir}/libzmq.la %check +%ifarch s390x make check V=1 || ( cat test-suite.log && exit 1 ) - +%endif %ldconfig_scriptlets From 135a5bb23be61471f8467c057582544f3d3b7bdf Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Sat, 9 Jan 2021 01:52:06 +0000 Subject: [PATCH 26/60] Add BuildRequires: make https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot --- zeromq.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/zeromq.spec b/zeromq.spec index 2308c48..4580172 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -9,6 +9,7 @@ License: LGPLv3+ URL: https://zeromq.org Source0: https://github.com/%{name}/libzmq/archive/v%{version}/libzmq-%{version}.tar.gz +BuildRequires: make BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc-c++ From f46381246bbbc4571651ea56430650c1abfa0feb Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 28 Jan 2021 00:40:52 +0000 Subject: [PATCH 27/60] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zeromq.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 4580172..64b8def 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.3.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Software library for fast, message-based applications License: LGPLv3+ @@ -101,6 +101,9 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Thu Jan 28 2021 Fedora Release Engineering - 4.3.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Tue Sep 15 2020 Denis Arnaud - 4.3.3-1 - Upstream upgrade - Fixes #1876738 and #1876689 From b11c5a2199b46d76f02643faa118f251ca1a6b0c Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Sat, 30 Jan 2021 00:41:36 +0100 Subject: [PATCH 28/60] Upstream upgrade Fixes #1921879, #1921972, #1921973, #1921975, #1921976, #1921979, #1921981, #1921983, #1921983, #1921985, #1921987, #1921989, #1921992, #1921994 --- sources | 2 +- zeromq.spec | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sources b/sources index 90451a8..626e461 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libzmq-4.3.3.tar.gz) = 99c9813e8b852997abaacf74f477feee7f1a4d87998c24fd6abcbb200eda3becdc2d051db7ace2ee82bc948d8801e2895ea9be7fe9784d982225e6b883044c81 +SHA512 (libzmq-4.3.4.tar.gz) = ad828b1ab5a87983285a6b44b08240816ed1c4e2c73306ab1a851bf80df1892b5e2f92064a49fbadc1f4c75043625ace77dd25b64d5d1c2a7d1d61cc916fba0b diff --git a/zeromq.spec b/zeromq.spec index 64b8def..84a772f 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -1,8 +1,8 @@ %bcond_without pgm Name: zeromq -Version: 4.3.3 -Release: 2%{?dist} +Version: 4.3.4 +Release: 1%{?dist} Summary: Software library for fast, message-based applications License: LGPLv3+ @@ -101,6 +101,11 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Sat Jan 30 2021 Denis Arnaud - 4.3.4-1 +- Upstream upgrade +- Fixes #1921879, #1921972, #1921973, #1921975, #1921976, #1921979, #1921981, +- #1921983, #1921983, #1921985, #1921987, #1921989, #1921992, #1921994 + * Thu Jan 28 2021 Fedora Release Engineering - 4.3.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From 5226e5546bf5cb0277b47a3f454cc5fc33ce5379 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 23 Jul 2021 22:16:38 +0000 Subject: [PATCH 29/60] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zeromq.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 84a772f..ff4d059 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.3.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Software library for fast, message-based applications License: LGPLv3+ @@ -101,6 +101,9 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Fri Jul 23 2021 Fedora Release Engineering - 4.3.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Sat Jan 30 2021 Denis Arnaud - 4.3.4-1 - Upstream upgrade - Fixes #1921879, #1921972, #1921973, #1921975, #1921976, #1921979, #1921981, From 1cff1e4bfab35d91a739418ebb3119d52e54ecaf Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jan 2022 05:50:16 +0000 Subject: [PATCH 30/60] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zeromq.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index ff4d059..869c9c8 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.3.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Software library for fast, message-based applications License: LGPLv3+ @@ -101,6 +101,9 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Sat Jan 22 2022 Fedora Release Engineering - 4.3.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Fri Jul 23 2021 Fedora Release Engineering - 4.3.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From 9958f382430102fe7fb458faac58b0900dfd6164 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 23 Jul 2022 13:53:53 +0000 Subject: [PATCH 31/60] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zeromq.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 869c9c8..2b849d7 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.3.4 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Software library for fast, message-based applications License: LGPLv3+ @@ -101,6 +101,9 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Sat Jul 23 2022 Fedora Release Engineering - 4.3.4-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Sat Jan 22 2022 Fedora Release Engineering - 4.3.4-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From c2c0544f921a70bb67707a523d45375bbc3ac9cd Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 21 Jan 2023 08:14:28 +0000 Subject: [PATCH 32/60] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zeromq.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 2b849d7..3c7fcfa 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,7 +2,7 @@ Name: zeromq Version: 4.3.4 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Software library for fast, message-based applications License: LGPLv3+ @@ -101,6 +101,9 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Sat Jan 21 2023 Fedora Release Engineering - 4.3.4-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Sat Jul 23 2022 Fedora Release Engineering - 4.3.4-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From 0da91cc7060e7c989316991e1ed4857047379699 Mon Sep 17 00:00:00 2001 From: Ben Woodard Date: Tue, 7 Mar 2023 12:34:18 -0800 Subject: [PATCH 33/60] Remove libunwind from dependencies In the case where a C application uses zeromq and then dlopen's a C++ module, the C++ exception handling functionality will not work because libzmg pulls in libunwind. Then the C++ module brings in libstdc++ and libgcc_s, the personality function which is part of the C++ exception handling the runtime finds the version of _Unwind_GetLanguageSpecificData which is in libunwind rather than the one that is in libgcc_s and uses that. However, version does not have a complete implementation and so it fails causing the application to abort. This fixes https://bugzilla.redhat.com/show_bug.cgi?id=2175966 Signed-off-by: Ben Woodard --- zeromq.spec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 3c7fcfa..bc67d32 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -1,8 +1,9 @@ %bcond_without pgm +%bcond_without unwind Name: zeromq Version: 4.3.4 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Software library for fast, message-based applications License: LGPLv3+ @@ -17,7 +18,10 @@ BuildRequires: libtool BuildRequires: asciidoc BuildRequires: xmlto BuildRequires: libsodium-devel + +%if %{with unwind} BuildRequires: libunwind-devel +%endif %if %{with pgm} BuildRequires: openpgm-devel @@ -63,7 +67,9 @@ autoreconf -fi --with-libgssapi_krb5 \ %endif --with-libsodium \ +%if %{with unwind} --enable-libunwind \ +%endif --disable-Werror \ --disable-static %make_build @@ -101,6 +107,10 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Tue Mar 7 2023 Ben Woodard - 4.3.4-6 +- disable building with libunwind to fix C++ exceptions when a C applicaion loads + a module written in C++ #2175966 + * Sat Jan 21 2023 Fedora Release Engineering - 4.3.4-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From b06c92b895b94411493c5891d0bdf716352dd7eb Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Wed, 17 May 2023 12:49:31 -0400 Subject: [PATCH 34/60] Convert License tag to SPDX identifiers Examined the source code and see most of the library is under LGPL-3.0-or-later, but sha1 in external/ is under BSD-3-Clause and unity in external/ is under MIT. Signed-off-by: David Cantrell --- zeromq.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/zeromq.spec b/zeromq.spec index bc67d32..f003f74 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -3,14 +3,14 @@ Name: zeromq Version: 4.3.4 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Software library for fast, message-based applications -License: LGPLv3+ +License: LGPL-3.0-or-later AND BSD-3-Clause AND MIT URL: https://zeromq.org Source0: https://github.com/%{name}/libzmq/archive/v%{version}/libzmq-%{version}.tar.gz -BuildRequires: make +BuildRequires: make BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc-c++ @@ -107,6 +107,9 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Wed May 17 2023 David Cantrell - 4.3.4-7 +- Convert License tag to SPDX identifiers + * Tue Mar 7 2023 Ben Woodard - 4.3.4-6 - disable building with libunwind to fix C++ exceptions when a C applicaion loads a module written in C++ #2175966 From 690b1cc3cfcb86326d500c988a3ace45fc2c9344 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jul 2023 19:40:04 +0000 Subject: [PATCH 35/60] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zeromq.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index f003f74..1097bf2 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -3,7 +3,7 @@ Name: zeromq Version: 4.3.4 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Software library for fast, message-based applications License: LGPL-3.0-or-later AND BSD-3-Clause AND MIT @@ -107,6 +107,9 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Sat Jul 22 2023 Fedora Release Engineering - 4.3.4-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Wed May 17 2023 David Cantrell - 4.3.4-7 - Convert License tag to SPDX identifiers From 4899b764e87db14efcaa2af232a3c2c1cdf565eb Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 5 Oct 2023 09:26:18 +0200 Subject: [PATCH 36/60] rebuild for new libsodium --- zeromq.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 1097bf2..d7f8b7f 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -3,7 +3,7 @@ Name: zeromq Version: 4.3.4 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Software library for fast, message-based applications License: LGPL-3.0-or-later AND BSD-3-Clause AND MIT @@ -107,6 +107,9 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog +* Thu Oct 05 2023 Remi Collet - 4.3.4-9 +- rebuild for new libsodium + * Sat Jul 22 2023 Fedora Release Engineering - 4.3.4-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 6666ee1fbef441d688cb1c9b1916f68bff48ad81 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Sun, 22 Oct 2023 23:47:40 +0200 Subject: [PATCH 37/60] Upstream upgrade --- zeromq.spec | 221 +--------------------------------------------------- 1 file changed, 4 insertions(+), 217 deletions(-) diff --git a/zeromq.spec b/zeromq.spec index d7f8b7f..b618170 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -2,8 +2,8 @@ %bcond_without unwind Name: zeromq -Version: 4.3.4 -Release: 9%{?dist} +Version: 4.3.5 +Release: %autorelease Summary: Software library for fast, message-based applications License: LGPL-3.0-or-later AND BSD-3-Clause AND MIT @@ -107,221 +107,8 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog -* Thu Oct 05 2023 Remi Collet - 4.3.4-9 -- rebuild for new libsodium - -* Sat Jul 22 2023 Fedora Release Engineering - 4.3.4-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Wed May 17 2023 David Cantrell - 4.3.4-7 -- Convert License tag to SPDX identifiers - -* Tue Mar 7 2023 Ben Woodard - 4.3.4-6 -- disable building with libunwind to fix C++ exceptions when a C applicaion loads - a module written in C++ #2175966 - -* Sat Jan 21 2023 Fedora Release Engineering - 4.3.4-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Sat Jul 23 2022 Fedora Release Engineering - 4.3.4-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Sat Jan 22 2022 Fedora Release Engineering - 4.3.4-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Fri Jul 23 2021 Fedora Release Engineering - 4.3.4-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Sat Jan 30 2021 Denis Arnaud - 4.3.4-1 +* Sun Oct 22 2023 Denis Arnaud - 4.3.5-1 - Upstream upgrade -- Fixes #1921879, #1921972, #1921973, #1921975, #1921976, #1921979, #1921981, -- #1921983, #1921983, #1921985, #1921987, #1921989, #1921992, #1921994 -* Thu Jan 28 2021 Fedora Release Engineering - 4.3.3-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild +%autochangelog -* Tue Sep 15 2020 Denis Arnaud - 4.3.3-1 -- Upstream upgrade -- Fixes #1876738 and #1876689 - -* Sat Aug 01 2020 Fedora Release Engineering - 4.3.2-5 -- Second attempt - Rebuilt for - https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Wed Jul 29 2020 Fedora Release Engineering - 4.3.2-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Wed Apr 15 2020 Dan Horák - 4.3.2-3 -- libunwind is available on all Fedora arches - -* Fri Jan 31 2020 Fedora Release Engineering - 4.3.2-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Sun Sep 08 2019 Elliott Sales de Andrade - 4.3.2-1 -- Update to latest version -- Fix CVE-2019-13132 (#1729830) - -* Sat Jul 27 2019 Fedora Release Engineering - 4.3.1-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Sat Feb 16 2019 Elliott Sales de Andrade - 4.3.1-3 -- Disable libunwind on unsupported arches (#1676262) - -* Sun Feb 03 2019 Fedora Release Engineering - 4.3.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Tue Jan 22 2019 Elliott Sales de Andrade - 4.3.1-1 -- Update to latest version of libzmq and cppzmq -- Split cppzmq subpackage into its own package - -* Mon Jan 21 2019 Elliott Sales de Andrade - 4.1.6-11 -- Backport patches to fix test failures in build -- Cleanup spec a little -- Use explicit soname version in file list - -* Tue Aug 28 2018 Pavel Zhukov - 4.1.6-10 -- Add gcc-c++ BR - -* Sat Jul 14 2018 Fedora Release Engineering - 4.1.6-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Fri Feb 09 2018 Fedora Release Engineering - 4.1.6-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Sat Feb 03 2018 Igor Gnatenko - 4.1.6-7 -- Switch to %%ldconfig_scriptlets - -* Mon Oct 02 2017 Remi Collet - 4.1.6-6 -- rebuild for libsodium - -* Thu Aug 03 2017 Fedora Release Engineering - 4.1.6-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Thu Jul 27 2017 Fedora Release Engineering - 4.1.6-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Mon May 15 2017 Fedora Release Engineering - 4.1.6-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild - -* Sat Feb 11 2017 Fedora Release Engineering - 4.1.6-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Sun Nov 13 2016 Thomas Spura - 4.1.6-1 -- update to 4.1.6 - -* Mon Mar 07 2016 Remi Collet - 4.1.4-5 -- rebuild for new libsodium soname - -* Sun Feb 14 2016 Thomas Spura - 4.1.4-4 -- Remove Werror from compile flags - -* Fri Feb 05 2016 Fedora Release Engineering - 4.1.4-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Sun Jan 24 2016 Thomas Spura - 4.1.4-2 -- Enable krb5 and fix building of pgm (#1301197) - -* Sat Dec 19 2015 Thomas Spura - 4.1.4-1 -- update to 4.1.4 (#1292814) -- refresh zmq.hpp - -* Mon Aug 24 2015 Thomas Spura - 4.1.3-1 -- update to 4.1.3 (#1256209) -- ipv6 patch included upstream -- refresh zmq.hpp - -* Tue Jun 23 2015 Thomas Spura - 4.1.2-1 -- update to 4.1.2 -- add upstream patch to fix problem with ipv6 - -* Fri Jun 19 2015 Fedora Release Engineering - 4.0.5-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Mon Jun 08 2015 Thomas Spura - 4.0.5-4 -- Add zmq.hpp, which originally belonged to zeromq: - https://github.com/zeromq/cppzmq/issues/48 - -* Tue May 19 2015 Thomas Spura - 4.0.5-3 -- Cherry-pick patch for protocol downgrade attack (#1221666, CVE-2014-9721) -- Remove Obsoletes:zeromq-utils -- Remove %%defattr - -* Sat May 02 2015 Kalev Lember - 4.0.5-2 -- Rebuilt for GCC 5 C++11 ABI change - -* Mon Nov 17 2014 Thomas Spura - 4.0.5-1 -- update to 4.0.5 - -* Mon Aug 18 2014 Fedora Release Engineering - 2.2.0-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - -* Sat Jun 07 2014 Fedora Release Engineering - 2.2.0-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Sun Aug 04 2013 Fedora Release Engineering - 2.2.0-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild - -* Fri May 17 2013 Thomas Spura - 2.2.0-7 -- Rebuilt for openpm-5.2 and sed correct version into configure (#963894) - -* Wed Mar 27 2013 Thomas Spura - 2.2.0-6 -- run autoreconf before configure so aarch64 is supported (#926859) - -* Fri Feb 15 2013 Fedora Release Engineering - 2.2.0-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild - -* Mon Jan 14 2013 Thomas Spura - 2.2.0-4 -- delete foreign files with dubious license in %%prep (#892111) - -* Mon Dec 24 2012 Thomas Spura - 2.2.0-3 -- add bcond_without pgm macro (Jose Pedro Oliveira, #867182) -- remove bundled pgm -- build against openpgm - -* Sun Jul 22 2012 Fedora Release Engineering - 2.2.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - -* Thu Apr 26 2012 Thomas Spura - 2.2.0-1 -- update to 2.2.0 - -* Sat Jan 7 2012 Thomas Spura - 2.1.11-1 -- update to 2.1.11 (as part of rebuilding with gcc-4.7) - -* Tue Sep 20 2011 Thomas Spura - 2.1.9-1 -- update to 2.1.9 -- add check section - -* Wed Apr 6 2011 Thomas Spura - 2.1.4-1 -- update to new version (#690199) - -* Wed Mar 23 2011 Thomas Spura - 2.1.3-1 -- update to new version (#690199) -- utils subpackage was removed upstream - (obsolete it) - -* Tue Feb 08 2011 Fedora Release Engineering - 2.0.10-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - -* Thu Jan 13 2011 Pavel Zhukov - 2.0.10-1 -- update version -- add rpath delete -- change includedir filelist - -* Fri Aug 27 2010 Thomas Spura - 2.0.8-1 -- update to new version - -* Fri Jul 23 2010 Thomas Spura - 2.0.7-4 -- upstream VCS changed -- remove buildroot / %%clean -- change descriptions - -* Tue Jul 20 2010 Thomas Spura - 2.0.7-3 -- move binaries to seperate utils package - -* Sat Jun 12 2010 Thomas Spura - 2.0.7-2 -- remove BR: libstdc++-devel -- move man3 to the devel package -- change group to System Environment/Libraries - -* Sat Jun 12 2010 Thomas Spura - 2.0.7-1 -- initial package (based on upstreams example one) From 0108fed20ce8eb9e3fe68039af7e1e640abd386b Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Sun, 22 Oct 2023 23:49:02 +0200 Subject: [PATCH 38/60] Upstream upgrade --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 626e461..69632ce 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libzmq-4.3.4.tar.gz) = ad828b1ab5a87983285a6b44b08240816ed1c4e2c73306ab1a851bf80df1892b5e2f92064a49fbadc1f4c75043625ace77dd25b64d5d1c2a7d1d61cc916fba0b +SHA512 (zeromq-4.3.5.tar.gz) = a71d48aa977ad8941c1609947d8db2679fc7a951e4cd0c3a1127ae026d883c11bd4203cf315de87f95f5031aec459a731aec34e5ce5b667b8d0559b157952541 From 7a106ac239474784a325b6d0ac8ad37e077207e7 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Sun, 22 Oct 2023 23:51:07 +0200 Subject: [PATCH 39/60] Upstream upgrade --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 69632ce..bf28eb0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zeromq-4.3.5.tar.gz) = a71d48aa977ad8941c1609947d8db2679fc7a951e4cd0c3a1127ae026d883c11bd4203cf315de87f95f5031aec459a731aec34e5ce5b667b8d0559b157952541 +SHA512 (libzmq-4.3.5.tar.gz) = a71d48aa977ad8941c1609947d8db2679fc7a951e4cd0c3a1127ae026d883c11bd4203cf315de87f95f5031aec459a731aec34e5ce5b667b8d0559b157952541 From e1c1539e1662c06e2f05b5dafaacd86d7d1204ab Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Sun, 22 Oct 2023 23:56:37 +0200 Subject: [PATCH 40/60] Upstream upgrade --- sources | 2 +- zeromq.spec | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sources b/sources index bf28eb0..69632ce 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libzmq-4.3.5.tar.gz) = a71d48aa977ad8941c1609947d8db2679fc7a951e4cd0c3a1127ae026d883c11bd4203cf315de87f95f5031aec459a731aec34e5ce5b667b8d0559b157952541 +SHA512 (zeromq-4.3.5.tar.gz) = a71d48aa977ad8941c1609947d8db2679fc7a951e4cd0c3a1127ae026d883c11bd4203cf315de87f95f5031aec459a731aec34e5ce5b667b8d0559b157952541 diff --git a/zeromq.spec b/zeromq.spec index b618170..dca7a31 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -8,7 +8,7 @@ Summary: Software library for fast, message-based applications License: LGPL-3.0-or-later AND BSD-3-Clause AND MIT URL: https://zeromq.org -Source0: https://github.com/%{name}/libzmq/archive/v%{version}/libzmq-%{version}.tar.gz +Source0: https://github.com/%{name}/libzmq/archive/v%{version}/%{name}-%{version}.tar.gz BuildRequires: make BuildRequires: autoconf @@ -50,7 +50,7 @@ developing applications that use %{name}. %prep -%autosetup -p1 -n libzmq-%{version} +%autosetup -p1 # Remove bundled code. rm -rf external/wepoll From de1a0c8e35ecb7b79b269b36a18802c82908c5a0 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Mon, 23 Oct 2023 00:01:24 +0200 Subject: [PATCH 41/60] Upstream upgrade --- zeromq.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zeromq.spec b/zeromq.spec index dca7a31..02c1862 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -6,7 +6,7 @@ Version: 4.3.5 Release: %autorelease Summary: Software library for fast, message-based applications -License: LGPL-3.0-or-later AND BSD-3-Clause AND MIT +License: MPL-2.0 AND BSD-3-Clause AND MIT URL: https://zeromq.org Source0: https://github.com/%{name}/libzmq/archive/v%{version}/%{name}-%{version}.tar.gz @@ -93,7 +93,7 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %files %doc README.md AUTHORS NEWS -%license COPYING COPYING.LESSER +%license LICENSE %{_bindir}/curve_keygen %{_libdir}/libzmq.so.5* %{_mandir}/man3/zmq_* From 12b8a0bc123f383f7e8212dce5673eae5c0675b9 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Mon, 23 Oct 2023 00:30:05 +0200 Subject: [PATCH 42/60] Fixed the changelog section --- zeromq.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/zeromq.spec b/zeromq.spec index 02c1862..968ec1b 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -107,8 +107,5 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %changelog -* Sun Oct 22 2023 Denis Arnaud - 4.3.5-1 -- Upstream upgrade - %autochangelog From e47d99b391842e8fa240d3d778347d5ef8e4f08f Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Mon, 23 Oct 2023 00:41:22 +0200 Subject: [PATCH 43/60] Fixed the license name --- zeromq.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 968ec1b..97f48c5 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -6,7 +6,7 @@ Version: 4.3.5 Release: %autorelease Summary: Software library for fast, message-based applications -License: MPL-2.0 AND BSD-3-Clause AND MIT +License: MPLv2.0 AND BSD-3-Clause AND MIT URL: https://zeromq.org Source0: https://github.com/%{name}/libzmq/archive/v%{version}/%{name}-%{version}.tar.gz From 0a97bab77b0ebadedd9dc193c415627ca2a074c1 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Tue, 24 Oct 2023 15:20:12 +0200 Subject: [PATCH 44/60] BZ#2245747 - Build system switched to CMake --- zeromq-fix-cmake-warnings.patch | 50 +++++++++++++++++++++++++++++++++ zeromq.spec | 39 ++++++++----------------- 2 files changed, 62 insertions(+), 27 deletions(-) create mode 100644 zeromq-fix-cmake-warnings.patch diff --git a/zeromq-fix-cmake-warnings.patch b/zeromq-fix-cmake-warnings.patch new file mode 100644 index 0000000..8b228b6 --- /dev/null +++ b/zeromq-fix-cmake-warnings.patch @@ -0,0 +1,50 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c64ccc1f..deae8efe 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,12 +1,7 @@ + # CMake build script for ZeroMQ ++cmake_minimum_required(VERSION 3.5..3.27) + project(ZeroMQ) + +-if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin) +- cmake_minimum_required(VERSION 3.0.2) +-else() +- cmake_minimum_required(VERSION 2.8.12) +-endif() +- + include(CheckIncludeFiles) + include(CheckCCompilerFlag) + include(CheckCXXCompilerFlag) +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index c1bda3bd..ce157c1e 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -1,10 +1,15 @@ + # CMake build script for ZeroMQ tests +-cmake_minimum_required(VERSION "2.8.1") ++cmake_minimum_required(VERSION 3.5..3.27) + + # On Windows: solution file will be called tests.sln + project(tests) + + set(tests ++ test_bind_stream_fuzzer ++ test_bind_ws_fuzzer ++ test_connect_stream_fuzzer ++ test_connect_ws_fuzzer ++ test_socket_options_fuzzer + test_ancillaries + test_system + test_pair_inproc +diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt +index 7132f00b..f76c3a1b 100644 +--- a/unittests/CMakeLists.txt ++++ b/unittests/CMakeLists.txt +@@ -1,5 +1,5 @@ + # CMake build script for ZeroMQ unit tests +-cmake_minimum_required(VERSION "2.8.1") ++cmake_minimum_required(VERSION 3.5..3.27) + + set(unittests + unittest_ypipe diff --git a/zeromq.spec b/zeromq.spec index 97f48c5..0bc3d97 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -10,14 +10,12 @@ License: MPLv2.0 AND BSD-3-Clause AND MIT URL: https://zeromq.org Source0: https://github.com/%{name}/libzmq/archive/v%{version}/%{name}-%{version}.tar.gz -BuildRequires: make -BuildRequires: autoconf -BuildRequires: automake BuildRequires: gcc-c++ -BuildRequires: libtool +BuildRequires: cmake BuildRequires: asciidoc BuildRequires: xmlto BuildRequires: libsodium-devel +BuildRequires: gnutls-devel %if %{with unwind} BuildRequires: libunwind-devel @@ -28,6 +26,8 @@ BuildRequires: openpgm-devel BuildRequires: krb5-devel %endif +Patch0: zeromq-fix-cmake-warnings.patch + %description The 0MQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by @@ -60,37 +60,22 @@ chmod -x src/xsub.hpp %build -autoreconf -fi -%configure \ -%if %{with pgm} - --with-pgm \ - --with-libgssapi_krb5 \ -%endif - --with-libsodium \ -%if %{with unwind} - --enable-libunwind \ -%endif - --disable-Werror \ - --disable-static -%make_build +%cmake +#cmake -DENABLE_CURVE:BOOL=ON -DWITH_LIBSODIUM:BOOL=ON -DWITH_OPENPGM:BOOL=ON .. +%cmake_build %install -%make_install - -# remove *.la -rm %{buildroot}%{_libdir}/libzmq.la - +%cmake_install %check +%ifnarch s390x +%ctest +%endif %ifarch s390x make check V=1 || ( cat test-suite.log && exit 1 ) %endif - -%ldconfig_scriptlets - - %files %doc README.md AUTHORS NEWS %license LICENSE @@ -104,7 +89,7 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %{_libdir}/libzmq.so %{_libdir}/pkgconfig/libzmq.pc %{_includedir}/zmq*.h - +%{_libdir}/cmake/ZeroMQ %changelog %autochangelog From b80422b75f353bdd12edeb8b05a81ac78add223a Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Tue, 24 Oct 2023 19:41:37 +0200 Subject: [PATCH 45/60] Improved the build --- zeromq.spec | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/zeromq.spec b/zeromq.spec index 0bc3d97..d581cf4 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -26,6 +26,7 @@ BuildRequires: openpgm-devel BuildRequires: krb5-devel %endif +# https://github.com/zeromq/libzmq/pull/4609 - Upgrade of CMake files Patch0: zeromq-fix-cmake-warnings.patch %description @@ -48,6 +49,12 @@ Requires: %{name}%{?_isa} = %{version}-%{release} The %{name}-devel package contains libraries and header files for developing applications that use %{name}. +%package doc +Summary: HTML documentation for the %{name} library +BuildArch: noarch + +%description doc +This package contains HTML pages for %{name}. %prep %autosetup -p1 @@ -68,6 +75,20 @@ chmod -x src/xsub.hpp %install %cmake_install +# Doc +mv -f %{buildroot}/usr/doc/zmq %{buildroot}%{_docdir}/ + +# Manual pages +install -d %{buildroot}%{_mandir}/{man3,man7} +install -pm 0644 doc/*.3 %{buildroot}%{_mandir}/man3/ +install -pm 0644 doc/*.7 %{buildroot}%{_mandir}/man7/ + +# Static library +rm -f %{buildroot}%{_libdir}/libzmq.a + +# Unused binaries +rm -f %{buildroot}%{_bindir}/{inproc_lat,inproc_thr,local_lat,local_thr,proxy_thr,remote_lat,remote_thr} + %check %ifnarch s390x %ctest @@ -79,7 +100,7 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %files %doc README.md AUTHORS NEWS %license LICENSE -%{_bindir}/curve_keygen +#%%{_bindir}/curve_keygen %{_libdir}/libzmq.so.5* %{_mandir}/man3/zmq_* %{_mandir}/man7/zmq_* @@ -89,7 +110,10 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %{_libdir}/libzmq.so %{_libdir}/pkgconfig/libzmq.pc %{_includedir}/zmq*.h -%{_libdir}/cmake/ZeroMQ +%{_libdir}/cmake/ZeroMQ/ + +%files doc +%{_docdir}/zmq/ %changelog %autochangelog From 13c901b7afbebd5fc92ef5fb8bdc466b145abb60 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Tue, 24 Oct 2023 20:29:42 +0200 Subject: [PATCH 46/60] Revert "CMake / Improved the build" This reverts commit b80422b75f353bdd12edeb8b05a81ac78add223a. --- zeromq.spec | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/zeromq.spec b/zeromq.spec index d581cf4..0bc3d97 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -26,7 +26,6 @@ BuildRequires: openpgm-devel BuildRequires: krb5-devel %endif -# https://github.com/zeromq/libzmq/pull/4609 - Upgrade of CMake files Patch0: zeromq-fix-cmake-warnings.patch %description @@ -49,12 +48,6 @@ Requires: %{name}%{?_isa} = %{version}-%{release} The %{name}-devel package contains libraries and header files for developing applications that use %{name}. -%package doc -Summary: HTML documentation for the %{name} library -BuildArch: noarch - -%description doc -This package contains HTML pages for %{name}. %prep %autosetup -p1 @@ -75,20 +68,6 @@ chmod -x src/xsub.hpp %install %cmake_install -# Doc -mv -f %{buildroot}/usr/doc/zmq %{buildroot}%{_docdir}/ - -# Manual pages -install -d %{buildroot}%{_mandir}/{man3,man7} -install -pm 0644 doc/*.3 %{buildroot}%{_mandir}/man3/ -install -pm 0644 doc/*.7 %{buildroot}%{_mandir}/man7/ - -# Static library -rm -f %{buildroot}%{_libdir}/libzmq.a - -# Unused binaries -rm -f %{buildroot}%{_bindir}/{inproc_lat,inproc_thr,local_lat,local_thr,proxy_thr,remote_lat,remote_thr} - %check %ifnarch s390x %ctest @@ -100,7 +79,7 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %files %doc README.md AUTHORS NEWS %license LICENSE -#%%{_bindir}/curve_keygen +%{_bindir}/curve_keygen %{_libdir}/libzmq.so.5* %{_mandir}/man3/zmq_* %{_mandir}/man7/zmq_* @@ -110,10 +89,7 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %{_libdir}/libzmq.so %{_libdir}/pkgconfig/libzmq.pc %{_includedir}/zmq*.h -%{_libdir}/cmake/ZeroMQ/ - -%files doc -%{_docdir}/zmq/ +%{_libdir}/cmake/ZeroMQ %changelog %autochangelog From 3dd626ffa022b1acc1627ef1ce762d206fd445c9 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Tue, 24 Oct 2023 20:30:24 +0200 Subject: [PATCH 47/60] Revert "BZ#2245747 - Build system switched to CMake" This reverts commit 0a97bab77b0ebadedd9dc193c415627ca2a074c1. --- zeromq-fix-cmake-warnings.patch | 50 --------------------------------- zeromq.spec | 39 +++++++++++++++++-------- 2 files changed, 27 insertions(+), 62 deletions(-) delete mode 100644 zeromq-fix-cmake-warnings.patch diff --git a/zeromq-fix-cmake-warnings.patch b/zeromq-fix-cmake-warnings.patch deleted file mode 100644 index 8b228b6..0000000 --- a/zeromq-fix-cmake-warnings.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c64ccc1f..deae8efe 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,12 +1,7 @@ - # CMake build script for ZeroMQ -+cmake_minimum_required(VERSION 3.5..3.27) - project(ZeroMQ) - --if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin) -- cmake_minimum_required(VERSION 3.0.2) --else() -- cmake_minimum_required(VERSION 2.8.12) --endif() -- - include(CheckIncludeFiles) - include(CheckCCompilerFlag) - include(CheckCXXCompilerFlag) -diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt -index c1bda3bd..ce157c1e 100644 ---- a/tests/CMakeLists.txt -+++ b/tests/CMakeLists.txt -@@ -1,10 +1,15 @@ - # CMake build script for ZeroMQ tests --cmake_minimum_required(VERSION "2.8.1") -+cmake_minimum_required(VERSION 3.5..3.27) - - # On Windows: solution file will be called tests.sln - project(tests) - - set(tests -+ test_bind_stream_fuzzer -+ test_bind_ws_fuzzer -+ test_connect_stream_fuzzer -+ test_connect_ws_fuzzer -+ test_socket_options_fuzzer - test_ancillaries - test_system - test_pair_inproc -diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt -index 7132f00b..f76c3a1b 100644 ---- a/unittests/CMakeLists.txt -+++ b/unittests/CMakeLists.txt -@@ -1,5 +1,5 @@ - # CMake build script for ZeroMQ unit tests --cmake_minimum_required(VERSION "2.8.1") -+cmake_minimum_required(VERSION 3.5..3.27) - - set(unittests - unittest_ypipe diff --git a/zeromq.spec b/zeromq.spec index 0bc3d97..97f48c5 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -10,12 +10,14 @@ License: MPLv2.0 AND BSD-3-Clause AND MIT URL: https://zeromq.org Source0: https://github.com/%{name}/libzmq/archive/v%{version}/%{name}-%{version}.tar.gz +BuildRequires: make +BuildRequires: autoconf +BuildRequires: automake BuildRequires: gcc-c++ -BuildRequires: cmake +BuildRequires: libtool BuildRequires: asciidoc BuildRequires: xmlto BuildRequires: libsodium-devel -BuildRequires: gnutls-devel %if %{with unwind} BuildRequires: libunwind-devel @@ -26,8 +28,6 @@ BuildRequires: openpgm-devel BuildRequires: krb5-devel %endif -Patch0: zeromq-fix-cmake-warnings.patch - %description The 0MQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by @@ -60,22 +60,37 @@ chmod -x src/xsub.hpp %build -%cmake -#cmake -DENABLE_CURVE:BOOL=ON -DWITH_LIBSODIUM:BOOL=ON -DWITH_OPENPGM:BOOL=ON .. +autoreconf -fi +%configure \ +%if %{with pgm} + --with-pgm \ + --with-libgssapi_krb5 \ +%endif + --with-libsodium \ +%if %{with unwind} + --enable-libunwind \ +%endif + --disable-Werror \ + --disable-static +%make_build -%cmake_build %install -%cmake_install +%make_install + +# remove *.la +rm %{buildroot}%{_libdir}/libzmq.la + %check -%ifnarch s390x -%ctest -%endif %ifarch s390x make check V=1 || ( cat test-suite.log && exit 1 ) %endif + +%ldconfig_scriptlets + + %files %doc README.md AUTHORS NEWS %license LICENSE @@ -89,7 +104,7 @@ make check V=1 || ( cat test-suite.log && exit 1 ) %{_libdir}/libzmq.so %{_libdir}/pkgconfig/libzmq.pc %{_includedir}/zmq*.h -%{_libdir}/cmake/ZeroMQ + %changelog %autochangelog From 9e6802e3b7168475f41546a4b07fc6bf502f5be2 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Tue, 31 Oct 2023 12:51:38 +0100 Subject: [PATCH 48/60] Enable draft API (rhbz#2247171) --- zeromq.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/zeromq.spec b/zeromq.spec index 97f48c5..2d41825 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -67,6 +67,7 @@ autoreconf -fi --with-libgssapi_krb5 \ %endif --with-libsodium \ + --enable-drafts \ %if %{with unwind} --enable-libunwind \ %endif From 04ba3e0b7edcf3e2052e6e2d1bf0cafa2caf1c91 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Tue, 31 Oct 2023 15:13:53 +0100 Subject: [PATCH 49/60] BZ#2247171 / PR#7 - Added the --enable-drafts option by default --- zeromq.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zeromq.spec b/zeromq.spec index 2d41825..158f4c7 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -67,7 +67,9 @@ autoreconf -fi --with-libgssapi_krb5 \ %endif --with-libsodium \ +%ifnarch s390x --enable-drafts \ +%endif %if %{with unwind} --enable-libunwind \ %endif From 0502eb19600dd1d9e19a5ac05cbcb87ebb94cdfd Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Tue, 31 Oct 2023 17:59:45 +0100 Subject: [PATCH 50/60] XFAIL the faileing tests/test_radio_dish --- zeromq.spec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/zeromq.spec b/zeromq.spec index 158f4c7..6b7df88 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -67,9 +67,7 @@ autoreconf -fi --with-libgssapi_krb5 \ %endif --with-libsodium \ -%ifnarch s390x --enable-drafts \ -%endif %if %{with unwind} --enable-libunwind \ %endif @@ -87,7 +85,7 @@ rm %{buildroot}%{_libdir}/libzmq.la %check %ifarch s390x -make check V=1 || ( cat test-suite.log && exit 1 ) +make check V=1 XFAIL_TESTS=tests/test_radio_dish || ( cat test-suite.log && exit 1 ) %endif From d1f897dccf492ea2955e426826903e4b91d8c71b Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 29 Nov 2023 14:33:04 +0100 Subject: [PATCH 51/60] Build with _DEFAULT_SOURCE to avoid compatibility issue --- zeromq-configure-c99.patch | 37 +++++++++++++++++++++++++++++++++++++ zeromq.spec | 1 + 2 files changed, 38 insertions(+) create mode 100644 zeromq-configure-c99.patch diff --git a/zeromq-configure-c99.patch b/zeromq-configure-c99.patch new file mode 100644 index 0000000..0bee83b --- /dev/null +++ b/zeromq-configure-c99.patch @@ -0,0 +1,37 @@ +Build with -D_DEFAULT_SOURCE along with -std=c11 + +On its own, -std=c11 hides POSIX and other extensions from C headers +such as when building against glibc. This causes the +posix_memalign probe to fail incorrectly with compilers that do not +accept implicit function declarations. _DEFAULT_SOURCE is ignored by +most non-GNU/Linux systems or not relevant in this context, so there +is no separate check for adding it. + +Submitted upstream: + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 68fb7251..f956f3fd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -122,7 +122,7 @@ if (NOT MSVC) + if(NOT CMAKE_C_FLAGS MATCHES "-std=" AND NOT C_STANDARD AND NOT CMAKE_C_STANDARD) + check_c_compiler_flag("-std=c11" COMPILER_SUPPORTS_C11) + if(COMPILER_SUPPORTS_C11) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_DEFAULT_SOURCE -std=c11") + else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") + endif() +diff --git a/configure.ac b/configure.ac +index b9e13d4f..ffcc145b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -66,7 +66,7 @@ ZMQ_ORIG_CXXFLAGS="${CXXFLAGS:-none}" + + # Checks for programs. + AC_PROG_CC +-AX_CHECK_COMPILE_FLAG([-std=c11], [CFLAGS+=" -std=c11"], [AC_PROG_CC_C99]) ++AX_CHECK_COMPILE_FLAG([-std=c11], [CFLAGS+=" -std=c11 -D_DEFAULT_SOURCE"], [AC_PROG_CC_C99]) + AC_PROG_CXX + AX_CODE_COVERAGE + AM_PROG_CC_C_O diff --git a/zeromq.spec b/zeromq.spec index 6b7df88..18794f8 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -9,6 +9,7 @@ Summary: Software library for fast, message-based applications License: MPLv2.0 AND BSD-3-Clause AND MIT URL: https://zeromq.org Source0: https://github.com/%{name}/libzmq/archive/v%{version}/%{name}-%{version}.tar.gz +Patch1: zeromq-configure-c99.patch BuildRequires: make BuildRequires: autoconf From 1cb438733f354aa156b0eeee6fb0dcdc0b19aba2 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jan 2024 11:04:44 +0000 Subject: [PATCH 52/60] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 1bc5134706ec9dcb1e79a35eec857d53ac6e654e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jul 2024 10:50:50 +0000 Subject: [PATCH 53/60] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From c8ae1309ae00141d9a2f296d279ca1dd74868a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Sun, 8 Sep 2024 20:06:32 +0000 Subject: [PATCH 54/60] Migrate to SPDX license This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4 If there will be no comments in two weeks, I will merge this. --- zeromq.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index 18794f8..a4f31f1 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -6,7 +6,7 @@ Version: 4.3.5 Release: %autorelease Summary: Software library for fast, message-based applications -License: MPLv2.0 AND BSD-3-Clause AND MIT +License: MPL-2.0 AND BSD-3-Clause AND MIT URL: https://zeromq.org Source0: https://github.com/%{name}/libzmq/archive/v%{version}/%{name}-%{version}.tar.gz Patch1: zeromq-configure-c99.patch From cb016e731716d3ce6779fcb2ae0f9039800a5f79 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 16:44:36 +0000 Subject: [PATCH 55/60] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 2ba6425a00ea0b2667a8aeb9b275df4d9c66b208 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Mon, 27 Jan 2025 23:08:26 +0100 Subject: [PATCH 56/60] Rebuild for OpenPGM --- zeromq.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/zeromq.spec b/zeromq.spec index a4f31f1..cb4276c 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -1,3 +1,4 @@ +# %bcond_without pgm %bcond_without unwind From 5cdfb5dc7a90d61a8116cf0b52d9540289101988 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Tue, 28 Jan 2025 11:40:11 +0100 Subject: [PATCH 57/60] Rebuild for OpenPGM in a side tag --- zeromq.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/zeromq.spec b/zeromq.spec index cb4276c..a4f31f1 100644 --- a/zeromq.spec +++ b/zeromq.spec @@ -1,4 +1,3 @@ -# %bcond_without pgm %bcond_without unwind From 8c0a9a27441bfb3f15dde5ba86ebe72d92c5ba79 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 21:17:35 +0000 Subject: [PATCH 58/60] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 61dda03ad695d60509ccfa414709aea4ce120068 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 17 Jan 2026 21:07:36 +0000 Subject: [PATCH 59/60] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild From 2b568b01363eff740cc72599500094aab3073dc8 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jul 2026 09:39:57 +0000 Subject: [PATCH 60/60] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild