[packages/cluster-glue] - added link patch (fixes linking of some plugins, avoid unnecessary libraries in global LIBS) - add

qboosh qboosh at pld-linux.org
Fri Sep 6 18:17:13 CEST 2013


commit 1be99b687a67e30e444f75a49a508497f0751f41
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Sep 6 18:16:40 2013 +0200

    - added link patch (fixes linking of some plugins, avoid unnecessary libraries in global LIBS)
    - added opt patch (avoid disabling all gcc optimizations with -O0)
    - separated -tests

 cluster-glue-link.patch | 104 ++++++++++++++++++++++++++++++++++++++++++++++++
 cluster-glue-opt.patch  |  13 ++++++
 cluster-glue.spec       |  97 ++++++++++++++++++++++++++++++++++----------
 3 files changed, 194 insertions(+), 20 deletions(-)
---
diff --git a/cluster-glue.spec b/cluster-glue.spec
index f4d3e11..b42358c 100644
--- a/cluster-glue.spec
+++ b/cluster-glue.spec
@@ -1,42 +1,51 @@
-# TODO
-# - tests packaged in -devel to own pkg or just rm -rf
+# TODO:
 # - pldize ha_logd initscript (look heartbeat.init?)
-# - stonith-libs? pils?
+# - stonith-libs? pils? (any sense? libs are small and have little external dependencies)
+# - separate some stonith plugins which have external dependencies?
+#
+# Conditional build:
+%bcond_without	vacm	# VACM stonith plugin
+#
 Summary:	Reusable cluster components
 Summary(pl.UTF-8):	Komponenty klastrowe wielokrotnego użytku
 Name:		cluster-glue
 Version:	1.0.11
 Release:	5
 License:	GPL v2+ and LGPL v2+
-Group:		Base
+Group:		Aplications/System
 Source0:	http://hg.linux-ha.org/glue/archive/glue-%{version}.tar.bz2
 # Source0-md5:	7d0acd99d43edac849dc76f43cfa4c7f
 Source1:	logd.service
+Patch0:		%{name}-link.patch
+Patch1:		%{name}-opt.patch
 URL:		http://www.linux-ha.org/
-BuildRequires:	OpenIPMI-devel
-BuildRequires:	autoconf
+BuildRequires:	OpenIPMI-devel >= 1.4
+BuildRequires:	autoconf >= 2.53
 BuildRequires:	automake
 BuildRequires:	bzip2-devel
 BuildRequires:	curl-devel
 BuildRequires:	docbook-dtd42-xml
 BuildRequires:	docbook-dtd44-xml
 BuildRequires:	docbook-style-xsl
-BuildRequires:	glib2-devel
+BuildRequires:	glib2-devel >= 2.0
+BuildRequires:	help2man
 BuildRequires:	libaio-devel
 BuildRequires:	libltdl-devel
-BuildRequires:	libnet-devel
+BuildRequires:	libnet-devel >= 1.0
 BuildRequires:	libstdc++-devel
 BuildRequires:	libtool
 BuildRequires:	libuuid-devel
-BuildRequires:	libxml2-devel
+BuildRequires:	libxml2-devel >= 2.0
 BuildRequires:	libxslt-progs
 BuildRequires:	ncurses-devel
 BuildRequires:	net-snmp-devel >= 5.4
 BuildRequires:	openhpi-devel
 BuildRequires:	openssl-devel
+BuildRequires:	perl-tools-pod
 BuildRequires:	pkgconfig
 BuildRequires:	python-devel
 BuildRequires:	rpm-pythonprov
+%{?with_vacm:BuildRequires:	vacm-devel}
 BuildRequires:	zlib-devel
 Requires(post,preun):	/sbin/chkconfig
 Requires(postun):	/usr/sbin/groupdel
@@ -58,8 +67,6 @@ Obsoletes:	heartbeat-common
 Obsoletes:	heartbeat-pils < 3.0.0-1
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		filterout_ld	-Wl,--as-needed
-
 %description
 A collection of common tools that are useful for writing cluster
 managers such as Pacemaker. Provides a local resource manager that
@@ -75,7 +82,7 @@ STONITH.
 %package libs
 Summary:	Reusable cluster libraries
 Summary(pl.UTF-8):	Biblioteki klastrowe wielokrotnego użytku
-Group:		Development/Libraries
+Group:		Libraries
 Obsoletes:	libheartbeat2
 
 %description libs
@@ -91,6 +98,8 @@ Summary:	Header files for writing cluster managers
 Summary(pl.UTF-8):	Pliki nagłówkowe do pisania zarządców klastrów
 Group:		Development/Libraries
 Requires:	%{name}-libs = %{version}-%{release}
+Requires:	glib2-devel >= 2.0
+Requires:	libltdl-devel
 Obsoletes:	libheartbeat-devel
 
 %description libs-devel
