[qpid-cpp] Changed qpid-cpp-server-ha to use systemd macros for pre/post/postun

Darryl L. Pierce mcpierce at fedoraproject.org
Wed May 7 18:56:30 UTC 2014


commit aec5c4656564f288ac40624c19f871068c34748e
Author: Darryl L. Pierce <mcpierce at gmail.com>
Date:   Wed May 7 14:56:42 2014 -0400

    Changed qpid-cpp-server-ha to use systemd macros for pre/post/postun
    
    - Resoves: BZ#1094928

 ...JIRA-qpidd.service-file-for-use-on-Fedora.patch |    6 +-
 ...ix-for-recovery-ambiguity-issue-other-cod.patch |    6 +-
 ...rovide-the-right-Perl-packages-in-top-lev.patch |    6 +-
 ...ix-Ruby-Perl-bindings-when-built-with-Wer.patch |    6 +-
 ...pdated-Ruby-bindings-to-build-under-CMake.patch |   61 ++++++++++++++++++++
 0006-QPID-5718-Dead-code-in-the-HA-codebase.patch  |   42 +++++++++++++
 0007-NO-JIRA-Remove-dead-code.patch                |   52 +++++++++++++++++
 ...-NO-JIRA-Bumped-max-Proton-version-to-0.7.patch |   25 ++++++++
 qpid-cpp.spec                                      |   49 ++++++++--------
 9 files changed, 217 insertions(+), 36 deletions(-)
---
diff --git a/0001-NO-JIRA-qpidd.service-file-for-use-on-Fedora.patch b/0001-NO-JIRA-qpidd.service-file-for-use-on-Fedora.patch
index f636fad..17f4119 100644
--- a/0001-NO-JIRA-qpidd.service-file-for-use-on-Fedora.patch
+++ b/0001-NO-JIRA-qpidd.service-file-for-use-on-Fedora.patch
@@ -1,7 +1,7 @@
-From 3f1ab5d5984c5f3ce25a4dace8a7546a2b618df1 Mon Sep 17 00:00:00 2001
+From 99c3da2bad54d640348b9c81c78ff160cc8c1d6e Mon Sep 17 00:00:00 2001
 From: "Darryl L. Pierce" <mcpierce at gmail.com>
 Date: Wed, 3 Apr 2013 10:07:37 -0400
-Subject: [PATCH 1/4] NO-JIRA: qpidd.service file for use on Fedora
+Subject: [PATCH 1/7] NO-JIRA: qpidd.service file for use on Fedora
 
 This patch provides the needed systemd file for running the Qpid broker
 as a service.
@@ -54,5 +54,5 @@ index 0000000..10a99d1
 +[Install]
 +WantedBy=multi-user.target
 -- 
-1.8.5.3
+1.9.0
 
diff --git a/0002-QPID-4984-Fix-for-recovery-ambiguity-issue-other-cod.patch b/0002-QPID-4984-Fix-for-recovery-ambiguity-issue-other-cod.patch
index 2182af3..8088996 100644
--- a/0002-QPID-4984-Fix-for-recovery-ambiguity-issue-other-cod.patch
+++ b/0002-QPID-4984-Fix-for-recovery-ambiguity-issue-other-cod.patch
@@ -1,7 +1,7 @@
-From af5030f948bdf5aba098c5ce137811ff97c436ea Mon Sep 17 00:00:00 2001
+From 184351d948031671743f25b2df365a8256201324 Mon Sep 17 00:00:00 2001
 From: kpvdr <kpvdr at 13f79535-47bb-0310-9956-ffa450edef68>
 Date: Thu, 14 Nov 2013 20:39:32 +0000
-Subject: [PATCH 2/4] QPID-4984: Fix for recovery ambiguity issue, other code
+Subject: [PATCH 2/7] QPID-4984: Fix for recovery ambiguity issue, other code
  tidy-ups
 
 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1542066 13f79535-47bb-0310-9956-ffa450edef68
@@ -5359,5 +5359,5 @@ index 6b455fe..0278317 100644
 +
 +#endif // ifndef QPID_LINEARSTORE_JOURNAL_WMGR_H
 -- 
-1.8.5.3
+1.9.0
 
