[Ocfs2-commits] mfasheh commits r2983 - in branches/ocfs2-1.2: . fs fs/configfs fs/ocfs2 fs/ocfs2/dlm vendor vendor/rhel5

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Mar 6 14:06:42 PST 2007


Author: mfasheh
Date: 2007-03-06 14:06:39 -0800 (Tue, 06 Mar 2007)
New Revision: 2983

Added:
   branches/ocfs2-1.2/vendor/rhel5/
   branches/ocfs2-1.2/vendor/rhel5/Makefile
   branches/ocfs2-1.2/vendor/rhel5/Vendor.make
   branches/ocfs2-1.2/vendor/rhel5/kernel.guess
   branches/ocfs2-1.2/vendor/rhel5/ocfs2.spec-generic.in
   branches/ocfs2-1.2/vendor/rhel5/rpmarch.guess
   branches/ocfs2-1.2/vendor/rhel5/vendor.guess
Modified:
   branches/ocfs2-1.2/Config.make.in
   branches/ocfs2-1.2/configure.in
   branches/ocfs2-1.2/fs/Makefile
   branches/ocfs2-1.2/fs/configfs/Makefile
   branches/ocfs2-1.2/fs/configfs/inode.c
   branches/ocfs2-1.2/fs/ocfs2/Makefile
   branches/ocfs2-1.2/fs/ocfs2/dlm/dlmfs.c
   branches/ocfs2-1.2/fs/ocfs2/dlmglue.c
   branches/ocfs2-1.2/fs/ocfs2/inode.c
   branches/ocfs2-1.2/fs/ocfs2/journal.c
   branches/ocfs2-1.2/fs/ocfs2/namei.c
   branches/ocfs2-1.2/vendor/Makefile
Log:
Add RHEL5 build support

Signed-off-by: jlbec



Modified: branches/ocfs2-1.2/Config.make.in
===================================================================
--- branches/ocfs2-1.2/Config.make.in	2007-02-09 19:45:44 UTC (rev 2982)
+++ branches/ocfs2-1.2/Config.make.in	2007-03-06 22:06:39 UTC (rev 2983)
@@ -60,8 +60,11 @@
 GET_SB_RETURNS_SB = @GET_SB_RETURNS_SB@
 DIO_OLD_GET_BLOCKS = @DIO_OLD_GET_BLOCKS@
 STATFS_GETS_SB = @STATFS_GETS_SB@
+INODE_HAS_BLKSIZE  = @INODE_HAS_BLKSIZE@
+INODE_HAS_PRIVATE  = @INODE_HAS_PRIVATE@
 
 BUILD_DEBUGFS_BACKPORT = @BUILD_DEBUGFS_BACKPORT@
+BUILD_CONFIGFS = @BUILD_CONFIGFS@
 
 OCFS_DEBUG = @OCFS_DEBUG@
 

Modified: branches/ocfs2-1.2/configure.in
===================================================================
--- branches/ocfs2-1.2/configure.in	2007-02-09 19:45:44 UTC (rev 2982)
+++ branches/ocfs2-1.2/configure.in	2007-03-06 22:06:39 UTC (rev 2983)
@@ -175,6 +175,11 @@
 AC_SUBST(BUILD_DEBUGFS_BACKPORT)
 AC_MSG_RESULT($enable_debugfs)
 
+BUILD_CONFIGFS=
+OCFS2_CHECK_KERNEL([an in-kernel configfs], configfs.h,
+  , BUILD_CONFIGFS=yes, [configfs_register_subsystem])
+AC_SUBST(BUILD_CONFIGFS)
+
 OCFS2_CHECK_KERNEL(generic_drop_inode, fs.h,
   have_generic_drop_inode=yes, have_generic_drop_inode=no)
 if test "x$have_generic_drop_inode" != "xyes"; then
@@ -258,7 +263,16 @@
   DIO_OLD_GET_BLOCKS=yes, , [get_blocks_t])
 AC_SUBST(DIO_OLD_GET_BLOCKS)
 
