--- ../fedora-cvs/qpidc/F-12/qpidc.spec	2009-12-04 15:16:27.987403493 +0100
+++ SPECS/qpid-cpp.spec	2010-02-08 16:45:24.000000000 +0100
@@ -1,33 +1,93 @@
 #
-# Spec file for Qpid C++ packages: qpidc, qpidc-devel, qpidd, qpidd-devel
-# svn revision: $Rev: 654927 $
+# Spec file for Qpid C++ packages: qpid-cpp-server*, qpid-cpp-client* and qmf
+# svn revision: $Rev$
 #
 
-%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%{!?ruby_sitelib: %define ruby_sitelib %(ruby -rrbconfig  -e 'puts Config::CONFIG["sitelibdir"]')}
-%{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"]')}
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%{!?ruby_sitelib: %global ruby_sitelib %(/usr/bin/ruby -rrbconfig  -e 'puts Config::CONFIG["sitelibdir"] ')}
+%{!?ruby_sitearch: %global ruby_sitearch %(/usr/bin/ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"] ')}
+
+# ===========
+# The following section controls which rpms are produced for which builds.
+# * To set the following flags, assign the value 1 for true; 0 for false.
+# * These two flags are mutually exclusive - ie they won't duplicate any packages.
+# RHEL-6:
+# * MRG_core is for building only RHEL-6 OS core components .
+# * MRG_non_core is for building only RHEL-6 MRG product components.
+# All other OSs (RHEL4/5/Fedora):
+# * The MRG product is entirely external to the OS.
+# * Set both MRG_core and MRG_non_core to true.
+%global MRG_core     1
+%global MRG_non_core 1
+
+# Release numbers
+%global qpid_release 0.6
+%global qpid_svnrev  895736
+%global store_svnrev 3795
+
+# Set fedora_lib_patch to 1 for Fedora builds that use so_number.patch
+%global fedora_lib_patch 1
+
+# Library current/revision/age
+%global libqpid_current       3
+%global libqpid_revision      0
+%global libqpid_age           0
+
+%global libqmf_current        1
+%global libqmf_revision       0
+%global libqmf_age            0
+
+%global libqmfengine_current  1
+%global libqmfengine_revision 0
+%global libqmfengine_age      1
+
+%global librdmawrap_current   0
+%global librdmawrap_revision  0
+%global librdmawrap_age       0
+
+# ===========
+
+# Note: if the mix is changed between MRG_core and MRG_non_core, then
+# the files that will be removed at the end of the install section will
+# need to be adjusted (moved from one section to the other).
+%global client            %{MRG_core}
+%global server            %{MRG_core}
+%global qmf               %{MRG_core}
+%global ruby_qmf          %{MRG_core}
+%global client_devel      %{MRG_core}
+%global client_devel_docs %{MRG_core}
+%global server_devel      %{MRG_core}
+%global qmf_devel         %{MRG_core}
+%global client_rdma       %{MRG_non_core}
+%global server_rdma       %{MRG_non_core}
+%global client_ssl        %{MRG_non_core}
+%global server_ssl        %{MRG_non_core}
+%global server_xml        %{MRG_non_core}
+%global server_cluster    %{MRG_non_core}
+%global server_store      %{MRG_non_core}
 
-%define qpid_svnrev 829175
-%define rhm_svnrev 3684
+%global name qpid-cpp
 
-Name:           qpidc
-Version:        0.5.%{qpid_svnrev}
+Name:           %{name}
+Version:        %{qpid_release}.%{qpid_svnrev}
 Release:        3%{?dist}
 Summary:        Libraries for Qpid C++ client applications
 Group:          System Environment/Libraries
 License:        ASL 2.0
 URL:            http://qpid.apache.org
 Source0:        %{name}-%{version}.tar.gz
-Source1:	rhm-0.5.%{rhm_svnrev}.tar.gz
-Source2:	qpidd.pp
-Patch0:		so_number.patch
-Patch1:		qmf.patch
-Patch2:		bz538355.patch
+Source1:        store-%{qpid_release}.%{store_svnrev}.tar.gz
+Source2:        qpidd.pp
+%if %{fedora_lib_patch}
+Patch0:         so_number.patch
+%endif
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+ExclusiveArch:  i586 i686 x86_64
 
 BuildRequires: boost-devel
+BuildRequires: boost-program-options
+BuildRequires: boost-filesystem
 BuildRequires: doxygen
-BuildRequires: e2fsprogs-devel
 BuildRequires: libuuid-devel
 BuildRequires: libtool
 BuildRequires: pkgconfig
@@ -47,208 +107,484 @@
 BuildRequires: corosynclib-devel >= 1.0.0-1
 BuildRequires: clusterlib-devel >= 3.0.0-20
 BuildRequires: swig
-
-%ifarch i686 x86_64
-#RHM
+%ifarch i386 i586 i686 x86_64
 BuildRequires: db4-devel
 BuildRequires: libaio-devel
-#/RHM
 %endif
 
+%description
+
+Run-time libraries for AMQP client applications developed using Qpid
+C++. Clients exchange messages with an AMQP message broker using
+the AMQP protocol.
+
+# === Package: qpid-cpp-client ===
+
+%if %{client}
+
+%package -n %{name}-client
+Summary: Libraries for Qpid C++ client applications
 Requires: boost
+Obsoletes: qpidc
+Provides: qpidc
 
 Requires(post):/sbin/chkconfig
 Requires(preun):/sbin/chkconfig
 Requires(preun):/sbin/service
 Requires(postun):/sbin/service
+Requires(postun):/sbin/ldconfig
 
-%description
+%description -n %{name}-client
 Run-time libraries for AMQP client applications developed using Qpid
 C++. Clients exchange messages with an AMQP message broker using
 the AMQP protocol.
 
-%package devel
-Summary: Header files and documentation for developing Qpid C++ clients
+%files -n %{name}-client
+%defattr(-,root,root,-)
+%doc cpp/LICENSE cpp/NOTICE cpp/README cpp/INSTALL cpp/RELEASE_NOTES cpp/DESIGN
+%_libdir/libqpidcommon.so.%{libqpid_current}
+%_libdir/libqpidcommon.so.%{libqpid_current}.%{libqpid_revision}.%{libqpid_age}
+%_libdir/libqpidclient.so.%{libqpid_current}
+%_libdir/libqpidclient.so.%{libqpid_current}.%{libqpid_revision}.%{libqpid_age}
+%dir %_libdir/qpid
+%dir %_libdir/qpid/client
+%dir %_sysconfdir/qpid
+%config(noreplace) %_sysconfdir/qpid/qpidc.conf
+
+%post -n %{name}-client -p /sbin/ldconfig
+
+%postun -n %{name}-client -p /sbin/ldconfig
+
+%endif
+
+# === Package: qpid-cpp-client-devel ===
+
+%if %{client_devel}
+
+%package -n %{name}-client-devel
+Summary: Header files, documentation and testing tools for developing Qpid C++ clients
 Group: Development/System
-Requires: %name = %version-%release
+Requires: %{name}-client = %version-%release
 Requires: boost-devel
+Requires: boost-program-options
+Requires: boost-filesystem
 Requires: e2fsprogs-devel
 Requires: libuuid-devel
 Requires: python
+Obsoletes: qpidc-devel
+Provides: qpidc-devel
+Obsoletes: qpidc-perftest
+Provides: qpidc-perftest
 
-%description devel
+%description -n %{name}-client-devel
 Libraries, header files and documentation for developing AMQP clients
 in C++ using Qpid.  Qpid implements the AMQP messaging specification.
 
-%package devel-docs
+%files -n %{name}-client-devel
+%defattr(-,root,root,-)
+%dir %_includedir/qpid
+%_includedir/qpid/*.h
+%_includedir/qpid/amqp_0_10
+%_includedir/qpid/client
+%_includedir/qpid/console
+%_includedir/qpid/framing
+%_includedir/qpid/sys
+%_includedir/qpid/log
+%_includedir/qpid/management
+%_includedir/qpid/messaging
+%_includedir/qpid/agent
+%_includedir/qmf
+%_libdir/libqpidcommon.so
+%_libdir/libqpidclient.so
+%_datadir/qpidc/examples
+%defattr(755,root,root,-)
+%_bindir/perftest
+%_bindir/topic_listener
+%_bindir/topic_publisher
+%_bindir/latencytest
+%_bindir/client_test
+%_bindir/txtest
+
+%endif
+
+# === Package: qpid-cpp-client-devel-docs ===
+
+%if %{client_devel_docs}
+
+%package -n %{name}-client-devel-docs
 Summary: AMQP client development documentation
 Group: Documentation
 BuildArch: noarch
+Obsoletes: qpidc-devel-docs
+Provides: qpidc-devel-docs
 
-%description devel-docs
+%description -n %{name}-client-devel-docs
 This package includes the AMQP clients development documentation in HTML
 format for easy browsing.
 
-%package -n qpidd
+%files -n %{name}-client-devel-docs
+%defattr(-,root,root,-)
+%doc cpp/docs/api/html
+
+%endif
+
+# === Package: qpid-cpp-server ===
+
+%if %{server}
+
+%package -n %{name}-server
 Summary: An AMQP message broker daemon
 Group: System Environment/Daemons
-Requires: %name = %version-%release
+Requires: %{name}-client = %version-%release
 Requires: cyrus-sasl
 Requires(post): policycoreutils
 Requires(post): selinux-policy-minimum
 Requires(post): /usr/sbin/semodule
 Requires(postun): /usr/sbin/semodule
+Obsoletes: qpidd
+Provides: qpidd
+Obsoletes: qpidd-acl
+Provides: qpidd-acl
 
-%description -n qpidd
+%description -n %{name}-server
 A message broker daemon that receives stores and routes messages using
 the open AMQP messaging protocol.
 
-%package -n qpidd-devel
+%files -n %{name}-server
+%defattr(-,root,root,-)
+%_datadir/selinux/packages/qpidd.pp
+%_libdir/libqpidbroker.so.%{libqpid_current}
+%_libdir/libqpidbroker.so.%{libqpid_current}.%{libqpid_revision}.%{libqpid_age}
+%_libdir/qpid/daemon/replicating_listener.so
+%_libdir/qpid/daemon/replication_exchange.so
+%_libdir/qpid/daemon/watchdog.so
+%_sbindir/qpidd
+%_libexecdir/qpid/qpidd_watchdog
+%config(noreplace) %_sysconfdir/qpidd.conf
+%config(noreplace) %_sysconfdir/sasl2/qpidd.conf
+%{_initrddir}/qpidd
+%dir %_libdir/qpid/daemon
+%_libdir/qpid/daemon/acl.so
+%attr(755, qpidd, qpidd) %_localstatedir/lib/qpidd
+%attr(755, qpidd, qpidd) /var/run/qpidd
+%attr(600, qpidd, qpidd) %config(noreplace) %_localstatedir/lib/qpidd/qpidd.sasldb
+%doc %_mandir/man1/qpidd.*
+
+%pre -n %{name}-server
+getent group qpidd >/dev/null || groupadd -r qpidd
+getent passwd qpidd >/dev/null || \
+  useradd -r -M -g qpidd -d %{_localstatedir}/lib/qpidd -s /sbin/nologin \
+    -c "Owner of Qpidd Daemons" qpidd
+exit 0
+
+%post -n %{name}-server
+# This adds the proper /etc/rc*.d links for the script
+/sbin/chkconfig --add qpidd
+/sbin/ldconfig
+/usr/sbin/semodule -i %_datadir/selinux/packages/qpidd.pp
+
+%preun -n %{name}-server
+# Check that this is actual deinstallation, not just removing for upgrade.
+if [ $1 = 0 ]; then
+        /sbin/service qpidd stop >/dev/null 2>&1 || :
+        /sbin/chkconfig --del qpidd
+fi
+
+%postun -n %{name}-server
+if [ "$1" -ge "1" ]; then
+        /sbin/service qpidd condrestart >/dev/null 2>&1 || :
+fi
+/sbin/ldconfig
+/usr/sbin/semodule -r qpidd
+
+%endif
+
+# === Package: qpid-cpp-server-devel ===
+
+%if %{server_devel}
+
+%package -n %{name}-server-devel
 Summary: Libraries and header files for developing Qpid broker extensions
 Group: Development/System
-Requires: %name-devel = %version-%release
-Requires: qpidd = %version-%release
+Requires: %{name}-client-devel = %version-%release
+Requires: %{name}-server = %version-%release
 Requires: boost-devel
+Requires: boost-program-options
+Requires: boost-filesystem
+Obsoletes: qpidd-devel
+Provides: qpidd-devel
 
-%description -n qpidd-devel
+%description -n %{name}-server-devel
 Libraries and header files for developing extensions to the
 Qpid broker daemon.
 
+%files -n %{name}-server-devel
+%defattr(-,root,root,-)
+%defattr(-,root,root,-)
+%_libdir/libqpidbroker.so
+%_includedir/qpid/broker
+
+%endif
+
+# === Package: qmf ===
+
+%if %{qmf}
+
 %package -n qmf
 Summary: The QPID Management Framework
 Group: System Environment/Daemons
-Requires: %name = %version-%release
+Requires: %{name}-client = %version-%release
 
 %description -n qmf
 An extensible managememt framework layered on QPID messaging.
 
+%files -n qmf
+%defattr(-,root,root,-)
+%_libdir/libqmf.so.%{libqmf_current}
+%_libdir/libqmf.so.%{libqmf_current}.%{libqmf_revision}.%{libqmf_age}
+%_libdir/libqmfengine.so.%{libqmfengine_current}
+%_libdir/libqmfengine.so.%{libqmfengine_current}.%{libqmfengine_revision}.%{libqmfengine_age}
+%_libdir/libqmfconsole.so.%{libqpid_current}
+%_libdir/libqmfconsole.so.%{libqpid_current}.%{libqpid_revision}.%{libqpid_age}
+
+%post -n qmf -p /sbin/ldconfig
+
+%postun -n qmf -p /sbin/ldconfig
+
+%endif
+
+# === Package: qmf-devel ===
+
+%if %{qmf_devel}
+
 %package -n qmf-devel
 Summary: Header files and tools for developing QMF extensions
 Group: Development/System
 Requires: qmf = %version-%release
-Requires: %name-devel = %version-%release
+Requires: %{name}-client-devel = %version-%release
 
 %description -n qmf-devel
 Header files and code-generation tools needed for developers of QMF-managed
 components.
 
+%files -n qmf-devel
+%defattr(-,root,root,-)
+%_libdir/libqmf.so
+%_libdir/libqmfengine.so
+%_libdir/libqmfconsole.so
+%_bindir/qmf-gen
+%{python_sitelib}/qmfgen
+
+%endif
+
+# === Package: ruby-qmf ===
+
+%if %{ruby_qmf}
+
 %package -n ruby-qmf
 Summary: The QPID Management Framework bindings for ruby
 Group: System Environment/Libraries
-Requires: %name = %version-%release
+Requires: %{name}-client = %version-%release
 
 %description -n ruby-qmf
 An extensible managememt framework layered on QPID messaging, bindings
 for ruby.
 
-%package -n qpidd-acl
-Summary: ACL based security for the Qpid daemon
-Group: System Environment/Libraries
-Requires: qpidd = %version-%release
+%files -n ruby-qmf
+%defattr(-,root,root,-)
+%{ruby_sitelib}/qmf.rb
+%{ruby_sitearch}/qmfengine.so
+
+%endif
 
-%description -n qpidd-acl
-A Qpid daemon plugin to support ACL-based access control.
+# === Package: qpid-cpp-client-rdma ===
 
-%package rdma
+%if %{client_rdma}
+
+%package -n %{name}-client-rdma
 Summary: RDMA Protocol support (including Infiniband) for Qpid clients
 Group: System Environment/Libraries
-Requires: %name = %version-%release
+Requires: %{name}-client = %version-%release
+Obsoletes: qpidc-rdma
+Provides: qpidc-rdma
 
-%description rdma
+%description -n %{name}-client-rdma
 A client plugin and support library to support RDMA protocols (including
 Infiniband) as the transport for Qpid messaging.
 
-%package -n qpidd-rdma
+%files -n %{name}-client-rdma
+%defattr(-,root,root,-)
+%_libdir/librdmawrap.so.%{librdmawrap_current}
+%_libdir/librdmawrap.so.%{librdmawrap_current}.%{librdmawrap_revision}.%{librdmawrap_age}
+%_libdir/qpid/client/rdmaconnector.so
+%config(noreplace) %_sysconfdir/qpid/qpidc.conf
+
+%post -n %{name}-client-rdma -p /sbin/ldconfig
+
+%postun -n %{name}-client-rdma -p /sbin/ldconfig
+
+%endif
+
+# === Package: qpid-cpp-server-rdma ===
+
+%if %{server_rdma}
+
+%package -n %{name}-server-rdma
 Summary: RDMA Protocol support (including Infiniband) for the Qpid daemon
 Group: System Environment/Libraries
-Requires: qpidd = %version-%release
-Requires: %name-rdma = %version-%release
+Requires: %{name}-server = %version-%release
+Requires: %{name}-client-rdma = %version-%release
+Obsoletes: qpidd-rdma
+Provides: qpidd-rdma
 
-%description -n qpidd-rdma
+%description -n %{name}-server-rdma
 A Qpid daemon plugin to support RDMA protocols (including Infiniband) as the
 transport for AMQP messaging.
 
-%package ssl
+%files -n %{name}-server-rdma
+%defattr(-,root,root,-)
+%_libdir/qpid/daemon/rdma.so
+
+%endif
+
+# === Package: qpid-cpp-client-ssl ===
+
+%if %{client_ssl}
+
+%package -n %{name}-client-ssl
 Summary: SSL support for Qpid clients
 Group: System Environment/Libraries
-Requires: %name = %version-%release
+Requires: %{name}-client = %version-%release
+Obsoletes: qpidc-ssl
+Provides: qpidc-ssl
 
-%description ssl
+%description -n %{name}-client-ssl
 A client plugin and support library to support SSL as the transport
 for Qpid messaging.
 
-%package -n qpidd-ssl
+%files -n %{name}-client-ssl
+%defattr(-,root,root,-)
+%_libdir/libsslcommon.so.%{libqpid_current}
+%_libdir/libsslcommon.so.%{libqpid_current}.%{libqpid_revision}.%{libqpid_age}
+%_libdir/qpid/client/sslconnector.so
+
+%post -n %{name}-client-ssl -p /sbin/ldconfig
+
+%postun -n %{name}-client-ssl -p /sbin/ldconfig
+
+%endif
+
+# === Package: qpid-cpp-server-ssl ===
+
+%if %{server_ssl}
+
+%package -n %{name}-server-ssl
 Summary: SSL support for the Qpid daemon
 Group: System Environment/Libraries
-Requires: qpidd = %version-%release
-Requires: %name-ssl = %version-%release
+Requires: %{name}-server = %version-%release
+Requires: %{name}-client-ssl = %version-%release
+Obsoletes: qpidd-ssl
+Provides: qpidd-ssl
 
-%description -n qpidd-ssl
+%description -n %{name}-server-ssl
 A Qpid daemon plugin to support SSL as the transport for AMQP
 messaging.
 
-%package -n qpidd-xml
+%files -n %{name}-server-ssl
+%defattr(-,root,root,-)
+%_libdir/qpid/daemon/ssl.so
+
+%endif
+
+# === Package: qpid-cpp-server-xml ===
+
+%if %{server_xml}
+
+%package -n %{name}-server-xml
 Summary: XML extensions for the Qpid daemon
 Group: System Environment/Libraries
-Requires: qpidd = %version-%release
+Requires: %{name}-server = %version-%release
 Requires: xqilla
 Requires: xerces-c
+Obsoletes: qpidd-xml
+Provides: qpidd-xml
 
-%description -n qpidd-xml
+%description -n %{name}-server-xml
 A Qpid daemon plugin to support extended XML-based routing of AMQP
 messages.
 
-%package -n qpidd-cluster
+%files -n %{name}-server-xml
+%defattr(-,root,root,-)
+%_libdir/qpid/daemon/xml.so
+
+%endif
+
+# === Package: qpid-cpp-server-cluster ===
+
+%if %{server_cluster}
+
+%package -n %{name}-server-cluster
 Summary: Cluster support for the Qpid daemon
 Group: System Environment/Daemons
-Requires: qpidd = %version-%release
-Requires: qpidc = %version-%release
+Requires: %{name}-server = %version-%release
+Requires: %{name}-client = %version-%release
 Requires: corosync >= 1.0.0-1
 Requires: clusterlib >= 3.0.0-20
+Obsoletes: qpidd-cluster
+Provides: qpidd-cluster
 
-%description -n qpidd-cluster
-A Qpid daemon plugin enabling broker clustering using openais
+%description -n %{name}-server-cluster
+A Qpid daemon plugin enabling broker clustering using corosync
 
-%package perftest
-Summary: Simple benchmarking tools
-Group: System Environment/Tools
-Requires: qpidc = %version-%release
+%files -n %{name}-server-cluster
+%defattr(-,root,root,-)
+%_libdir/qpid/daemon/cluster.so
 
-%description perftest
-Tools for performing testing and benchmarking of MRG-Messaging
 
-%ifarch i686 x86_64
-#RHM
-%package -n rhm-cpp-server-store
+%endif
+
+# === Package: qpid-cpp-server-store ===
+
+%if %{server_store}
+%ifarch i386 i586 i686 x86_64
+
+%package -n %{name}-server-store
 Summary: Red Hat persistence extension to the Qpid messaging system
 Group: System Environment/Libraries
-Requires: qpidd = 0.5.%{qpid_svnrev}
+License: LGPL 2.0
+Requires: %{name}-server = %{qpid_release}.%{qpid_svnrev}
 Requires: db4
 Requires: libaio
 Obsoletes: rhm
+Provides: rhm
 
-%description -n rhm-cpp-server-store
+%description -n %{name}-server-store
 Red Hat persistence extension to the Qpid AMQP broker: persistent message
 storage using either a libaio-based asynchronous journal, or synchronously
 with Berkeley DB.
-#/RHM
+
+%files -n %{name}-server-store
+%defattr(-,root,root,-)
+%doc ../store-%{qpid_release}.%{store_svnrev}/README 
+%_libdir/qpid/daemon/msgstore.so*
+%_libexecdir/qpid/jrnl.py*
+%_libexecdir/qpid/resize
+%_libexecdir/qpid/store_chk
+
+%attr(0775,qpidd,qpidd) %dir %_localstatedir/rhm
+
+%endif
 %endif
 
-%pre -n qpidd
-getent group qpidd >/dev/null || groupadd -r qpidd
-getent passwd qpidd >/dev/null || \
-  useradd -r -M -g qpidd -d %{_localstatedir}/lib/qpidd -s /sbin/nologin \
-    -c "Owner of Qpidd Daemons" qpidd
-exit 0
+# ===
 
 %prep
-%setup
-%setup -T -D -b 1
+%setup -q -n %{name}-%{version}
+%setup -q -T -D -b 1 -n %{name}-%{version}
+%if %{fedora_lib_patch}
 %patch0
-%patch1
-%patch2
-
-%define perftests "perftest topic_listener topic_publisher latencytest client_test txtest"
+%endif
+%global perftests "perftest topic_listener topic_publisher latencytest client_test txtest"
 
 install -d selinux
 install %{SOURCE2} selinux
@@ -268,16 +604,14 @@
 popd
 popd
 
-%ifarch i686 x86_64
-#RHM
-pushd ../rhm-0.5.%{rhm_svnrev}
+%ifarch i386 i586 i686 x86_64
+pushd ../store-%{qpid_release}.%{store_svnrev}
 export CXXFLAGS="%{optflags} -DNDEBUG" 
 ./bootstrap
 %configure --disable-static --disable-rpath --disable-dependency-tracking --with-qpid-checkout=%{_builddir}/%{name}-%{version}
 make dist
 make #%{?_smp_mflags}
 popd
-#/RHM
 %endif
 
 %install
@@ -287,7 +621,7 @@
 make install DESTDIR=%{buildroot}
 install -Dp -m0755 etc/qpidd %{buildroot}%{_initrddir}/qpidd
 install -d -m0755 %{buildroot}%{_localstatedir}/lib/qpidd
-install -d -m0755 %{buildroot}%{_libdir}/qpidd
+install -d -m0755 %{buildroot}%_libdir/qpidd
 install -d -m0755 %{buildroot}/var/run/qpidd
 # Install perftest utilities
 pushd src/tests/
@@ -320,19 +654,91 @@
 rm -f %{buildroot}%{ruby_sitearch}/qmfengine.la
 popd
 
-%ifarch i686 x86_64
-#RHM
-pushd %{_builddir}/rhm-0.5.%{rhm_svnrev}
+%ifarch i386 i586 i686 x86_64
+pushd %{_builddir}/store-%{qpid_release}.%{store_svnrev}
 make install DESTDIR=%{buildroot}
 install -d -m0775 %{buildroot}%{_localstatedir}/rhm
-install -d -m0755 %{buildroot}%{_libdir}/qpid/daemon
+install -d -m0755 %{buildroot}%_libdir/qpid/daemon
 rm -f %{buildroot}%_libdir/qpid/daemon/*.a
 rm -f %{buildroot}%_libdir/qpid/daemon/*.la
 rm -f %{buildroot}%_libdir/*.a
 rm -f %{buildroot}%_libdir/*.la
-rm %{buildroot}%_sysconfdir/rhmd.conf
+rm -f %{buildroot}%_sysconfdir/rhmd.conf
 popd
-#/RHM
+%endif
+
+%if ! %{MRG_core}
+rm -f  %{buildroot}%_sysconfdir/qpidd.conf
+rm -f  %{buildroot}%_sysconfdir/rc.d/init.d/qpidd
+rm -f  %{buildroot}%_sysconfdir/sasl2/qpidd.conf
+rm -f %{buildroot}%{ruby_sitelib}/qmf.rb
+rm -f  %{buildroot}%_libdir/libqmf.so.*
+rm -f  %{buildroot}%_libdir/libqmfconsole.so.*
+rm -f  %{buildroot}%_libdir/libqmfengine.so.*
+rm -f  %{buildroot}%_libdir/libqpidbroker.so.*
+rm -f  %{buildroot}%_libdir/libqpidclient.so.*
+rm -f  %{buildroot}%_libdir/libqpidcommon.so.*
+rm -f  %{buildroot}%_libdir/qpid/daemon/acl.so
+rm -f  %{buildroot}%_libdir/qpid/daemon/replicating_listener.so
+rm -f  %{buildroot}%_libdir/qpid/daemon/replication_exchange.so
+rm -f  %{buildroot}%_libdir/qpid/daemon/watchdog.so
+rm -f  %{buildroot}%{ruby_sitearch}/qmfengine.so
+rm -f  %{buildroot}%_libexecdir/qpid/qpidd_watchdog
+rm -f  %{buildroot}%_sbindir/qpidd
+rm -f  %{buildroot}%_datadir/man/man1/qpidd.1
+rm -f  %{buildroot}%_datadir/selinux/packages/qpidd.pp
+rm -f  %{buildroot}%_localstatedir/lib/qpidd/qpidd.sasldb
+# The following should be removed when -devel becomes part of non-core:
+rm -rf %{buildroot}%_includedir/qmf
+rm -rf %{buildroot}%_includedir/qpid
+rm -rf %{buildroot}%_datadir/qpidc/examples
+rm -rf %{buildroot}%{python_sitelib}/qmfgen
+rm -f  %{buildroot}%_bindir/perftest
+rm -f  %{buildroot}%_bindir/topic_listener
+rm -f  %{buildroot}%_bindir/topic_publisher
+rm -f  %{buildroot}%_bindir/latencytest
+rm -f  %{buildroot}%_bindir/client_test
+rm -f  %{buildroot}%_bindir/txtest
+rm -f  %{buildroot}%_bindir/qmf-gen
+rm -f  %{buildroot}%_libdir/libqmf.so
+rm -f  %{buildroot}%_libdir/libqmfconsole.so
+rm -f  %{buildroot}%_libdir/libqmfengine.so
+rm -f  %{buildroot}%_libdir/libqpidbroker.so
+rm -f  %{buildroot}%_libdir/libqpidclient.so
+rm -f  %{buildroot}%_libdir/libqpidcommon.so
+%endif
+
+%if ! %{MRG_non_core}
+# The following should be uncommented when -devel becomes a part of non-core:
+#rm -rf %{buildroot}%_includedir/qmf
+#rm -rf %{buildroot}%_includedir/qpid
+#rm -rf %{buildroot}%_datadir/qpidc/examples
+#rm -rf %{buildroot}%{python_sitelib}/qmfgen
+#rm -f  %{buildroot}%_bindir/perftest
+#rm -f  %{buildroot}%_bindir/topic_listener
+#rm -f  %{buildroot}%_bindir/topic_publisher
+#rm -f  %{buildroot}%_bindir/latencytest
+#rm -f  %{buildroot}%_bindir/client_test
+#rm -f  %{buildroot}%_bindir/txtest
+#rm -f  %{buildroot}%_bindir/qmf-gen
+#rm -f  %{buildroot}%_libdir/libqmf.so
+#rm -f  %{buildroot}%_libdir/libqmfconsole.so
+#rm -f  %{buildroot}%_libdir/libqmfengine.so
+#rm -f  %{buildroot}%_libdir/libqpidbroker.so
+#rm -f  %{buildroot}%_libdir/libqpidclient.so
+#rm -f  %{buildroot}%_libdir/libqpidcommon.so
+rm -f  %{buildroot}%_libdir/librdmawrap.so.*
+rm -f  %{buildroot}%_libdir/libsslcommon.so.*
+rm -f  %{buildroot}%_libdir/qpid/client/rdmaconnector.so
+rm -f  %{buildroot}%_libdir/qpid/client/sslconnector.so
+rm -f  %{buildroot}%_libdir/qpid/daemon/cluster.so
+rm -f  %{buildroot}%_libdir/qpid/daemon/msgstore.so
+rm -f  %{buildroot}%_libdir/qpid/daemon/rdma.so
+rm -f  %{buildroot}%_libdir/qpid/daemon/ssl.so
+rm -f  %{buildroot}%_libdir/qpid/daemon/xml.so
+rm -f  %{buildroot}%_libexecdir/qpid/jrnl.py
+rm -f  %{buildroot}%_libexecdir/qpid/resize
+rm -f  %{buildroot}%_libexecdir/qpid/store_chk
 %endif
 
 %clean
@@ -346,194 +752,55 @@
 #LANG=C ECHO=echo make check
 #popd
 
-%ifarch i686 x86_64
+%ifarch i386 i586 i686 x86_64
 #RHM
-#pushd %{_builddir}/rhm-0.5.%{rhm_svnrev}
+#pushd %{_builddir}/store-%{qpid_release}.%{store_svnrev}
 #make check
 #popd
 #/RHM
 %endif
 
-%files
-%defattr(-,root,root,-)
-%doc cpp/LICENSE cpp/NOTICE cpp/README cpp/INSTALL cpp/RELEASE_NOTES cpp/DESIGN
-%_libdir/libqpidcommon.so.3
-%_libdir/libqpidcommon.so.3.0.0
-%_libdir/libqpidclient.so.3
-%_libdir/libqpidclient.so.3.0.0
-%dir %_libdir/qpid
-%dir %_libdir/qpid/client
-%dir %_sysconfdir/qpid
-%config(noreplace) %_sysconfdir/qpid/qpidc.conf
-
-%files devel
-%defattr(-,root,root,-)
-%dir %_includedir/qpid
-%_includedir/qpid/*.h
-%_includedir/qpid/amqp_0_10
-%_includedir/qpid/client
-%_includedir/qpid/console
-%_includedir/qpid/framing
-%_includedir/qpid/sys
-%_includedir/qpid/log
-%_includedir/qpid/management
-%_includedir/qpid/messaging
-%_includedir/qpid/agent
-%_includedir/qmf
-%_libdir/libqpidcommon.so
-%_libdir/libqpidclient.so
-%_datadir/qpidc/examples
-
-%files -n qpidd
-%defattr(-,root,root,-)
-%_datadir/selinux/packages/qpidd.pp
-%_libdir/libqpidbroker.so.3
-%_libdir/libqpidbroker.so.3.0.0
-%_libdir/qpid/daemon/replicating_listener.so
-%_libdir/qpid/daemon/replication_exchange.so
-%_libdir/qpid/daemon/watchdog.so
-%_sbindir/qpidd
-%_libexecdir/qpid/qpidd_watchdog
-%config(noreplace) %_sysconfdir/qpidd.conf
-%config(noreplace) %_sysconfdir/sasl2/qpidd.conf
-%{_initrddir}/qpidd
-%dir %_libdir/qpid/daemon
-%attr(755, qpidd, qpidd) %_localstatedir/lib/qpidd
-%attr(755, qpidd, qpidd) /var/run/qpidd
-%attr(600, qpidd, qpidd) %config(noreplace) %_localstatedir/lib/qpidd/qpidd.sasldb
-%doc %_mandir/man1/qpidd.*
-
-%files -n qpidd-devel
-%defattr(-,root,root,-)
-%defattr(-,root,root,-)
-%_libdir/libqpidbroker.so
-%_includedir/qpid/broker
-
-%files -n qmf
-%defattr(-,root,root,-)
-%_libdir/libqmf.so.1
-%_libdir/libqmf.so.1.0.0
-%_libdir/libqmfengine.so.1
-%_libdir/libqmfengine.so.1.0.1
-%_libdir/libqmfconsole.so.3
-%_libdir/libqmfconsole.so.3.0.0
-
-%files -n qmf-devel
-%defattr(-,root,root,-)
-%_libdir/libqmf.so
-%_libdir/libqmfengine.so
-%_libdir/libqmfconsole.so
-%_bindir/qmf-gen
-%{python_sitelib}/qmfgen
-
-%files -n ruby-qmf
-%defattr(-,root,root,-)
-%{ruby_sitelib}/qmf.rb
-%{ruby_sitearch}/qmfengine.so
-
-%files -n qpidd-acl
-%defattr(-,root,root,-)
-%_libdir/qpid/daemon/acl.so
-
-%files rdma
-%defattr(-,root,root,-)
-%_libdir/librdmawrap.so.0
-%_libdir/librdmawrap.so.0.0.0
-%_libdir/qpid/client/rdmaconnector.so
-%config(noreplace) %_sysconfdir/qpid/qpidc.conf
-
-%files -n qpidd-rdma
-%defattr(-,root,root,-)
-%_libdir/qpid/daemon/rdma.so
-
-%files ssl
-%defattr(-,root,root,-)
-%_libdir/libsslcommon.so.3
-%_libdir/libsslcommon.so.3.0.0
-%_libdir/qpid/client/sslconnector.so
-
-%files -n qpidd-ssl
-%defattr(-,root,root,-)
-%_libdir/qpid/daemon/ssl.so
-
-%files -n qpidd-xml
-%defattr(-,root,root,-)
-%_libdir/qpid/daemon/xml.so
-
-%files -n qpidd-cluster
-%defattr(-,root,root,-)
-%_libdir/qpid/daemon/cluster.so
-
-%files perftest
-%defattr(755,root,root,-)
-%_bindir/perftest
-%_bindir/topic_listener
-%_bindir/topic_publisher
-%_bindir/latencytest
-%_bindir/client_test
-%_bindir/txtest
-
-%files devel-docs
-%defattr(-,root,root,-)
-%doc cpp/docs/api/html
-
-%ifarch i686 x86_64
-%files -n rhm-cpp-server-store
-%defattr(-,root,root,-)
-%doc ../rhm-0.5.%{rhm_svnrev}/README 
-%{_libdir}/qpid/daemon/msgstore.so*
-%attr(0775,qpidd,qpidd) %dir %_localstatedir/rhm
-%endif
-
 %post -p /sbin/ldconfig
 
 %postun -p /sbin/ldconfig
 
-%post -n qpidd
-# This adds the proper /etc/rc*.d links for the script
-/sbin/chkconfig --add qpidd
-/sbin/ldconfig
-/usr/sbin/semodule -i %_datadir/selinux/packages/qpidd.pp
-
-%preun -n qpidd
-# Check that this is actual deinstallation, not just removing for upgrade.
-if [ $1 = 0 ]; then
-        /sbin/service qpidd stop >/dev/null 2>&1 || :
-        /sbin/chkconfig --del qpidd
-fi
-
-%postun -n qpidd
-if [ "$1" -ge "1" ]; then
-        /sbin/service qpidd condrestart >/dev/null 2>&1 || :
-fi
-/sbin/ldconfig
-
-/usr/sbin/semodule -r qpidd
-
-%post rdma -p /sbin/ldconfig
-
-%postun rdma -p /sbin/ldconfig
-
-%post ssl -p /sbin/ldconfig
-
-%postun ssl -p /sbin/ldconfig
-
-%post -n qmf -p /sbin/ldconfig
-
-%postun -n qmf -p /sbin/ldconfig
-
 %changelog
-* Wed Dec  2 2009 Nuno Santos <nsantos@redhat.com> - 0.5.829175-3
-- Patch for BZ538355
-
-* Tue Nov  3 2009 Nuno Santos <nsantos@redhat.com> - 0.5.829175-2
-- Add patch for qmf fixes
-
-* Fri Oct 23 2009 Nuno Santos <nsantos@redhat.com> - 0.5.829175-1
-- Rebased to svn rev 829175
+* Thu Jan 14 2010 Kim van der Riet <kim.vdriet@redhat.com> - 0.6.895736-3
+- Related: rhbz#554415
+  Moved the -devel and -devel-docs into MRG_core for initial RHEL-6
+  release.
+
+* Thu Jan 14 2010 Kim van der Riet <kim.vdriet@redhat.com> - 0.6.895736-3
+- Related: rhbz#554415
+  Parametized lib revision numbers and Fedora patches, updated files that
+  need to be removed.
+
+* Wed Jan 13 2010 Kim van der Riet <kim.vdriet@redhat.com> - 0.6.895736-3
+- Related: rhbz#554415
+  removed a remaining patch0 tag
+
+* Wed Jan 13 2010 Kim van der Riet <kim.vdriet@redhat.com> - 0.6.895736-3
+- Related: rhbz#554415
+  Removed so_number.patch (used in Fedora, but not needed for RHEL)
+
+* Wed Jan 13 2010 Kim van der Riet <kim.vdriet@redhat.com> - 0.6.895736-2
+- Related: rhbz#554415
+  Changed architecture flags from BuildArchitectures: to ExclusiveArch:
+
+* Wed Jan 13 2010 Kim van der Riet <kim.vdriet@redhat.com> - 0.6.895736-1
+- Related: rhbz#554415
+  Limited builds to i686 and x86_64 archs.
+  Rebased qpid to r.895736 (qpid 0.6 branch) and store to r.3795
+
+* Tue Jan 12 2010 Kim van der Riet <kim.vdriet@redhat.com> - 0.5.819892-3
+- qpid-cpp: Add qpid-cpp package to RHEL-6 (rhbz#554415)
+  Related: rhbz#554415
+  Copied from rawhide and split project into core and non-core parts:
+  core:     The RHEL-6 core components distributed with the base OS
+  non-core: The remaining MRG components that make up the subscription product.
 
-* Thu Oct 15 2009 Nuno Santos <nsantos@redhat.com> - 0.5.825677-1
-- Rebased to svn rev 825677
+* Tue Oct 27 2009 Nuno Santos <nsantos@redhat.com> - 0.5.819819-2
+- Renaming of subpackages as per http://fedoraproject.org/wiki/Features/ImprovedQpidCppPackaging
 
 * Tue Sep 29 2009 Nuno Santos <nsantos@redhat.com> - 0.5.819819-1
 - Rebased to svn rev 819819 for F12 beta
