[packages/ocfs2-tools] - added linux,format,link patches to fix build in recent environment - added cman,corosync,dlm,opena

qboosh qboosh at pld-linux.org
Sun Dec 20 22:10:09 CET 2015


commit d3ab888599a11475c71b6056dd6d4d1351bc2976
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Dec 20 22:11:34 2015 +0100

    - added linux,format,link patches to fix build in recent environment
    - added cman,corosync,dlm,openais,pacemaker bconds

 ocfs2-tools-format.patch | 118 +++++++++++++++++++++++++++++++++++++++++++++++
 ocfs2-tools-link.patch   |  17 +++++++
 ocfs2-tools-linux.patch  |  13 ++++++
 ocfs2-tools.spec         |  95 ++++++++++++++++++++++++++++++--------
 4 files changed, 224 insertions(+), 19 deletions(-)
---
diff --git a/ocfs2-tools.spec b/ocfs2-tools.spec
index c3ec0ff..635f704 100644
--- a/ocfs2-tools.spec
+++ b/ocfs2-tools.spec
@@ -1,45 +1,57 @@
 #
 # Conditional build:
-%bcond_without gtk2	# build without GTK
+%bcond_without	cman		# cman support
+%bcond_without	corosync	# Corosync support
+%bcond_without	dlm		# DLM support
+%bcond_with	openais		# OpenAIS ckpt support
+%bcond_without	pacemaker	# Pacemaker support
+%bcond_without	gtk2		# GTK+ 2 ocfs2console tool
 #
 Summary:	Tools for the OCFS2 filesystem
 Summary(pl.UTF-8):	Narzędzia dla systemu plików OCFS2
 Name:		ocfs2-tools
 Version:	1.4.4
 Release:	5
-License:	GPL v2
+License:	GPL v2+
 Group:		Applications/System
-Source0:	http://oss.oracle.com/projects/ocfs2-tools/dist/files/source/v1.4/%{name}-%{version}.tar.gz
+#Source0Download: https://oss.oracle.com/projects/ocfs2-tools/files/source/
+Source0:	https://oss.oracle.com/projects/ocfs2-tools/dist/files/source/v1.4/%{name}-%{version}.tar.gz
 # Source0-md5:	f7ae245e8baa499aa56d7af25a7885d5
 Source1:	ocfs2.init
 Source2:	o2cb.init
 Source3:	o2cb.sysconfig
 Patch0:		%{name}-tinfo.patch
 Patch1:		%{name}-vla-initializer.patch
+Patch2:		%{name}-linux.patch
+Patch3:		%{name}-format.patch
+Patch4:		%{name}-link.patch
 URL:		http://oss.oracle.com/projects/ocfs2-tools/
-BuildRequires:	autoconf
+BuildRequires:	autoconf >= 2.54
 BuildRequires:	automake
-BuildRequires:	cman-devel
+%{?with_cman:BuildRequires:	cman-devel}
+%{?with_corosync:BuildRequires:	corosync-devel}
 BuildRequires:	device-mapper-devel
+%{?with_dlm:BuildRequires:	dlm-devel}
 BuildRequires:	e2fsprogs-devel
 BuildRequires:	glib2-devel >= 2.2.3
+BuildRequires:	libblkid-devel >= 1.36
+BuildRequires:	libcom_err-devel
 BuildRequires:	libuuid-devel
 BuildRequires:	ncurses-devel
-BuildRequires:	openais-devel
+%{?with_openais:BuildRequires:	openais-devel}
+%{?with_pacemaker:BuildRequires:	pacemaker-devel}
 BuildRequires:	pkgconfig
-%{?with_gtk2:BuildRequires:	python-devel}
+%{?with_gtk2:BuildRequires:	python-devel >= 1:2.3}
 %{?with_gtk2:BuildRequires:	python-pygtk-gtk}
 BuildRequires:	readline-devel
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.268
-#BuildRequires:	scons
 Requires(post):	/sbin/ldconfig
 Requires(post,preun):	/sbin/chkconfig
+Requires:	glib2 >= 2.2.3
 Requires:	rc-scripts
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		filterout_ld	-Wl,--as-needed
-
 %description
 Tools and support files for creating and managing OCFS2 volumes.
 
@@ -74,12 +86,20 @@ Interfejs GTK+ do narzędzi OCFS2.
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
 
 %build
 %{__aclocal} -I .
 %{__autoconf}
 
 %configure \
+	%{!?with_corosync:ac_cv_header_corosync_cpg_h=no ac_cv_header_openais_cpg_h=no} \
+	%{!?with_cman:ac_cv_lib_cman_cman_replyto_shutdown=no} \
+	%{!?with_dlm:ac_cv_lib_dlmcontrol_dlmc_fs_connect=no} \
+	%{!?with_openais:ac_cv_header_openais_saCkpt_h=no} \
+	%{!?with_pacemaker:ac_cv_lib_crmcluster_crm_get_peer=no} \
 	--enable-dynamic-fsck=yes \
 	--enable-dynamic-ctl=yes \
 	%{?with_gtk2:--enable-ocfs2console=yes}
