rpms/cluster/devel cluster-dlmheaders.patch, NONE, 1.1 cluster.logrotate, NONE, 1.1 cluster.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Fabio M. Di Nitto (fabbione) fedora-extras-commits at redhat.com
Mon May 19 17:57:07 UTC 2008


Author: fabbione

Update of /cvs/pkgs/rpms/cluster/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16333/devel

Modified Files:
	.cvsignore sources 
Added Files:
	cluster-dlmheaders.patch cluster.logrotate cluster.spec 
Log Message:
Import first package


cluster-dlmheaders.patch:

--- NEW FILE cluster-dlmheaders.patch ---
diff --git a/dlm/include/linux/dlm.h b/dlm/include/linux/dlm.h
new file mode 100644
index 0000000..203a025
--- /dev/null
+++ b/dlm/include/linux/dlm.h
@@ -0,0 +1,169 @@
+/******************************************************************************
+*******************************************************************************
+**
+**  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
+**  Copyright (C) 2004-2007 Red Hat, Inc.  All rights reserved.
+**
+**  This copyrighted material is made available to anyone wishing to use,
+**  modify, copy, or redistribute it subject to the terms and conditions
+**  of the GNU General Public License v.2.
+**
+*******************************************************************************
+******************************************************************************/
+
+#ifndef __DLM_DOT_H__
+#define __DLM_DOT_H__
+
+/*
+ * Interface to Distributed Lock Manager (DLM)
+ * routines and structures to use DLM lockspaces
+ */
+
+/* Lock levels and flags are here */
+#include <linux/dlmconstants.h>
+#include <linux/types.h>
+
+typedef void dlm_lockspace_t;
+
+/*
+ * Lock status block
+ *
+ * Use this structure to specify the contents of the lock value block.  For a
+ * conversion request, this structure is used to specify the lock ID of the
+ * lock.  DLM writes the status of the lock request and the lock ID assigned
+ * to the request in the lock status block.
+ *
+ * sb_lkid: the returned lock ID.  It is set on new (non-conversion) requests.
+ * It is available when dlm_lock returns.
+ *
+ * sb_lvbptr: saves or returns the contents of the lock's LVB according to rules
+ * shown for the DLM_LKF_VALBLK flag.
+ *
+ * sb_flags: DLM_SBF_DEMOTED is returned if in the process of promoting a lock,
+ * it was first demoted to NL to avoid conversion deadlock.
+ * DLM_SBF_VALNOTVALID is returned if the resource's LVB is marked invalid.
+ *
+ * sb_status: the returned status of the lock request set prior to AST
+ * execution.  Possible return values:
+ *
+ * 0 if lock request was successful
+ * -EAGAIN if request would block and is flagged DLM_LKF_NOQUEUE
+ * -ENOMEM if there is no memory to process request
+ * -EINVAL if there are invalid parameters
+ * -DLM_EUNLOCK if unlock request was successful
+ * -DLM_ECANCEL if a cancel completed successfully
+ */
+
+#define DLM_SBF_DEMOTED		0x01
+#define DLM_SBF_VALNOTVALID	0x02
+#define DLM_SBF_ALTMODE		0x04
+
+struct dlm_lksb {
+	int 	 sb_status;
+	__u32	 sb_lkid;
+	char 	 sb_flags;
+	char *	 sb_lvbptr;
+};
+
+#define DLM_LSFL_NODIR		0x00000001
+#define DLM_LSFL_TIMEWARN	0x00000002
+#define DLM_LSFL_FS     	0x00000004
+
+#ifdef __KERNEL__
+
+/*
+ * dlm_new_lockspace
+ *
+ * Starts a lockspace with the given name.  If the named lockspace exists in
+ * the cluster, the calling node joins it.
+ */
+
+int dlm_new_lockspace(char *name, int namelen, dlm_lockspace_t **lockspace,
+		      uint32_t flags, int lvblen);
+
+/*
+ * dlm_release_lockspace
+ *
+ * Stop a lockspace.
+ */
+
+int dlm_release_lockspace(dlm_lockspace_t *lockspace, int force);
+
+/*
+ * dlm_lock
+ *
+ * Make an asyncronous request to acquire or convert a lock on a named
+ * resource.
+ *
+ * lockspace: context for the request
+ * mode: the requested mode of the lock (DLM_LOCK_)
+ * lksb: lock status block for input and async return values
+ * flags: input flags (DLM_LKF_)
+ * name: name of the resource to lock, can be binary
+ * namelen: the length in bytes of the resource name (MAX_RESNAME_LEN)
+ * parent: the lock ID of a parent lock or 0 if none
+ * lockast: function DLM executes when it completes processing the request
+ * astarg: argument passed to lockast and bast functions
+ * bast: function DLM executes when this lock later blocks another request
+ *
+ * Returns:
+ * 0 if request is successfully queued for processing
+ * -EINVAL if any input parameters are invalid
+ * -EAGAIN if request would block and is flagged DLM_LKF_NOQUEUE
+ * -ENOMEM if there is no memory to process request
+ * -ENOTCONN if there is a communication error
+ *
+ * If the call to dlm_lock returns an error then the operation has failed and
+ * the AST routine will not be called.  If dlm_lock returns 0 it is still
+ * possible that the lock operation will fail. The AST routine will be called
+ * when the locking is complete and the status is returned in the lksb.
+ *
+ * If the AST routines or parameter are passed to a conversion operation then
+ * they will overwrite those values that were passed to a previous dlm_lock
+ * call.
+ *
+ * AST routines should not block (at least not for long), but may make
+ * any locking calls they please.
+ */
+
+int dlm_lock(dlm_lockspace_t *lockspace,
+	     int mode,
+	     struct dlm_lksb *lksb,
+	     uint32_t flags,
+	     void *name,
+	     unsigned int namelen,
+	     uint32_t parent_lkid,
+	     void (*lockast) (void *astarg),
+	     void *astarg,
+	     void (*bast) (void *astarg, int mode));
+
+/*
+ * dlm_unlock
+ *
+ * Asynchronously release a lock on a resource.  The AST routine is called
+ * when the resource is successfully unlocked.
+ *
+ * lockspace: context for the request
+ * lkid: the lock ID as returned in the lksb
+ * flags: input flags (DLM_LKF_)
+ * lksb: if NULL the lksb parameter passed to last lock request is used
+ * astarg: the arg used with the completion ast for the unlock
+ *
+ * Returns:
+ * 0 if request is successfully queued for processing
+ * -EINVAL if any input parameters are invalid
+ * -ENOTEMPTY if the lock still has sublocks
+ * -EBUSY if the lock is waiting for a remote lock operation
+ * -ENOTCONN if there is a communication error
+ */
+
+int dlm_unlock(dlm_lockspace_t *lockspace,
+	       uint32_t lkid,
+	       uint32_t flags,
+	       struct dlm_lksb *lksb,
+	       void *astarg);
+
+#endif				/* __KERNEL__ */
+
+#endif				/* __DLM_DOT_H__ */
+
diff --git a/dlm/include/linux/dlm_device.h b/dlm/include/linux/dlm_device.h
new file mode 100644
index 0000000..c603450
--- /dev/null
+++ b/dlm/include/linux/dlm_device.h
@@ -0,0 +1,108 @@
+/******************************************************************************
+*******************************************************************************
+**
+**  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
+**  Copyright (C) 2004-2007 Red Hat, Inc.  All rights reserved.
+**
+**  This copyrighted material is made available to anyone wishing to use,
+**  modify, copy, or redistribute it subject to the terms and conditions
+**  of the GNU General Public License v.2.
+**
+*******************************************************************************
+******************************************************************************/
+
+#ifndef _LINUX_DLM_DEVICE_H
+#define _LINUX_DLM_DEVICE_H
+
+/* This is the device interface for dlm, most users will use a library
+ * interface.
+ */
+
+#include <linux/dlm.h>
+#include <linux/types.h>
+
+#define DLM_USER_LVB_LEN	32
+
+/* Version of the device interface */
+#define DLM_DEVICE_VERSION_MAJOR 6
+#define DLM_DEVICE_VERSION_MINOR 0
+#define DLM_DEVICE_VERSION_PATCH 0
+
+/* struct passed to the lock write */
+struct dlm_lock_params {
+	__u8 mode;
+	__u8 namelen;
+	__u16 unused;
+	__u32 flags;
+	__u32 lkid;
+	__u32 parent;
+	__u64 xid;
+	__u64 timeout;
+	void __user *castparam;
+	void __user *castaddr;
+	void __user *bastparam;
+	void __user *bastaddr;
+	struct dlm_lksb __user *lksb;
+	char lvb[DLM_USER_LVB_LEN];
+	char name[0];
+};
+
+struct dlm_lspace_params {
+	__u32 flags;
+	__u32 minor;
+	char name[0];
+};
+
+struct dlm_purge_params {
+	__u32 nodeid;
+	__u32 pid;
+};
+
+struct dlm_write_request {
+	__u32 version[3];
+	__u8 cmd;
+	__u8 is64bit;
+	__u8 unused[2];
+
+	union  {
+		struct dlm_lock_params   lock;
+		struct dlm_lspace_params lspace;
+		struct dlm_purge_params  purge;
+	} i;
+};
+
+struct dlm_device_version {
+	__u32 version[3];
+};
+
+/* struct read from the "device" fd,
+   consists mainly of userspace pointers for the library to use */
+
+struct dlm_lock_result {
+	__u32 version[3];
+	__u32 length;
+	void __user * user_astaddr;
+	void __user * user_astparam;
+	struct dlm_lksb __user * user_lksb;
+	struct dlm_lksb lksb;
+	__u8 bast_mode;
+	__u8 unused[3];
+	/* Offsets may be zero if no data is present */
+	__u32 lvb_offset;
+};
+
+/* Commands passed to the device */
+#define DLM_USER_LOCK         1
+#define DLM_USER_UNLOCK       2
+#define DLM_USER_QUERY        3
+#define DLM_USER_CREATE_LOCKSPACE  4
+#define DLM_USER_REMOVE_LOCKSPACE  5
+#define DLM_USER_PURGE        6
+#define DLM_USER_DEADLOCK     7
+
+/* Lockspace flags */
+#define DLM_USER_LSFLG_AUTOFREE   1
+#define DLM_USER_LSFLG_FORCEFREE  2
+
+#endif
+
diff --git a/dlm/include/linux/dlm_netlink.h b/dlm/include/linux/dlm_netlink.h
new file mode 100644
index 0000000..1927633
--- /dev/null
+++ b/dlm/include/linux/dlm_netlink.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2007 Red Hat, Inc.  All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License v.2.
+ */
+
+#ifndef _DLM_NETLINK_H
+#define _DLM_NETLINK_H
+
+enum {
+	DLM_STATUS_WAITING = 1,
+	DLM_STATUS_GRANTED = 2,
+	DLM_STATUS_CONVERT = 3,
+};
+
+#define DLM_LOCK_DATA_VERSION 1
+
+struct dlm_lock_data {
+	uint16_t version;
+	uint32_t lockspace_id;
+	int nodeid;
+	int ownpid;
+	uint32_t id;
+	uint32_t remid;
+	uint64_t xid;
+	int8_t status;
+	int8_t grmode;
+	int8_t rqmode;
+	unsigned long timestamp;
+	int resource_namelen;
+	char resource_name[DLM_RESNAME_MAXLEN];
+};
+
+enum {
+	DLM_CMD_UNSPEC = 0,
+	DLM_CMD_HELLO,		/* user->kernel */
+	DLM_CMD_TIMEOUT,	/* kernel->user */
+	__DLM_CMD_MAX,
+};
+
+#define DLM_CMD_MAX (__DLM_CMD_MAX - 1)
+
+enum {
+	DLM_TYPE_UNSPEC = 0,
+	DLM_TYPE_LOCK,
+	__DLM_TYPE_MAX,
+};
+
+#define DLM_TYPE_MAX (__DLM_TYPE_MAX - 1)
+
+#define DLM_GENL_VERSION 0x1
+#define DLM_GENL_NAME "DLM"
+
+#endif /* _DLM_NETLINK_H */
diff --git a/dlm/include/linux/dlm_plock.h b/dlm/include/linux/dlm_plock.h
new file mode 100644
index 0000000..18d5fdb
--- /dev/null
+++ b/dlm/include/linux/dlm_plock.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2005-2008 Red Hat, Inc.  All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License v.2.
+ */
+
+#ifndef __DLM_PLOCK_DOT_H__
+#define __DLM_PLOCK_DOT_H__
+
+#define DLM_PLOCK_MISC_NAME		"dlm_plock"
+
+#define DLM_PLOCK_VERSION_MAJOR	1
+#define DLM_PLOCK_VERSION_MINOR	1
+#define DLM_PLOCK_VERSION_PATCH	0
+
+enum {
+	DLM_PLOCK_OP_LOCK = 1,
+	DLM_PLOCK_OP_UNLOCK,
+	DLM_PLOCK_OP_GET,
+};
+
+struct dlm_plock_info {
+	__u32 version[3];
+	__u8 optype;
+	__u8 ex;
+	__u8 wait;
+	__u8 pad;
+	__u32 pid;
+	__s32 nodeid;
+	__s32 rv;
+	__u32 fsid;
+	__u64 number;
+	__u64 start;
+	__u64 end;
+	__u64 owner;
+};
+
+#ifdef __KERNEL__
+int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
+		int cmd, struct file_lock *fl);
+int dlm_posix_unlock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
+		struct file_lock *fl);
+int dlm_posix_get(dlm_lockspace_t *lockspace, u64 number, struct file *file,
+		struct file_lock *fl);
+#endif /* __KERNEL__ */
+
+#endif
+
diff --git a/dlm/include/linux/dlmconstants.h b/dlm/include/linux/dlmconstants.h
new file mode 100644
index 0000000..47bf08d
--- /dev/null
+++ b/dlm/include/linux/dlmconstants.h
@@ -0,0 +1,163 @@
+/******************************************************************************
+*******************************************************************************
+**
+**  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
+**  Copyright (C) 2004-2007 Red Hat, Inc.  All rights reserved.
+**
+**  This copyrighted material is made available to anyone wishing to use,
+**  modify, copy, or redistribute it subject to the terms and conditions
+**  of the GNU General Public License v.2.
+**
+*******************************************************************************
+******************************************************************************/
+
+#ifndef __DLMCONSTANTS_DOT_H__
+#define __DLMCONSTANTS_DOT_H__
+
+/*
+ * Constants used by DLM interface.
+ */
+
+#define DLM_LOCKSPACE_LEN       64
+#define DLM_RESNAME_MAXLEN      64
+
+
+/*
+ * Lock Modes
+ */
+
+#define DLM_LOCK_IV		(-1)	/* invalid */
+#define DLM_LOCK_NL		0	/* null */
+#define DLM_LOCK_CR		1	/* concurrent read */
+#define DLM_LOCK_CW		2	/* concurrent write */
+#define DLM_LOCK_PR		3	/* protected read */
+#define DLM_LOCK_PW		4	/* protected write */
+#define DLM_LOCK_EX		5	/* exclusive */
+
+
+/*
+ * Flags to dlm_lock
+ *
+ * DLM_LKF_NOQUEUE
+ *
+ * Do not queue the lock request on the wait queue if it cannot be granted
+ * immediately.  If the lock cannot be granted because of this flag, DLM will
+ * either return -EAGAIN from the dlm_lock call or will return 0 from
+ * dlm_lock and -EAGAIN in the lock status block when the AST is executed.
+ *
+ * DLM_LKF_CANCEL
+ *
+ * Used to cancel a pending lock request or conversion.  A converting lock is
+ * returned to its previously granted mode.
+ *
+ * DLM_LKF_CONVERT
+ *
+ * Indicates a lock conversion request.  For conversions the name and namelen
+ * are ignored and the lock ID in the LKSB is used to identify the lock.
+ *
+ * DLM_LKF_VALBLK
+ *
+ * Requests DLM to return the current contents of the lock value block in the
+ * lock status block.  When this flag is set in a lock conversion from PW or EX
+ * modes, DLM assigns the value specified in the lock status block to the lock
+ * value block of the lock resource.  The LVB is a DLM_LVB_LEN size array
+ * containing application-specific information.
+ *
+ * DLM_LKF_QUECVT
+ *
+ * Force a conversion request to be queued, even if it is compatible with
+ * the granted modes of other locks on the same resource.
+ *
+ * DLM_LKF_IVVALBLK
+ *
+ * Invalidate the lock value block.
+ *
+ * DLM_LKF_CONVDEADLK
+ *
+ * Allows the dlm to resolve conversion deadlocks internally by demoting the
+ * granted mode of a converting lock to NL.  The DLM_SBF_DEMOTED flag is
+ * returned for a conversion that's been effected by this.
+ *
+ * DLM_LKF_PERSISTENT
+ *
+ * Only relevant to locks originating in userspace.  A persistent lock will not
+ * be removed if the process holding the lock exits.
+ *
+ * DLM_LKF_NODLCKWT
+ *
+ * Do not cancel the lock if it gets into conversion deadlock.
+ * Exclude this lock from being monitored due to DLM_LSFL_TIMEWARN.
+ *
+ * DLM_LKF_NODLCKBLK
+ *
+ * net yet implemented
+ *
+ * DLM_LKF_EXPEDITE
+ *
+ * Used only with new requests for NL mode locks.  Tells the lock manager
+ * to grant the lock, ignoring other locks in convert and wait queues.
+ *
+ * DLM_LKF_NOQUEUEBAST
+ *
+ * Send blocking AST's before returning -EAGAIN to the caller.  It is only
+ * used along with the NOQUEUE flag.  Blocking AST's are not sent for failed
+ * NOQUEUE requests otherwise.
+ *
+ * DLM_LKF_HEADQUE
+ *
+ * Add a lock to the head of the convert or wait queue rather than the tail.
+ *
+ * DLM_LKF_NOORDER
+ *
+ * Disregard the standard grant order rules and grant a lock as soon as it
+ * is compatible with other granted locks.
+ *
+ * DLM_LKF_ORPHAN
+ *
+ * not yet implemented
+ *
+ * DLM_LKF_ALTPR
+ *
+ * If the requested mode cannot be granted immediately, try to grant the lock
+ * in PR mode instead.  If this alternate mode is granted instead of the
+ * requested mode, DLM_SBF_ALTMODE is returned in the lksb.
+ *
+ * DLM_LKF_ALTCW
+ *
+ * The same as ALTPR, but the alternate mode is CW.
+ *
+ * DLM_LKF_FORCEUNLOCK
+ *
+ * Unlock the lock even if it is converting or waiting or has sublocks.
+ * Only really for use by the userland device.c code.
+ *
+ */
+
+#define DLM_LKF_NOQUEUE		0x00000001
+#define DLM_LKF_CANCEL		0x00000002
+#define DLM_LKF_CONVERT		0x00000004
+#define DLM_LKF_VALBLK		0x00000008
+#define DLM_LKF_QUECVT		0x00000010
+#define DLM_LKF_IVVALBLK	0x00000020
+#define DLM_LKF_CONVDEADLK	0x00000040
+#define DLM_LKF_PERSISTENT	0x00000080
+#define DLM_LKF_NODLCKWT	0x00000100
+#define DLM_LKF_NODLCKBLK	0x00000200
+#define DLM_LKF_EXPEDITE	0x00000400
+#define DLM_LKF_NOQUEUEBAST	0x00000800
+#define DLM_LKF_HEADQUE		0x00001000
+#define DLM_LKF_NOORDER		0x00002000
+#define DLM_LKF_ORPHAN		0x00004000
+#define DLM_LKF_ALTPR		0x00008000
+#define DLM_LKF_ALTCW		0x00010000
+#define DLM_LKF_FORCEUNLOCK	0x00020000
+#define DLM_LKF_TIMEOUT		0x00040000
+
+/*
+ * Some return codes that are not in errno.h
+ */
+
+#define DLM_ECANCEL		0x10001
+#define DLM_EUNLOCK		0x10002
+
+#endif  /* __DLMCONSTANTS_DOT_H__ */
diff --git a/dlm/libdlm/Makefile b/dlm/libdlm/Makefile
index d164ec9..4b53d73 100644
--- a/dlm/libdlm/Makefile
+++ b/dlm/libdlm/Makefile
@@ -41,7 +41,7 @@ include $(OBJDIR)/make/uninstall.mk
 
 AISTARGET= libaislock
 
