[Ocfs2-tools-devel] [PATCH 1/1] tools: Fix rpm building without ocfs2console

Sunil Mushran sunil.mushran at oracle.com
Fri Mar 18 16:01:38 PDT 2011


Commit d3c7f28d09f271b151dabd844084f8578988c1f0 disabled building ocfs2console
by default. However, that commit broke the rpm build.

Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
---
 Makefile                                  |    3 ++
 configure.in                              |   50 +++++++++++++++++------------
 vendor/common/Vendor.make                 |    1 +
 vendor/common/ocfs2-tools.spec-generic.in |   13 ++++++-
 4 files changed, 44 insertions(+), 23 deletions(-)

diff --git a/Makefile b/Makefile
index 63d5bd1..9235158 100644
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,9 @@ SUBDIRS = include libtools-internal libo2dlm libo2cb libocfs2 fsck.ocfs2 mkfs.oc
 
 ifdef BUILD_OCFS2CONSOLE
 SUBDIRS += ocfs2console
+OCFS2CONSOLE = 1
+else
+OCFS2CONSOLE = 0
 endif
 
 SUBDIRS += vendor
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/Vendor.make b/vendor/common/Vendor.make
index e92884e..bf3f760 100644
--- a/vendor/common/Vendor.make
+++ b/vendor/common/Vendor.make
@@ -20,6 +20,7 @@ $(TOPDIR)/ocfs2-tools-$(DIST_VERSION)-$(PKG_VERSION).$(VENDOR_EXTENSION).src.rpm
 		-e 's,@@PYVERSION@@,'$(PYVERSION)',g' \
 		-e 's,@@COMPILE_PY@@,'$(COMPILE_PY)',g' \
 		-e 's,@@CHKCONFIG_DEP@@,'$(CHKCONFIG_DEP)',g' \
+		-e 's,@@OCFS2CONSOLE@@,'$(OCFS2CONSOLE)',g' \
 		< "$(TOPDIR)/vendor/common/ocfs2-tools.spec-generic" \
 		> "$(TOPDIR)/vendor/common/ocfs2-tools.spec"
 	$(RPMBUILD) -bs --define "_sourcedir $(RPM_TOPDIR)" --define "_srcrpmdir $(RPM_TOPDIR)" "$(TOPDIR)/vendor/common/ocfs2-tools.spec"
diff --git a/vendor/common/ocfs2-tools.spec-generic.in b/vendor/common/ocfs2-tools.spec-generic.in
index f903ed3..6a37352 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	@@OCFS2CONSOLE@@
+%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