@@ -100,6 +109,18 @@ Header files useful for writing cluster managers such as Pacemaker.
 Pliki nagłówkowe przydatne przy pisaniu zarządców klastrów, takich jak
 Pacemaker.
 
+%package tests
+Summary:	Tests for cluster-glue framework
+Summary(pl.UTF-8):	Testy dla szkieletu cluster-glue
+Group:		Development
+Requires:	%{name}-libs = %{version}-%{release}
+
+%description tests
+Tests for cluster-glue framework.
+
+%description tests -l pl.UTF-8
+Testy dla szkieletu cluster-glue.
+
 %package stonith
 Summary:	Provides an interface to Shoot The Other Node In The Head
 Summary(pl.UTF-8):	Interfejs do "odstrzelenia" drugiego węzła w klastrze
@@ -117,6 +138,9 @@ STONITH (Shoot The Other Node In The Head) to interfejs służący do
 
 %prep
 %setup -q -n Reusable-Cluster-Components-glue--glue-%{version}
+%patch0 -p1
+%patch1 -p1
+
 sed -i -e's;#!/usr/bin/env \(python\|perl\);#!/usr/bin/\1;' \
 					lib/plugins/stonith/external/*
 
@@ -127,12 +151,12 @@ sed -i -e's;#!/usr/bin/env \(python\|perl\);#!/usr/bin/\1;' \
 %{__automake}
 %{__autoconf}
 %configure \
-	--with-initdir=/etc/rc.d/init.d \
+	--docdir=%{_docdir}/%{name}-%{version} \
 	--disable-fatal-warnings \
+	--disable-static \
 	--with-daemon-group=haclient \
-	--with-daemon-user=hacluster\
-	--docdir=%{_docdir}/%{name}-%{version} \
-	--disable-static
+	--with-daemon-user=hacluster \
+	--with-initdir=/etc/rc.d/init.d
 %{__make}
 
 %install
@@ -144,7 +168,7 @@ install -d $RPM_BUILD_ROOT%{systemdunitdir}
 
 find $RPM_BUILD_ROOT -name '*.la' -delete
 
-%{__sed} -e's;@libdir@;%{_libdir};g' \
+%{__sed} -e 's;@libdir@;%{_libdir};g' \
 	%{SOURCE1} > $RPM_BUILD_ROOT%{systemdunitdir}/logd.service
 
 %clean
@@ -178,7 +202,7 @@ fi
 
 %files
 %defattr(644,root,root,755)
-%doc AUTHORS logd/logd.cf
+%doc AUTHORS ChangeLog logd/logd.cf
 %attr(754,root,root) /etc/rc.d/init.d/logd
 %{systemdunitdir}/logd.service
 
@@ -234,6 +258,7 @@ fi
 %attr(755,root,root) %ghost %{_libdir}/libstonith.so.1
 %dir %{_libdir}/heartbeat
 %dir %{_libdir}/heartbeat/plugins
+# also used by resource-agents runtime package (shouldn't agent_config.h be in resource-agents-devel?)
 %dir %{_includedir}/heartbeat
 
 %files libs-devel
@@ -244,10 +269,15 @@ fi
 %attr(755,root,root) %{_libdir}/libplumbgpl.so
 %attr(755,root,root) %{_libdir}/libstonith.so
 %{_includedir}/clplumbing
-%{_includedir}/heartbeat/*
+%{_includedir}/heartbeat/compress.h
+%{_includedir}/heartbeat/glue_config.h
+%{_includedir}/heartbeat/ha_msg.h
+%{_includedir}/heartbeat/lrm
 %{_includedir}/stonith
 %{_includedir}/pils
 
+%files tests
+%defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/heartbeat/ipctest
 %attr(755,root,root) %{_libdir}/heartbeat/ipctransientclient
 %attr(755,root,root) %{_libdir}/heartbeat/ipctransientserver
@@ -293,6 +323,33 @@ fi
 %dir %{_libdir}/stonith/plugins/external
 %attr(755,root,root) %{_libdir}/stonith/plugins/external/*
 %dir %{_libdir}/stonith/plugins/stonith2
-%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/*.so
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/apcmaster.so
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/apcmastersnmp.so
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/apcsmart.so
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/baytech.so
+# R: openhpi
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/bladehpi.so
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/cyclades.so
+# R: curl libxml2
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/drac3.so
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/external.so
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/ibmhmc.so
+# R: OpenIPMI
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/ipmilan.so
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/meatware.so
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/null.so
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/nw_rpc100s.so
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/rcd_serial.so
+# R: libxml2
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/rhcs.so
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/rps10.so
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/ssh.so
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/suicide.so
+%if %{with vacm}
+# R: vacm-libs
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/vacm.so
+%endif
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/wti_mpc.so
+%attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/wti_nps.so
 %attr(755,root,root) %{_libdir}/stonith/plugins/stonith2/ribcl.py
 %attr(755,root,root) %{_libdir}/stonith/plugins/xen0-ha-dom0-stonith-helper
diff --git a/cluster-glue-link.patch b/cluster-glue-link.patch
new file mode 100644
index 0000000..8881c96
--- /dev/null
+++ b/cluster-glue-link.patch
@@ -0,0 +1,104 @@
+--- Reusable-Cluster-Components-glue--glue-1.0.11/lib/plugins/stonith/Makefile.am.orig	2012-10-15 15:58:55.000000000 +0200
++++ Reusable-Cluster-Components-glue--glue-1.0.11/lib/plugins/stonith/Makefile.am	2013-09-06 15:41:19.579970814 +0200
+@@ -156,7 +156,7 @@
+ 
+ rhcs_la_SOURCES	= rhcs.c	$(INCFILES)
+ rhcs_la_LDFLAGS	= -export-dynamic -module -avoid-version
+-rhcs_la_LIBADD	= $(top_builddir)/lib/stonith/libstonith.la $(top_builddir)/replace/libreplace.la
++rhcs_la_LIBADD	= $(top_builddir)/lib/stonith/libstonith.la $(top_builddir)/replace/libreplace.la $(LIBXML2)
+ 
+ ibmhmc_la_SOURCES	= ibmhmc.c	$(INCFILES)
+ ibmhmc_la_LDFLAGS	= -export-dynamic -module -avoid-version
+@@ -196,7 +196,7 @@
+ 
+ vacm_la_SOURCES		= vacm.c $(INCFILES)
+ vacm_la_LDFLAGS		= -export-dynamic -module -avoid-version
+-vacm_la_LIBADD		= $(top_builddir)/lib/stonith/libstonith.la $(top_builddir)/replace/libreplace.la
++vacm_la_LIBADD		= $(top_builddir)/lib/stonith/libstonith.la $(top_builddir)/replace/libreplace.la -lvacmclient
+ 
+ wti_nps_la_SOURCES	= wti_nps.c $(INCFILES)
+ wti_nps_la_LDFLAGS	= -export-dynamic -module -avoid-version
+--- Reusable-Cluster-Components-glue--glue-1.0.11/configure.ac.orig	2013-09-06 16:40:51.983154227 +0200
++++ Reusable-Cluster-Components-glue--glue-1.0.11/configure.ac	2013-09-06 17:26:50.276371805 +0200
+@@ -545,14 +545,13 @@
+ dnl ===============================================
+ dnl Libraries
+ dnl ===============================================
+-AC_CHECK_LIB(socket, socket)			
+-AC_CHECK_LIB(c, dlopen)				dnl if dlopen is in libc...
+-AC_CHECK_LIB(dl, dlopen)			dnl for Linux
+-AC_CHECK_LIB(rt, sched_getscheduler)            dnl for Tru64
+-AC_CHECK_LIB(gnugetopt, getopt_long)		dnl if available
+-AC_CHECK_LIB(uuid, uuid_parse)			dnl e2fsprogs
+-AC_CHECK_LIB(uuid, uuid_create)			dnl ossp
+-AC_CHECK_LIB(posix4, sched_getscheduler)
++AC_SEARCH_LIBS(socket, [socket])
++AC_SEARCH_LIBS(dlopen, [dl])
++AC_SEARCH_LIBS(sched_getscheduler, [rt posix4])
++AC_SEARCH_LIBS(getopt_long, [gnugetopt])		dnl if available
++AC_CHECK_LIB(uuid, uuid_parse, [LIBUUID=-luuid])	dnl e2fsprogs
++AC_CHECK_LIB(uuid, uuid_create, [LIBUUID=-luuid])	dnl ossp
++AC_SUBST([LIBUUID])
+ 
+ if test x"${PKGCONFIG}" = x""; then
+    AC_MSG_ERROR(You need pkgconfig installed in order to build ${PACKAGE})
+@@ -699,7 +697,8 @@
+ else
+    XML2HEAD="`$XML2CONFIG --cflags`"
+    AC_MSG_RESULT($XML2HEAD)
+-   AC_CHECK_LIB(xml2, xmlReadMemory)
++   AC_CHECK_LIB(xml2, xmlReadMemory, [LIBXML2=-lxml2])
++   AC_SUBST([LIBXML2])
+ fi
+ 
+ CPPFLAGS="$CPPFLAGS $XML2HEAD"
+@@ -1107,7 +1105,7 @@
+ dnl check if header file and lib are there for zlib
+ zlib_installed="yes"
+ AC_CHECK_HEADERS(zlib.h, , [zlib_installed="no"],)
+-AC_CHECK_LIB(z, compress , , [zlib_installed="no"])
++AC_CHECK_LIB(z, compress , [LIBZ=-lz], [zlib_installed="no"])
+ AM_CONDITIONAL(BUILD_ZLIB_COMPRESS_MODULE, test "x${zlib_installed}" = "xyes")
+ if test "x${zlib_installed}" = "xno"; then
+ 	FatalMissingThing "zlib" \
+@@ -1116,7 +1114,7 @@
+ 
+ bz2_installed="yes"
+ AC_CHECK_HEADERS(bzlib.h, , [bz2_installed="no"],)
+-AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffCompress , , [bz2_installed="no"])
++AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffCompress , [LIBBZ2=-lbz2], [bz2_installed="no"])
+ AM_CONDITIONAL(BUILD_BZ2_COMPRESS_MODULE, test "x${bz2_installed}" = "xyes")
+ 
+ #if test x$ac_cv_lib_bz2_BZ2_bzBuffToBuffCompress != xyes ; then
+--- Reusable-Cluster-Components-glue--glue-1.0.11/lib/clplumbing/Makefile.am.orig	2012-10-15 15:58:55.000000000 +0200
++++ Reusable-Cluster-Components-glue--glue-1.0.11/lib/clplumbing/Makefile.am	2013-09-06 17:39:45.736339262 +0200
+@@ -61,7 +61,7 @@
+ 			uids.c 	
+ 
+ libplumb_la_LIBADD      = $(top_builddir)/replace/libreplace.la \
+-			$(top_builddir)/lib/pils/libpils.la
++			$(top_builddir)/lib/pils/libpils.la $(LIBUUID)
+ libplumb_la_LDFLAGS	= -version-info 3:0:1
+ 
+ libplumbgpl_la_SOURCES	= setproctitle.c
+--- Reusable-Cluster-Components-glue--glue-1.0.11/lib/stonith/Makefile.am.orig	2012-10-15 15:58:55.000000000 +0200
++++ Reusable-Cluster-Components-glue--glue-1.0.11/lib/stonith/Makefile.am	2013-09-06 17:49:16.516315308 +0200
+@@ -33,7 +33,7 @@
+ 
+ stonith_SOURCES		= main.c
+ 
+-stonith_LDADD		= libstonith.la $(top_builddir)/lib/pils/libpils.la $(GLIBLIB) \
++stonith_LDADD		= libstonith.la $(top_builddir)/lib/pils/libpils.la $(GLIBLIB) $(LIBXML2) \
+ 			$(top_builddir)/lib/clplumbing/libplumb.la	\
+ 			$(top_builddir)/lib/clplumbing/libplumbgpl.la
+ stonith_LDFLAGS		=  @LIBADD_DL@ @LIBLTDL@ -export-dynamic @DLOPEN_FORCE_FLAGS@ @LIBADD_INTL@ 
+--- Reusable-Cluster-Components-glue--glue-1.0.11/lib/plugins/lrm/Makefile.am.orig	2012-10-15 15:58:55.000000000 +0200
++++ Reusable-Cluster-Components-glue--glue-1.0.11/lib/plugins/lrm/Makefile.am	2013-09-06 17:59:43.946288978 +0200
+@@ -44,6 +44,7 @@
+ 
+ lsb_la_SOURCES = raexeclsb.c
+ lsb_la_LDFLAGS = -L$(top_builddir)/lib/pils -lpils -export-dynamic -module -avoid-version
++lsb_la_LIBADD = $(LIBXML2)
+ 
+ ocf_la_SOURCES = raexecocf.c
+ ocf_la_LDFLAGS = -L$(top_builddir)/lib/pils -lpils -export-dynamic -module -avoid-version
diff --git a/cluster-glue-opt.patch b/cluster-glue-opt.patch
new file mode 100644
index 0000000..a28bcd6
--- /dev/null
+++ b/cluster-glue-opt.patch
@@ -0,0 +1,13 @@
+--- Reusable-Cluster-Components-glue--glue-1.0.11/configure.ac.orig	2012-10-15 15:58:55.000000000 +0200
++++ Reusable-Cluster-Components-glue--glue-1.0.11/configure.ac	2013-09-06 16:26:42.523189874 +0200
+@@ -1199,10 +1199,8 @@
+ fi
+ 
+ if test "$GCC" != yes; then
+-        CFLAGS="$CFLAGS -g"
+ 	enable_fatal_warnings=no
+ else
+-        CFLAGS="$CFLAGS -ggdb3 -O0"
+ 
+ 	# We had to eliminate -Wnested-externs because of libtool changes
+         EXTRA_FLAGS="-fgnu89-inline
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/cluster-glue.git/commitdiff/1be99b687a67e30e444f75a49a508497f0751f41



More information about the pld-cvs-commit mailing list