Browse Source

2015-02-28 Ryoichi INAGAKI <ryo1@toki.waseda.jp>

	* corosync, pacemaker, resoure-agents: updated
	* libqb, perl-Net-IAMP-Simple-SSL: new
	


git-svn-id: http://trac.vinelinux.org/repos/projects/specs@9394 ec354946-7b23-47d6-9f5a-488ba84defc7
inagaki 9 years ago
parent
commit
1997a3dc01

+ 217 - 116
c/corosync/corosync-vl.spec

@@ -1,56 +1,157 @@
+# Conditionals
+# Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
+# to disable or enable specific features
+%bcond_with testagents
+%bcond_with watchdog
+%bcond_with monitoring
+%bcond_without snmp
+%bcond_without dbus
+# no InfiniBand stack on s390(x)
+#ifnarch s390 s390x
+%bcond_with    rdma
+#endif
+%bcond_with    systemd
+%bcond_without upstart
+%bcond_without xmlconf
+%bcond_without runautogen
+
 Name: corosync
 Summary: The Corosync Cluster Engine and Application Programming Interfaces
-Summary(ja): Corosyncクラスタエンジンおよびアプリケーションプログラミングインタフェース
-Version: 1.4.3
+Summary(ja): Corosync クラスタエンジン及びその API
+Version: 2.3.4
 Release: 1%{?_dist_release}
 License: BSD
 Group: System Environment/Base
-URL: http://ftp.corosync.org
-Source0: ftp://ftp:downloads@ftp.corosync.org/downloads/%{name}-%{version}/%{name}-%{version}.tar.gz
+URL: http://www.corosync.org/
+
+Source0: http://corosync.org/download/%{name}-%{version}.tar.gz
+
+ExclusiveArch: i686 x86_64
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+# Build bits
+BuildRequires: groff
+BuildRequires: libqb-devel >= 0.14.2
+BuildRequires: nss-devel
+%if %{with runautogen}
+BuildRequires: autoconf automake libtool
+%endif
+%if %{with monitoring}
+BuildRequires: libstatgrab-devel
+%endif
+%if %{with rdma}
+BuildRequires: libibverbs-devel librdmacm-devel
+%endif
+%if %{with snmp}
+BuildRequires: net-snmp-devel
+%endif
+%if %{with dbus}
+BuildRequires: dbus-devel
+%endif
+%if %{with systemd}
+BuildRequires: systemd-units
+Requires(post): systemd
+Requires(preun): systemd
+Requires(postun): systemd
+%endif
+%if %{with xmlconf}
+Requires: libxslt
+%endif
 
 # Runtime bits
 Requires: corosynclib = %{version}-%{release}
-Requires(pre): shadow-utils
-Requires(post): chkconfig
-Requires(preun): chkconfig
+Requires(pre): /usr/sbin/useradd
+Requires(post): /sbin/chkconfig
+Requires(preun): /sbin/chkconfig
+Obsoletes: openais, openais-devel, openaislib, openaislib-devel
+Obsoletes: cman, clusterlib, clusterlib-devel
 
-# Build bits
+%description
+This package contains the Corosync Cluster Engine Executive, several default
+APIs and libraries, default configuration files, and an init script.
 
-%define buildtrunk 0
-%{?_with_buildtrunk: %define buildtrunk 1}
-%define enablerdma 0
-%{?_with_rdma: %define enablerdma 1}
+# optional testagent rpm
+#
+%if %{with testagents}
+%package -n corosync-testagents
+Summary: The Corosync Cluster Engine Test Agents
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: libqb >= 0.14.2
 
-%if %{buildtrunk}
-BuildRequires: autoconf automake
-%endif
-BuildRequires: nss-devel
-%if %{enablerdma}
-BuildRequires: libibverbs-devel librdmacm-devel
+%description -n corosync-testagents
+This package contains corosync test agents.
 %endif
 
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+# library
+#
+%package -n corosynclib
+Summary: The Corosync Cluster Engine Libraries
+Summary(ja): Corosync クラスタエンジンのライブラリ
+Group: System Environment/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description -n corosynclib
+This package contains corosync libraries.
+
+%package -n corosynclib-devel
+Summary: The Corosync Cluster Engine Development Kit
+Summary(ja): Corosync クラスタエンジン開発キット
+Group: Development/Libraries
+Requires: corosynclib = %{version}-%{release}
+Requires: pkgconfig
+Provides: corosync-devel = %{version}
+Obsoletes: corosync-devel < 0.92-7
+
+%description -n corosynclib-devel
+This package contains include files and man pages used to develop using
+The Corosync Cluster Engine APIs.
+
 
 %prep
 %setup -q -n %{name}-%{version}
 
 %build
-%if %{buildtrunk}
+%if %{with runautogen}
 ./autogen.sh
 %endif
 
-%if %{enablerdma}
-export ibverbs_CFLAGS=-I/usr/include/infiniband \
+%if %{with rdma}
+export ibverbs_CFLAGS=-I%{_includedir}/infiniband \
 export ibverbs_LIBS=-libverbs \
-export rdmacm_CFLAGS=-I/usr/include/rdma \
+export rdmacm_CFLAGS=-I%{_includedir}/rdma \
 export rdmacm_LIBS=-lrdmacm \
 %endif
 %{configure} \
-	--enable-nss \
-%if %{enablerdma}
+%if %{with testagents}
+	--enable-testagents \
+%endif
+%if %{with watchdog}
+	--enable-watchdog \
+%endif
+%if %{with monitoring}
+	--enable-monitoring \
+%endif
+%if %{with snmp}
+	--enable-snmp \
+%endif
+%if %{with dbus}
+	--enable-dbus \
+%endif
+%if %{with rdma}
 	--enable-rdma \
 %endif
-	--with-initddir=%{_initrddir}
+%if %{with systemd}
+	--enable-systemd \
+%endif
+%if %{with upstart}
+	--enable-upstart \
+%endif
+%if %{with xmlconf}
+	--enable-xmlconf \
+%endif
+	--with-initddir=%{_initrddir} \
+	--with-systemddir=%{_unitdir} \
+	--with-upstartdir=%{_sysconfdir}/init
 
 make %{_smp_mflags}
 
@@ -59,182 +160,182 @@ rm -rf %{buildroot}
 
 make install DESTDIR=%{buildroot}
 