-CFLAGS += -I$(S)
+CFLAGS += -I$(S) -I$(S)/../include
 CFLAGS += -I${incdir}
 CFLAGS += -I$(KERNEL_SRC)/include
 
diff --git a/dlm/libdlmcontrol/Makefile b/dlm/libdlmcontrol/Makefile
index 30447f3..f5e8c69 100644
--- a/dlm/libdlmcontrol/Makefile
+++ b/dlm/libdlmcontrol/Makefile
@@ -35,6 +35,7 @@ include $(OBJDIR)/make/uninstall.mk
 OBJS=	main.o
 
 CFLAGS += -fPIC
+CFLAGS += -I$(S)/../include
 CFLAGS += -I$(S)/../../group/dlm_controld
 CFLAGS += -I${incdir}
 CFLAGS += -I$(KERNEL_SRC)/include
diff --git a/group/dlm_controld/Makefile b/group/dlm_controld/Makefile
index 3e2f3dc..4db7a48 100644
--- a/group/dlm_controld/Makefile
+++ b/group/dlm_controld/Makefile
@@ -36,6 +36,7 @@ OBJS=	action.o \
 CFLAGS += -I${ccsincdir} -I${cmanincdir} 
 CFLAGS += -I${dlmincdir} -I${dlmcontrolincdir}
 CFLAGS += -I${openaisincdir} -I${fencedincdir}
