From 5ac0f2fb9546f6f8d1904c5214230d60e140f23c Mon Sep 17 00:00:00 2001 From: Joshua Clayton Date: Sat, 14 Nov 2020 10:19:43 -0700 Subject: [PATCH 1/5] Update the spec file to build 1.1 Put some documentation in a better location Don't include compiled samples (but rater cpp files) --- dist/paho-cpp.spec | 37 +++++++----- dist/paho1.1_logremove.patch | 110 +++++++++++++++++++++++++++++++++++ 2 files changed, 134 insertions(+), 13 deletions(-) create mode 100644 dist/paho1.1_logremove.patch diff --git a/dist/paho-cpp.spec b/dist/paho-cpp.spec index 6a05157a..d1126e30 100644 --- a/dist/paho-cpp.spec +++ b/dist/paho-cpp.spec @@ -1,10 +1,11 @@ Summary: MQTT CPP Client Name: paho-cpp -Version: 1.0.0 -Release: 0%{?dist} +Version: 1.1 +Release: 1%{?dist} License: Eclipse Distribution License 1.0 and Eclipse Public License 1.0 Group: Development/Tools -Source: https://github.com/eclipse/paho.mqtt.cpp/archive/v%{version}.tar.gz +Source: https://github.com/eclipse/paho.mqtt.cpp/archive/v-%{version}.tar.gz +Patch0: paho1.1_logremove.patch URL: https://eclipse.org/paho/clients/cpp/ BuildRequires: cmake3 BuildRequires: gcc @@ -13,7 +14,7 @@ BuildRequires: doxygen BuildRequires: openssl-devel BuildRequires: paho-c-devel Requires: openssl -Requires: paho-c +Requires: paho-c >= 1.3.1 %description @@ -37,28 +38,38 @@ Group: Development/Libraries Development documentation files for the the Paho MQTT CPP Client. %prep -%autosetup -n paho-cpp-%{version} +%autosetup -n paho.mqtt.cpp-%{version} -p0 1 %build mkdir build.paho.cpp && cd build.paho.cpp -%cmake3 -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_DOCUMENTATION=TRUE -DPAHO_BUILD_SAMPLES=TRUE .. -make %{?_smp_mflags} +%cmake -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_DOCUMENTATION=TRUE .. +%cmake_build %install -cd build.paho.cpp -make install DESTDIR=%{buildroot} +pushd build.paho.cpp +%cmake_install +popd + +mkdir -p %{buildroot}%{_datadir}/doc/%{name}/samples/ +# put the samples into the documentation directory +cp -a src/samples/*.cpp %{buildroot}%{_datadir}/doc/%{name}/samples/ +# Put paho html docs in a paho subdirectory +mv %{buildroot}%{_datadir}/doc/html %{buildroot}%{_datadir}/doc/%{name} %files %doc edl-v10 epl-v10 %{_libdir}/* %files devel -%{_bindir}/* %{_includedir}/* - -%files devel-docs -%{_datadir}/* +/usr/lib/cmake/PahoMqttCpp +%doc %{_docdir}/%{name}/samples/ +%doc %{_docdir}/%{name}/html/ %changelog +* Tue Dec 08 2020 Joshua Clayton - 1.1 +- Update and patch for 1.1 +- Put the html documenation into an appropriate paho-cpp directory +- instead of compiling the samples, put the cpp files in with documentation * Wed Oct 11 2017 Julien Courtat - 1.0.0 - Initial packaging diff --git a/dist/paho1.1_logremove.patch b/dist/paho1.1_logremove.patch new file mode 100644 index 00000000..9d820ab6 --- /dev/null +++ b/dist/paho1.1_logremove.patch @@ -0,0 +1,110 @@ +--- src/async_client.cpp.old 2020-11-13 12:13:30.694805240 -0700 ++++ src/async_client.cpp 2020-11-13 12:15:40.033041375 -0700 +@@ -35,25 +35,6 @@ + #endif + + ///////////////////////////////////////////////////////////////////////////// +-// Paho C logger +- +-enum LOG_LEVELS { +- INVALID_LEVEL = -1, +- TRACE_MAX = 1, +- TRACE_MED, +- TRACE_MIN, +- TRACE_PROTOCOL, +- LOG_PROTOCOL = TRACE_PROTOCOL, +- LOG_ERROR, +- LOG_SEVERE, +- LOG_FATAL, +-}; +- +-extern "C" { +- void Log(enum LOG_LEVELS, int, const char *, ...); +-} +- +-///////////////////////////////////////////////////////////////////////////// + + namespace mqtt { + +@@ -150,8 +131,6 @@ + // is notified of success on a normal connect with callbacks. + void async_client::on_connected(void* context, char* cause) + { +- ::Log(TRACE_MIN, -1, "[cpp] on_connected"); +- + if (context) { + async_client* cli = static_cast(context); + callback* cb = cli->userCallback_; +@@ -172,8 +151,6 @@ + // MQTTAsync_setCallbacks(). + void async_client::on_connection_lost(void *context, char *cause) + { +- ::Log(TRACE_MIN, -1, "[cpp] on_connection lost"); +- + if (context) { + async_client* cli = static_cast(context); + callback* cb = cli->userCallback_; +--- src/token.cpp.old 2020-11-13 12:14:59.155612309 -0700 ++++ src/token.cpp 2020-11-13 12:16:09.034371509 -0700 +@@ -24,25 +24,6 @@ + #include + + ///////////////////////////////////////////////////////////////////////////// +-// Paho C logger +- +-enum LOG_LEVELS { +- INVALID_LEVEL = -1, +- TRACE_MAX = 1, +- TRACE_MED, +- TRACE_MIN, +- TRACE_PROTOCOL, +- LOG_PROTOCOL = TRACE_PROTOCOL, +- LOG_ERROR, +- LOG_SEVERE, +- LOG_FATAL, +-}; +- +-extern "C" { +- void Log(enum LOG_LEVELS, int, const char *, ...); +-} +- +-///////////////////////////////////////////////////////////////////////////// + + namespace mqtt { + +@@ -110,8 +91,6 @@ + // + void token::on_success(MQTTAsync_successData* rsp) + { +- ::Log(TRACE_MIN, -1, "[cpp] on_success"); +- + unique_lock g(lock_); + iaction_listener* listener = listener_; + +@@ -154,8 +133,6 @@ + // + void token::on_success5(MQTTAsync_successData5* rsp) + { +- ::Log(TRACE_MIN, -1, "[cpp] on_success5"); +- + unique_lock g(lock_); + iaction_listener* listener = listener_; + if (rsp) { +@@ -197,8 +174,6 @@ + // + void token::on_failure(MQTTAsync_failureData* rsp) + { +- ::Log(TRACE_MIN, -1, "[cpp] on_failure"); +- + unique_lock g(lock_); + iaction_listener* listener = listener_; + if (rsp) { +@@ -230,8 +205,6 @@ + // + void token::on_failure5(MQTTAsync_failureData5* rsp) + { +- ::Log(TRACE_MIN, -1, "[cpp] on_failure5"); +- + unique_lock g(lock_); + iaction_listener* listener = listener_; + if (rsp) { From 7524e57438975584c12003badf55c0d4b756e4d5 Mon Sep 17 00:00:00 2001 From: Joshua Clayton Date: Tue, 25 May 2021 12:12:52 -0600 Subject: [PATCH 2/5] Update for version 1.2.0 Patch no longer needed to build. Dependency is now on paho-c v1.3.8, released at about the same time --- dist/paho-cpp.spec | 11 ++-- dist/paho1.1_logremove.patch | 110 ----------------------------------- 2 files changed, 6 insertions(+), 115 deletions(-) delete mode 100644 dist/paho1.1_logremove.patch diff --git a/dist/paho-cpp.spec b/dist/paho-cpp.spec index d1126e30..f7096063 100644 --- a/dist/paho-cpp.spec +++ b/dist/paho-cpp.spec @@ -1,11 +1,10 @@ Summary: MQTT CPP Client Name: paho-cpp -Version: 1.1 +Version: 1.2.0 Release: 1%{?dist} License: Eclipse Distribution License 1.0 and Eclipse Public License 1.0 Group: Development/Tools -Source: https://github.com/eclipse/paho.mqtt.cpp/archive/v-%{version}.tar.gz -Patch0: paho1.1_logremove.patch +Source: https://github.com/eclipse/paho.mqtt.cpp/archive/refs/tags/v-%{version}.tar.gz#/paho.mqtt.cpp-%{version}.tar.gz URL: https://eclipse.org/paho/clients/cpp/ BuildRequires: cmake3 BuildRequires: gcc @@ -14,7 +13,7 @@ BuildRequires: doxygen BuildRequires: openssl-devel BuildRequires: paho-c-devel Requires: openssl -Requires: paho-c >= 1.3.1 +Requires: paho-c >= 1.3.8 %description @@ -38,7 +37,7 @@ Group: Development/Libraries Development documentation files for the the Paho MQTT CPP Client. %prep -%autosetup -n paho.mqtt.cpp-%{version} -p0 1 +%autosetup -n paho.mqtt.cpp-%{version} %build mkdir build.paho.cpp && cd build.paho.cpp @@ -67,6 +66,8 @@ mv %{buildroot}%{_datadir}/doc/html %{buildroot}%{_datadir}/doc/%{name} %doc %{_docdir}/%{name}/html/ %changelog +* Fri Feb 26 2021 Joshua Clayton - 1.2.0 +- Update for version 1.2.0 * Tue Dec 08 2020 Joshua Clayton - 1.1 - Update and patch for 1.1 - Put the html documenation into an appropriate paho-cpp directory diff --git a/dist/paho1.1_logremove.patch b/dist/paho1.1_logremove.patch deleted file mode 100644 index 9d820ab6..00000000 --- a/dist/paho1.1_logremove.patch +++ /dev/null @@ -1,110 +0,0 @@ ---- src/async_client.cpp.old 2020-11-13 12:13:30.694805240 -0700 -+++ src/async_client.cpp 2020-11-13 12:15:40.033041375 -0700 -@@ -35,25 +35,6 @@ - #endif - - ///////////////////////////////////////////////////////////////////////////// --// Paho C logger -- --enum LOG_LEVELS { -- INVALID_LEVEL = -1, -- TRACE_MAX = 1, -- TRACE_MED, -- TRACE_MIN, -- TRACE_PROTOCOL, -- LOG_PROTOCOL = TRACE_PROTOCOL, -- LOG_ERROR, -- LOG_SEVERE, -- LOG_FATAL, --}; -- --extern "C" { -- void Log(enum LOG_LEVELS, int, const char *, ...); --} -- --///////////////////////////////////////////////////////////////////////////// - - namespace mqtt { - -@@ -150,8 +131,6 @@ - // is notified of success on a normal connect with callbacks. - void async_client::on_connected(void* context, char* cause) - { -- ::Log(TRACE_MIN, -1, "[cpp] on_connected"); -- - if (context) { - async_client* cli = static_cast(context); - callback* cb = cli->userCallback_; -@@ -172,8 +151,6 @@ - // MQTTAsync_setCallbacks(). - void async_client::on_connection_lost(void *context, char *cause) - { -- ::Log(TRACE_MIN, -1, "[cpp] on_connection lost"); -- - if (context) { - async_client* cli = static_cast(context); - callback* cb = cli->userCallback_; ---- src/token.cpp.old 2020-11-13 12:14:59.155612309 -0700 -+++ src/token.cpp 2020-11-13 12:16:09.034371509 -0700 -@@ -24,25 +24,6 @@ - #include - - ///////////////////////////////////////////////////////////////////////////// --// Paho C logger -- --enum LOG_LEVELS { -- INVALID_LEVEL = -1, -- TRACE_MAX = 1, -- TRACE_MED, -- TRACE_MIN, -- TRACE_PROTOCOL, -- LOG_PROTOCOL = TRACE_PROTOCOL, -- LOG_ERROR, -- LOG_SEVERE, -- LOG_FATAL, --}; -- --extern "C" { -- void Log(enum LOG_LEVELS, int, const char *, ...); --} -- --///////////////////////////////////////////////////////////////////////////// - - namespace mqtt { - -@@ -110,8 +91,6 @@ - // - void token::on_success(MQTTAsync_successData* rsp) - { -- ::Log(TRACE_MIN, -1, "[cpp] on_success"); -- - unique_lock g(lock_); - iaction_listener* listener = listener_; - -@@ -154,8 +133,6 @@ - // - void token::on_success5(MQTTAsync_successData5* rsp) - { -- ::Log(TRACE_MIN, -1, "[cpp] on_success5"); -- - unique_lock g(lock_); - iaction_listener* listener = listener_; - if (rsp) { -@@ -197,8 +174,6 @@ - // - void token::on_failure(MQTTAsync_failureData* rsp) - { -- ::Log(TRACE_MIN, -1, "[cpp] on_failure"); -- - unique_lock g(lock_); - iaction_listener* listener = listener_; - if (rsp) { -@@ -230,8 +205,6 @@ - // - void token::on_failure5(MQTTAsync_failureData5* rsp) - { -- ::Log(TRACE_MIN, -1, "[cpp] on_failure5"); -- - unique_lock g(lock_); - iaction_listener* listener = listener_; - if (rsp) { From e0df577b59d9ec8456b4f73dd21520f608d88dd2 Mon Sep 17 00:00:00 2001 From: Joshua Clayton Date: Tue, 1 Jun 2021 14:42:39 -0600 Subject: [PATCH 3/5] paho-cpp.spec: Fix many details for fedora consideration See https://bugzilla.redhat.com/show_bug.cgi?id=1964682 Use licence abbreviations BSD and EPL-1.0 Remove Group: descriptions (no longer used by fedora) BuildRequire g++ instead of just gcc Shorten the description below 80 characters Follow fedra guildelines for devel dependency Do not manually specify a cmake build directory Adjust lecences and %files as requested --- dist/paho-cpp.spec | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/dist/paho-cpp.spec b/dist/paho-cpp.spec index f7096063..4ce19624 100644 --- a/dist/paho-cpp.spec +++ b/dist/paho-cpp.spec @@ -2,12 +2,11 @@ Summary: MQTT CPP Client Name: paho-cpp Version: 1.2.0 Release: 1%{?dist} -License: Eclipse Distribution License 1.0 and Eclipse Public License 1.0 -Group: Development/Tools -Source: https://github.com/eclipse/paho.mqtt.cpp/archive/refs/tags/v-%{version}.tar.gz#/paho.mqtt.cpp-%{version}.tar.gz +License: BSD and EPL-1.0 +Source: https://github.com/eclipse/paho.mqtt.cpp/archive/v%{version}/%{name}-%{version}.tar.gz URL: https://eclipse.org/paho/clients/cpp/ BuildRequires: cmake3 -BuildRequires: gcc +BuildRequires: gcc-c++ BuildRequires: graphviz BuildRequires: doxygen BuildRequires: openssl-devel @@ -17,13 +16,12 @@ Requires: paho-c >= 1.3.8 %description -The Paho MQTT CPP Client is a fully fledged MQTT client written in ANSI standard C++ 11. +Paho MQTT CPP is a fully fledged MQTT client written in ANSI standard C++ 11. %package devel Summary: MQTT CPP Client development kit -Group: Development/Libraries -Requires: paho-cpp +Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Development files and samples for the the Paho MQTT CPP Client. @@ -31,7 +29,6 @@ Development files and samples for the the Paho MQTT CPP Client. %package devel-docs Summary: MQTT CPP Client development kit documentation -Group: Development/Libraries %description devel-docs Development documentation files for the the Paho MQTT CPP Client. @@ -40,37 +37,43 @@ Development documentation files for the the Paho MQTT CPP Client. %autosetup -n paho.mqtt.cpp-%{version} %build -mkdir build.paho.cpp && cd build.paho.cpp -%cmake -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_DOCUMENTATION=TRUE .. +%cmake -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_DOCUMENTATION=TRUE %cmake_build %install -pushd build.paho.cpp %cmake_install -popd -mkdir -p %{buildroot}%{_datadir}/doc/%{name}/samples/ +mkdir -p %{buildroot}%{_docdir}/%{name}/samples/ # put the samples into the documentation directory -cp -a src/samples/*.cpp %{buildroot}%{_datadir}/doc/%{name}/samples/ +cp -a src/samples/*.cpp %{buildroot}%{_docdir}/%{name}/samples/ # Put paho html docs in a paho subdirectory -mv %{buildroot}%{_datadir}/doc/html %{buildroot}%{_datadir}/doc/%{name} +mv %{buildroot}%{_docdir}/html %{buildroot}%{_docdir}/%{name}/html +mkdir -p %{buildroot}%{_libdir}/cmake +mv %{buildroot}/usr/lib/cmake/PahoMqttCpp %{buildroot}%{_libdir}/cmake %files -%doc edl-v10 epl-v10 -%{_libdir}/* +%license edl-v10 epl-v10 +%{_libdir}/libpaho-mqttpp3.so.* %files devel -%{_includedir}/* -/usr/lib/cmake/PahoMqttCpp -%doc %{_docdir}/%{name}/samples/ -%doc %{_docdir}/%{name}/html/ +%license edl-v10 epl-v10 +%{_includedir}/mqtt +%{_libdir}/libpaho-mqttpp3.so +%{_libdir}/cmake/PahoMqttCpp + +%files devel-docs +%doc CHANGELOG.md CONTRIBUTING.md README.md +%doc %{_docdir}/%{name} %changelog * Fri Feb 26 2021 Joshua Clayton - 1.2.0 - Update for version 1.2.0 +- Fix many details for inclusion in fedora + * Tue Dec 08 2020 Joshua Clayton - 1.1 - Update and patch for 1.1 - Put the html documenation into an appropriate paho-cpp directory - instead of compiling the samples, put the cpp files in with documentation + * Wed Oct 11 2017 Julien Courtat - 1.0.0 - Initial packaging From 9722edc3e26ca376608f9e0a570d2211424025bd Mon Sep 17 00:00:00 2001 From: Joshua Clayton Date: Thu, 3 Jun 2021 15:16:04 -0600 Subject: [PATCH 4/5] paho-ccp.spec: fixup cmake destination in %prep Moving the files still made rpmlint complain, so fix it up earlier --- dist/paho-cpp.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dist/paho-cpp.spec b/dist/paho-cpp.spec index 4ce19624..b37e74ac 100644 --- a/dist/paho-cpp.spec +++ b/dist/paho-cpp.spec @@ -35,6 +35,7 @@ Development documentation files for the the Paho MQTT CPP Client. %prep %autosetup -n paho.mqtt.cpp-%{version} +sed -i'' 's|lib/cmake|%{_lib}/cmake|' cmake/CMakeLists.txt %build %cmake -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_DOCUMENTATION=TRUE @@ -48,8 +49,6 @@ mkdir -p %{buildroot}%{_docdir}/%{name}/samples/ cp -a src/samples/*.cpp %{buildroot}%{_docdir}/%{name}/samples/ # Put paho html docs in a paho subdirectory mv %{buildroot}%{_docdir}/html %{buildroot}%{_docdir}/%{name}/html -mkdir -p %{buildroot}%{_libdir}/cmake -mv %{buildroot}/usr/lib/cmake/PahoMqttCpp %{buildroot}%{_libdir}/cmake %files %license edl-v10 epl-v10 From 87478d9b771080adf3b8b06a03aa42571570c841 Mon Sep 17 00:00:00 2001 From: Joshua Clayton Date: Thu, 3 Jun 2021 15:18:05 -0600 Subject: [PATCH 5/5] pho-cpp.spec: More corrections for fedora Make the major version explicit in the output correct the descriptions of where code samples went Make the devel-docs buildarch noach add the license files to the devel-docs package --- dist/paho-cpp.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dist/paho-cpp.spec b/dist/paho-cpp.spec index b37e74ac..11383c6c 100644 --- a/dist/paho-cpp.spec +++ b/dist/paho-cpp.spec @@ -24,14 +24,16 @@ Summary: MQTT CPP Client development kit Requires: %{name}%{?_isa} = %{version}-%{release} %description devel -Development files and samples for the the Paho MQTT CPP Client. +Development files for the the Paho MQTT CPP Client. %package devel-docs Summary: MQTT CPP Client development kit documentation +BuildArch: noarch %description devel-docs -Development documentation files for the the Paho MQTT CPP Client. +Development documentation and code samples for the the Paho MQTT CPP Client. + %prep %autosetup -n paho.mqtt.cpp-%{version} @@ -52,7 +54,7 @@ mv %{buildroot}%{_docdir}/html %{buildroot}%{_docdir}/%{name}/html %files %license edl-v10 epl-v10 -%{_libdir}/libpaho-mqttpp3.so.* +%{_libdir}/libpaho-mqttpp3.so.1* %files devel %license edl-v10 epl-v10 @@ -61,11 +63,12 @@ mv %{buildroot}%{_docdir}/html %{buildroot}%{_docdir}/%{name}/html %{_libdir}/cmake/PahoMqttCpp %files devel-docs +%license edl-v10 epl-v10 %doc CHANGELOG.md CONTRIBUTING.md README.md %doc %{_docdir}/%{name} %changelog -* Fri Feb 26 2021 Joshua Clayton - 1.2.0 +* Thu Jun 03 2021 Joshua Clayton - 1.2.0 - Update for version 1.2.0 - Fix many details for inclusion in fedora