+%if %{with dbus}
+mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
+install -m 644 %{_builddir}/%{name}-%{version}%{?gittarver}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
+%endif
+
 ## tree fixup
 # drop static libs
 rm -f %{buildroot}%{_libdir}/*.a
+rm -f %{buildroot}%{_libdir}/*.la
 # drop docs and html docs for now
 rm -rf %{buildroot}%{_docdir}/*
+# /etc/sysconfig/corosync-notifyd
+mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
+install -m 644 tools/corosync-notifyd.sysconfig.example \
+   %{buildroot}%{_sysconfdir}/sysconfig/corosync-notifyd
+# /etc/sysconfig/corosync
+install -m 644 init/corosync.sysconfig.example \
+   %{buildroot}%{_sysconfdir}/sysconfig/corosync
 
 %clean
 rm -rf %{buildroot}
 
-%description
-This package contains the Corosync Cluster Engine Executive, several default
-APIs and libraries, default configuration files, and an init script.
-
 %post
+%if %{with systemd} && 0%{?systemd_post:1}
+%systemd_post corosync.service
+%else
 if [ $1 -eq 1 ]; then
 	/sbin/chkconfig --add corosync || :
 fi
+%endif
 
 %preun
+%if %{with systemd} && 0%{?systemd_preun:1}
+%systemd_preun corosync.service
+%else
 if [ $1 -eq 0 ]; then
 	/sbin/service corosync stop &>/dev/null || :
 	/sbin/chkconfig --del corosync || :
 fi
+%endif
+
+%postun
+%if %{with systemd} && 0%{?systemd_postun:1}
+%systemd_postun
+%endif
+
+%post -n corosynclib -p /sbin/ldconfig
+
+%postun -n corosynclib -p /sbin/ldconfig
 
 %files
 %defattr(-,root,root,-)
 %doc LICENSE SECURITY
-%{_bindir}/corosync-blackbox
 %{_sbindir}/corosync
 %{_sbindir}/corosync-keygen
-%{_sbindir}/corosync-objctl
+%{_sbindir}/corosync-cmapctl
 %{_sbindir}/corosync-cfgtool
-%{_sbindir}/corosync-fplay
-%{_sbindir}/corosync-pload
 %{_sbindir}/corosync-cpgtool
 %{_sbindir}/corosync-quorumtool
 %{_sbindir}/corosync-notifyd
+%{_bindir}/corosync-blackbox
+%if %{with xmlconf}
+%{_bindir}/corosync-xmlproc
+%config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example
+%dir %{_datadir}/corosync
+%{_datadir}/corosync/xml2conf.xsl
+%{_mandir}/man8/corosync-xmlproc.8*
+%{_mandir}/man5/corosync.xml.5*
+%endif
 %dir %{_sysconfdir}/corosync
-%dir %{_sysconfdir}/corosync/service.d
 %dir %{_sysconfdir}/corosync/uidgid.d
 %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
 %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
+%config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd
+%config(noreplace) %{_sysconfdir}/sysconfig/corosync
+%if %{with dbus}
+%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
+%endif
+%if %{with snmp}
+%{_datadir}/snmp/mibs/COROSYNC-MIB.txt
+%endif
+%if %{with systemd}
+%{_unitdir}/corosync.service
+%{_unitdir}/corosync-notifyd.service
+%dir %{_datadir}/corosync
+%{_datadir}/corosync/corosync
+%{_datadir}/corosync/corosync-notifyd
+%else
 %{_initrddir}/corosync
 %{_initrddir}/corosync-notifyd
-%dir %{_libexecdir}/lcrso
-%{_libexecdir}/lcrso/coroparse.lcrso
-%{_libexecdir}/lcrso/objdb.lcrso
-%{_libexecdir}/lcrso/service_cfg.lcrso
-%{_libexecdir}/lcrso/service_cpg.lcrso
-%{_libexecdir}/lcrso/service_evs.lcrso
-%{_libexecdir}/lcrso/service_confdb.lcrso
-%{_libexecdir}/lcrso/service_pload.lcrso
-%{_libexecdir}/lcrso/quorum_votequorum.lcrso
-%{_libexecdir}/lcrso/quorum_testquorum.lcrso
-%{_libexecdir}/lcrso/vsf_quorum.lcrso
-%{_libexecdir}/lcrso/vsf_ykd.lcrso
+%endif
+%if %{with upstart}
+%{_sysconfdir}/init/corosync.conf
+%{_sysconfdir}/init/corosync-notifyd.conf
+%endif
 %dir %{_localstatedir}/lib/corosync
 %dir %{_localstatedir}/log/cluster
 %{_mandir}/man8/corosync_overview.8*
 %{_mandir}/man8/corosync.8*
 %{_mandir}/man8/corosync-blackbox.8*
-%{_mandir}/man8/corosync-objctl.8*
+%{_mandir}/man8/corosync-cmapctl.8*
 %{_mandir}/man8/corosync-keygen.8*
 %{_mandir}/man8/corosync-cfgtool.8*
 %{_mandir}/man8/corosync-cpgtool.8*
-%{_mandir}/man8/corosync-fplay.8*
-%{_mandir}/man8/corosync-pload.8*
-%{_mandir}/man8/corosync-quorumtool.8*
 %{_mandir}/man8/corosync-notifyd.8*
+%{_mandir}/man8/corosync-quorumtool.8*
 %{_mandir}/man5/corosync.conf.5*
-
-%package -n corosynclib
-Summary: The Corosync Cluster Engine Libraries
-Summary(ja): The Corosync Cluster Engine Libraries
-Group: System Environment/Libraries
-Requires: %{name} = %{version}-%{release}
-
-%description -n corosynclib
-This package contains corosync libraries.
+%{_mandir}/man5/votequorum.5*
+%{_mandir}/man8/cmap_keys.8*
+
+%if %{with testagents}
+%files -n corosync-testagents
+%defattr(755,root,root,-)
+%{_datadir}/corosync/tests/mem_leak_test.sh
+%{_datadir}/corosync/tests/net_breaker.sh
+%{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh
+%{_datadir}/corosync/tests/shm_leak_audit.sh
+%{_bindir}/cpg_test_agent
+%{_bindir}/sam_test_agent
+%{_bindir}/votequorum_test_agent
+%endif
 
 %files -n corosynclib
 %defattr(-,root,root,-)
 %doc LICENSE
 %{_libdir}/libcfg.so.*
 %{_libdir}/libcpg.so.*
-%{_libdir}/libconfdb.so.*
-%{_libdir}/libevs.so.*
+%{_libdir}/libcmap.so.*
 %{_libdir}/libtotem_pg.so.*
-%{_libdir}/liblogsys.so.*
-%{_libdir}/libcoroipcc.so.*
-%{_libdir}/libcoroipcs.so.*
 %{_libdir}/libquorum.so.*
 %{_libdir}/libvotequorum.so.*
-%{_libdir}/libpload.so.*
 %{_libdir}/libsam.so.*
-
-%post -n corosynclib -p /sbin/ldconfig
-
-%postun -n corosynclib -p /sbin/ldconfig
-
-%package -n corosynclib-devel
-Summary: The Corosync Cluster Engine Development Kit
-Summary(ja): The Corosync Cluster Engine Development Kit
-Group: Development/Libraries
-Requires: corosynclib = %{version}-%{release}
-Requires: pkgconfig
-Provides: corosync-devel = %{version}
-Obsoletes: corosync-devel < 0.92-7
-
-%description -n corosynclib-devel
-This package contains include files and man pages used to develop using
-The Corosync Cluster Engine APIs.
+%{_libdir}/libcorosync_common.so.*
 
 %files -n corosynclib-devel
 %defattr(-,root,root,-)
-%doc LICENSE README.devmap
+%doc LICENSE
 %dir %{_includedir}/corosync/
-%{_includedir}/corosync/cs_config.h
 %{_includedir}/corosync/corodefs.h
-%{_includedir}/corosync/coroipc_types.h
-%{_includedir}/corosync/coroipcs.h
-%{_includedir}/corosync/coroipcc.h
 %{_includedir}/corosync/cfg.h
-%{_includedir}/corosync/confdb.h
+%{_includedir}/corosync/cmap.h
 %{_includedir}/corosync/corotypes.h
 %{_includedir}/corosync/cpg.h
-%{_includedir}/corosync/evs.h
 %{_includedir}/corosync/hdb.h
-%{_includedir}/corosync/list.h
-%{_includedir}/corosync/mar_gen.h
 %{_includedir}/corosync/sam.h
-%{_includedir}/corosync/swab.h
 %{_includedir}/corosync/quorum.h
 %{_includedir}/corosync/votequorum.h
 %dir %{_includedir}/corosync/totem/
-%{_includedir}/corosync/totem/coropoll.h
 %{_includedir}/corosync/totem/totem.h
 %{_includedir}/corosync/totem/totemip.h
 %{_includedir}/corosync/totem/totempg.h
-%dir %{_includedir}/corosync/lcr/
-%{_includedir}/corosync/lcr/lcr_ckpt.h
-%{_includedir}/corosync/lcr/lcr_comp.h
-%{_includedir}/corosync/lcr/lcr_ifact.h
-%dir %{_includedir}/corosync/engine
-%{_includedir}/corosync/engine/config.h
-%{_includedir}/corosync/engine/coroapi.h
-%{_includedir}/corosync/engine/logsys.h
-%{_includedir}/corosync/engine/objdb.h
-%{_includedir}/corosync/engine/quorum.h
 %{_libdir}/libcfg.so
 %{_libdir}/libcpg.so
-%{_libdir}/libconfdb.so
-%{_libdir}/libevs.so
+%{_libdir}/libcmap.so
 %{_libdir}/libtotem_pg.so
-%{_libdir}/liblogsys.so
-%{_libdir}/libcoroipcc.so
-%{_libdir}/libcoroipcs.so
 %{_libdir}/libquorum.so
 %{_libdir}/libvotequorum.so
-%{_libdir}/libpload.so
 %{_libdir}/libsam.so
+%{_libdir}/libcorosync_common.so
 %{_libdir}/pkgconfig/*.pc
 %{_mandir}/man3/cpg_*3*
-%{_mandir}/man3/evs_*3*
-%{_mandir}/man3/confdb_*3*
+%{_mandir}/man3/quorum_*3*
 %{_mandir}/man3/votequorum_*3*
 %{_mandir}/man3/sam_*3*
 %{_mandir}/man8/cpg_overview.8*
-%{_mandir}/man8/evs_overview.8*
-%{_mandir}/man8/confdb_overview.8*
-%{_mandir}/man8/logsys_overview.8*
 %{_mandir}/man8/votequorum_overview.8*
-%{_mandir}/man8/coroipc_overview.8*
 %{_mandir}/man8/sam_overview.8*
+%{_mandir}/man3/cmap_*3*
+%{_mandir}/man8/cmap_overview.8*
+%{_mandir}/man8/quorum_overview.8*
 
 %changelog
+* Thu Feb 26 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 2.3.4-1
+- updated to 2.3.4
+- added BR: libqb-devel
+
 * Sat Jun 16 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.4.3-1
 - new upstream release
 

+ 598 - 0
lib/libq/libqb/libqb-vl.spec

@@ -0,0 +1,598 @@
+Name:           libqb
+Version:        0.17.1
+Release:        2%{?_dist_release}
+Summary:        An IPC library for high performance servers
+Summary(ja):    高性能サーバー用のプロセス間通信ライブラリ
+
+Group:          System Environment/Libraries
+License:        LGPLv2+
+URL:            http://clusterlabs.github.io/libqb/
+Source0:        https://fedorahosted.org/releases/q/u/quarterback/%{name}-%{version}.tar.xz
+
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
+BuildRequires:  libtool doxygen procps check-devel automake
+
+%description
+libqb provides high performance client server reusable features.
+Initially these are IPC and poll.
+
+%package        devel
+Summary:        Development files for %{name}
+Summary(ja):    %{name} の開発用ファイル
+Group:          Development/Libraries
+Requires:       %{name} = %{version}-%{release}
+Requires:       pkgconfig
+
+%description    devel
+The %{name}-devel package contains libraries and header files for
+developing applications that use %{name}.
+
+
+%prep
+%setup -q
+
+# Make sure the timestamps are correct
+find . -exec touch \{\} \;
+
+%build
+%configure --disable-static
+make %{?_smp_mflags}
+
+%check
+make -j1 check
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
+rm -rf $RPM_BUILD_ROOT/%{_docdir}/*
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(-,root,root,-)
+%doc COPYING
+%{_sbindir}/qb-blackbox
+%{_libdir}/libqb.so.*
+
+%files devel
+%defattr(-,root,root,-)
+%doc COPYING README.markdown
+%{_includedir}/qb/
+%{_libdir}/libqb.so
+%{_libdir}/pkgconfig/libqb.pc
+%{_mandir}/man3/qb*3*
+%{_mandir}/man8/qb-blackbox.8.gz
+
+%changelog
+* Thu Feb 26 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> - 0.17.1-2
+- Initial build for Vine Linux
+
+* Tue Aug 26 2014 David Vossel <dvossel@redhat.com> - 0.17.1-1
+Fix: ipcs: Correctly allocate receive buffer size
+Fix: ipc_socket: Signalhandler must be resetted to Default, use only cleanup_sigpipe to return from qb_ipc_dgram_sock_setup.
+Fix: trie: allow modifying the trie map during the notify callback
+Fix: fix invalid option when run 'ipcclient -h'
+Fix: epoll: don't miss poll events under high load
+Fix: ipc_shm: fix error handling in qb_ipcs_shm_connect()
+Fix: ringbuffer: fix size in qb_rb_create_from_file()
+Fix: ringbuffer: fix qb_rb_open_2() debug format string
+Fix: trie: fixes regression caused by ref count refactoring
+Fix: ipcc: Properly timeout during recv when timeout value is provided
+
+* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.17.0-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
+
+* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.17.0-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
+
+
+* Thu Feb 20 2014 David Vossel <dvossel@redhat.com> - 0.17.0-2
+Fix testsuite timing values
+
+* Wed Feb 19 2014 David Vossel <dvossel@redhat.com> - 0.17.0-1
+Fix: build: Allow 'make rpm' to work with lightweight tags for release candidates
+Fix: spec: reference correct url in spec file
+Doc: update broken doxygen link to something that exists
+Bump version to 0.17.0
+Low: ipc_socket: further optimize max msg size calculations for fbsd portability tests
+Low: ipc_socket: Allow socket max msg size to be calculated more accurately
+Fix: fixes travis compile time error
+Low: tests: Fixes compile time issue with make check
+High: ipcs: Prevent ipc server use after free.
+Low: ipc: Remove ipc connection reference given to dispatch functions
+High: ipc: Fixes memory leak in server connection accept when client partially connects
+IPC: Increase the listen backlog of IPC server
+Low: ipcs: Clarifications to the ipcs server callback documentation.
+Fix rb.test to avoid overwriting memory during reading.
+Low: example: Update client/server example to use server enforced buffer size
+Low: Client side buffer retrieval regression test
+Feature: New api function to retrieve client buffer size
+Low: check_ipc.c: Verify server enforced buffer sizes work
+Feature: Enforce buffer size limits on the server side
+Low: regession tests for regex log filters
+Feature: Filter logs using regex patter on function, format, or filename
+ipc_setup: Set SO_PASSCRED on listener socket
+Fix: log: Filtering by function and file must match exactly, no substring matches
+Low: blackbox: Abort blackbox logging on ringbuffer overwrite reclaim error
+High: ipcs: Api function allowing server to retrieve client connection's ipc buffer size
+Low: ringbuffer: Abort during chunk reclaim if OVERWRITE flag is set and reclaim fails.
+High: blackbox: unique blackbox ringbuffer files per pid
+Low: ipc_socket: Fixes fd leak in socket ipc client disconnection
+Use sizeof to get the correct size of the sockaddr_un sun_path member in a portable way. Fixes corosync on Mac OS X.
+Detect the max signal value that can be used using NSIG macro
+Avoid double-decrement of level->todo
+
+* Thu Aug 1 2013 David Vossel <dvossel@redhat.com> - 0.16.0-1
+Bump version to 0.16.0 ... do not use version 0.15.0
+Update release gpg sign key
+Bump the version to 0.15.0
+Merge pull request #83 from davidvossel/master
+Low: ipc_socket: Output send event failure as debug instead of error
+Low: ipcserver.c: Fix example server's glib mainloop implementation
+High: ipc_socket.c: Detect EOF connection on connection STREAM socket
+Merge pull request #81 from davidvossel/dgram_max_msg
+Low: tests: Add dgram max size detection test
+Low: ipc_socket.c: Handle the unlikely event of an EAGAIN or EINTR during dgram max size detection
+Merge pull request #82 from davidvossel/master
+Fixes detect disconnect on send for tcp example
+Fixes sem leak
+Fixes less-than-zero comparision of unsigned int
+fixes double close
+Fixes double close
+Fixes double fd close
+Fixes fd leak
+Prevent use after free in benchmark util
+Fixes use ater free in shm disconnect
+Fixes use after free during ipcs client disconnect
+Remove dead code
+Low: check_ipc.c: Verify dgram max size during tests
+High: ipcc: Add abilty to verify dgram kernel buffer size meets max msg value
+Fixes travis build error
+Merge pull request #80 from davidvossel/master
+Low: check_ipc.c: fix debug message to only display once.
+High: ringbuffer: Make max_size of ringbuffer accurate so shm ipc max msg size value is honored
+Low: ipcs: For shm ipc, always retry outstanding notifications when next event is sent
+Low: tests: Added test to verify sending ipc msg equal to max size succeeds
+Merge pull request #79 from davidvossel/master
+Merge pull request #78 from davidvossel/master
+Fix: ipcs: Fixes compile time issue reported by travis
+Merge pull request #77 from davidvossel/stress_tests_fixes
+Low: loop_pool_kqueue: remove potentially noisy dbug statement
+Low: tests: rework bulk event msg ipc test
+Account for fbsd ENOBUFS during stress test
+Low: tests: Adds ipc event stress test to testsuite
+Low: ipc_socket: In fbsd send() returns ENOBUFS when dgram queue is full, this should be treated similar to EAGAIN
+High: kqueue: Properly enable kqueue filter in poll loop
+Low: ipcs: Attempt to resend outstanding event notifications during event send
+Merge pull request #75 from davidvossel/ref_count_cleanup
+Low: qbipcs.h: update ipcs connection iterator documentation
+Merge pull request #74 from davidvossel/ref_count_cleanup
+Fix: ipcs: Disconnect shm ipc connection when poll socket returns error on msg receive
+Fix: ipcs: Properly disconnect client connection on POLLNVAL or any other error causing connection removal from mainloop.
+Simplify internal ipcs ref counting, add comments and document api behavior
+Simplifies connection ref counting without changing behavior
+Low remove ref-count error in example ipcserver.
+Merge pull request #73 from davidvossel/ref_count_cleanup
+Merge pull request #72 from davidvossel/master
+Low: tests: Verify reading valid blackbox file works
+Fix: refcount leak
+Fix: ringbuffer: Add file header version field and detect reading corrupted blackbox files using hash value
+Fix: tests: On some platforms -ECONNRESET is returned rather than -ENOTCONN after server failure
+Fix: tests: Make blackbox_segfault.sh not depend on bash
+Hopefully this is the last travis link fix
+Fix travis icon (travis is case sensitive)
+Fix the github links
+Merge pull request #70 from yuusuke/fix_logging
+fix a problem when the character string beyond the number of the maximum characters is passed
+Merge pull request #68 from r1mikey/upstream
+Add a IPC service context pointer and accessors from both the connection and service level.
+Enable distcheck on the travis tests
+Add atomic_int.h to noinst_HEADERS
+Use the new atomic ops in the ringbuffer
+Add internal support for the new __atomic gcc builtins
+Rename the configure macros from atomic to sync
+ringbuffer: use atomic ops on ringbuffer chunk magic
+Remove some test code mistakenly committed to the example program.
+IPC: make each connection ref the owning service
+Indicate when/why qb_rb_force_close() fails to remove share memory files
+Typo fixed in configure
+Fix "make srpm"
+Remove doxygen from travis deps to try and get the job working.
+Fix make distcheck
+Merge pull request #60 from t-matsuo/fix-makefile-of-tests
+add file_change_bytes into check_PROGRAMS and fix a typo
+Deal better with corrupt blackbox files.
+Merge pull request #58 from inouekazu/fix_connection_state_checking
+IPC: fix the connection state checking
+LOG: copy the function/filename for dynamic callsites
+Deal with /dev/shm issue on Travis builders
+Properly discover SO_NOSIGPIPE and MSG_SIGNAL
+IPC: fix call to QB_SUN_LEN
+list: don't splice empty lists onto the head.
+rpl_sem: make destroy more compliant
+test: fix unused-but-set-variable warning
+test: fix missing-format-attribute warning
+RB: make the "sem" abstraction into a notifier
+IPC: clean up the connection state checking
+Use dgram sockets for message oriented communications
+IPC: don't interpret EMSGSIZE and ENOMSG as a disconnect
+POLL: prevent a spin if the fd is not removed from the mainloop
+add TAGS and ~ files to .gitignore
+docs: install qb-blackbox.8 if doxygen is not available.
+IPC: seperate ipc_us.c into 2 files
+IPC: move utility functions to unix.c
+IPC: make sure we return a consistent error when the message is too big.
+
+* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.14.4-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+
+* Thu Jan 17 2013 Angus Salkeld <asalkeld@redhat.com> - 0.14.4-1
+LOG: prevent the last char of the blackbox message from getting lost.
+Example: make the blackbox example more practical.
+Add the processing which remove notifier at skiplist_destroy function
+Add the processing which remove hash node and notifier at hashtable_destroy function
+Unify to QB_TRUE/QB_FALSE a boolean value
+Document the default prefix in INSTALL
+Unify the list processing with qb_list function
+Add travis link to the readme.
+Fix return code which is an error occurred at pthread function
+TEST: add a progam to compare the speed of vsnprintf and qb_vsnprintf_serialize
+LOG: add a test for a padded hex int.
+Fedora's splint has a strange syntax error, don't fail on it.
+LOG: fix truncation in some messages that get padded.
+Fix the blackbox formatter when specifing the string len/precision
+Fix strlcpy and strlcat functions
+IPC: don't over log on disconnect
+Make sure we don't use the format string whilst it is getting changed.
+ptrie: deref the current node in trie_iter_free()
+LOG: fix the format comparison to avoid generating multiple entries.
+LOG: set the return code when calloc fails
+IPC: call poll if we are mid message and get EAGAIN
+Remove extra ";"
+IPC: set the error more correctly when qb_sys_mmap_file_open() fails.
+Make sure that mmap'ed files smaller than a page size are written to.
+example/test: check for error in qb_ipc_run()
+example: check for error in qb_ipc_run()
+TEST: fix typo s/,/; in check_ipc.c
+
+* Mon Oct 29 2012 Angus Salkeld <asalkeld@redhat.com> - 0.14.3-2
+Fix test code highlighted by new check version
+Remove the call to autogen.sh - not needed anymore.
+
+* Mon Oct 29 2012 Angus Salkeld <asalkeld@redhat.com> - 0.14.3-1
+IPC: Pass the timeout to poll() if the recv function returns EAGAIN
+LOG: make the format comparison safe and sane
+LOG: don't break on empty callsites, just ignore them
+LOG: use the array callback to register new callsites
+array: add a mechanism to get a callback when a bin is allocated
+Solaris based operating systems don't define MSG_NOSIGNAL and SO_NOSIGPIPE.
+Make sure atomic's are initialized (for non-gcc atomic).
+
+* Wed Sep 12 2012 Angus Salkeld <asalkeld@redhat.com> - 0.14.2-2
+Fix a crash in ptrie if you iterate over the map in the deleted notifier.
+
+* Mon Sep 10 2012 Angus Salkeld <asalkeld@redhat.com> - 0.14.2-1
+Get libqb building on cygwin.
+ipc_us: slightly more robust cmsg handling
+ipc_us: on Linux, set SO_PASSCRED on the sending socket too
+ipc_us: clear request unused fields
+TEST: Include writing and reading the blackbox in the log_long_msg test
+LOG: fix qb_vsnprintf_deserialize()
+blackbox: fix 64-bit big-endian issues
+Remove IPC_NEEDS_RESPONSE_ACK and turn off shm ipc on solaris
+Define unix path max for openbsd
+Only turn on ipc_needs_response_ack=yes for solaris
+Some improvements to kqueue usage.
+kqueue: drop log message to trace.
+Fix splint warning
+openbsd requires netinet/in.h before arpa/inet.h
+Avoid strcpy() use strlcpy() instead.
+Fix kqueue complile warnings
+openbsd doesn't have EBADMSG
+openbsd has a different UNIX_PATH_MAX
+LOG: change qb_vsprintf_serialize() into qb_vsnprintf_serialize()
+TEST: increase timeout to 6 secs as the recv timeout is 5 secs
+TEST: get the logic right - grrr.
+Turn off attribute_section on netbsd
+Some missing pshared semaphore checks
+Cleanup the checks for pshared semaphores
+Add a config check for pthread_mutexattr_setpshared
+Remove uses of timersub and use qb_util_stopwatch
+RB: change the #error to ENOTSUP if no usable shared process sem
+LOOP-KQUEUE: fix reference before assignment.
+build: fix libqb.pc creation and make maintainer-clean
+LOG: Make sure the semaphores are initialized.
+build: remove bashism in cc support check
+Catch disconnected sockets on Solaris
+Don't free rb->shared_hdr in qb_rb_create_from_file()
+Check error return of qb_ipcs_uc_recv_and_auth()
+Fix removal of automatically installed doc files when building rpms
+Add the mailing list to the travis email notifications.
+Work around debian not setting the arch path in splint.
+Remove color-tests and parallel-tests automake options.
+Add travis continuous integration config
+LOG: Invoke custom log filter function if tag changes
+tests/rbwriter: don't ignore write failure
+ipcs: avoid use-after-free for size-0 || disconnect-request
+
+* Wed Jul 18 2012 Angus Salkeld <asalkeld@redhat.com> - 0.14.1-1
+RB: set the new read pointer after clearing the header (#839605).
+RB: improve the debug print outs
+RB: be more explicit about the word alignment
+RB: cleanup the macros for wrapping the index
+RB: use sem_getvalue as a tie breaker when read_pt == write_pt
+RB: if read or peek don't get the message then re-post to the semaphore
+RB: convert the rb_peek() status into a recv like status.
+RB: use internal reclaim function
+IPC: use calloc instead of malloc to fix valgrind warnings
+Upgrade the doxygen config.
+Fix a valgrind error.
+
+* Sun Jun 24 2012 Angus Salkeld <asalkeld@redhat.com> - 0.14.0-1
+LOG: fix threaded logging.
+Add user control of the permissions that are set on the shared mem files
+LOG: Restrict string trucation during serialization to when a precision is specified
+LOG: Gracefully fail when the caller exceeds QB_LOG_MAX_LEN
+LOG: Observe field widths when serializing string arguments
+RB: use the same mechanism in reclaim as read/peek to detect end-of-ring
+Add needs_response_ack option to ./check
+RB: fix wrong sem_flg IPC_NOWAIT option
+TESTS: fix warning about unused functions
+Remove D_FORTIFY_SOURCE from check.
+Open shared mem file in /dev/shm only for linux
+Don't use msg_flags on solaris (recvmsg).
+Turn off attribute_section on solaris
+ipc example: add -e (events) option
+IPC: if the server returns EAGAIN or ETIMEOUT the check the connection
+LOG: make it possible to fsync() on each file log.
+IPC: make sure that the created callback happens before dispatches
+LOG: fix the printing of %p in the blackbox
+IPC: On bsd's use the notifier for responses
+IPC: interpret ECONNRESET and EPIPE as ENOTCONN
+cleanup some warnings
+config: use newer AC_COMPILE_IFELSE()
+blackbox: fix %p formatting
+LOG: put all fields in the blackbox (added priority and tags)
+example: make the priority uint8_t
+Remove strerror out of check_funcs
+RB: fix compiler warning.
+Add replacement function stpcpy
+Add missing AC_TYPE_UINT16_T to configure.ac
+Use AC_FUNC_STRERROR_R and STRERROR_R_CHAR_P
+Add stpcpy strcasecmp to the check_funcs
+Move some conditional defines into code (from the configure script)
+Remove some unused configure checks
+Remove message queues
+Check for union semun properly
+Blackbox: provide more space for log messages when reading from the blackbox.
+Add the blackbox reader manpage to the spec file
+Enable error logging for the blackbox reader
+RB: Read the file size into an initialized variable of the correct size
+Add a tool to dump the blackbox.
+RB: to be safer save the read and write pointers at the top of the blackbox
+avoid unwarranted use of strncpy: use memcpy instead
+blackbox: fix the print_from_file()
+RB: add an option to not use any semaphores
+LOG: tweak the blackbox format string
+LOG: accept NULL strings into the blackbox
+LOG: protect close and reload from calling log
+Add benchmark option (-b) to examples/ipcclient
+TEST: make rbreader/writer more like the other benchmarking apps
+IPC: log the connection description in all logs
+TEST: re-organise the ipc test suites
+IPC: only modify the dispatch if we get EAGAIN
+Correctly display timestamp in blackbox
+
+* Thu May 10 2012 Angus Salkeld <asalkeld@redhat.com> - 0.13.0-1
+- Remove unneccessary __attribute__ ((aligned(8))) from internal headers
+- IPC: add a new function to get (and alloc) the extended stats.
+- Revert "Add the event queue length to the connection stats."
+- IPC: cleanup better on a failed client connect.
+- IPC(soc): be more consistent with control struct size
+- IPC: kill a compiler warning
+- IPC(soc): pass in the correct size into munmap()
+- TEST: Use /bin/sh not /bin/bash
+- TEST: check for lost shared mem on bsd too
+- rb: cleanup the semaphores
+- Fix some small issues in ./check
+- Cleanup the .gitignore files
+- configure.ac tweaks
+- Remove HZ and use sysconf instead.
+- SUN_LEN() macro is present if __EXTENSIONS__ is defined on Illumos
+- PF_UNIX is a POSIX standard name
+- Test for log facility names
+- IPC: drop log message to debug.
+- IPC: fix retrying of partial recv's and sends.
+- IPC: initialize enough shared mem for all 3 one way connections.
+- IPC: keep retrying to recv the socket message if partially recv'ed (part 2)
+- IPC: keep retrying to recv the socket message if partially recv'ed
+- IPC: handle the server shutdown better
+- IPC: handle a connection disconnect from the server better
+- IPC: make it possible to send events in the connected callback.
+- Add the event queue length to the connection stats.
+- IPC: add a is_connected client side function.
+- Fix typo in ./check
+- docs: clarify the need to use request/response headers
+- Remove unused local variable
+- IPC: change the socket recv function to read the response header.
+- Add some special commands into the ipc example
+- TEST: improve the tracing in the ipc tests.
+- Make "make (s)rpm" work more reliably
+- TEST: add a test to confirm we get the events we send.
+- TEST: reuse send_and_check for events.
+- IPC: make it possible for a root client to talk to a non-root server.
+- Run ./Lindent in the examples directory
+- Add some debug code to the ipcclient example
+- IPC: make sure ipc (socket) clients can connect to a server running as root.
+- IPC: allow qb to bump the max_message_size
+- IPC: check for a sane minimum max_message_size
+- add rpl_sem.h loop_poll_int.h to noinst_headers
+- Handle errors more consistently
+- call recv_ready on socket types
+- Handle a recv of size 0
+- make bsd shm path better by default.
+- Fix kqueue on freebsd.
+- Get the example socket includes right.
+- Fix kqueue compiling.
+- POLL: seperate out the poll/epoll and add kqueue
+- Test existence of getpeer* functions
+- Add inet header to tcpclient example
+- Don't link with setpshared if unavailable
+- NetBSD doesn't have semun defined
+- Use MADV_NOSYNC only on systems where available
+- Use SCHED_BATCH only on platforms where available
+- Fix a bug introduced by the bsd patch.
+- Cleanup the selection of semaphores to use
+- Fix some leaks in the logging.
+- Try and improve the portability on bsd variants.
+
+* Sun Mar 11 2012  Angus Salkeld <asalkeld@redhat.com> - 0.11.1-1
+- configue libqb to not use epoll as it seems broken (#800865)
+- LOOP: remove some old timerfd code.
+- TEST: add a test to check the order of the jobs
+- LOOP: when new jobs are added they are added to the head instead of the tail.
+- LOG: Now the array is self locking we can make the lookup array dynamic
+- Add locking to the array when growing.
+- IPC: make the _request_q_len_get() function more obvious.
+- IPC: fix multiple receives from qb_ipc_us_recv()
+- IPC: make sure that the wrong union member is not written to.
+- TIMER: check for null timer handle
+
+Wed Mar 7 2012  Angus Salkeld <asalkeld@redhat.com> - 0.11.0-1
+- ARRAY: cleanup the pointer sizeof()
+- LOG: turn off __attribute__(section) for powerpc (not working)
+- TESTS: move the util tests into "slow-tests" (i.e. optional)
+- TEST: make the test_priority the same type as in the callsite
+- LOG: make the log arrays manually grow-able since we need to lock the calls.
+- RB: fix test failure on ppc
+- RB: change the name of the size to word_size to be more clear
+- TEST: add some more signal tests.
+- LOOP: fix deletion of signal handlers when they are pending
+- LOOP: signal handlers were always added as high priority.
+- TEST: deal with mac's limited sed
+- check: add debugging to the configure options and remove unused options
+- TEST: properly clear the filters
+- LOG: expose the mechanism to get a dynamic callsite.
+- Revert part of my COARSE grained timer commit
+- Remove timerfd usage and go back to timelist.
+- UTIL: if possible use COARSE resolution clocks - they are much faster.
+- ARRAY: save memory (in the bins array) and allow holes in the array
+- LOOP: add qb_loop_timer_is_running()
+- LOOP: allow stop() and run() to be called with NULL loop instance.
+- LOOP: fix doxygen parameter comment
+- LOG: add stdout target
+- LOOP: add a function to delete jobs
+- LOG: remove debug printf's
+- LOG: remove an old/incorrect doxygen comment.
+- LOG: add a hostname %H format specifier.
+- LOG: Add qb_log_filter_fn_set()
+
+* Tue Feb 14 2012 Angus Salkeld <asalkeld@redhat.com> - 0.10.1-1
+- Fix "make distcheck" add include path to AM_CPPFLAGS
+- Bump the version to 0.10.1
+- clang: Remove unused code
+- TEST: make the ipc failure test closer to corosync's case.
+- RB: add a debug message if trying to read a message of the wrong size
+- IPC: split up the recv into chuncks of 2 seconds. (#788742)
+- Be more consistent with the internal logs.
+- LOOP: make it possible to pass in NULL as the default loop instance
+- RB: use the proper struct not the typedef in the implementation.
+- RB: Fix potential mem leak
+- Don't mix enums (QB_TRUE/TRUE)
+- use random() not rand()
+- Remove dead code
+- set umask before calling mkstemp()
+- Use safer versions of string functions (strcpy -> strlcpy)
+- Increase the coverity aggressiveness
+- TEST: make the loop ratelimit test more forgiving.
+
+* Tue Feb 07 2012 Angus Salkeld <asalkeld@redhat.com> - 0.10.0-1
+- LOOP: handle errors from the poll function
+- LOOP: make the item type applicable to jobs too.
+- LOOP: fix the todo calculations.
+- TEST: check for a single job causing a cpu spin
+- LOOP: prevent jobs from consuming too much cpu.
+- Get coverity to ignore this warning.
+- Change example code to use fgets instead of gets
+- LOG: pass the result of qb_log_thread_start() back to the user
+- Fix some issues found by clang
+- Add clang-analyzer check
+- Add a split timer to the stopwatch.
+- IPC: merge common code into new function
+- IPC: better handle a disconnect been called from within connection_created()
+- IPC: fix scary typo
+- IPC: fix server error handling
+
+* Mon Feb 06 2012 Angus Salkeld <asalkeld@redhat.com> - 0.9.0-2
+- Fix a spin in the mainloop when a timer or poll gets removed
+  When in the job queue (#787196).
+
+* Fri Jan 27 2012  Angus Salkeld <asalkeld@redhat.com> - 0.9.0-1
+- Rebased to 0.9.0
+
+* Tue Jan 10 2012  Angus Salkeld <asalkeld@redhat.com> - 0.8.1-2
+- fix qb_timespec_add_ms()
+
+* Thu Jan 5 2012  Angus Salkeld <asalkeld@redhat.com> - 0.8.1-1
+- Rebased to 0.8.1 (#771914)
+
+* Wed Nov 17 2011 Angus Salkeld <asalkeld@redhat.com> - 0.7.0-1
+- Rebased to 0.7.0 (#754610)
+
+* Thu Sep 1 2011 Angus Salkeld <asalkeld@redhat.com> - 0.6.0-2
+- LOG: fix the default syslog filter
+
+* Tue Aug 30 2011 Angus Salkeld <asalkeld@redhat.com> - 0.6.0-1
+- Rebased to 0.6.0 which includes (#734457):
+- Add a stop watch
+- LOG: serialize the va_list, don't snprintf
+- LOG: change active list into array access
+- atomic: fix qb_atomic_pointer macros
+- LOG: allow the thread priority to be set.
+- Fix splint warning on ubuntu 11.04
+
+* Mon Jul 18 2011 Angus Salkeld <asalkeld@redhat.com> - 0.5.1-1
+- Rebased to 0.5.1 which includes:
+- LOOP: make the return more consistent in qb_loop_timer_expire_time_get()
+- LOG: add string.h to qblog.h
+- Add a qb_strerror_r wrapper.
+- don't let an invalid time stamp provoke a NULL dereference
+- LOG: move priority check up to prevent unnecessary format.
+- rename README to README.markdown
+
+* Wed Jun 8 2011 Angus Salkeld <asalkeld@redhat.com> - 0.5.0-1
+- Rebased to 0.5.0 which includes:
+- new logging API
+- support for sparc
+- coverity fixes
+
+* Tue Feb 8 2011 Angus Salkeld <asalkeld@redhat.com> - 0.4.1-2
+- SPEC: improve devel files section
+- SPEC: remove global variables
+
+* Mon Jan 31 2011 Angus Salkeld <asalkeld@redhat.com> - 0.4.1-1
+- SPEC: add procps to BuildRequire
+- SPEC: remove automake and autoconf from BuildRequire
+- SPEC: remove call to ./autogen.sh
+- SPEC: update to new upstream version 0.4.1
+- LOOP: check read() return value
+- DOCS: add missing @param on new timeout argument
+- BUILD: only set -g and -O options if explicitly requested.
+- BUILD: Remove unneccessary check for library "dl"
+- BUILD: improve the release build system
+
+* Fri Jan 14 2011 Angus Salkeld <asalkeld@redhat.com> - 0.4.0-2
+- remove "." from Summary
+- Add "check-devel to BuildRequires
+- Add "make check" to check section
+- Changed a buildroot to RPM_BUILD_ROOT
+- Document alphatag, numcomm and dirty variables.
+
+* Sun Jan 09 2011 Angus Salkeld <asalkeld@redhat.com> - 0.4.0-1
+- Initial release

+ 367 - 180
p/pacemaker/pacemaker-vl.spec

@@ -2,144 +2,207 @@
 %global uname hacluster
 %global pcmk_docdir %{_docdir}/%{name}
 
-# Supported cluster stacks, must support at least one
-%bcond_without ais
-%bcond_with heartbeat
+#%global specversion 3
+#%global upstream_version Pacemaker-1.1.2
+#%global upstream_prefix Pacemaker-1-1-
 
-# ESMTP is not available in RHEL, only in EPEL. Allow people to build
-# the RPM without ESMTP in case they choose not to use EPEL packages
-%bcond_without esmtp
+%global py_site %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
 
-# SNMP trap support only works with Net-SNMP 5.4 and above
-%bcond_without snmp
+# Turn off the auto compilation of python files not in the site-packages directory
+# Needed so that the -devel package is multilib compliant
+%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
 
-# We generate some docs using Publican, but its not available everywhere
-%bcond_with publican
+%global cs_major %(pkg-config corosync --modversion  | awk -F . '{print $1}')
+%global cs_minor %(pkg-config corosync --modversion  | awk -F . '{print $2}')
 
-%global specversion 3
-%global upstream_version Pacemaker-1.1.2
-%global upstream_prefix Pacemaker-1-1-
+
+# Conditionals
+# Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
+# to disable or enable specific features
+
+# Legacy stonithd fencing agents
+%bcond_with stonithd
+
+# Build with/without support for profiling tools
+%bcond_with profiling
+
+# We generate docs using Publican, Asciidoc and Inkscape, but they're not available everywhere
+%bcond_without doc
+
+# Use a different versioning scheme
+%bcond_with pre_release
+
+# Ship an Upstart job file
+%bcond_with upstart_job
+
+%if %{with profiling}
+# This disables -debuginfo package creation and also the stripping binaries/libraries
+# Useful if you want sane profiling data
+%global debug_package %{nil}
+%endif
 
 # Keep around for when/if required
 #global alphatag %{upstream_version}.hg
 
-%global pcmk_release %{?alphatag:0.}%{specversion}%{?alphatag:.%{alphatag}}%{?dist}
+#%global pcmk_release %{?alphatag:0.}%{specversion}%{?alphatag:.%{alphatag}}%{?dist}
 
 # When downloading directly from Mercurial, it will automatically add a prefix
 # Invoking 'hg archive' wont but you can add one with:
 # hg archive -t tgz -p "$upstream_prefix-$upstream_version" -r $upstream_version $upstream_version.tar.gz
 
-Name:		pacemaker
-Summary:	Scalable High-Availability cluster resource manager
-Summary(ja):	スケーラブル高可用クラスタリソースマネージャ
-Version:	1.1.2
-Release:        4%{?_dist_release}
-License:	GPLv2+ and LGPLv2+
-Url:		http://www.clusterlabs.org
-Group:		System Environment/Daemons
-Source0:	http://hg.clusterlabs.org/pacemaker/1.1/archive/%{upstream_version}.tar.bz2
-Patch1:		bug-lf-2401.patch
-Patch2:		doc-validation.patch
-Patch3:		pacemaker-1.1.2-fix-docbook-detection.patch
-Patch4:		pacemaker-1.1.2-dont-use-find-to-detect-host-env.patch
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
-AutoReqProv:	on
-Requires(pre):	cluster-glue
-Requires:	resource-agents
-Requires:	perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
+Name:	       pacemaker
+Summary:       Scalable High-Availability cluster resource manager
+Summary(ja):   スケーラブルかつ高可用性なクラスタリソースマネージャ
+Version:       1.1.12
+Release:       1%{?_dist_release}
+License:       GPLv2+ and LGPLv2+
+Group:	       System Environment/Daemons
+URL:	       http://www.clusterlabs.org
+
+Source0:       https://github.com/ClusterLabs/%{name}/archive/Pacemaker-%{version}.tar.gz
+
+BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root
+AutoReqProv:   on
+#Requires(pre):	cluster-glue
+Requires:      resource-agents
+Requires:      %{name}-libs = %{version}-%{release}
+Requires:      %{name}-cluster-libs = %{version}-%{release}
+Requires:      %{name}-cli = %{version}-%{release}
+Requires:      python >= 2.4
 
 # Required for core functionality
-BuildRequires:	automake autoconf libtool pkgconfig libtool-ltdl-devel python-devel
-BuildRequires:	glib2-devel cluster-glue-libs-devel libxml2-devel libxslt-devel 
-BuildRequires:	pkgconfig python-devel gcc-c++ bzip2-devel gnutls-devel pam-devel
+BuildRequires:	automake autoconf libtool pkgconfig libtool-ltdl-devel
+BuildRequires:	glib2-devel libxml2-devel libxslt-devel libuuid-devel 
+BuildRequires:	pkgconfig python-devel gcc-c++ bzip2-devel pam-devel
 
-# Enables optional functionality
-BuildRequires:	help2man ncurses-devel openssl-devel
+# Required for agent_config.h which specifies the correct scratch directory
+BuildRequires: resource-agents
 
-%if %{with esmtp}
-BuildRequires:	libesmtp-devel
-%endif
+# We need reasonably recent versions of libqb
+BuildRequires: libqb-devel > 0.11.0
+Requires:      libqb > 0.11.0
 
-%if %{with snmp}
-BuildRequires:	net-snmp-devel >= 5.4
-Requires:	net-snmp
-%endif
+# Enables optional functionality
+BuildRequires: ncurses-devel openssl-devel docbook-style-xsl
+BuildRequires: bison byacc flex help2man dbus-devel
 
-%if %{with ais}
-BuildRequires:	corosynclib-devel
+%if %{defined _unitdir}
+BuildRequires: systemd-devel
 %endif
 
-%if %{with heartbeat}
-BuildRequires:	heartbeat-devel heartbeat-libs
+Requires:      corosync
+BuildRequires: corosynclib-devel
+
+%if %{with stonithd}
+BuildRequires: cluster-glue-libs-devel
 %endif
 
-%if %{with publican}
-%ifarch i386 x86_64
-BuildRequires:	publican
+%if %{with doc}
+%ifarch %{ix86} x86_64
+BuildRequires: inkscape asciidoc
+#BuildRequires: publican inkscape asciidoc
 %endif
 %endif
 
 %description
 Pacemaker is an advanced, scalable High-Availability cluster resource
-manager for Linux-HA (Heartbeat) and/or OpenAIS.
+manager for Corosync, CMAN and/or Linux-HA.
 
-It supports "n-node" clusters with significant capabilities for
-managing resources and dependencies.
+It supports more than 16 node clusters with significant capabilities
+for managing resources and dependencies.
 
 It will run scripts at initialization, when machines go up or down,
 when related resources fail and can be configured to periodically check
 resource health.
 
-%package -n pacemaker-libs
-License:	GPLv2+ and LGPLv2+
-Summary:	Libraries used by the Pacemaker cluster resource manager and its clients
-Summary(ja):	Libraries used by the Pacemaker cluster resource manager and its clients
-Group:		System Environment/Daemons
-Requires:	%{name} = %{version}-%{release}
+Available rpmbuild rebuild options:
+  --with(out) : stonithd doc profiling pre_release upstart_job
 
-%description -n pacemaker-libs
+%package cli
+License:      GPLv2+ and LGPLv2+
+Summary:      Command line tools for controlling Pacemaker clusters
+Group:        System Environment/Base
+Requires:     %{name}-libs = %{version}-%{release}
+Requires:     perl-TimeDate
+
+%description cli
 Pacemaker is an advanced, scalable High-Availability cluster resource
-manager for Linux-HA (Heartbeat) and/or OpenAIS.
+manager for Corosync, CMAN and/or Linux-HA.
 
-It supports "n-node" clusters with significant capabilities for
-managing resources and dependencies.
+The %{name}-cli package contains command line tools that can be used
+to query and control the cluster from machines that may, or may not,
+be part of the cluster.
 
-It will run scripts at initialization, when machines go up or down,
-when related resources fail and can be configured to periodically check
-resource health.
 
-%package -n pacemaker-libs-devel 
-License:	GPLv2+ and LGPLv2+
-Summary:	Pacemaker development package
-Summary(ja):	Pacemaker 開発パッケージ
-Group:		Development/Libraries
-Requires:	%{name}-libs = %{version}-%{release}
-Requires:	cluster-glue-libs-devel
-%if %{with ais}
-Requires:	corosynclib-devel
-%endif
-%if %{with heartbeat}
-Requires:	heartbeat-devel
-%endif
-
-%description -n pacemaker-libs-devel
-Headers and shared libraries for developing tools for Pacemaker.
+%package -n %{name}-libs
+License:      GPLv2+ and LGPLv2+
+Summary:      Core Pacemaker libraries
+Summary(ja):  Pacemaker コアライブラリ
+Group:	      System Environment/Libraries
 
+%description -n pacemaker-libs
 Pacemaker is an advanced, scalable High-Availability cluster resource
-manager for Linux-HA (Heartbeat) and/or OpenAIS.
+manager for Corosync, CMAN and/or Linux-HA.
 
-It supports "n-node" clusters with significant capabilities for
-managing resources and dependencies.
+The %{name}-libs package contains shared libraries needed for cluster
+nodes and those just running the CLI tools.
 
-It will run scripts at initialization, when machines go up or down,
-when related resources fail and can be configured to periodically check
-resource health.
+%package -n %{name}-cluster-libs
+License:      GPLv2+ and LGPLv2+
+Summary:      Cluster Libraries used by Pacemaker
+Summary(ja):  Pacemaker で用いられるクラスタライブラリ
+Group:        System Environment/Libraries
+Requires:     %{name}-libs = %{version}-%{release}
+
+%description -n %{name}-cluster-libs
+Pacemaker is an advanced, scalable High-Availability cluster resource
+manager for Corosync, CMAN and/or Linux-HA.
+
+The %{name}-cluster-libs package contains cluster-aware shared
+libraries needed for nodes that will form part of the cluster nodes.
+
+%package remote
+License:      GPLv2+ and LGPLv2+
+Summary:      Pacemaker remote daemon for non-cluster nodes
+Group:        System Environment/Daemons
+Requires:     %{name}-libs = %{version}-%{release}
+Requires:     %{name}-cli = %{version}-%{release}
+Requires:     resource-agents
+#%if %{defined systemd_requires}
+#%systemd_requires
+#%endif
+
+%description remote
+Pacemaker is an advanced, scalable High-Availability cluster resource
+manager for Corosync, CMAN and/or Linux-HA.
+
+The %{name}-remote package contains the Pacemaker Remote daemon
+which is capable of extending pacemaker functionality to remote
+nodes not running the full corosync/cluster stack.
+
+%package -n %{name}-libs-devel 
+License:      GPLv2+ and LGPLv2+
+Summary:      Pacemaker development package
+Summary(ja):  Pacemaker 開発パッケージ
+Group:	      Development/Libraries
+Requires:     %{name}-cts = %{version}-%{release}
+Requires:     %{name}-libs = %{version}-%{release}
+Requires:     %{name}-cluster-libs = %{version}-%{release}
+Requires:     libtool-ltdl-devel libqb-devel libuuid-devel
+Requires:     libxml2-devel libxslt-devel bzip2-devel glib2-devel
+Requires:     corosynclib-devel
+
+%description -n %{name}-libs-devel
+Pacemaker is an advanced, scalable High-Availability cluster resource
+manager for Corosync, CMAN and/or Linux-HA.
+
+The %{name}-libs-devel package contains headers and shared libraries
+for developing tools for Pacemaker.
 
 %package	cts
 License:	GPLv2+ and LGPLv2+
 Summary:	Test framework for cluster-related technologies like Pacemaker
-Summary(ja):	Test framework for cluster-related technologies like Pacemaker
-Group:		System Environment/Daemons
+Group:		Development/Libraries
 Requires:	python
 
 %description	cts
@@ -148,142 +211,258 @@ Test framework for cluster-related technologies like Pacemaker
 %package	doc
 License:	GPLv2+ and LGPLv2+
 Summary:	Documentation for Pacemaker
-Summary(ja):	Documentation for Pacemaker
+Summary(ja):	Pacemaker のドキュメント
 Group:		Documentation
 
 %description	doc
 Documentation for Pacemaker.
 
 Pacemaker is an advanced, scalable High-Availability cluster resource
-manager for OpenAIS/Corosync.
-
-It supports "n-node" clusters with significant capabilities for
-managing resources and dependencies.
-
-It will run scripts at initialization, when machines go up or down,
-when related resources fail and can be configured to periodically check
-resource health.
+manager for Corosync, CMAN and/or Linux-HA.
 
 %prep
-%setup -q -n %{upstream_prefix}%{upstream_version}
-%patch1 -p1
-%patch2 -p0
-%patch3 -p1
-%patch4 -p1
+%setup -q -n %{name}-Pacemaker-%{version}
 
 %build
 ./autogen.sh
-%{configure}			\
-	%{!?_with_heartbeat:--without-hearbeat}	\
-	%{?_without_ais}	\
-	%{?_without_esmtp}	\
-	%{?_without_snmp}	\
-	--disable-ansi          \
-	--docdir=%{pcmk_docdir}	\
-	--localstatedir=%{_var}	\
-	--enable-fatal-warnings=no
-
-make %{_smp_mflags}
+%configure \
+    %{?with_profiling: --with-profiling} \
+    --with-initdir=%{_initrddir} \
+    --docdir=%{pcmk_docdir}	\
+    --localstatedir=%{_var} \
+    --with-version=%{version}-%{release} \
+    --disable-ansi
+
+make %{_smp_mflags} V=1 docdir=%{pcmk_docdir} all
 
 %install
-rm -rf %{buildroot}
-make DESTDIR=%{buildroot} install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT install
+
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
+mkdir -p $RPM_BUILD_ROOT%{_var}/lib/pacemaker/cores
+install -m 644 mcp/pacemaker.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/pacemaker
+
+%if %{with upstart_job}
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init
+install -m 644 mcp/pacemaker.upstart $RPM_BUILD_ROOT%{_sysconfdir}/init/pacemaker.conf
+install -m 644 mcp/pacemaker.combined.upstart $RPM_BUILD_ROOT%{_sysconfdir}/init/pacemaker.combined.conf
+%endif
 
 # Scripts that need should be executable
-chmod a+x %{buildroot}/%{_datadir}/pacemaker/tests/cts/CTSlab.py
-chmod a+x %{buildroot}/%{_datadir}/pacemaker/tests/cts/extracttests.py
+chmod a+x $RPM_BUILD_ROOT%{_datadir}/pacemaker/tests/cts/CTSlab.py
 
 # These are not actually scripts
-find %{buildroot} -name '*.xml' -type f -print0 | xargs -0 chmod a-x
-find %{buildroot} -name '*.xsl' -type f -print0 | xargs -0 chmod a-x
-find %{buildroot} -name '*.rng' -type f -print0 | xargs -0 chmod a-x
-find %{buildroot} -name '*.dtd' -type f -print0 | xargs -0 chmod a-x
+find $RPM_BUILD_ROOT -name '*.xml' -type f -print0 | xargs -0 chmod a-x
+find $RPM_BUILD_ROOT -name '*.xsl' -type f -print0 | xargs -0 chmod a-x
+find $RPM_BUILD_ROOT -name '*.rng' -type f -print0 | xargs -0 chmod a-x
+find $RPM_BUILD_ROOT -name '*.dtd' -type f -print0 | xargs -0 chmod a-x
  
 # Dont package static libs or compiled python
-find %{buildroot} -name '*.a' -type f -print0 | xargs -0 rm -f
-find %{buildroot} -name '*.la' -type f -print0 | xargs -0 rm -f
+find $RPM_BUILD_ROOT -name '*.a' -type f -print0 | xargs -0 rm -f
+find $RPM_BUILD_ROOT -name '*.la' -type f -print0 | xargs -0 rm -f
 
 # Don't package these either
-rm -f %{buildroot}/%{_libdir}/heartbeat/hb2openais-helper.py
-rm -f %{buildroot}/%{_libdir}/heartbeat/crm_primitive.py
-rm -f %{buildroot}/%{_libdir}/service_crm.so
-rm -f %{buildroot}/usr/lib/ocf/resource.d/pacemaker/pingd
+rm -f $RPM_BUILD_ROOT%{_libdir}/service_crm.so
+
+# Don't ship init scripts for systemd based platforms
+%if %{defined _unitdir}
+rm -f $RPM_BUILD_ROOT%{_initrddir}/pacemaker
+rm -f $RPM_BUILD_ROOT%{_initrddir}/pacemaker_remote
+%endif
+
+%if %{with profiling}
+GCOV_BASE=$RPM_BUILD_ROOT/%{_var}/lib/pacemaker/gcov
+mkdir -p $GCOV_BASE
+find . -name '*.gcno' -type f | while read F ; do
+        D=`dirname $F`
+        mkdir -p ${GCOV_BASE}/$D
+        cp $F ${GCOV_BASE}/$D
+done
+%endif
 
 %clean
-rm -rf %{buildroot}
+rm -rf $RPM_BUILD_ROOT
+
+%post
+%if %{defined _unitdir} && 0%{?systemd_post:1}
+%systemd_post pacemaker.service
+%else
+if [ $1 -eq 1 ]; then
+    /sbin/chkconfig --add pacemaker || :
+fi
+%endif
 
-%post -n pacemaker-libs -p /sbin/ldconfig
+%preun
+%if %{defined _unitdir} && 0%{?systemd_preun:1}
+%systemd_preun pacemaker.service
+%else
+if [ $1 -eq 0 ]; then
+    /sbin/service pacemaker stop &>/dev/null || :
+    /sbin/chkconfig --del pacemaker || :
+fi
+%endif
+
+%postun
+%if %{defined _unitdir} && 0%{?systemd_postun_with_restart:1}
+%systemd_postun_with_restart pacemaker.service 
+%endif
 
-%postun -n pacemaker-libs -p /sbin/ldconfig
+%post remote
+%if %{defined _unitdir} && 0%{?systemd_post:1}
+%systemd_post pacemaker_remote.service
+%else
+if [ $1 -eq 1 ]; then
+    /sbin/chkconfig --add pacemaker_remote || :
+fi
+%endif
+
+%preun remote
+%if %{defined _unitdir} && 0%{?systemd_preun:1}
+%systemd_preun pacemaker_remote.service
+%else
+if [ $1 -eq 0 ]; then
+    /sbin/service pacemaker_remote stop &>/dev/null || :
+    /sbin/chkconfig --del pacemaker_remote || :
+fi
+%endif
+
+%postun remote
+%if %{defined _unitdir} && 0%{?systemd_postun_with_restart:1}
+%systemd_postun_with_restart pacemaker_remote.service 
+%endif
+
+%pre -n %{name}-libs
+getent group %{gname} >/dev/null || groupadd -r %{gname} -g 189
+getent passwd %{uname} >/dev/null || useradd -r -g %{gname} -u 189 -s /sbin/nologin -c "cluster user" %{uname}
+exit 0
+
+%post -n %{name}-libs -p /sbin/ldconfig
+
+%postun -n %{name}-libs -p /sbin/ldconfig
+
+%post -n %{name}-cluster-libs -p /sbin/ldconfig
+
+%postun -n %{name}-cluster-libs -p /sbin/ldconfig
 
 %files
 ###########################################################
 %defattr(-,root,root)
+%doc AUTHORS COPYING ChangeLog
 
 %exclude %{_datadir}/pacemaker/tests
 
+%config(noreplace) %{_sysconfdir}/sysconfig/pacemaker
+%{_sbindir}/pacemakerd
+
+%if %{defined _unitdir}
+%{_unitdir}/pacemaker.service
+%else
+%{_initrddir}/pacemaker
+%endif
+
 %{_datadir}/pacemaker
 %{_datadir}/snmp/mibs/PCMK-MIB.txt
-%{_libdir}/heartbeat/*
-%{_sbindir}/cibadmin
+%exclude %{_libexecdir}/pacemaker/lrmd_test
+%exclude %{_sbindir}/pacemaker_remoted
+%{_libexecdir}/pacemaker/*
+
 %{_sbindir}/crm_attribute
-%{_sbindir}/crm_diff
-%{_sbindir}/crm_failcount
 %{_sbindir}/crm_master
-%{_sbindir}/crm_mon
-%{_sbindir}/crm
-%{_sbindir}/crm_simulate
-%{_sbindir}/crm_resource
-%{_sbindir}/crm_report
-%{_sbindir}/crm_standby
-%{_sbindir}/crm_verify
-%{_sbindir}/crmadmin
-%{_sbindir}/iso8601
-%{_sbindir}/attrd_updater
-%{_sbindir}/ptest
-%{_sbindir}/crm_shadow
-%{_sbindir}/cibpipe
 %{_sbindir}/crm_node
+%{_sbindir}/attrd_updater
 %{_sbindir}/fence_legacy
+%{_sbindir}/fence_pcmk
 %{_sbindir}/stonith_admin
-%{python_sitelib}/crm
-#%{_mandir}/man8/*.8*
-%{_mandir}
 
-%if %{with heartbeat}
-%{_sbindir}/crm_uuid
-%else
-%exclude %{_sbindir}/crm_uuid
-%endif
-
-# Packaged elsewhere
-%exclude %{_datadir}/pacemaker/tests
-
-%doc COPYING
-%doc AUTHORS
-
-%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/heartbeat/crm
-%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pengine
-%dir %attr (750, %{uname}, %{gname}) %{_var}/run/crm
+%doc %{_mandir}/man7/*
+%doc %{_mandir}/man8/attrd_updater.*
+%doc %{_mandir}/man8/crm_attribute.*
+%doc %{_mandir}/man8/crm_node.*
+%doc %{_mandir}/man8/crm_master.*
+%doc %{_mandir}/man8/fence_pcmk.*
+%doc %{_mandir}/man8/pacemakerd.*
+%doc %{_mandir}/man8/stonith_admin.*
+
+%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker
+%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/cib
+%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/cores
+%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/pengine
+%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/blackbox
+%ghost %dir %attr (750, %{uname}, %{gname}) %{_var}/run/crm
 %dir /usr/lib/ocf
 %dir /usr/lib/ocf/resource.d
 /usr/lib/ocf/resource.d/pacemaker
-%if %{with ais}
+
+%if 0%{?cs_major} < 2
+%if 0%{?cs_minor} < 8
 %{_libexecdir}/lcrso/pacemaker.lcrso
 %endif
+%endif
+
+%if %{with upstart_job}
+%config(noreplace) %{_sysconfdir}/init/pacemaker.conf
+%config(noreplace) %{_sysconfdir}/init/pacemaker.combined.conf
+%endif
 
-%files -n pacemaker-libs
+%files cli
+%defattr(-,root,root)
+%doc AUTHORS COPYING ChangeLog
+%{_sbindir}/cibadmin
+%{_sbindir}/crm_diff
+%{_sbindir}/crm_error
+%{_sbindir}/crm_failcount
+%{_sbindir}/crm_mon
+%{_sbindir}/crm_resource
+%{_sbindir}/crm_standby
+%{_sbindir}/crm_verify
+%{_sbindir}/crmadmin
+%{_sbindir}/iso8601
+%{_sbindir}/crm_shadow
+%{_sbindir}/crm_simulate
+%{_sbindir}/crm_report
+%{_sbindir}/crm_ticket
+%doc %{_mandir}/man8/*
+%exclude %{_mandir}/man8/attrd_updater.*
+%exclude %{_mandir}/man8/crm_attribute.*
+%exclude %{_mandir}/man8/crm_node.*
+%exclude %{_mandir}/man8/crm_master.*
+%exclude %{_mandir}/man8/fence_pcmk.*
+%exclude %{_mandir}/man8/pacemakerd.*
+%exclude %{_mandir}/man8/pacemaker_remoted.*
+%exclude %{_mandir}/man8/stonith_admin.*
+
+%files -n %{name}-libs
 %defattr(-,root,root)
+%doc AUTHORS COPYING.LIB
 %{_libdir}/libcib.so.*
+%{_libdir}/liblrmd.so.*
+%{_libdir}/libcrmservice.so.*
 %{_libdir}/libcrmcommon.so.*
-%{_libdir}/libcrmcluster.so.*
 %{_libdir}/libpe_status.so.*
 %{_libdir}/libpe_rules.so.*
 %{_libdir}/libpengine.so.*
-%{_libdir}/libtransitioner.so.*
 %{_libdir}/libstonithd.so.*
-%doc COPYING.LIB
-%doc AUTHORS
+%{_libdir}/libtransitioner.so.*
+
+%files -n %{name}-cluster-libs
+%defattr(-,root,root)
+%{_libdir}/libcrmcluster.so.*
+%doc AUTHORS COPYING.LIB
+
+
+%files remote
+%defattr(-,root,root)
+%doc AUTHORS COPYING.LIB
+%config(noreplace) %{_sysconfdir}/logrotate.d/pacemaker
+%config(noreplace) %{_sysconfdir}/sysconfig/pacemaker
+%if %{defined _unitdir}
+%{_unitdir}/pacemaker_remote.service
+%else
+%{_initrddir}/pacemaker_remote
+%endif
+%{_sbindir}/pacemaker_remoted
+%{_mandir}/man8/pacemaker_remoted.*
 
 %files doc
 %defattr(-,root,root)
@@ -291,21 +470,29 @@ rm -rf %{buildroot}
 
 %files cts
 %defattr(-,root,root)
-%{python_sitelib}/cts
+%doc AUTHORS COPYING.LIB
+%{py_site}/cts
 %{_datadir}/pacemaker/tests/cts
-%doc COPYING.LIB
-%doc AUTHORS
+%{_libexecdir}/pacemaker/lrmd_test
 
-%files -n pacemaker-libs-devel
+%files -n %{name}-libs-devel
 %defattr(-,root,root)
+%doc AUTHORS COPYING.LIB
 %exclude %{_datadir}/pacemaker/tests/cts
 %{_datadir}/pacemaker/tests
 %{_includedir}/pacemaker
 %{_libdir}/*.so
-%doc COPYING.LIB
-%doc AUTHORS
+%if %{with profiling}
+%{_var}/lib/pacemaker
+%endif
+%{_libdir}/pkgconfig/*.pc
+
 
 %changelog
+* Sat Feb 28 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 1.1.12-1
+- updated to 1.1.12
+- rebuilt with gnutls 3.2.20 and corosync 2.3.4
+
 * Wed Mar 07 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.1.2-4
 - rebuild with net-snmp-5.7.1
 

+ 92 - 0
p/perl-Net-IMAP-Simple-SSL/perl-Net-IMAP-Simple-SSL-vl.spec

@@ -0,0 +1,92 @@
+Name: perl-Net-IMAP-Simple-SSL
+Version: 1.3
+Release: 14%{?_dist_release}
+Summary: Simple IMAP account handling with SSL
+
+Group: Development/Libraries
+License: GPL+ or Artistic
+URL: http://search.cpan.org/dist/Net-IMAP-Simple-SSL
+
+Source0: http://www.cpan.org/modules/by-module/Net/Net-IMAP-Simple-SSL-%{version}.tar.gz
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+BuildArch: noarch
+BuildRequires: perl(ExtUtils::MakeMaker), perl(Test::More)
+BuildRequires: perl(IO::Socket::SSL)
+Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
+
+%description
+Perl extension for simple IMAP account handling, mostly compatible
+with Net::POP3.
+
+%prep
+%setup -q -n Net-IMAP-Simple-SSL-%{version}
+
+%build
+%{__perl} Makefile.PL INSTALLDIRS=vendor
+make %{?_smp_mflags}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make %{?_smp_mflags} pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
+find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
+find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null ';'
+chmod -R u+w $RPM_BUILD_ROOT
+
+%check
+make %{?_smp_mflags} test
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%doc README Changes
+%dir %{perl_vendorlib}/Net/
+%dir %{perl_vendorlib}/Net/IMAP/
+%dir %{perl_vendorlib}/Net/IMAP/Simple/
+%{perl_vendorlib}/Net/IMAP/Simple/SSL.pm
+%{_mandir}/man3/Net::IMAP::Simple::SSL.3*
+
+%changelog
+* Thu Feb 26 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> - 1.3-14
+- Initial build for Vine Linux
+
+* Thu Aug 28 2014 Jitka Plesnikova <jplesnik@redhat.com> - 1.3-13
+- Perl 5.20 rebuild
+
+* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3-12
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
+
+* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3-11
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
+
+* Tue Jul 23 2013 Petr Pisar <ppisar@redhat.com> - 1.3-10
+- Perl 5.18 rebuild
+
+* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3-9
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+
+* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3-8
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Thu Jun 14 2012 Petr Pisar <ppisar@redhat.com> - 1.3-7
+- Perl 5.16 rebuild
+
+* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3-6
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Tue Jul 19 2011 Petr Sabata <contyk@redhat.com> - 1.3-5
+- Perl mass rebuild
+
+* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Tue Dec 21 2010 Marcela Maslanova <mmaslano@redhat.com> - 1.3-3
+- 661697 rebuild for fixing problems with vendorach/lib
+
+* Sun Jun 27 2010 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.3-2
+- Fix %%description
+
+* Sat Jun 19 2010 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.3-1
+- First package

+ 142 - 113
r/resource-agents/resource-agents-vl.spec

@@ -1,41 +1,38 @@
-###############################################################################
-###############################################################################
-##
-##  Copyright (C) 2004-2010 Red Hat, Inc.  All rights reserved.
-##
-##  This copyrighted material is made available to anyone wishing to use,
-##  modify, copy, or redistribute it subject to the terms and conditions
-##  of the GNU General Public License v.2.
-##
-###############################################################################
-###############################################################################
-
-# keep around ready for later user
-## global alphatag rc4
-
-# When downloading directly from Mercurial, it will automatically add this prefix
-# Invoking 'hg archive' wont but you can add one with:
-#  hg archive -t tgz -p "Cluster-Resource-Agents-" -r $altversion $altversion.tar.gz
-%global altprefix Cluster-Resource-Agents-
-%global altversion a7c0f35916bf
-
-Name: resource-agents
-Summary: Open Source HA Resource Agents
-Summary(ja): Open Source HA Resource Agents
-Version: 3.0.13
-Release: 1%{?_dist_release}
-License: GPLv2+ and LGPLv2+
-Group: System Environment/Base
-URL: http://sources.redhat.com/cluster/wiki/
-Source0: https://fedorahosted.org/releases/c/l/cluster/%{name}-%{version}.tar.bz2
-Source1: http://hg.linux-ha.org/agents/archive/%{altversion}.tar.bz2
+# determine the ras-set to process based on configure invokation
+%bcond_with    rgmanager
+%bcond_without linuxha
+
+Name:		resource-agents
+Summary:	Open Source HA Reusable Cluster Resource Scripts
+Version:	3.9.6
+Release:	1%{?_dist_release}
+License:	GPLv3+ and LGPLv2+
+Group:		System Environment/Base
+URL:		https://github.com/ClusterLabs/resource-agents
+
+Source0:	https://github.com/ClusterLabs/%{name}/archive/v%{version}.tar.gz
+
+## Setup/build bits
+BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root
+# Build dependencies
+BuildRequires:	automake autoconf pkgconfig
+BuildRequires:	perl python-devel
+BuildRequires:	libxslt glib2-devel
+BuildRequires:	which
+#BuildRequires: cluster-glue-libs-devel 
+BuildRequires:	docbook-style-xsl docbook-dtds
+BuildRequires:	libnet-devel
 
 ## Runtime deps
 # system tools shared by several agents
+## These apply to rgmanager agents only to guarantee agents
+## are functional
+%if %{with rgmanager}
+# system tools shared by several agents
 Requires: bash grep sed gawk
 Requires: procps net-tools
 Requires: psmisc
-Requires: util-linux-ng
+Requires: util-linux
 
 # fs.sh
 Requires: quota
@@ -52,99 +49,108 @@ Requires: lvm2
 
 # netfs.sh
 Requires: nfs-utils samba-client
+%endif
 
-## Setup/build bits
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-
-# Build dependencies
-BuildRequires: cluster-glue-libs-devel glib2-devel
-BuildRequires: automake autoconf pkgconfig
-BuildRequires: libxslt docbook-style-xsl
-BuildRequires: python perl 
-BuildRequires: libnet-devel
+Obsoletes:	heartbeat-resources <= %{version}
+Provides:	heartbeat-resources = %{version}
 
 %description
 A set of scripts to interface with several services to operate in a
 High Availability environment for both Pacemaker and rgmanager
 service managers.
 
+%if %{with linuxha}
 %package -n ldirectord
-Summary:          Monitor daemon for maintaining high availability resources
-Summary(ja):          Monitor daemon for maintaining high availability resources
-Group:            System Environment/Daemons
-Requires:         ipvsadm
-Requires(post):   /sbin/chkconfig
-Requires(preun):  /sbin/chkconfig
-
-# We were originally ldirectord, then renamed with a heartbeat- prefix.
-# Upstream maintainer wishes to use no prefix, which is consistent with 
-# how it is packaged for other distributions
-Provides:  ldirectord = 3.0.0-15
-Obsoletes: ldirectord < 3.0.0-15
-Provides:  heartbeat-ldirectord = 3.0.0-15
-Obsoletes: heartbeat-ldirectord < 3.0.0-15
-
-# removed for now until it's in Fedora
-#Requires:  perl(Net::IMAP::Simple::SSL)
+Summary:	Monitor daemon for maintaining high availability resources
+Group:		System Environment/Daemons
+License:	GPLv2+
+Requires:	perl-Net-SSLeay perl-libwww-perl perl-MailTools
+Requires:	perl-Net-IMAP-Simple-SSL
+Requires:	ipvsadm logrotate
+Requires(post): /sbin/chkconfig
+Requires(preun):/sbin/chkconfig
+Obsoletes:	heartbeat-ldirectord <= %{version}
+Provides:	heartbeat-ldirectord = %{version}
 
 %description -n ldirectord
-ldirectord is a stand-alone daemon to monitor services of real 
-for virtual services provided by The Linux Virtual Server
-(http://www.linuxvirtualserver.org/). It is simple to install 
-and works with the heartbeat code (http://www.linux-ha.org/).
-
-# we inherit configure from cluster project. Configure it for vars we need.
-# building from source directly without those parameters will NOT work.
-# See http://www.redhat.com/archives/cluster-devel/2009-February/msg00003.html
+The Linux Director Daemon (ldirectord) was written by Jacob Rief.
+<jacob.rief@tiscover.com>
+
+ldirectord is a stand alone daemon for monitoring the services on real
+servers. Currently, HTTP, HTTPS, and FTP services are supported.
+lditrecord is simple to install and works with the heartbeat code
+(http://www.linux-ha.org/).
+
+See 'ldirectord -h' and linux-ha/doc/ldirectord for more information.
+%endif
+
 %prep
-%setup -q -n %{name}-%{version} -a 1
+%setup -q -n %{name}-%{version} 
 
 # prepare rgmanager RAs
-%{_configure} \
-  --sbindir=%{_sbindir} \
-  --initddir=%{_sysconfdir}/rc.d/init.d \
-  --libdir=%{_libdir} \
-  --without_fence_agents \
-  --disable_kernel_check
+#configure \
+#  --sbindir=%{_sbindir} \
+#  --initddir=%{_sysconfdir}/rc.d/init.d \
+#  --libdir=%{_libdir} \
+#  --without_fence_agents \
+#  --disable_kernel_check
 
 # prepare pacemaker RAs
-cd %{altprefix}%{altversion}
-./autogen.sh
-%{configure} --enable-fatal-warnings=no --with-rsctmpdir=%{_var}/run/heartbeat/rsctmp
+#cd %{altprefix}%{altversion}
+#./autogen.sh
+#configure --enable-fatal-warnings=no --with-rsctmpdir=%{_var}/run/heartbeat/rsctmp
 
 %build
-##CFLAGS="$(echo '%{optflags}')" make %{_smp_mflags}
-# %{_smp_mflags} is broken from upstream and unrequired for this project.
-CFLAGS="$(echo '%{optflags}')" make -C rgmanager/src/resources
-make -C %{altprefix}%{altversion} %{_smp_mflags}
+if [ ! -f configure ]; then
+	./autogen.sh
+fi
+
+%if %{with rgmanager}
+%global rasset rgmanager
+%endif
+%if %{with linuxha}
+%global rasset linux-ha
+%endif
+%if %{with rgmanager} && %{with linuxha}
+%global rasset all
+%endif
+
+%configure \
+    --enable-fatal-warnings=no \
+    --with-version=%{version} \
+    --with-pkg-name=%{name} \
+    --with-initdir=%{_initdir} \
+    --with-ras-set=%{rasset}
+
+make %{?_smp_mflags}
 
 %install
 rm -rf %{buildroot}
-make -C rgmanager/src/resources install DESTDIR=%{buildroot}
-make -C %{altprefix}%{altversion} install DESTDIR=%{buildroot}
+make install DESTDIR=%{buildroot}
 
 # tree fixup
-rm %{buildroot}/%{_libdir}/heartbeat/ocf-*
-find %{buildroot} -type f -name '.ocf-*' -exec chmod 644 {} \;
-find %{buildroot} -type f -name 'ocf-*' -exec chmod 644 {} \;
-find %{buildroot} -type f -name '*.dtd' -exec chmod 644 {} \;
-chmod 755 %{buildroot}/%{_sbindir}/ocf-tester
-chmod 755 %{buildroot}/%{_datadir}/cluster/ocf-shellfuncs
-
-# Strange location, remove until we can confirm
-rm -f %{buildroot}%{_libdir}/heartbeat/tickle_tcp
-
-# Test harness, worth creating a devel package for?
-rm -rf %{buildroot}%{_datadir}/resource-agents/ocft
-rm -f  %{buildroot}%{_sbindir}/ocft
+# remove docs (there is only one and they should come from doc sections in files)
+rm -rf %{buildroot}/usr/share/doc/resource-agents
 
+%if %{with rgmanager}
 # symlink to allow pacemaker to use rgmanager RAs
 cd %{buildroot}/usr/lib/ocf/resource.d/ && \
- ln -sf %{_datadir}/cluster/ vine
+    ln -sf %{_datadir}/cluster/ vine
+
+# remove symlink named redhat
+rm -f %{buildroot}/usr/lib/ocf/resource.d/redhat
+%endif
 
 %clean
 rm -rf %{buildroot}
 
+
+%if %{with rgmanager}
+%post -n resource-agents
+ccs_update_schema > /dev/null 2>&1 ||:
+%endif
+
+%if %{with linuxha}
 %post -n ldirectord
 /sbin/chkconfig --add ldirectord
 
@@ -152,45 +158,68 @@ rm -rf %{buildroot}
 
 %preun -n ldirectord
 /sbin/chkconfig --del ldirectord
+%endif
 
 %files
 %defattr(-,root,root,-)
-%doc doc/COPYING.* doc/COPYRIGHT doc/README.licence
-%doc %{altprefix}%{altversion}/AUTHORS
+%doc AUTHORS COPYING COPYING.GPLv3 ChangeLog
+%if %{with linuxha}
+%doc doc/README.webapps
+%doc %{_datadir}/%{name}/ra-api-1.dtd
+%endif
+
+%if %{with rgmanager}
 %{_datadir}/cluster
+%{_sbindir}/rhev-check.sh
+%endif
 
+%if %{with linuxha}
 %dir /usr/lib/ocf
 %dir /usr/lib/ocf/resource.d
+%dir /usr/lib/ocf/lib
+/usr/lib/ocf/lib/heartbeat
 /usr/lib/ocf/resource.d/heartbeat
+%if %{with rgmanager}
 /usr/lib/ocf/resource.d/vine
+%endif
+%dir %{_datadir}/%{name}
+%dir %{_datadir}/%{name}/ocft
+%{_datadir}/%{name}/ocft/configs
+%{_datadir}/%{name}/ocft/caselib
+%{_datadir}/%{name}/ocft/README
+%{_datadir}/%{name}/ocft/README.zh_CN
 %{_sbindir}/ocf-tester
-%{_sbindir}/sfex_init
-
-%dir %{_datadir}/resource-agents
-%doc %{_datadir}/resource-agents/ra-api-1.dtd
+%{_sbindir}/ocft
+%{_includedir}/heartbeat
+%dir %attr (1755, root, root)	%{_var}/run/resource-agents
 %{_mandir}/man7/*.7*
-
+%{_mandir}/man8/ocf-tester.8*
+# For compatability with pre-existing agents
 %dir %{_sysconfdir}/ha.d
 %{_sysconfdir}/ha.d/shellfuncs
+%{_libexecdir}/heartbeat
+%endif
 
-%dir %{_libdir}/heartbeat
-%{_libdir}/heartbeat/findif
-%{_libdir}/heartbeat/send_arp  
-%{_libdir}/heartbeat/sfex_daemon
-%{_includedir}/heartbeat/agent_config.h
-
+%if %{with linuxha}
 %files -n ldirectord
 %defattr(-,root,root,-)
-%doc %{altprefix}%{altversion}/COPYING 
-%doc %{altprefix}%{altversion}/ldirectord/ldirectord.cf
 %{_sbindir}/ldirectord
+%doc ldirectord/ldirectord.cf COPYING
 %config(noreplace) %{_sysconfdir}/logrotate.d/ldirectord
-%{_sysconfdir}/init.d/ldirectord
+%dir %{_sysconfdir}/ha.d
+%dir %{_sysconfdir}/ha.d/resource.d
 %{_sysconfdir}/ha.d/resource.d/ldirectord
-%{_mandir}/man8/ldirectord.8*
+%{_initdir}/ldirectord
 /usr/lib/ocf/resource.d/heartbeat/ldirectord
+%{_mandir}/man8/ldirectord.8*
+%endif
+
 
 %changelog
+* Thu Feb 26 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.9.6-1
+- updated to 3.9.6
+- added R: perl-Net-IMAP-Simple-SSL to ldirectord
+
 * Sat Jul 10 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 3.0.13-1
 - initial build for Vine Linux