+INODE_HAS_BLKSIZE=
+OCFS2_CHECK_KERNEL([i_blksize field on struct inode], fs.h,
+  INODE_HAS_BLKSIZE=yes, , [i_blksize])
+AC_SUBST(INODE_HAS_BLKSIZE)
 
+INODE_HAS_PRIVATE=
+OCFS2_CHECK_KERNEL([i_private field on struct inode], fs.h,
+  INODE_HAS_PRIVATE=yes, , [i_private])
+AC_SUBST(INODE_HAS_PRIVATE)
+
 # using -include has two advantages:
 #  the source doesn't need to know to include compat headers
 #  the compat header file names don't go through the search path
@@ -271,4 +285,5 @@
 vendor/ax2/ocfs2.spec-generic
 vendor/rhel4/ocfs2.spec-generic
 vendor/sles9/ocfs2.spec-generic
+vendor/rhel5/ocfs2.spec-generic
 ])

Modified: branches/ocfs2-1.2/fs/Makefile
===================================================================
--- branches/ocfs2-1.2/fs/Makefile	2007-02-09 19:45:44 UTC (rev 2982)
+++ branches/ocfs2-1.2/fs/Makefile	2007-03-06 22:06:39 UTC (rev 2983)
@@ -16,12 +16,18 @@
 # As 2.6 kbuild is unhappy seeing SUBDIRS, this is a safe one to
 # set globally.  Do not include trailing slashes.
 #
-SAFE_SUBDIRS := configfs ocfs2
+SAFE_SUBDIRS :=
 
+ifdef BUILD_CONFIGFS
+SAFE_SUBDIRS += configfs
+endif
+
 ifdef BUILD_DEBUGFS_BACKPORT
 SAFE_SUBDIRS += debugfs
 endif
 
+SAFE_SUBDIRS += ocfs2
+
 ifneq ($(KERNELRELEASE),)
 #
 # Called under kbuild 2.6

Modified: branches/ocfs2-1.2/fs/configfs/Makefile
===================================================================
--- branches/ocfs2-1.2/fs/configfs/Makefile	2007-02-09 19:45:44 UTC (rev 2982)
+++ branches/ocfs2-1.2/fs/configfs/Makefile	2007-03-06 22:06:39 UTC (rev 2983)
@@ -33,6 +33,10 @@
 EXTRA_CFLAGS += -DGET_SB_RETURNS_SB
 endif
 
+ifdef INODE_HAS_BLKSIZE
+EXTRA_CFLAGS += -DINODE_HAS_BLKSIZE
+endif
+
 INSTALL_MOD_DIR := fs/configfs
 
 obj-m		:= configfs.o configfs_example.o bobtest.o

Modified: branches/ocfs2-1.2/fs/configfs/inode.c
===================================================================
--- branches/ocfs2-1.2/fs/configfs/inode.c	2007-02-09 19:45:44 UTC (rev 2982)
+++ branches/ocfs2-1.2/fs/configfs/inode.c	2007-03-06 22:06:39 UTC (rev 2983)
@@ -59,7 +59,9 @@
 		inode->i_mode = mode;
 		inode->i_uid = 0;
 		inode->i_gid = 0;
+#ifdef INODE_HAS_BLKSIZE
 		inode->i_blksize = PAGE_CACHE_SIZE;
+#endif
 		inode->i_blocks = 0;
 		inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
 		inode->i_mapping->a_ops = &configfs_aops;

Modified: branches/ocfs2-1.2/fs/ocfs2/Makefile
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/Makefile	2007-02-09 19:45:44 UTC (rev 2982)
+++ branches/ocfs2-1.2/fs/ocfs2/Makefile	2007-03-06 22:06:39 UTC (rev 2983)
@@ -10,8 +10,12 @@
 
 include $(OUR_TOPDIR)/Config.make
 
+# Only add our includes if configfs is to be built, since it is the only user.
+# If that changes in the future, we'll have to update this check.
+ifdef BUILD_CONFIGFS
 CPPFLAGS := -I$(OUR_TOPDIR)/include $(CPPFLAGS)
 endif
