[Ocfs2-tools-devel] [PATCH 2/2] tools: Fix rpm building without ocfs2console
Sunil Mushran
sunil.mushran at oracle.com
Mon Apr 4 16:28:32 PDT 2011
Commit d3c7f28d09f271b151dabd844084f8578988c1f0 disabled building ocfs2console
by default. However, that commit broke the rpm build.
[Take 2 - BUILD_OCFS2CONSOLE conifigure option does not the rpm spec]
Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
---
configure.in | 50 +++++++++++++++++------------
vendor/common/ocfs2-tools.spec-generic.in | 13 ++++++-
2 files changed, 40 insertions(+), 23 deletions(-)
diff --git a/configure.in b/configure.in
index 12afa21..45ee98a 100644
--- a/configure.in
+++ b/configure.in
@@ -385,41 +385,50 @@ if test "x$cman_found" = "xyes" -a "x$BUILD_OCFS2_CONTROLD" = "xyes"; then
fi
AC_SUBST(BUILD_CMAN_SUPPORT)
+HAVE_PYTHON=no
+AM_PATH_PYTHON(2.3, have_python=yes, have_python=no)
+if test "x$have_python" = "xyes"; then
+ AM_CHECK_PYTHON_HEADERS(have_pythondev=yes, have_pythondev=no)
+
+ if test "x$have_pythondev" = "xyes"; then
+ if $PYTHON -c 'import gobject' >/dev/null 2>&1; then
+ HAVE_PYTHON=yes
+ OCFS2_BLKID
+ else
+ AC_MSG_WARN([could not find PyGTK, ocfs2console will not be built])
+ fi
+ else
+ AC_MSG_WARN([could not find Python headers, ocfs2console will not be built])
+ fi
+else
+ AC_MSG_WARN([could not find Python 2.3 or higher, ocfs2console will not be built])
+fi
+
BUILD_OCFS2CONSOLE=
AC_MSG_CHECKING(whether to build ocfs2console)
AC_ARG_ENABLE(ocfs2console, [ --enable-ocfs2console=[yes/no] Build GUI frontend [default=no]],,enable_ocfs2console=no)
AC_MSG_RESULT($enable_ocfs2console)
if test "x$enable_ocfs2console" = "xyes"; then
- dnl check for Python
- AM_PATH_PYTHON(2.3, have_python=yes, have_python=no)
-
- if test "x$have_python" = "xyes"; then
- AM_CHECK_PYTHON_HEADERS(have_pythondev=yes, have_pythondev=no)
-
- if test "x$have_pythondev" = "xyes"; then
- if $PYTHON -c 'import gobject' >/dev/null 2>&1; then
- BUILD_OCFS2CONSOLE=yes
- OCFS2_BLKID
- else
- AC_MSG_WARN([could not find PyGTK, ocfs2console will not be built])
- fi
- else
- AC_MSG_WARN([could not find Python headers, ocfs2console will not be built])
- fi
- else
- AC_MSG_WARN([could not find Python 2.3 or higher, ocfs2console will not be built])
+ if test "x$HAVE_PYTHON" = "xno"; then
+ AC_MSG_ERROR([Unable to build ocfs2console])
fi
+ BUILD_OCFS2CONSOLE=yes
fi
-
AC_SUBST(BUILD_OCFS2CONSOLE)
+if test "x$BUILD_OCFS2CONSOLE" = "xyes"; then
+AC_CONFIG_FILES([
+ocfs2console/ocfs2interface/confdefs.py
+ocfs2console/ocfs2console.8
+])
+fi
+
AC_CONFIG_FILES([
Config.make
o2cb.pc
o2dlm.pc
ocfs2.pc
-ocfs2console/ocfs2interface/confdefs.py
debugfs.ocfs2/debugfs.ocfs2.8
mkfs.ocfs2/mkfs.ocfs2.8
mounted.ocfs2/mounted.ocfs2.8
@@ -429,7 +438,6 @@ mount.ocfs2/mount.ocfs2.8
o2cb_ctl/o2cb_ctl.8
o2cb_ctl/o2cb.8
ocfs2_hb_ctl/ocfs2_hb_ctl.8
-ocfs2console/ocfs2console.8
tunefs.ocfs2/tunefs.ocfs2.8
o2image/o2image.8
o2info/o2info.1
diff --git a/vendor/common/ocfs2-tools.spec-generic.in b/vendor/common/ocfs2-tools.spec-generic.in
index f903ed3..b4ec40d 100644
--- a/vendor/common/ocfs2-tools.spec-generic.in
+++ b/vendor/common/ocfs2-tools.spec-generic.in
@@ -14,7 +14,13 @@
%define brokenrhlibdir %{_libdir}
%endif
-%define compile_py @@COMPILE_PY@@
+
+%define build_ocfs2console 0
+%define compile_py 0
+
+%if %{build_ocfs2console}
+%define compile_py @@COMPILE_PY@@
+%endif
Summary: Tools for managing the Oracle Cluster Filesystem 2
Name: ocfs2-tools
@@ -36,7 +42,7 @@ BuildRoot: %{_tmppath}/ocfs2-tools-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
%description
Tools to manage Oracle Cluster Filesystem 2 volumes.
-
+%if %{build_ocfs2console}
%package -n ocfs2console
Summary: GUI frontend for OCFS2 management
Group: System Environment/Kernel
@@ -47,6 +53,7 @@ AutoReqProv: No
%description -n ocfs2console
GUI frontend for management and debugging of Oracle Cluster Filesystem 2
volumes.
+%endif
@@ -140,11 +147,13 @@ fi
/usr/share/man/man1/o2info.1.gz
+%if %{build_ocfs2console}
%files -n ocfs2console
%defattr(-,root,root)
%{brokenrhlibdir}/python@@PYVERSION@@/site-packages/ocfs2interface
/usr/sbin/ocfs2console
/usr/share/man/man8/ocfs2console.8.gz
+%endif
%files -n ocfs2-tools-devel
%defattr(-,root,root)
--
1.7.1
More information about the Ocfs2-tools-devel
mailing list