diff --git a/0003-QPID-5556-Provide-the-right-Perl-packages-in-top-lev.patch b/0003-QPID-5556-Provide-the-right-Perl-packages-in-top-lev.patch
index 0a075f0..be5319f 100644
--- a/0003-QPID-5556-Provide-the-right-Perl-packages-in-top-lev.patch
+++ b/0003-QPID-5556-Provide-the-right-Perl-packages-in-top-lev.patch
@@ -1,7 +1,7 @@
-From c78029b46b7bc5142b679084f0b93f65fd68fa86 Mon Sep 17 00:00:00 2001
+From db995bb9af85ff1fcbef61b92ecfa9415552c079 Mon Sep 17 00:00:00 2001
 From: "Darryl L. Pierce" <mcpierce at apache.org>
 Date: Mon, 17 Feb 2014 22:03:13 +0000
-Subject: [PATCH 3/4] QPID-5556: Provide the right Perl packages in top-level
+Subject: [PATCH 3/7] QPID-5556: Provide the right Perl packages in top-level
  modules.
 
 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1569117 13f79535-47bb-0310-9956-ffa450edef68
@@ -35,5 +35,5 @@ index 524bbaa..2948748 100644
  
  __END__
 -- 
-1.8.5.3
+1.9.0
 
diff --git a/0004-QPID-5499-Fix-Ruby-Perl-bindings-when-built-with-Wer.patch b/0004-QPID-5499-Fix-Ruby-Perl-bindings-when-built-with-Wer.patch
index 2b05500..5a2aae0 100644
--- a/0004-QPID-5499-Fix-Ruby-Perl-bindings-when-built-with-Wer.patch
+++ b/0004-QPID-5499-Fix-Ruby-Perl-bindings-when-built-with-Wer.patch
@@ -1,7 +1,7 @@
-From 0855e2c108d2dc0b0514c585890da96a092218ce Mon Sep 17 00:00:00 2001
+From bf274f3b6c6fa7ef2dccb2fefa0101850e20d3d6 Mon Sep 17 00:00:00 2001
 From: "Darryl L. Pierce" <mcpierce at apache.org>
 Date: Fri, 7 Feb 2014 13:44:03 +0000
-Subject: [PATCH 4/4] QPID-5499: Fix Ruby/Perl bindings when built with
+Subject: [PATCH 4/7] QPID-5499: Fix Ruby/Perl bindings when built with
  -Werror=format-security
 
 Changed the swig descriptors so that they use a constant format string.
@@ -180,5 +180,5 @@ index 1a07cc8..4e07088 100644
  
          return result;
 -- 
-1.8.5.3
+1.9.0
 