+endif
 
 EXTRA_CFLAGS += -I$(OUR_TOPDIR)/fs/ocfs2
 
@@ -51,6 +55,14 @@
 EXTRA_CFLAGS += -DSTATFS_GETS_SB
 endif
 
+ifdef INODE_HAS_BLKSIZE
+EXTRA_CFLAGS += -DINODE_HAS_BLKSIZE
+endif
+
+ifdef INODE_HAS_PRIVATE
+EXTRA_CFLAGS += -DINODE_HAS_PRIVATE
+endif
+
 EXTRA_CFLAGS += -DOCFS2_CDSL
 
 #

Modified: branches/ocfs2-1.2/fs/ocfs2/dlm/dlmfs.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlm/dlmfs.c	2007-02-09 19:45:44 UTC (rev 2982)
+++ branches/ocfs2-1.2/fs/ocfs2/dlm/dlmfs.c	2007-03-06 22:06:39 UTC (rev 2983)
@@ -339,7 +339,9 @@
 		inode->i_mode = mode;
 		inode->i_uid = current->fsuid;
 		inode->i_gid = current->fsgid;
+#ifdef INODE_HAS_BLKSIZE
 		inode->i_blksize = PAGE_CACHE_SIZE;
+#endif
 		inode->i_blocks = 0;
 		inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info;
 		inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
@@ -366,7 +368,9 @@
 	inode->i_mode = mode;
 	inode->i_uid = current->fsuid;
 	inode->i_gid = current->fsgid;
+#ifdef INODE_HAS_BLKSIZE
 	inode->i_blksize = PAGE_CACHE_SIZE;
+#endif
 	inode->i_blocks = 0;
 	inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info;
 	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;

Modified: branches/ocfs2-1.2/fs/ocfs2/dlmglue.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlmglue.c	2007-02-09 19:45:44 UTC (rev 2982)
+++ branches/ocfs2-1.2/fs/ocfs2/dlmglue.c	2007-03-06 22:06:39 UTC (rev 2983)
@@ -1911,7 +1911,11 @@
 		mlog_errno(ret);
 		goto out;
 	}
+#ifdef INODE_HAS_PRIVATE
+	osb = inode->i_private;
+#else
 	osb = (struct ocfs2_super *) inode->u.generic_ip;
+#endif
 	ocfs2_get_dlm_debug(osb->osb_dlm_debug);
 	priv->p_dlm_debug = osb->osb_dlm_debug;
 	INIT_LIST_HEAD(&priv->p_iter_res.l_debug_list);

Modified: branches/ocfs2-1.2/fs/ocfs2/inode.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/inode.c	2007-02-09 19:45:44 UTC (rev 2982)
+++ branches/ocfs2-1.2/fs/ocfs2/inode.c	2007-03-06 22:06:39 UTC (rev 2983)
@@ -247,7 +247,9 @@
 	inode->i_mode = le16_to_cpu(fe->i_mode);
 	inode->i_uid = le32_to_cpu(fe->i_uid);
 	inode->i_gid = le32_to_cpu(fe->i_gid);
+#ifdef INODE_HAS_BLKSIZE
 	inode->i_blksize = (u32)osb->s_clustersize;
+#endif
 
 	/* Fast symlinks will have i_size but no allocated clusters. */
 	if (S_ISLNK(inode->i_mode) && !fe->i_clusters)
