[Debian-ha-maintainers] Bug#650820: patch

Gabriele Giacone 1o5g4r8o at gmail.com
Tue Jul 24 06:49:01 UTC 2012


tag 650820 + patch
thanks

On Sat, May 05, 2012 at 11:53:10AM +0200, Robert Millan wrote:
> Current version still FTBFS with this patch.  It needs a bit more work...

Improved Robert's one to fix both kfreebsd and hurd FTBFS.
Thanks for considering.

--
Gabriele
-------------- next part --------------
diff --git a/debian/cluster-glue.install b/debian/cluster-glue.install
index 62160ed..891dd32 100644
--- a/debian/cluster-glue.install
+++ b/debian/cluster-glue.install
@@ -37,7 +37,6 @@ usr/lib/stonith/plugins/stonith2/wti_mpc.so
 var/*
 usr/sbin/stonith
 usr/sbin/meatclient
-usr/sbin/sbd
 usr/sbin/lrmadmin
 usr/sbin/ha_logger
 usr/sbin/hb_report
diff --git a/debian/control b/debian/control
index d267bf4..d564ed7 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: admin
 Priority: optional
 Maintainer: Debian HA Maintainers <debian-ha-maintainers at lists.alioth.debian.org>
 Uploaders: Martin Loschwitz <madkiss at debian.org>, Anibal Monsalve Salazar <anibal at debian.org>, Simon Horman <horms at debian.org>, Frederik Sch?ler <fs at debian.org>
-Build-Depends: debhelper (>= 7), libsnmp-dev, libglib2.0-dev, perl, net-tools, iputils-ping, python, psmisc, libnet1-dev, iproute, libtool, libcurl4-openssl-dev | libcurl3-openssl-dev, libxml2-dev, bison, flex, uuid-dev, lynx, libbz2-dev, zlib1g-dev, uuid-dev, libsensors4-dev | libsensors-dev, libltdl3-dev, swig, openssh-client, libgnutls-dev, python-central (>= 0.5), python-dev, libpam0g-dev, libncurses5-dev, psmisc, libopenhpi-dev, libopenipmi-dev, autoconf, automake, libtool, xsltproc, docbook-xsl, chrpath, docbook-xml, libdbus-glib-1-dev, libdbus-1-dev, help2man
+Build-Depends: debhelper (>= 7), libsnmp-dev, libglib2.0-dev, perl, net-tools, inetutils-ping, python, psmisc, libnet1-dev, iproute [linux-any], libtool, libcurl4-openssl-dev | libcurl3-openssl-dev, libxml2-dev, bison, flex, uuid-dev, lynx, libbz2-dev, zlib1g-dev, uuid-dev, libsensors4-dev [!hurd-any] | libsensors-dev [!hurd-any], libltdl3-dev, swig, openssh-client, libgnutls-dev, python-central (>= 0.5), python-dev, libpam0g-dev, libncurses5-dev, psmisc, libopenhpi-dev [!hurd-any], libopenipmi-dev [!hurd-any], autoconf, automake, libtool, xsltproc, docbook-xsl, chrpath, docbook-xml, libdbus-glib-1-dev, libdbus-1-dev, help2man
 Standards-Version: 3.9.1
 Homepage: http://hg.linux-ha.org/glue/
 Vcs-Hg: http://hg.debian.org/hg/debian-ha/cluster-glue
@@ -124,6 +124,15 @@ Description: Reusable cluster development files -- libstonith1
  library from cluster-glue, the reusable cluster components 
  package. 
 
+Package: ha-sbd
+Architecture: linux-any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Replaces: cluster-glue (<< 1.0.9+hg2665-2)
+Breaks: cluster-glue (<< 1.0.9+hg2665-2)
+Description: Shared storage fencing tool
+ This package contains the shared storage fencing daemon from
+ the Linux HA project.
+
 Package: libcluster-glue-dev
 Architecture: all
 Section: libdevel
@@ -137,7 +146,7 @@ Description: The reusable cluster components for Linux HA (transitional package)
 
 Package: cluster-glue
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, python, libtimedate-perl, liblrm2 (= ${binary:Version}), libpils2 (= ${binary:Version}), libplumb2 (= ${binary:Version}), libplumbgpl2 (= ${binary:Version}), libstonith1 (= ${binary:Version})
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, python, libtimedate-perl, liblrm2 (= ${binary:Version}), libpils2 (= ${binary:Version}), libplumb2 (= ${binary:Version}), libplumbgpl2 (= ${binary:Version}), libstonith1 (= ${binary:Version}), ha-sbd (>= 1.0.9+hg2665-2)
 Replaces: heartbeat (<= 2.99.2+sles11r9-5), heartbeat-common (<= 2.99.2+sles11r9-5), libheartbeat2 (<= 2.99.2+sles11r9-5)
 Conflicts: heartbeat (<= 2.99.2+sles11r9-5), heartbeat-common (<= 2.99.2+sles11r9-5), libheartbeat2 (<= 2.99.2+sles11r9-5)
 Description: The reusable cluster components for Linux HA
diff --git a/debian/ha-sbd.install b/debian/ha-sbd.install
new file mode 100644
index 0000000..efb53ea
--- /dev/null
+++ b/debian/ha-sbd.install
@@ -0,0 +1 @@
+usr/sbin/sbd
diff --git a/debian/patches/hurd.diff b/debian/patches/hurd.diff
new file mode 100644
index 0000000..9741144
--- /dev/null
+++ b/debian/patches/hurd.diff
@@ -0,0 +1,40 @@
+Index: cluster-glue.git/lib/clplumbing/cl_pidfile.c
+===================================================================
+--- cluster-glue.git.orig/lib/clplumbing/cl_pidfile.c	2012-07-24 05:36:32.000000000 +0000
++++ cluster-glue.git/lib/clplumbing/cl_pidfile.c	2012-07-24 05:38:03.000000000 +0000
+@@ -79,7 +79,11 @@
+ 	int rc = 0;
+ 	long mypid;
+ 	int running = 0;
++#ifdef __GNU__
++	char proc_path[4096], exe_path[4096], myexe_path[4096];
++#else
+ 	char proc_path[PATH_MAX], exe_path[PATH_MAX], myexe_path[PATH_MAX];
++#endif
+ 	
+ 	/* check if pid is running */
+ 	if (CL_KILL(pid, 0) < 0 && errno == ESRCH) {
+@@ -93,7 +97,11 @@
+ 	/* check to make sure pid hasn't been reused by another process */
+ 	snprintf(proc_path, sizeof(proc_path), "/proc/%lu/exe", pid);
+ 	
++#ifdef __GNU__
++	rc = readlink(proc_path, exe_path, sizeof(exe_path)-1);
++#else
+ 	rc = readlink(proc_path, exe_path, PATH_MAX-1);
++#endif
+ 	if(rc < 0) {
+ 		cl_perror("Could not read from %s", proc_path);
+ 		goto bail;
+@@ -103,7 +111,11 @@
+ 	mypid = (unsigned long) getpid();
+ 	
+ 	snprintf(proc_path, sizeof(proc_path), "/proc/%lu/exe", mypid);
++#ifdef __GNU__
++	rc = readlink(proc_path, myexe_path, sizeof(myexe_path)-1);
++#else
+ 	rc = readlink(proc_path, myexe_path, PATH_MAX-1);
++#endif
+ 	if(rc < 0) {
+ 		cl_perror("Could not read from %s", proc_path);
+ 		goto bail;
diff --git a/debian/patches/kfbsd.diff b/debian/patches/kfbsd.diff
new file mode 100644
index 0000000..78a83e0
--- /dev/null
+++ b/debian/patches/kfbsd.diff
@@ -0,0 +1,13 @@
+Index: cluster-glue.git/lib/clplumbing/ipcsocket.c
+===================================================================
+--- cluster-glue.git.orig/lib/clplumbing/ipcsocket.c	2012-07-24 05:37:17.000000000 +0000
++++ cluster-glue.git/lib/clplumbing/ipcsocket.c	2012-07-24 05:38:33.000000000 +0000
+@@ -2516,7 +2516,7 @@
+ 
+ #define	EXTRASPACE	0
+ 
+-#ifdef HAVE_STRUCT_CMSGCRED
++#if defined(HAVE_STRUCT_CMSGCRED) || defined( __FreeBSD_kernel__) || defined(__GNU__)
+ 	/* FreeBSD */
+   typedef struct cmsgcred Cred;
+ #	define crRuid	cmcred_uid
diff --git a/debian/patches/series b/debian/patches/series
index e69de29..782f6da 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+kfbsd.diff
+hurd.diff
diff --git a/debian/rules b/debian/rules
index e9cb990..1a58003 100755
--- a/debian/rules
+++ b/debian/rules
@@ -57,6 +57,8 @@ clean:
 	dh_testroot
 	[ ! -f Makefile ] || $(MAKE) clean
 	[ ! -f Makefile ] || $(MAKE) distclean
+	find . -name Makefile.in -delete
+	-rm lrm/admin/lrmadmin.8
 	dh_clean 
 
 install: install-indep install-arch
@@ -71,7 +73,11 @@ install-arch:
 		sed -i "/dependency_libs/ s/'.*'/''/" $$file ; \
 	done
 	chrpath -r "" debian/tmp/usr/lib/stonith/plugins/stonith2/ipmilan.so || true
+ifeq (hurd,$(DEB_HOST_ARCH_OS))
+	dh_install --sourcedir=$(CURDIR)/debian/tmp --list-missing -Xbladehpi -Xipmilan
+else
 	dh_install --sourcedir=$(CURDIR)/debian/tmp --list-missing
+endif
 
 	# install logd.cf configuration file
 	mkdir -p $(CURDIR)/debian/cluster-glue/etc/


More information about the Debian-ha-maintainers mailing list