+CFLAGS += -I$(S)/../../dlm/include/
 CFLAGS += -I${KERNEL_SRC}/include/
 CFLAGS += -I$(S)/../lib/ -I$(S)/../include/
 CFLAGS += -I${incdir}
diff --git a/group/gfs_controld/Makefile b/group/gfs_controld/Makefile
index 2b05312..f46666c 100644
--- a/group/gfs_controld/Makefile
+++ b/group/gfs_controld/Makefile
@@ -30,6 +30,7 @@ OBJS= 	main.o \
 	recover.o
 
 CFLAGS += -I${ccsincdir} -I${cmanincdir} -I${openaisincdir}
+CFLAGS += -I$(S)/../../dlm/include
 CFLAGS += -I${KERNEL_SRC}/include/
 CFLAGS += -I$(S)/../lib/ -I$(S)/../include/
 CFLAGS += -I${incdir}


--- NEW FILE cluster.logrotate ---
/var/log/cluster/*log {
	missingok
	compress
	notifempty
	daily
	rotate 7
	create 0600 root root
}


--- NEW FILE cluster.spec ---
###############################################################################
###############################################################################
##
##  Copyright (C) 2004-2008 Red Hat, Inc.  All rights reserved.
##
##  This copyrighted material is made available to anyone wishing to use,
##  modify, copy, or redistribute it subject to the terms and conditions
##  of the GNU General Public License v.2.
##
###############################################################################
###############################################################################

# main (empty) package
# http://www.rpm.org/max-rpm/s1-rpm-subpack-spec-file-changes.html

# keep around ready for later user
# %%define alphatag 2.99.02

Name: cluster
Summary: Red Hat Cluster
Version: 2.99.02
Release: 1%{?alphatag:.%{alphatag}}%{?dist}
License:  GPLv2 and LGPLv2
Group: System Environment/Base
URL: http://sources.redhat.com/cluster/wiki/
Source0: ftp://sources.redhat.com/pub/cluster/releases/cluster-%{version}.tar.gz
Source1: cluster.logrotate
# 2.99.01 requires 2.6.26 headers to build but it can run on 2.6.25 or lower
# in compat mode. As long as the new headers are not propagated in Fedora,
# use a local copy that will go away.
Patch0: cluster-dlmheaders.patch

## Setup/build bits

# build support for xen
%define buildxen 0
%ifarch i386 x86_64 ia64
%define buildxen 1
%endif

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

# Build dependencies
BuildRequires: perl python
BuildRequires: glibc-kernheaders glibc-devel kernel-devel
BuildRequires: libxml2-devel ncurses-devel slang-devel libvolume_id-devel
BuildRequires: openais-devel >= 0.83
%if %{buildxen}
BuildRequires: nss-devel nspr-devel libvirt-devel xen-libs
%endif

%prep
%setup -q -n cluster-%{version}
%patch0 -p1

%build
# required by dlm and gfs2-utils for now. Investigate if we can drop it
ksrc="$(ls -d /usr/src/kernels/*)"

# for legacy reasons, all binaries have always been installed in /sbin
./configure \
  --sbindir=/sbin \
  --initddir=%{_sysconfdir}/rc.d/init.d \
  --libdir=%{_libdir} \
%if %{buildxen}
  --enable_xen \
%endif
  --openaislibdir=%{_libdir}/openais \
  --without_gfs \
  --without_gnbd \
  --kernel_build=${ksrc} \
  --kernel_src=${ksrc} \
  --disable_kernel_check

CFLAGS="$(echo '%{optflags}')" make %{_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/cluster
# install logging bits
mkdir -p $RPM_BUILD_ROOT/var/log/cluster
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
install -m 644 -p %{SOURCE1} \
	$RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/cman

## tree fix up
# remove static libraries
find $RPM_BUILD_ROOT -name "*.a" -exec rm {} \;
# fix library permissions or fedora strip helpers won't work.
find $RPM_BUILD_ROOT -name "lib*.so.*" -exec chmod 0755 {} \;
# fix lcrso permissions or fedora strip helpers won't work.
find $RPM_BUILD_ROOT -name "*.lcrso" -exec chmod 0755 {} \;
# fix libfence permissions
chmod 0755 $RPM_BUILD_ROOT%{_datadir}/fence/*.py
# fix script permissions
chmod 0755 $RPM_BUILD_ROOT%{_datadir}/cluster/{ocf-shellfuncs,svclib_nfslock,utils/config-utils.sh}
# do not ship fence_vmware for now
find $RPM_BUILD_ROOT -name "fence_vmware" -exec rm {} \;

%clean
rm -rf $RPM_BUILD_ROOT

## Runtime and subpackages section

# main empty package
%description
Red Hat Cluster

## subpackages

%package -n cman
Group: System Environment/Base
Summary: Red Hat Cluster Manager
# None of those packages have been in the pool since F7.
#Obsoletes: fence ccs dlm
#Conflicts: GFS <= 6.0
#Conflicts: GFS-modules
Requires(post): chkconfig
Requires(preun): initscripts
Requires(preun): chkconfig
Requires: openais >= 0.83 sg3_utils

%description -n cman
Red Hat Cluster Manager

%post -n cman
/sbin/chkconfig --add cman
/sbin/chkconfig --add scsi_reserve
/sbin/chkconfig --add qdiskd
/sbin/ldconfig > /dev/null

# make sure to stop cman always as last
%preun -n cman
if [ "$1" = 0 ]; then
	/sbin/service qdiskd stop >/dev/null 2>&1
	/sbin/service scsi_reserve stop >/dev/null 2>&1
	/sbin/service cman stop >/dev/null 2>&1
	/sbin/chkconfig --del qdiskd
	/sbin/chkconfig --del scsi_reserve
	/sbin/chkconfig --del cman
fi

%postun -n cman -p /sbin/ldconfig

%files -n cman
%defattr(-,root,root,-)
%dir %{_sysconfdir}/cluster
%{_sysconfdir}/rc.d/init.d/cman
%{_sysconfdir}/rc.d/init.d/qdiskd
%{_sysconfdir}/rc.d/init.d/scsi_reserve
%config(noreplace) %{_sysconfdir}/udev/rules.d/*-dlm.rules
%config(noreplace) %{_sysconfdir}/logrotate.d/cman
/sbin/ccs*
/sbin/cman*
/sbin/dlm*
/sbin/fence*
/sbin/gfs_controld
/sbin/group*
/sbin/*qdisk*
%{_libdir}/*.so.*
%{_datadir}/fence*
%{_datadir}/snmp/mibs/*
/usr/libexec/*
%dir /var/log/cluster
%{_mandir}/man5/*
%{_mandir}/man7/*
%{_mandir}/man8/ccs*
%{_mandir}/man8/cman*
%{_mandir}/man8/dlm*
%{_mandir}/man8/fence*
%{_mandir}/man8/gfs_controld*
%{_mandir}/man8/group*
%{_mandir}/man8/*qdisk*

%package -n cman-devel
Group: Development/Libraries
Summary: The Cluster Manager development package
Requires: cman = %{version}-%{release}

%files -n cman-devel
%defattr(-,root,root,-)
%{_libdir}/*.so
%{_includedir}/*
%{_mandir}/man3/*

%description -n cman-devel
The Cluster Manager development package

%package -n rgmanager
Group: System Environment/Base
Summary: Open Source HA Resource Group Failover for Red Hat Cluster
License: GPLv2+
Requires: chkconfig initscripts glibc ncurses bash grep sed gawk
Requires: cman
Requires: net-tools mount e2fsprogs
Requires(post): chkconfig
Requires(preun): initscripts
Requires(preun): chkconfig

%description -n rgmanager
Red Hat Resource Group Manager provides high availability of critical server
applications in the event of planned or unplanned system downtime.

%post -n rgmanager
/sbin/chkconfig --add rgmanager

%preun -n rgmanager
if [ "$1" = 0 ]; then
	/sbin/service rgmanager stop >/dev/null 2>&1
	/sbin/chkconfig --del rgmanager
fi

%files -n rgmanager
%defattr(-,root,root,-)
%doc rgmanager/README rgmanager/AUTHORS rgmanager/COPYING rgmanager/errors.txt
%{_sysconfdir}/rc.d/init.d/rgmanager
/sbin/clu*
/sbin/rg_test
%{_datadir}/cluster
%{_mandir}/man8/clu*

%package -n gfs2-utils
Group: System Environment/Kernel
Summary: Utilities for managing the global filesystem (GFS2)
Requires(post): chkconfig
Requires(preun): initscripts
Requires(preun): chkconfig

%description -n gfs2-utils
The gfs2-utils package contains a number of utilities for creating,
checking, modifying, and correcting any inconsistencies in GFS2
filesystems.

%post -n gfs2-utils
/sbin/chkconfig --add gfs2

%preun -n gfs2-utils
if [ "$1" = 0 ]; then
	/sbin/service gfs2 stop >/dev/null 2>&1
	/sbin/chkconfig --del gfs2
fi

%files -n gfs2-utils
%defattr(-,root,root,-)
%{_sysconfdir}/rc.d/init.d/gfs2
/sbin/*gfs2*
%{_mandir}/man8/*gfs2*

%changelog
* Mon May 19 2008 Fabio M. Di Nitto <fdinitto at redhat.com> - 2.99.02-1
- New upstream release
- Shut up the last few rpmlint warnings

* Wed May 15 2008 Fabio M. Di Nitto <fdinitto at redhat.com> - 2.99.01-4
- Fix typo in rgmanager Summary

* Wed May 14 2008 Fabio M. Di Nitto <fdinitto at redhat.com> - 2.99.01-3
- Fix rgmanager License: tag.

* Wed May 14 2008 Fabio M. Di Nitto <fdinitto at redhat.com> - 2.99.01-2
- Drop BR on openais as it is pulled by openais-devel.
- Change postun section to use -p /sbin/ldconfig.
- Fix rgmanager Requires.

* Wed May 14 2008 Fabio M. Di Nitto <fdinitto at redhat.com> - 2.99.01-1
- Initial packaging.


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/cluster/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	19 May 2008 16:14:01 -0000	1.1
+++ .cvsignore	19 May 2008 17:56:27 -0000	1.2
@@ -0,0 +1 @@
+cluster-2.99.02.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/cluster/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	19 May 2008 16:14:01 -0000	1.1
+++ sources	19 May 2008 17:56:27 -0000	1.2
@@ -0,0 +1 @@
+81711f11394adde1c7f4637c011719c4  cluster-2.99.02.tar.gz




More information about the scm-commits mailing list