@@ -1148,8 +1150,6 @@
 void ocfs2_refresh_inode(struct inode *inode,
 			 struct ocfs2_dinode *fe)
 {
-	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
-
 	spin_lock(&OCFS2_I(inode)->ip_lock);
 
 	OCFS2_I(inode)->ip_clusters = le32_to_cpu(fe->i_clusters);
@@ -1161,7 +1161,9 @@
 	inode->i_uid = le32_to_cpu(fe->i_uid);
 	inode->i_gid = le32_to_cpu(fe->i_gid);
 	inode->i_mode = le16_to_cpu(fe->i_mode);
-	inode->i_blksize = (u32) osb->s_clustersize;
+#ifdef INODE_HAS_BLKSIZE
+	inode->i_blksize = (u32) OCFS2_SB(inode->i_sb)->s_clustersize;
+#endif
 	if (S_ISLNK(inode->i_mode) && le32_to_cpu(fe->i_clusters) == 0)
 		inode->i_blocks = 0;
 	else

Modified: branches/ocfs2-1.2/fs/ocfs2/journal.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/journal.c	2007-02-09 19:45:44 UTC (rev 2982)
+++ branches/ocfs2-1.2/fs/ocfs2/journal.c	2007-03-06 22:06:39 UTC (rev 2983)
@@ -564,7 +564,7 @@
 	}
 
 	mlog(0, "inode->i_size = %lld\n", inode->i_size);
-	mlog(0, "inode->i_blocks = %lu\n", inode->i_blocks);
+	mlog(0, "inode->i_blocks = %lu\n", (unsigned long)inode->i_blocks);
 	mlog(0, "inode->ip_clusters = %u\n", OCFS2_I(inode)->ip_clusters);
 
 	/* call the kernels journal init function now */