@@ -102,7 +122,7 @@ install -d $RPM_BUILD_ROOT/dlm
 %if %{with gtk2}
 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
-rm $RPM_BUILD_ROOT%{py_sitedir}/ocfs2interface/*.py
+%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/ocfs2interface/*.py
 %endif
 
 %clean
@@ -127,27 +147,64 @@ fi
 
 %files
 %defattr(644,root,root,755)
-%doc documentation/*.txt
+%doc CREDITS MAINTAINERS README README.O2CB documentation/*.txt
 %attr(754,root,root) /etc/rc.d/init.d/o2cb
 %attr(754,root,root) /etc/rc.d/init.d/ocfs2
-%attr(755,root,root) /sbin/*
+%attr(755,root,root) /sbin/debugfs.ocfs2
+%attr(755,root,root) /sbin/fsck.ocfs2
+%attr(755,root,root) /sbin/mkfs.ocfs2
+%attr(755,root,root) /sbin/mount.ocfs2
+%attr(755,root,root) /sbin/mounted.ocfs2
+%attr(755,root,root) /sbin/o2cb_ctl
+%attr(755,root,root) /sbin/o2image
+%attr(755,root,root) /sbin/ocfs2_hb_ctl
+%attr(755,root,root) /sbin/tunefs.ocfs2
+%if %{with corosync} && %{with openais} && %{with dlm}
+%if %{with cman}
+%attr(755,root,root) /sbin/ocfs2_controld.cman
+%endif
+%if %{with pacemaker}
+%attr(755,root,root) /sbin/ocfs2_controld.pcmk
+%endif
+%endif
 %dir %{_sysconfdir}/ocfs2
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ocfs2/cluster.conf
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/o2cb
 %dir /dlm
-%{_mandir}/man[78]/*
+%{_mandir}/man7/o2cb.7*
+%{_mandir}/man8/debugfs.ocfs2.8*
+%{_mandir}/man8/fsck.ocfs2.8*
+%{_mandir}/man8/fsck.ocfs2.checks.8*
+%{_mandir}/man8/mkfs.ocfs2.8*
+%{_mandir}/man8/mount.ocfs2.8*
+%{_mandir}/man8/mounted.ocfs2.8*
+%{_mandir}/man8/o2cb_ctl.8*
+%{_mandir}/man8/o2image.8*
+%{_mandir}/man8/ocfs2_hb_ctl.8*
+%{_mandir}/man8/tunefs.ocfs2.8*
 
 %files devel
 %defattr(644,root,root,755)
-%{_includedir}/*
-%{_libdir}/lib*.a
-%{_pkgconfigdir}/*.pc
+%{_includedir}/o2cb
+%{_includedir}/o2dlm
+%{_includedir}/ocfs2
+%{_includedir}/ocfs2-kernel
+%{_libdir}/libo2cb.a
+%{_libdir}/libo2dlm.a
+%{_libdir}/libocfs2.a
+%{_pkgconfigdir}/o2cb.pc
+%{_pkgconfigdir}/o2dlm.pc
+%{_pkgconfigdir}/ocfs2.pc
 
 %if %{with gtk2}
 %files gtk
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_sbindir}/*
+%attr(755,root,root) %{_sbindir}/ocfs2console
 %dir %{py_sitedir}/ocfs2interface
-%attr(755,root,root) %{py_sitedir}/ocfs2interface/*.so
+%attr(755,root,root) %{py_sitedir}/ocfs2interface/gidlemodule.so
+%attr(755,root,root) %{py_sitedir}/ocfs2interface/o2cbmodule.so
+%attr(755,root,root) %{py_sitedir}/ocfs2interface/ocfs2module.so
+%attr(755,root,root) %{py_sitedir}/ocfs2interface/plistmodule.so
 %{py_sitedir}/ocfs2interface/*.py[co]
+%{_mandir}/man8/ocfs2console.8*
 %endif
diff --git a/ocfs2-tools-format.patch b/ocfs2-tools-format.patch
new file mode 100644
index 0000000..9769882
--- /dev/null
+++ b/ocfs2-tools-format.patch
@@ -0,0 +1,118 @@
+--- ocfs2-tools-1.4.4/fsck.ocfs2/problem.c.orig	2008-12-03 19:38:21.000000000 +0100
++++ ocfs2-tools-1.4.4/fsck.ocfs2/problem.c	2015-12-13 18:22:46.957121947 +0100
+@@ -112,9 +112,9 @@
+ 		ans = ost->ost_answer ? 'y' : 'n';
+ 	} else {
+ 		if (flags & PY)
+-			printf(yes);
++			fputs(yes, stdout);
+ 		else if (flags & PN)
+-			printf(no);
++			fputs(no, stdout);
+ 	}
+ 
+ 	fflush(stdout);
+--- ocfs2-tools-1.4.4/tunefs.ocfs2/op_query.c.orig	2009-04-14 00:10:40.000000000 +0200
++++ ocfs2-tools-1.4.4/tunefs.ocfs2/op_query.c	2015-12-13 18:47:05.127060750 +0100
+@@ -150,7 +150,7 @@
+ {
+ 	char label[OCFS2_MAX_VOL_LABEL_LEN + 1];
+ 
+-	snprintf(label, OCFS2_MAX_VOL_LABEL_LEN + 1,
++	snprintf(label, OCFS2_MAX_VOL_LABEL_LEN + 1, "%s",
+ 		 (char *)OCFS2_RAW_SB(query_fs->fs_super)->s_label);
+ 
+ 	return print_string(stream, info, args, label);
+@@ -338,7 +338,7 @@
+ 	register_printf_function('O', handle_ro_compat, handle_arginfo);
+ 
+ 	query_fs = fs;
+-	fprintf(stdout, fmt);
++	fprintf(stdout, fmt, NULL /* hack */);
+ 	query_fs = NULL;
+ 
+ 	ocfs2_free(&fmt);
+--- ocfs2-tools-1.4.4/debugfs.ocfs2/commands.c.orig	2010-03-17 01:10:43.000000000 +0100
++++ ocfs2-tools-1.4.4/debugfs.ocfs2/commands.c	2015-12-13 19:23:59.780301145 +0100
+@@ -677,7 +677,7 @@
+ 	gbls.cwd = strdup("/");
+ 
+ 	/* lookup heartbeat file */
+-	snprintf (sysfile, sizeof(sysfile),
++	snprintf (sysfile, sizeof(sysfile), "%s",
+ 		  ocfs2_system_inodes[HEARTBEAT_SYSTEM_INODE].si_name);
+ 	ret = ocfs2_lookup(gbls.fs, gbls.sysdir_blkno, sysfile,
+ 			   strlen(sysfile), NULL, &gbls.hb_blkno);
+@@ -685,7 +685,7 @@
+ 		gbls.hb_blkno = 0;
+ 
+ 	/* lookup slotmap file */
+-	snprintf (sysfile, sizeof(sysfile),
++	snprintf (sysfile, sizeof(sysfile), "%s",
+ 		  ocfs2_system_inodes[SLOT_MAP_SYSTEM_INODE].si_name);
+ 	ret = ocfs2_lookup(gbls.fs, gbls.sysdir_blkno, sysfile,
+ 			   strlen(sysfile), NULL, &gbls.slotmap_blkno);
+--- ocfs2-tools-1.4.4/debugfs.ocfs2/find_block_inode.c.orig	2010-03-11 20:29:36.000000000 +0100
++++ ocfs2-tools-1.4.4/debugfs.ocfs2/find_block_inode.c	2015-12-13 19:24:25.760300055 +0100
+@@ -203,7 +203,7 @@
+ 	char sysfile[50];
+ 	errcode_t ret = 0;
+ 
+-	snprintf(sysfile, sizeof(sysfile),
++	snprintf(sysfile, sizeof(sysfile), "%s",
+ 		 ocfs2_system_inodes[GLOBAL_BITMAP_SYSTEM_INODE].si_name);
+ 
+ 	ret = ocfs2_lookup(fs, fs->fs_sysdir_blkno, sysfile,
+--- ocfs2-tools-1.4.4/mount.ocfs2/mount.ocfs2.c.orig	2015-12-13 17:42:28.663890097 +0100
++++ ocfs2-tools-1.4.4/mount.ocfs2/mount.ocfs2.c	2015-12-13 19:25:34.140297185 +0100
+@@ -185,7 +185,7 @@
+ 	}
+ 
+ 	if (mo->type && strcmp(mo->type, OCFS2_FS_NAME)) {
+-		com_err(progname, OCFS2_ET_UNKNOWN_FILESYSTEM, mo->type);
++		com_err(progname, OCFS2_ET_UNKNOWN_FILESYSTEM, "%s", mo->type);
+ 		return -1;
+ 	}
+ 
+--- ocfs2-tools-1.4.4/fswreck/corrupt.c.orig	2010-03-17 01:11:06.000000000 +0100
++++ ocfs2-tools-1.4.4/fswreck/corrupt.c	2015-12-13 19:27:51.333624758 +0100
+@@ -49,7 +49,7 @@
+ 	case 10:
+ 	case 11:
+ 	case 12:
+-		snprintf(sysfile, sizeof(sysfile),
++		snprintf(sysfile, sizeof(sysfile), "%s",
+ 			 ocfs2_system_inodes[GLOBAL_BITMAP_SYSTEM_INODE].si_name);
+ 		break;
+ #ifdef _LATER_
+--- ocfs2-tools-1.4.4/fswreck/chain.c.orig	2010-02-25 03:06:23.000000000 +0100
++++ ocfs2-tools-1.4.4/fswreck/chain.c	2015-12-13 19:28:24.540290032 +0100
+@@ -345,7 +345,7 @@
+ 	struct ocfs2_super_block *sb = OCFS2_RAW_SB(fs->fs_super);
+ 	
+ 	if (slotnum == UINT16_MAX)
+-		snprintf(sysfile, sizeof(sysfile),
++		snprintf(sysfile, sizeof(sysfile), "%s",
+ 		ocfs2_system_inodes[GLOBAL_BITMAP_SYSTEM_INODE].si_name);
+ 	else
+ 		snprintf(sysfile, sizeof(sysfile),
+@@ -401,7 +401,7 @@
+ 	uint64_t blkno;
+ 	struct ocfs2_super_block *sb = OCFS2_RAW_SB(fs->fs_super);
+ 
+-	snprintf(sysfile, sizeof(sysfile),
++	snprintf(sysfile, sizeof(sysfile), "%s",
+ 		 ocfs2_system_inodes[GLOBAL_BITMAP_SYSTEM_INODE].si_name);
+ 
+ 	ret = ocfs2_lookup(fs, sb->s_system_dir_blkno, sysfile,
+--- ocfs2-tools-1.4.4/fswreck/group.c.orig	2010-02-25 03:06:24.000000000 +0100
++++ ocfs2-tools-1.4.4/fswreck/group.c	2015-12-13 19:29:30.580287261 +0100
+@@ -214,7 +214,7 @@
+ 	struct ocfs2_super_block *sb = OCFS2_RAW_SB(fs->fs_super);
+ 	
+ 	if (slotnum == UINT16_MAX)
+-		snprintf(sysfile, sizeof(sysfile),
++		snprintf(sysfile, sizeof(sysfile), "%s",
+ 		ocfs2_system_inodes[GLOBAL_BITMAP_SYSTEM_INODE].si_name);
+ 	else
+ 		snprintf(sysfile, sizeof(sysfile),
diff --git a/ocfs2-tools-link.patch b/ocfs2-tools-link.patch
new file mode 100644
index 0000000..72ad26d
--- /dev/null
+++ b/ocfs2-tools-link.patch
@@ -0,0 +1,17 @@
+--- ocfs2-tools-1.4.4/configure.in.orig	2015-12-20 18:30:44.175054200 +0100
++++ ocfs2-tools-1.4.4/configure.in	2015-12-20 21:54:38.464540770 +0100
+@@ -256,10 +256,13 @@
+         # TRY="$TRY"
+ 
+         saved_LDFLAGS="$LDFLAGS"
+-        LDFLAGS="$LDFLAGS $TRY -lcpg"
++	saved_LIBS="$LIBS"
++        LDFLAGS="$LDFLAGS $TRY"
++        LIBS="$LIBS -lcpg"
+         AC_LINK_IFELSE([AC_LANG_CALL([], [cpg_initialize])],
+         	       cpg_found=yes)
+         LDFLAGS="$saved_LDFLAGS"
++        LIBS="$saved_LIBS"
+ 
+         if test "x$cpg_found" = "xyes"; then
+             CPG_LDFLAGS="$TRY"
diff --git a/ocfs2-tools-linux.patch b/ocfs2-tools-linux.patch
new file mode 100644
index 0000000..ca8f378
--- /dev/null
+++ b/ocfs2-tools-linux.patch
@@ -0,0 +1,13 @@
+--- ocfs2-tools-1.4.4/include/ocfs2-kernel/ocfs2_fs.h.orig	2010-03-17 01:10:43.000000000 +0100
++++ ocfs2-tools-1.4.4/include/ocfs2-kernel/ocfs2_fs.h	2015-12-13 18:20:04.847128749 +0100
+@@ -25,6 +25,10 @@
+ #ifndef _OCFS2_FS_H
+ #define _OCFS2_FS_H
+ 
++#ifndef __KERNEL__
++typedef unsigned short umode_t;
++#endif
++
+ /* Version */
+ #define OCFS2_MAJOR_REV_LEVEL		0
+ #define OCFS2_MINOR_REV_LEVEL          	90
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ocfs2-tools.git/commitdiff/d3ab888599a11475c71b6056dd6d4d1351bc2976



More information about the pld-cvs-commit mailing list