diff --git a/0005-QPID-5656-Updated-Ruby-bindings-to-build-under-CMake.patch b/0005-QPID-5656-Updated-Ruby-bindings-to-build-under-CMake.patch
new file mode 100644
index 0000000..9dbfe06
--- /dev/null
+++ b/0005-QPID-5656-Updated-Ruby-bindings-to-build-under-CMake.patch
@@ -0,0 +1,61 @@
+From 8f699f70262d6acb919fc3db2e83930d9f271db4 Mon Sep 17 00:00:00 2001
+From: "Darryl L. Pierce" <dpierce at redhat.com>
+Date: Tue, 1 Apr 2014 16:12:48 -0400
+Subject: [PATCH 5/7] QPID-5656: Updated Ruby bindings to build under CMake 3.0
+
+CMake 3.0 has reverted to the CMake 2.6 naming for libraries. prepending
+"lib" to only the Ruby library names.
+---
+ qpid/cpp/bindings/qmf2/ruby/CMakeLists.txt | 6 ++++--
+ qpid/cpp/bindings/qpid/ruby/CMakeLists.txt | 6 ++++--
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/qpid/cpp/bindings/qmf2/ruby/CMakeLists.txt b/qpid/cpp/bindings/qmf2/ruby/CMakeLists.txt
+index 4ea61ab..19fe4bf 100644
+--- a/qpid/cpp/bindings/qmf2/ruby/CMakeLists.txt
++++ b/qpid/cpp/bindings/qmf2/ruby/CMakeLists.txt
+@@ -36,7 +36,8 @@ swig_link_libraries(cqmf2_ruby qmf2 ${RUBY_LIBRARY})
+ ##----------------------------------
+ ## Install the complete Ruby binding
+ ##----------------------------------
+-if ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
++if ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8) OR
++    (${CMAKE_MAJOR_VERSION} EQUAL 3))
+   install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cqmf2_ruby.so
+         RENAME cqmf2.so
+         DESTINATION ${RUBY_PFX_ARCH_DIR}
+@@ -48,5 +49,6 @@ else()
+         DESTINATION ${RUBY_PFX_ARCH_DIR}
+         COMPONENT ${QPID_COMPONENT_CLIENT}
+         )
+-endif ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
++endif ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8) OR
++       (${CMAKE_MAJOR_VERSION} EQUAL 2))
+ 
+diff --git a/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt b/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt
+index 60c6044..f40af7a 100644
+--- a/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt
++++ b/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt
+@@ -51,7 +51,8 @@ set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_F
+ ##----------------------------------
+ ## Install the complete Ruby binding
+ ##----------------------------------
+-if ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
++if ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8) OR
++    (${CMAKE_MAJOR_VERSION} EQUAL 3))
+   install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cqpid_ruby.so
+         RENAME cqpid.so
+         DESTINATION ${RUBY_PFX_ARCH_DIR}
+@@ -63,7 +64,8 @@ else()
+         DESTINATION ${RUBY_PFX_ARCH_DIR}
+         COMPONENT ${QPID_COMPONENT_CLIENT}
+         )
+-endif ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
++endif ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8) OR 
++       (${CMAKE_MAJOR_VERSION} EQUAL 3))
+ 
+ add_custom_command(OUTPUT ${GEM_BINDINGS_SOURCE_FILE}
+                    COMMAND cp ${swig_generated_file_fullname} ${GEM_BINDINGS_SOURCE_FILE}
+-- 
+1.9.0
+
diff --git a/0006-QPID-5718-Dead-code-in-the-HA-codebase.patch b/0006-QPID-5718-Dead-code-in-the-HA-codebase.patch
new file mode 100644
index 0000000..668b9c0
--- /dev/null
+++ b/0006-QPID-5718-Dead-code-in-the-HA-codebase.patch
@@ -0,0 +1,42 @@
+From e145459c41b9433dacda655f5b4c5c907a67c45e Mon Sep 17 00:00:00 2001
+From: Alan Conway <aconway at apache.org>
+Date: Wed, 23 Apr 2014 14:45:13 +0000
+Subject: [PATCH 6/7] QPID-5718: Dead code in the HA codebase
+
+Removed: std::ostream& operator<<(std::ostream& o, const QueueSetPrinter& qp)
+Already gone: void collectQueueReplicators(const boost::shared_ptr<Exchange>& ex, set<boost::shared_ptr<QueueReplicator> >& collect)
+
+git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1589431 13f79535-47bb-0310-9956-ffa450edef68
+---
+ qpid/cpp/src/qpid/ha/RemoteBackup.cpp | 15 ---------------
+ 1 file changed, 15 deletions(-)
+
+diff --git a/qpid/cpp/src/qpid/ha/RemoteBackup.cpp b/qpid/cpp/src/qpid/ha/RemoteBackup.cpp
+index 0993c6e..2f4c179 100644
+--- a/qpid/cpp/src/qpid/ha/RemoteBackup.cpp
++++ b/qpid/cpp/src/qpid/ha/RemoteBackup.cpp
+@@ -84,21 +84,6 @@ RemoteBackup::GuardPtr RemoteBackup::guard(const QueuePtr& q) {
+     return guard;
+ }
+ 
+-namespace {
+-typedef std::set<boost::shared_ptr<broker::Queue> > QS;
+-struct QueueSetPrinter {
+-    const QS& qs;
+-    std::string prefix;
+-    QueueSetPrinter(const std::string& p, const QS& q) : qs(q), prefix(p) {}
+-};
+-std::ostream& operator<<(std::ostream& o, const QueueSetPrinter& qp) {
+-    if (!qp.qs.empty()) o << qp.prefix;
+-    for (QS::const_iterator i = qp.qs.begin(); i != qp.qs.end(); ++i)
+-        o << (*i)->getName() << " ";
+-    return o;
+-}
+-}
+-
+ void RemoteBackup::ready(const QueuePtr& q) {
+     catchupQueues.erase(q);
+     if (catchupQueues.size()) {
+-- 
+1.9.0
+
diff --git a/0007-NO-JIRA-Remove-dead-code.patch b/0007-NO-JIRA-Remove-dead-code.patch
new file mode 100644
index 0000000..faf1a31
--- /dev/null
+++ b/0007-NO-JIRA-Remove-dead-code.patch
@@ -0,0 +1,52 @@
+From ea0895579d5e877638f30d866e78ad48f422f116 Mon Sep 17 00:00:00 2001
+From: "Darryl L. Pierce" <dpierce at redhat.com>
+Date: Wed, 23 Apr 2014 15:28:09 -0400
+Subject: [PATCH] NO-JIRA: Remove dead code
+
+---
+ qpid/cpp/src/qpid/ha/BrokerReplicator.cpp          | 10 ----------
+ qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp |  7 -------
+ 2 files changed, 17 deletions(-)
+
+diff --git a/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp b/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp
+index 5e8da17..27a6916 100644
+--- a/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp
++++ b/qpid/cpp/src/qpid/ha/BrokerReplicator.cpp
+@@ -329,16 +329,6 @@ void BrokerReplicator::initialize() {
+ 
+ BrokerReplicator::~BrokerReplicator() {}
+ 
+-namespace {
+-void collectQueueReplicators(
+-    const boost::shared_ptr<Exchange>& ex,
+-    set<boost::shared_ptr<QueueReplicator> >& collect)
+-{
+-    boost::shared_ptr<QueueReplicator> qr(boost::dynamic_pointer_cast<QueueReplicator>(ex));
+-    if (qr) collect.insert(qr);
+-}
+-} // namespace
+-
+ void BrokerReplicator::shutdown() {
+     // NOTE: this is called in a QMF dispatch thread, not the Link's connection
+     // thread.  It's OK to be unlocked because it doesn't use any mutable state,
+diff --git a/qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp b/qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp
+index 5595d52..5973709 100644
+--- a/qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp
++++ b/qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp
+@@ -135,13 +135,6 @@ uint64_t getFilterDescriptor(const std::string& key)
+ {
+     return hasWildcards(key) ? qpid::amqp::filters::LEGACY_TOPIC_FILTER_CODE : qpid::amqp::filters::LEGACY_DIRECT_FILTER_CODE;
+ }
+-bool contains(const Variant::List& list, const std::string& item)
+-{
+-    for (Variant::List::const_iterator i = list.begin(); i != list.end(); ++i) {
+-        if (*i == item) return true;
+-    }
+-    return false;
+-}
+ 
+ bool test(const Variant::Map& options, const std::string& name)
+ {
+-- 
+1.9.0
+
diff --git a/0008-NO-JIRA-Bumped-max-Proton-version-to-0.7.patch b/0008-NO-JIRA-Bumped-max-Proton-version-to-0.7.patch
new file mode 100644
index 0000000..0bdf6e5
--- /dev/null
+++ b/0008-NO-JIRA-Bumped-max-Proton-version-to-0.7.patch
@@ -0,0 +1,25 @@
+From ef10d201870b630b2d148b1a0e351adb53bcaf47 Mon Sep 17 00:00:00 2001
+From: "Darryl L. Pierce" <dpierce at redhat.com>
+Date: Wed, 7 May 2014 07:42:15 -0400
+Subject: [PATCH] NO-JIRA: Bumped max Proton version to 0.7
+
+---
+ qpid/cpp/src/amqp.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/qpid/cpp/src/amqp.cmake b/qpid/cpp/src/amqp.cmake
+index 14b660d..b4870bd 100644
+--- a/qpid/cpp/src/amqp.cmake
++++ b/qpid/cpp/src/amqp.cmake
+@@ -48,7 +48,7 @@ endif()
+ 
+ set (amqp_default ${amqp_force})
+ set (minimum_version 0.5)
+-set (maximum_version 0.6)
++set (maximum_version 0.7)
+ if (PROTON_FOUND)
+     if (PROTON_VERSION LESS ${minimum_version})
+         message(STATUS "Qpid proton ${PROTON_VERSION} is too old, require ${minimum_version} - ${maximum_version}; amqp 1.0 support not enabled")
+-- 
+1.9.0
+
diff --git a/qpid-cpp.spec b/qpid-cpp.spec
index fdca963..45d8902 100644
--- a/qpid-cpp.spec
+++ b/qpid-cpp.spec
@@ -3,16 +3,20 @@
 
 Name:          qpid-cpp
 Version:       0.26
-Release:       2%{?dist}
+Release:       3%{?dist}
 Summary:       Libraries for Qpid C++ client applications
 License:       ASL 2.0
 URL:           http://qpid.apache.org
 
 Source0:       http://www.apache.org/dist/qpid/%{version}/qpid-%{version}.tar.gz
-Patch1: 0001-NO-JIRA-qpidd.service-file-for-use-on-Fedora.patch
-Patch2: 0002-QPID-4984-Fix-for-recovery-ambiguity-issue-other-cod.patch
-Patch3: 0003-QPID-5556-Provide-the-right-Perl-packages-in-top-lev.patch
-Patch4: 0004-QPID-5499-Fix-Ruby-Perl-bindings-when-built-with-Wer.patch
+Patch01: 0001-NO-JIRA-qpidd.service-file-for-use-on-Fedora.patch
+Patch02: 0002-QPID-4984-Fix-for-recovery-ambiguity-issue-other-cod.patch
+Patch03: 0003-QPID-5556-Provide-the-right-Perl-packages-in-top-lev.patch
+Patch04: 0004-QPID-5499-Fix-Ruby-Perl-bindings-when-built-with-Wer.patch
+Patch05: 0005-QPID-5656-Updated-Ruby-bindings-to-build-under-CMake.patch
+Patch06: 0006-QPID-5718-Dead-code-in-the-HA-codebase.patch
+Patch07: 0007-NO-JIRA-Remove-dead-code.patch
+Patch08: 0008-NO-JIRA-Bumped-max-Proton-version-to-0.7.patch
 
 BuildRequires: gcc-c++
 BuildRequires: cmake
@@ -209,7 +213,7 @@ exit 0
 %systemd_preun qpidd.service
 
 %postun server
-%systemd_postun qpidd.service
+%systemd_postun_with_restart qpidd.service
 /sbin/ldconfig
 
 # === qpid-cpp-server-ha
@@ -234,24 +238,13 @@ Requires(postun): systemd-units
 
 %post server-ha
 /sbin/ldconfig
-if [ $1 -eq 1 ]; then
-    # Initial installation
-    /bin/systemctl --no-reload enable qpidd-primary.service >/dev/null 2>&1 || :
-fi
+%systemd_post qpidd-primary.service
 
 %preun server-ha
-if [ $1 -eq 0 ]; then
-    # Package removal, not upgrade
-    /bin/systemctl --no-reload disable qpidd-primary.service > /dev/null 2>&1 || :
-    /bin/systemctl stop qpidd-primary.service > /dev/null 2>&1 || :
-fi
+%systemd_preun qpidd-primary.service
 
 %postun server-ha
-if [ $1 -ge 1 ]; then
-    # Package upgrade, not uninstall
-    /bin/systemctl stop qpidd-primary.service > /dev/null 2>&1 || :
-    /bin/systemctl start qpidd-primary.service > /dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart qpidd-primary.service
 /sbin/ldconfig
 
 # === qpid-cpp-client-rdma
@@ -388,10 +381,14 @@ Management and diagnostic tools for Apache Qpid brokers and clients.
 %prep
 %setup -q -n qpid-%{version}
 
-%patch1 -p2
-%patch2 -p2
-%patch3 -p2
-%patch4 -p2
+%patch01 -p2
+%patch02 -p2
+%patch03 -p2
+%patch04 -p2
+%patch05 -p2
+%patch06 -p2
+%patch07 -p2
+%patch08 -p2
 
 %global perftests "qpid-perftest qpid-topic-listener qpid-topic-publisher qpid-latency-test qpid-client-test qpid-txtest"
 
@@ -487,6 +484,10 @@ rm -rf %{buildroot}/usr/local/%{_lib}/ruby/site_ruby
 
 
 %changelog
+* Wed May  7 2014 Darryl L. Pierce <dpierce at redhat.com> - 0.26-3
+- Changed qpid-cpp-server-ha to use systemd macros for pre/post/postun
+- Resoves: BZ#1094928
+
 * Fri Feb 21 2014 Darryl L. Pierce <dpierce at redhat.com> - 0.26-2
 - QPID-5499: Fix for building with -Werror=format-security enabled.
 - * This was previously for files include in qpid-cpp-client-devel.


More information about the scm-commits mailing list