@@ -834,7 +834,7 @@
 	memset(bhs, 0, sizeof(struct buffer_head *) * CONCURRENT_JOURNAL_FILL);
 
 	mlog(0, "Force reading %lu blocks\n",
-	     (inode->i_blocks >> (inode->i_sb->s_blocksize_bits - 9)));
+	     (unsigned long)(inode->i_blocks >> (inode->i_sb->s_blocksize_bits - 9)));
 
 	v_blkno = 0;
 	while (v_blkno <

Modified: branches/ocfs2-1.2/fs/ocfs2/namei.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/namei.c	2007-02-09 19:45:44 UTC (rev 2982)
+++ branches/ocfs2-1.2/fs/ocfs2/namei.c	2007-03-06 22:06:39 UTC (rev 2983)
@@ -1426,7 +1426,7 @@
 	blocks = (bytes_left + sb->s_blocksize - 1) >> sb->s_blocksize_bits;
 
 	mlog_entry("i_blocks = %lu, i_size = %llu, blocks = %d\n",
-		       inode->i_blocks, i_size_read(inode), blocks);
+		   (unsigned long)inode->i_blocks, i_size_read(inode), blocks);
 
 	/* Sanity check -- make sure we're going to fit. */
 	if (bytes_left >

Modified: branches/ocfs2-1.2/vendor/Makefile
===================================================================
--- branches/ocfs2-1.2/vendor/Makefile	2007-02-09 19:45:44 UTC (rev 2982)
+++ branches/ocfs2-1.2/vendor/Makefile	2007-03-06 22:06:39 UTC (rev 2983)
@@ -2,6 +2,6 @@
 
 include $(TOPDIR)/Preamble.make
 
-SUBDIRS = ax2 rhel4 sles9
+SUBDIRS = ax2 rhel4 sles9 rhel5
 
 include $(TOPDIR)/Postamble.make

Added: branches/ocfs2-1.2/vendor/rhel5/Makefile
===================================================================
--- branches/ocfs2-1.2/vendor/rhel5/Makefile	2007-02-09 19:45:44 UTC (rev 2982)
+++ branches/ocfs2-1.2/vendor/rhel5/Makefile	2007-03-06 22:06:39 UTC (rev 2983)
@@ -0,0 +1,12 @@
+TOPDIR = ../..
+
+include $(TOPDIR)/Preamble.make
+
+DIST_FILES = 			\
+	ocfs2.spec-generic.in	\
+	kernel.guess		\
+	rpmarch.guess		\
+	Vendor.make		\
+	vendor.guess
+
+include $(TOPDIR)/Postamble.make

Added: branches/ocfs2-1.2/vendor/rhel5/Vendor.make
===================================================================
--- branches/ocfs2-1.2/vendor/rhel5/Vendor.make	2007-02-09 19:45:44 UTC (rev 2982)
+++ branches/ocfs2-1.2/vendor/rhel5/Vendor.make	2007-03-06 22:06:39 UTC (rev 2983)
@@ -0,0 +1,29 @@
+#
+# RHEL5
+#
+
+TOOLSARCH = $(shell $(TOPDIR)/vendor/rhel5/rpmarch.guess tools $(TOPDIR))
+MODULEARCH = $(shell $(TOPDIR)/vendor/rhel5/rpmarch.guess module $(TOPDIR))
+
+$(TOPDIR)/vendor/rhel5/ocfs2-%.spec: $(TOPDIR)/vendor/rhel5/ocfs2.spec-generic
+	SPECVER="$@"; \
+		SPECVER="$${SPECVER#*ocfs2-}"; \
+		SPECVER="$${SPECVER%.spec}"; \
+		LARGEVER="$${SPECVER#2.6.9-}"; \
+		LARGEVER="$${LARGEVER%%.*}"; \
+		if [ "$${LARGEVER}" -lt 34 ]; \
+		then \
+			LARGESMP=0; \
+		else \
+			LARGESMP=1; \
+		fi; \
+		sed -e 's/@@KVER@@/'$${SPECVER}'/' -e 's/@@PKG_VERSION@@/'$(PKG_VERSION)'/' -e 's/@@LARGESMP@@/'$${LARGESMP}'/' < $< > $@
+
+rhel5_%_srpm: dist $(TOPDIR)/vendor/rhel5/ocfs2-%.spec
+	rpmbuild -bs --define "_sourcedir $(TOPDIR)" --define "_srcrpmdir $(TOPDIR)" $(TOPDIR)/vendor/rhel5/ocfs2-$(patsubst rhel5_%_srpm,%,$@).spec
+
+rhel5_%_rpm: rhel5_%_srpm
+	rpmbuild --rebuild $(MODULEARCH) "ocfs2-$(patsubst rhel5_%_rpm,%,$@)-$(DIST_VERSION)-$(PKG_VERSION).src.rpm"
+
+
+packages: $(shell $(TOPDIR)/vendor/rhel5/kernel.guess targets)

Added: branches/ocfs2-1.2/vendor/rhel5/kernel.guess
===================================================================
--- branches/ocfs2-1.2/vendor/rhel5/kernel.guess	2007-02-09 19:45:44 UTC (rev 2982)
+++ branches/ocfs2-1.2/vendor/rhel5/kernel.guess	2007-03-06 22:06:39 UTC (rev 2983)
@@ -0,0 +1,221 @@
+#!/bin/sh
+
+
+RHEL5_KERNEL_BASE="/usr/src/kernels"
+
+#
+# This is a simple mapping of architectures to kernel flavors.  One
+# entry per architecture, <arch>:<flavor1>[,<flavor> ...]
+#
+# This is used when detecting kernels to build packages for.  A kernel
+# is only built if build trees for all flavors are installed.
+#
+# Unique to redhat, empty types (the 'default' kernel) are allowed.
+# Be careful parsing this!
+#
+# Fedora Core only has one type of kernel.  It's always SMP.  So we have
+# a very simple type list :-)
+#
+RHEL5_KERNEL_TYPES="
+    i686:
+    x86_64:
+    ia64:
+    ppc64:
+    s390x:
+"
+
+
+
+guess_rhel5_arch()
+{
+    # This appears to DTRT (i686 on x86, ppc64 on pSeries).
+    uname -m
+}
+
+guess_rhel5_type()
+{
+    # Only one type for rhel5
+    case "$1" in
+    *)
+        echo ""
+        ;;
+    esac
+}
+
+guess_rhel5_dir()
+{
+    KVER="$1"
+
+    DIRTYPE=$(guess_rhel5_type "$KVER")
+    ARCH=$(guess_rhel5_arch)
+
+    if [ -z "$DIRTYPE" ]
+    then
+        echo "${1%${DIRTYPE}}-${ARCH}"
+    else
+        echo "${1%${DIRTYPE}}-${DIRTYPE}-${ARCH}"
+    fi
+}
+
+verfromdir()
+{
+    TESTDIR="$1"
+    if [ -r "${TESTDIR}/include/linux/utsrelease.h" ]
+    then
+        awk '/UTS_RELEASE/{gsub(/"/,"",$3); print $3}' "${TESTDIR}/include/linux/utsrelease.h"
+    fi
+}
+
+validate_dir()
+{
+    KVER="$1"
+    DIR="$2"
+
+    if [ ! -d "${RHEL5_KERNEL_BASE}/${DIR}" ]
+    then
+        return 1
+    elif [ ! -f "${RHEL5_KERNEL_BASE}/${DIR}/include/linux/autoconf.h" ]
+    then
+        return 1
+    elif [ ! -f "${RHEL5_KERNEL_BASE}/${DIR}/include/linux/version.h" ]
+    then
+        return 1
+    fi
+
+    if [ "$KVER" != "$(verfromdir "${RHEL5_KERNEL_BASE}/${DIR}")" ]
+    then
+        return 1
+    fi
+
+    return 0
+}
+
+# Takes a `uname -r` and returns "ver type", where ver
+# is 2.6.9-NN.EL and type is "smp" or the like.
+validate_version()
+{
+    KVER="$1"
+
+    dir=$(guess_rhel5_dir "$KVER")
+    if validate_dir "$KVER" "$dir"
+    then
+        echo "${RHEL5_KERNEL_BASE}/${dir}"
+    fi
+}
+
+find_version()
+{
+    # Find the most recent valid kernel
+    ls -1 -t "$RHEL5_KERNEL_BASE" | while read kdir
+    do
+        KVER="$(verfromdir "${RHEL5_KERNEL_BASE}/${kdir}")"
+        if validate_dir "$KVER" "$kdir"
+        then
+            echo "${RHEL5_KERNEL_BASE}/${kdir}"
+            break
+        fi
+    done
+}
+
+# For a given KVER, see if all the -devel packages exist
+validate_target()
+{
+    KVER="$1"
+    ARCH="$2"
+    TYPELIST="$3"
+
+    typelist="${TYPELIST#$ARCH:}"
+    while :
+    do
+        type="${typelist%%,*}"
+        VERDIR="$(validate_version ${KVER}${type})"
+        if [ -z "$VERDIR" ]
+        then
+            return 1
+        fi
+    
+        # This loop walks the list of types being careful of the empty
+        # typename
+        tmp="${typelist#*,}"
+        if [ -z "$tmp" -o "$tmp" = "$typelist" ]
+        then
+            break
+        fi
+        typelist="$tmp"
+    done
+
+    return 0
+}
+
+find_targets()
+{
+    # Pre-calculate ARCH and TYPELIST, at least
+    ARCH="$(guess_rhel5_arch)"
+    if [ -z "$ARCH" ]
+    then
+        return
+    fi
+
+    TYPELIST=
+    for typelist in $RHEL5_KERNEL_TYPES
+    do
+        TARCH=$(echo "$typelist" | cut -f1 -d:)
+        if [ "$TARCH" = "$ARCH" ]
+        then
+            TYPELIST="$typelist"
+            break
+        fi
+    done
+
+    if [ -z "$TYPELIST" ]
+    then
+        return
+    fi
+    
+    ls -1 -t "$RHEL5_KERNEL_BASE" | while read kdir
+    do
+        KVER="$(verfromdir "${RHEL5_KERNEL_BASE}/${kdir}")"
+        if ! validate_dir "$KVER" "$kdir"
+        then
+            continue
+        fi
+        if validate_target "$KVER" "$ARCH" "$TYPELIST"
+        then
+            echo "rhel5_${KVER}_rpm"
+        fi
+    done
+}
+
+case "$1" in
+include|build)
+    if [ -n "$2" ]
+    then
+        KPATH="$(validate_version "$2")"
+    else
+        KVER="$(uname -r)"
+        KPATH="$(validate_version "$KVER")"
+        if [ -z "$KPATH" ]
+        then
+            KPATH="$(find_version)"
+        fi
+    fi
+    if [ -n "$KPATH" ]
+    then
+        if [ "$1" = "include" ]
+        then
+            KPATH="${KPATH}/include"
+        fi
+        echo "${KPATH}"
+    fi
+    ;;
+targets)
+    find_targets
+    ;;
+"")
+    echo "Missing operation" >&2
+    ;;
+*)
+    echo "Invalid operation: $1" >&2
+    exit 1
+    ;;
+esac


Property changes on: branches/ocfs2-1.2/vendor/rhel5/kernel.guess
___________________________________________________________________
Name: svn:executable
   + *

Added: branches/ocfs2-1.2/vendor/rhel5/ocfs2.spec-generic.in
===================================================================
--- branches/ocfs2-1.2/vendor/rhel5/ocfs2.spec-generic.in	2007-02-09 19:45:44 UTC (rev 2982)
+++ branches/ocfs2-1.2/vendor/rhel5/ocfs2.spec-generic.in	2007-03-06 22:06:39 UTC (rev 2983)
@@ -0,0 +1,123 @@
+#
+# Spec file for OCFS2 on RHEL4
+#
+
+# Macros
+# This one is hardcoded because, well, it belongs there
+%define _prefix /usr
+# Because RPM is dumb
+%define _unpackaged_files_terminate_build 0
+
+%ifarch i686
+%define karch		i686
+%endif
+
+%ifarch x86_64
+%define karch		x86_64
+%endif
+
+%ifarch ia64
+%define karch		ia64
+%endif
+
+%ifarch ppc64
+%define karch		ppc64
+%endif
+
+%ifarch s390x
+%define karch		s390x
+%endif
+
+%define kver		@@KVER@@
+
+# The minimum tools package required for the kernel bits.
+%define tools_ver     @TOOLS_REQUIRED_VERSION@
+
+Summary: The Oracle Cluster Filesystem 2.
+Name: ocfs2-%{kver}
+Version: @DIST_VERSION@
+Release: @@PKG_VERSION@@
+License: GPL
+Group: System Environment/Kernel
+Source: ocfs2- at DIST_VERSION@.tar.gz
+URL: http://oss.oracle.com/projects/ocfs2/
+Distribution: Oracle
+Vendor: Oracle
+Packager: Joel Becker <joel.becker at oracle.com>
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+Requires: kernel = %{kver}
+Requires: ocfs2-tools >= %{tools_ver}
+BuildRequires: kernel-devel = %{kver}
+
+
+BuildRoot: %{_tmppath}/ocfs2-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
+
+
+%description
+OCFS2 is the Oracle Cluster Filesystem 2.
+
+
+%prep
+%setup -n ocfs2-%{version}
+
+
+%build
+
+local_configure()
+{
+	./configure					\
+		--prefix=%{_prefix}			\
+		--exec-prefix=%{_exec_prefix}		\
+		--bindir=%{_bindir}			\
+		--sbindir=%{_sbindir}			\
+		--sysconfdir=%{_sysconfdir}		\
+		--datadir=%{_datadir}			\
+		--includedir=%{_includedir}             \
+		--libdir=%{_libdir}			\
+		--libexecdir=%{_libexecdir}		\
+		--localstatedir=%{_localstatedir}	\
+		--sharedstatedir=%{_sharedstatedir}	\
+		--mandir=%{_mandir}			\
+		--infodir=%{_infodir}			\
+		--with-vendor=rhel5			\
+		--with-vendorkernel="$1"
+}
+
+local_configure "%{kver}"
+
+make V=0
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}/extra/"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}/kernel"
+for i in ocfs2/ ocfs2/dlm/ ocfs2/cluster/
+do
+	mkdir -p "${INST_MODLIB}/fs/$i"
+	mv "${EXTRA_MODLIB}"/$i/ocfs2*.ko "${INST_MODLIB}/fs/$i"
+	rm -f "${EXTRA_MODLIB}"/$i/*.ko
+done
+
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+
+%post
+depmod -ae %{kver}
+
+%files
+%defattr(-,root,root)
+/lib/modules/%{kver}/kernel/fs
+
+
+%changelog
+* Wed Feb 21 2007 Joel Becker <joel.becker at oracle.com>
+- Modify for rhel5
+
+* Thu Jun 22 2006 Sunil Mushran <sunil.mushran at oracle.com>
+- Add largesmp
+
+* Mon Jan 24 2004 Manish Singh <manish.singh at oracle.com>
+- Initial rpm spec file

Added: branches/ocfs2-1.2/vendor/rhel5/rpmarch.guess
===================================================================
--- branches/ocfs2-1.2/vendor/rhel5/rpmarch.guess	2007-02-09 19:45:44 UTC (rev 2982)
+++ branches/ocfs2-1.2/vendor/rhel5/rpmarch.guess	2007-03-06 22:06:39 UTC (rev 2983)
@@ -0,0 +1,68 @@
+#! /bin/sh
+
+mode="$1"
+srcdir="$2"
+
+host_cpu=
+
+
+QUERYFILE=/etc/redhat-release
+
+if test -n "$QUERYFILE"; then
+  host_cpu="`rpm -qf $QUERYFILE --queryformat \"%{ARCH}\"`"
+fi
+
+if test -z "$host_cpu" -o "$host_cpu" = "noarch" ; then
+  host_alias=`$srcdir/config.guess`
+  host=`$srcdir/config.sub $host_alias`
+  host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+fi
+
+case "$host_cpu" in
+  x86_64|ia64|s390x)
+    TOOLSARCH="$host_cpu"
+    ;;
+  i386|i486|i586|i686|i786|k6|k7)
+    TOOLSARCH="i386"
+    ;;
+  ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64)
+    TOOLSARCH="ppc64"
+    ;;
+  *)
+    echo "rpmarch.guess: Warning: unknown RPM CPU architecture: $host_cpu" >&2
+    TOOLSARCH=""
+    ;;
+esac
+
+# Only a few of these need to be overwritten from RPM's default
+case "$host_cpu" in
+  i386|i586)
+    MODULEARCH="i686"
+    ;;
+  ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64)
+    MODULEARCH="ppc64"
+    ;;
+  *)
+    MODULEARCH=""
+    ;;
+esac
+
+case "$mode" in
+  module)
+    if [ -n "$MODULEARCH" ] ; then
+      echo "--target $MODULEARCH"
+    fi
+    ;;
+  tools)
+    if [ -n "$TOOLSARCH" ] ; then
+      echo "--target $TOOLSARCH"
+    fi
+    ;;
+  *)
+    echo "rpmarch.guess: Invalid mode: $mode" >&2
+    echo "error"
+    exit 1
+    ;;
+esac
+
+exit 0


Property changes on: branches/ocfs2-1.2/vendor/rhel5/rpmarch.guess
___________________________________________________________________
Name: svn:executable
   + *

Added: branches/ocfs2-1.2/vendor/rhel5/vendor.guess
===================================================================
--- branches/ocfs2-1.2/vendor/rhel5/vendor.guess	2007-02-09 19:45:44 UTC (rev 2982)
+++ branches/ocfs2-1.2/vendor/rhel5/vendor.guess	2007-03-06 22:06:39 UTC (rev 2983)
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+if [ ! -f /etc/redhat-release ]
+then
+    exit 1
+fi
+
+case "`rpm -qf /etc/redhat-release --qf '%{VERSION}' 2>/dev/null`" in
+    4.9*) ;;
+    5*) ;;
+    *) exit 1;;
+esac
+
+exit 0


Property changes on: branches/ocfs2-1.2/vendor/rhel5/vendor.guess
___________________________________________________________________
Name: svn:executable
   + *




More information about the Ocfs2-commits mailing list