rpms/gridengine/devel Licenses, NONE, 1.1 aimk.site.lib.patch, NONE, 1.1 bootstrap, NONE, 1.1 distinst.site.patch, NONE, 1.1 gridengine-6.0u8-buffer.patch, NONE, 1.1 gridengine-6.0u8-lesstif.patch, NONE, 1.1 gridengine-6.1pre-Werror.patch, NONE, 1.1 gridengine-6.1pre-depend.patch, NONE, 1.1 gridengine-6.1u2-auto.patch, NONE, 1.1 gridengine-6.1u2-java.patch, NONE, 1.1 gridengine-6.1u2-ppc.patch, NONE, 1.1 gridengine-6.1u2-qmon.patch, NONE, 1.1 gridengine-6.1u2-qstat-xml.patch, NONE, 1.1 gridengine-6.1u2-x86_64.patch, NONE, 1.1 gridengine-6.1u3-execd.patch, NONE, 1.1 gridengine-6.1u3-libs.patch, NONE, 1.1 gridengine-6.1u3-open.patch, NONE, 1.1 gridengine-6.1u3-perm.patch, NONE, 1.1 gridengine-6.1u3-rctemplates.patch, NONE, 1.1 gridengine-6.1u3-rpath.patch, NONE, 1.1 gridengine.spec, NONE, 1.1 gridengine.sysconfig, NONE, 1.1 my_configuration.conf, NONE, 1.1 qtcsh.sh.h.patch, NONE, 1.1 sge.csh, NONE, 1.1 sge.sh, NONE, 1.1 sge_execd, NONE, 1.1 sgemaster, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Orion Poplawski (orion) fedora-extras-commits at redhat.com
Fri Feb 8 21:58:02 UTC 2008


Author: orion

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

Modified Files:
	.cvsignore sources 
Added Files:
	Licenses aimk.site.lib.patch bootstrap distinst.site.patch 
	gridengine-6.0u8-buffer.patch gridengine-6.0u8-lesstif.patch 
	gridengine-6.1pre-Werror.patch gridengine-6.1pre-depend.patch 
	gridengine-6.1u2-auto.patch gridengine-6.1u2-java.patch 
	gridengine-6.1u2-ppc.patch gridengine-6.1u2-qmon.patch 
	gridengine-6.1u2-qstat-xml.patch gridengine-6.1u2-x86_64.patch 
	gridengine-6.1u3-execd.patch gridengine-6.1u3-libs.patch 
	gridengine-6.1u3-open.patch gridengine-6.1u3-perm.patch 
	gridengine-6.1u3-rctemplates.patch 
	gridengine-6.1u3-rpath.patch gridengine.spec 
	gridengine.sysconfig my_configuration.conf qtcsh.sh.h.patch 
	sge.csh sge.sh sge_execd sgemaster 
Log Message:
initial import


--- NEW FILE Licenses ---
Whole license:			SISSL

source/3rdparty/adoc/		GPL+ -> unused
source/3rdparty/fnmatch/	BSD with advertising -> unused
source/3rdparty/openssl/	OpenSSL	-> unused			
source/3rdparty/qidl/		copyright only -> unused

source/3rdparty/qmake/		GPL+ -> Installed as qmake
source/3rdparty/qmake/alloca.c	Public Domain? -> unused
source/3rdparty/qmake/amiga.c	GPLv2+ -> Installed as qmake
(and others)
			! Note
				qmake is not linked or used by other parts
				of gridengine

source/3rdparty/qmon/Xbae/	MIT
source/3rdparty/qmon/Xmt310/	BSD
source/3rdparty/qmon/iconlist/	MIT
source/3rdparty/qmon/ltree/	LGPL+
source/3rdparty/qmon/spinbox/	MIT
source/3rdparty/qmon/tab/	MIT

source/3rdparty/qtcsh/		BSD with advertising -> Installed as qtcsh
source/3rdparty/qtcsh/ma.setp.c		MIT -> unused
			! Note
				qtcsh is not linked or used by other parts
				of gridengine

source/3rdparty/sge_depend/	MIT
source/3rdparty/snprintf/	the Frontier Artistic License -> unused
source/3rdparty/strptime/	BSD with advertising -> unused

source/scripts/ldAix		MIT -> unused


aimk.site.lib.patch:

--- NEW FILE aimk.site.lib.patch ---
--- gridengine/source/aimk.site.lib	2007-02-16 07:02:44.000000000 -0700
+++ gridengine/source/aimk.site	2007-08-16 15:23:03.000000000 -0600
@@ -72,7 +72,7 @@
 # is installed
 #
 set OPENSSL_SOVERSION = 0.9.7l
-set OPENSSL_HOME = /vol2/tools/SW/openssl-0.9.7l-origin/$buildarch
+set OPENSSL_HOME = /usr
 
 
 # 
@@ -85,16 +85,16 @@
 # BERKELEYDB_HOME the directory where the include and lib directory of
 # Berkeley DB is installed
 #
-set BERKELEYDB_HOME = /vol2/SW/db-4.4.20/$buildarch
-set BDB_INCLUDE_SUBDIR =
-set BDB_LIB_SUBDIR =
+set BERKELEYDB_HOME = /usr
+set BDB_INCLUDE_SUBDIR = /include
+set BDB_LIB_SUBDIR = /lib
 set BDB_LIB_SUFFIX =
 
 # 
 # KRB_HOME the directory where the include and lib directory of kerberos is
 # installed
 #
-set KRB_HOME = /vol2/tools/SW/krb5/$buildarch
+set KRB_HOME = /usr
 
 # 
 # INSURE4_LIBDIR the directory where the insure library is installed
@@ -103,26 +103,26 @@
 # 
 # man2html path
 #
-set MAN2HTMLPATH = /vol2/tools/SW/$buildarch/bin
+set MAN2HTMLPATH = /usr/bin
 # 
 # groff path
 #
-set GROFFPATH = /vol2/tools/SW/$buildarch/bin
+set GROFFPATH = /usr/bin
 
 #
 # SWIG path 
 #
-set SWIG = /vol2/tools/SW/swig-1.3.22/$buildarch/bin/swig
+set SWIG = /usr/bin/swig
 
 #
 # PERL path
 #
-set PERL = /vol2/tools/SW/$buildarch/bin/perl
+set PERL = /usr/bin/perl
 
 #
 # TCLSH path
 #
-set TCLSH = /vol2/tools/SW/$buildarch/bin/tclsh8.3
+set TCLSH = /usr/bin/tclsh8.3
 
 #
 # Location of a copyright.h file which containes a copyright string
@@ -169,7 +169,7 @@
 endif
 
 # set junit jar file
-set JUNIT_JAR = '/vol2/tools/SW/java/junit3.8.1/junit.jar'
+set JUNIT_JAR = '/usr/share/java/junit.jar'
 
 # set some variables which are necessary to compile GE for win32 architecture
 #


--- NEW FILE bootstrap ---
# Version: 6.1u2
#
admin_user             sgeadmin
default_domain          none
ignore_fqdn             true
spooling_method         berkeleydb
spooling_lib            libspoolb
spooling_params         /var/spool/gridengine/default/spooldb
binary_path             /usr/share/gridengine/bin
qmaster_spool_dir       /var/spool/gridengine/default/qmaster
security_mode           none

distinst.site.patch:

--- NEW FILE distinst.site.patch ---
--- gridengine/source/scripts/distinst.site.orig	2006-12-11 09:17:36.000000000 -0700
+++ gridengine/source/scripts/distinst.site	2007-01-26 13:08:47.000000000 -0700
@@ -35,6 +35,6 @@
 OPENSSLBASE=/vol2/tools/SW/openssl-0.9.7l
 
 # Base directory where BDB resides
-BERKELEYDBBASE=/vol2/SW/db-4.4.20
+BERKELEYDBBASE=
 
 TAR=gtar

gridengine-6.0u8-buffer.patch:

--- NEW FILE gridengine-6.0u8-buffer.patch ---
--- gridengine/source/3rdparty/qmon/Xmt310/Xmt/Menu.c.buffer	2006-10-03 09:53:00.000000000 -0600
+++ gridengine/source/3rdparty/qmon/Xmt310/Xmt/Menu.c	2006-10-03 09:53:22.000000000 -0600
@@ -346,7 +346,7 @@
     Arg args[10], submenu_args[10];
     int n, m;
     XmString accel_label = NULL;
-    char namebuf[10], submenu_buf[20];
+    char namebuf[20], submenu_buf[20];
     char *name, *submenu_name;
     int numlabel, numpush, numtoggle, numsep, numsub;
     int i;

gridengine-6.0u8-lesstif.patch:

--- NEW FILE gridengine-6.0u8-lesstif.patch ---
--- gridengine/source/3rdparty/qmon/Xmt310/Xmt/PixmapCvt.c.lesstif	2006-11-07 11:51:41.000000000 -0700
+++ gridengine/source/3rdparty/qmon/Xmt310/Xmt/PixmapCvt.c	2006-11-07 11:51:52.000000000 -0700
@@ -72,13 +72,6 @@
     XmRPrimForegroundPixmap,
     XmRManForegroundPixmap,
     XmRGadgetPixmap
-#if XmVersion >= 2000
-    ,
-    XmRLargeIconPixmap ,
-    XmRSmallIconPixmap,
-    XmRDynamicPixmap
-#endif
-    
 };
 
 #if NeedFunctionPrototypes
--- gridengine/source/3rdparty/qmon/iconlist/IconList.c.lesstif	2006-11-07 12:08:05.000000000 -0700
+++ gridengine/source/3rdparty/qmon/iconlist/IconList.c	2006-11-07 12:08:30.000000000 -0700
@@ -50,50 +50,6 @@
 #include <Xm/Traversal.h>
 #endif
 
-#ifndef SOLARIS
-#if XmVersion >= 2000
-extern void _XmResizeObject(
-                        Widget g,
-#ifdef NeedWidePrototypes
-                        int width,
-                        int height,
-                        int border_width) ;
-#else
-                        Dimension width,
-                        Dimension height,
-                        Dimension border_width) ;
-#endif /* NeedWidePrototypes */
-extern void _XmMoveObject(
-                        Widget g,
-#ifdef NeedWidePrototypes
-                        int x,
-                        int y) ;
-#else
-                        Position x,
-                        Position y) ;
-#endif /* NeedWidePrototypes */
-extern void _XmDrawHighlight(
-                        Display *display,
-                        Drawable d,
-                        GC gc,
-#ifdef NeedWidePrototypes
-                        int x,
-                        int y,
-                        int width,
-                        int height,
-                        int highlight_thick,
-#else
-                        Position x,
-                        Position y,
-                        Dimension width,
-                        Dimension height,
-                        Dimension highlight_thick,
-#endif /* NeedWidePrototypes */
-                        int line_style) ;
-
-#endif
-#endif
-
 #include "DumbClip.h"
 #include "IconListP.h"
 
--- gridengine/source/3rdparty/qmon/Xmt310/Xmt/Layout.c.lesstif	2001-07-18 05:06:02.000000000 -0600
+++ gridengine/source/3rdparty/qmon/Xmt310/Xmt/Layout.c	2006-11-15 10:32:35.000000000 -0700
@@ -492,6 +492,12 @@
     if (!lw->layout.font)
         XmeRenderTableGetDefaultFont(lw->layout.render_table,
                                      &lw->layout.font);
+    /*
+     * The previous fails with lesstif, try again...
+     */
+    if (!lw->layout.font)
+        _XmFontListGetDefaultFont(lw->layout.font_list,
+                                     &lw->layout.font);
 #endif
     
     /* figure out resolution independence values */

gridengine-6.1pre-Werror.patch:

--- NEW FILE gridengine-6.1pre-Werror.patch ---
--- gridengine/source/aimk.Werror	2007-01-26 14:52:28.000000000 -0700
+++ gridengine/source/aimk	2007-01-26 15:14:52.000000000 -0700
@@ -1274,7 +1274,7 @@
       set CFLAGS = "$CFLAGS -Wno-strict-aliasing"
    endif
 
-   set CFLAGS = "$OFLAG -Wall -Werror -Wstrict-prototypes -D__GRIDENGINE_FD_SETSIZE=8192 -DLINUX -D$BUILDARCH -D$COMPILE_ARCH -D_GNU_SOURCE -DGETHOSTBYNAME_R6 -DGETHOSTBYADDR_R8 $DEBUG_FLAG $CFLAGS"
+   set CFLAGS = "$OFLAG -Wall -Wstrict-prototypes -D__GRIDENGINE_FD_SETSIZE=8192 -DLINUX -D$BUILDARCH -D$COMPILE_ARCH -D_GNU_SOURCE -DGETHOSTBYNAME_R6 -DGETHOSTBYADDR_R8 $DEBUG_FLAG $CFLAGS"
 
    if ("$ADOC" == 1) then
       set CFLAGS = "$CFLAGS -Wno-error"

gridengine-6.1pre-depend.patch:

--- NEW FILE gridengine-6.1pre-depend.patch ---
--- gridengine/source/aimk.depend	2006-12-04 01:18:24.000000000 -0700
+++ gridengine/source/aimk	2007-01-26 13:21:47.000000000 -0700
@@ -1660,6 +1660,8 @@
    exit 1
 endsw
 
+set DEPEND_FLAGS = "`echo $DEPEND_FLAGS | sed -e 's/-[^DI][^ ]*//g'`"
+
 if ( $JNI == 1 ) then
    set CORE_INCLUDE = "$CORE_INCLUDE -I${JAVA_HOME}/${JAVA_INCL}"
 
--- gridengine/source/libs/comm/Makefile.orig	2006-04-10 14:30:07.000000000 -0600
+++ gridengine/source/libs/comm/Makefile	2006-04-10 14:30:20.000000000 -0600
@@ -36,7 +36,7 @@
 ##########################################################################
 SHELL  = /bin/sh
 RM     = rm -f 
-DEPEND = $(SOURCE)/3rdparty/sge_depend/$(COMPILE_ARCH)/sge_depend -l -S -Y $(CFLAGS)
+DEPEND = $(SOURCE)/3rdparty/sge_depend/$(COMPILE_ARCH)/sge_depend -l -S -Y $(DEPEND_FLAGS)
 ##########################################################################
 
 ###############################################################################

gridengine-6.1u2-auto.patch:

--- NEW FILE gridengine-6.1u2-auto.patch ---
--- gridengine/source/dist/inst_sge.auto	2007-10-03 11:24:25.000000000 -0600
+++ gridengine/source/dist/inst_sge	2007-10-03 11:24:35.000000000 -0600
@@ -138,6 +138,7 @@
      FILE="$2"
      if [ ! -f "$2" ]; then
         ErrUsage
+        exit 1
      fi
      shift
      ARGC=`expr $ARGC - 1`

gridengine-6.1u2-java.patch:

--- NEW FILE gridengine-6.1u2-java.patch ---
--- gridengine/source/classes/build.xml.java	2007-07-05 13:53:11.000000000 -0600
+++ gridengine/source/classes/build.xml	2007-10-02 15:24:24.000000000 -0600
@@ -49,8 +49,8 @@
          <equals arg1="${java.buildhost}" arg2="${hostname}" trim="true"/>
       </condition>
 
-      <property location="../CLASSES" name="classes.dir"/>
-      <property location="../CLASSES/test" name="classes.dir.test"/>
+      <property location="../classes" name="classes.dir"/>
+      <property location="../classes/test" name="classes.dir.test"/>
       <property location="." name="src.dir"/>
       <property location="${src.dir}/test" name="src.dir.test"/>
       <property location="../JAVADOCS" name="javadoc.dir"/>
@@ -66,8 +66,8 @@
       <javac debug="true"
              deprecation="true"
              destdir="${classes.dir}"
-             source="1.4"
-             target="1.4">
+             source="1.5"
+             target="1.5">
          <src path="${src.dir}/"/>
          <include name="org/ggf/drmaa/*.java"/>
          <include name="com/sun/grid/drmaa/*.java"/>
@@ -82,8 +82,8 @@
              deprecation="true"
              destdir="${classes.dir.test}"
              classpath="${classes.dir}:${libs.junit.classpath}"
-             source="1.4"
-             target="1.4">
+             source="1.5"
+             target="1.5">
          <src path="${src.dir.test}"/>
          <include name="org/ggf/drmaa/*.java"/>
          <include name="com/sun/grid/*.java"/>
--- gridengine/source/libs/jgdi/build.xml.java	2007-10-03 09:57:34.000000000 -0600
+++ gridengine/source/libs/jgdi/build.xml	2007-10-03 09:57:56.000000000 -0600
@@ -745,15 +745,15 @@
       <property environment="env"/>
 
       <echo message="env.AIMK_TARGET_BITS=${env.AIMK_TARGET_BITS}"/>
-      <echo message="env.aimk_buildarch=${env.aimk_buildarch}"/>
+      <echo message="env.buildarch=${env.buildarch}"/>
       <!-- 
       <echo message="A=${A}"/>
       <echo message="B=${B}"/>
       <echo message="C=${C}"/>
       -->
 
-      <condition property="sge.arch" value="${env.aimk_buildarch}">
-         <isset property="env.aimk_buildarch"/>
+      <condition property="sge.arch" value="${env.buildarch}">
+         <isset property="env.buildarch"/>
       </condition>
       <!-- else -->
       <exec executable="${sge.srcdir}/dist/util/arch" outputproperty="sge.arch" 
--- gridengine/source/build.properties.java	2007-10-03 10:29:10.000000000 -0600
+++ gridengine/source/build.properties	2007-10-03 10:34:12.000000000 -0600
@@ -64,10 +64,10 @@
 
 # needed for libs/jgdi/cullconv (mandatory)
 # https://javacc.dev.java.net
-javacc.home=${jgdi_libs.dir}/javacc-4.0
+javacc.home=/usr/share/java
 
 # needed for Todo.html generation (optional)
 tododoclet.jar=${jgdi_libs.dir}/tododoclet/TodoDoclet.jar
 
 # junit jar file classpath
-libs.junit.classpath=/vol2/tools/SW/java/junit3.8.1/junit.jar
+libs.junit.classpath=/usr/share/java/junit.jar

gridengine-6.1u2-ppc.patch:

--- NEW FILE gridengine-6.1u2-ppc.patch ---
--- gridengine/source/dist/util/arch.ppc64	2007-11-13 17:54:30.000000000 -0500
+++ gridengine/source/dist/util/arch	2007-11-13 17:54:56.000000000 -0500
@@ -192,9 +192,12 @@
    ia64)
       lxmachine=ia64
       ;;
-   ppc*)
+   ppc)
       lxmachine=ppc
       ;;
+   ppc64)
+      lxmachine=ppc64
+      ;;
    *)
       unsupported="UNSUPPORTED-"
       lxmachine=$osmachine
--- gridengine/source/scripts/compilearch.ppc64	2007-11-13 17:57:07.000000000 -0500
+++ gridengine/source/scripts/compilearch	2007-11-13 18:14:44.000000000 -0500
@@ -194,6 +194,11 @@
       COMPILE_ARCH=LINUXPPC_26
       TARGET_BITS=TARGET_32BIT
       ;;
+   lx26-ppc64)
+      BUILDARCH=LINUXPPC64
+      COMPILE_ARCH=LINUXPPC64_26
+      TARGET_BITS=TARGET_64BIT
+      ;;
    lx26-ia64)               
       BUILDARCH=LINUXIA64
       COMPILE_ARCH=LINUXIA64_26
--- gridengine/source/aimk.ppc	2007-08-08 09:30:54.000000000 -0400
+++ gridengine/source/aimk	2007-11-13 18:27:48.000000000 -0500
@@ -1260,6 +1264,7 @@
 case LINUXAMD64:
 case LINUXIA64:
 case LINUXPPC:
+case LINUXPPC64:
 case LINUXSPARC:
 case LINUXSPARC64:
    set MAKEWINGRIDLIB   = 0
@@ -1289,8 +1294,8 @@
       set OFLAG = "-O2"
    endif
 
-   if ($BUILDARCH == LINUXPPC) then
-      set CFLAGS = "-m32 $CFLAGS"
+   if ($BUILDARCH == LINUXPPC64) then
+      set LFLAGS = "-m64 $LFLAGS"
    endif
 
    if ($BUILDARCH == LINUXSPARC64) then
@@ -1745,6 +1752,12 @@
          case lx26-ia64:
              set JAVA_LIB_ARCH = ia64
              breaksw
+         case lx26-ppc:
+             set JAVA_LIB_ARCH = ppc
+             breaksw
+         case lx26-ppc64:
+             set JAVA_LIB_ARCH = ppc64
+             breaksw
          case hp11:
              set JAVA_LIB_ARCH = PA_RISC
              breaksw
--- gridengine/source/3rdparty/qtcsh/sh.h.ppc	2007-11-14 14:37:15.000000000 -0700
+++ gridengine/source/3rdparty/qtcsh/sh.h	2007-11-14 14:40:54.000000000 -0700
@@ -1252,7 +1252,7 @@
  */
 #define SIGN_EXTEND_CHAR(a)	(((a) & 0x80) ? ((a) | ~0x7f) : (a))
 
-#if defined(LINUX86) || defined(ALINUX) || defined(LINUXIA64) || defined(LINUXAMD64) || defined(LINUXSPARC) || defined(LINUX)
+#if defined(LINUX86) || defined(ALINUX) || defined(LINUXIA64) || defined(LINUXAMD64) || defined(LINUXSPARC) || defined(LINUX) || defined(linux)
 #include <time.h>
 #endif
 

gridengine-6.1u2-qmon.patch:

--- NEW FILE gridengine-6.1u2-qmon.patch ---
--- gridengine/source/dist/util/install_modules/inst_common.sh.qmon	2007-10-02 11:31:47.000000000 -0600
+++ gridengine/source/dist/util/install_modules/inst_common.sh	2007-10-02 11:31:56.000000000 -0600
@@ -338,7 +338,7 @@
           sge_execd sge_qmaster  \
           sge_schedd sge_shadowd \
           sge_shepherd qacct qalter qconf qdel qhold \
-          qhost qlogin qmake qmod qmon qresub qrls qrsh qselect qsh \
+          qhost qlogin qmake qmod qresub qrls qrsh qselect qsh \
           qstat qsub qtcsh qping qquota sgepasswd"
 
 WINBINFILES="sge_coshepherd sge_execd sge_shepherd  \

gridengine-6.1u2-qstat-xml.patch:

--- NEW FILE gridengine-6.1u2-qstat-xml.patch ---
--- gridengine/source/clients/qstat/qstat_xml.c.orig	2007-06-15 10:34:13.000000000 +0200
+++ gridengine/source/clients/qstat/qstat_xml.c	2007-09-15 11:15:57.000000000 +0200
@@ -1012,10 +1012,10 @@
 
    /* number of used/free slots */
    xml_append_Attr_I(attribute_list, "slots_used", summary->used_slots); 
-   xml_append_Attr_I(attribute_list, "slots_total", summary->used_slots + summary->free_slots);
+   xml_append_Attr_I(attribute_list, "slots_total", summary->free_slots);
 
    /* load avg */
-   if (summary->has_load_value && summary->has_load_value_from_object) {
+   if (!summary->has_load_value && summary->has_load_value_from_object) {
       xml_append_Attr_D(attribute_list, "load_avg", summary->load_avg);
    }


gridengine-6.1u2-x86_64.patch:

--- NEW FILE gridengine-6.1u2-x86_64.patch ---
--- gridengine/source/aimk.x86_64	2007-08-16 15:41:42.000000000 -0600
+++ gridengine/source/aimk	2007-08-16 15:43:14.000000000 -0600
@@ -330,7 +322,11 @@
 set SECFLAGS          = "-DSECURE -I$OPENSSL_HOME/include"
 set SECLIB            = ""
 set SECLIBS           = ""
-set SECLIBS_STATIC    = "$OPENSSL_HOME/lib/libssl.a $OPENSSL_HOME/lib/libcrypto.a"
+if ($TARGET_BITS == TARGET_32BIT || $BUILDARCH == ALINUX || $BUILDARCH == LINUXIA64) then
+   set SECLIBS_STATIC    = "$OPENSSL_HOME/lib/libssl.a $OPENSSL_HOME/lib/libcrypto.a"
+else
+   set SECLIBS_STATIC    = "$OPENSSL_HOME/lib64/libssl.a $OPENSSL_HOME/lib64/libcrypto.a"
+endif
 set SECLIBOBJS        = ""
 set SECTARGETS        = ""
 set KLFLAGS           = "-L$OPENSSL_HOME/lib"

gridengine-6.1u3-execd.patch:

--- NEW FILE gridengine-6.1u3-execd.patch ---
--- gridengine/source/dist/util/install_modules/inst_common.sh.execd	2008-01-09 14:30:54.000000000 -0700
+++ gridengine/source/dist/util/install_modules/inst_common.sh	2008-01-31 15:56:08.000000000 -0700
@@ -335,7 +335,7 @@
 {
 
 BINFILES="sge_coshepherd \
-          sge_execd sge_qmaster  \
+          sge_qmaster  \
           sge_schedd sge_shadowd \
           sge_shepherd qacct qalter qconf qdel qhold \
           qhost qlogin qmake qmod qresub qrls qrsh qselect qsh \

gridengine-6.1u3-libs.patch:

--- NEW FILE gridengine-6.1u3-libs.patch ---
--- gridengine/source/3rdparty/qmon/ltree/Makefile.aimk.libs	2008-02-01 14:19:16.000000000 -0700
+++ gridengine/source/3rdparty/qmon/ltree/Makefile.aimk	2008-02-01 14:19:09.000000000 -0700
@@ -27,7 +27,7 @@
 	$(RANLIB) libXltree.a
 
 libXltree$(SHAREDEXT): $(XLTREE_OBJS)
-	$(SHAREDLD) $(XLFLAGS) $(GSHARED_LFLAGS) -o libXltree$(SHAREDEXT) $(XLTREE_OBJS) $(XLIBS)
+	$(SHAREDLD) $(XLFLAGS) $(GSHARED_LFLAGS) -o libXltree$(SHAREDEXT) $(XLTREE_OBJS) -lXm -lXt -lX11
 
 Xltree_clean:
 	$(RM) $(XLTREE_OBJS) libXltree.a libXltree$(SHAREDEXT)
--- gridengine/source/libs/spool/berkeleydb/Makefile.libs	2004-05-19 13:56:15.000000000 -0600
+++ gridengine/source/libs/spool/berkeleydb/Makefile	2008-02-01 14:37:55.000000000 -0700
@@ -69,7 +69,7 @@
 	$(RANLIB) libspoolb.a
 
 libspoolb$(SHAREDEXT): $(SPOOLBLIB_OBJS) $(SPOOLLIB) $(SCHEDLIB) $(SGEOBJLIB) $(ALLLISTSLIB) $(COMMLIB) $(COMMLISTSLIB) $(CULLLIB) $(UTILIB) $(RMONLIB) $(LCKLIB) 
-	$(SHAREDLD) $(SHARED_LFLAGS) -o libspoolb$(SHAREDEXT) $(SPOOLBLIB_OBJS) -lspool -lsched -lsgeobj -lsgeobjd -lcull -lcomm -lcommlists -luti -lrmon -llck -ldb${BDB_LIB_SUFFIX} $(LIBS) -lc
+	$(SHAREDLD) $(SHARED_LFLAGS) -o libspoolb$(SHAREDEXT) $(SPOOLBLIB_OBJS) -lspool -lsched -lsgeobj -lsgeobjd -lcull -lcomm -lcommlists -luti -lrmon -llck -ldb${BDB_LIB_SUFFIX}
 
 ###############################################################################
 # include dependencies for object files generated by sge_depend
--- gridengine/source/libs/spool/classic/Makefile.libs	2006-11-17 08:23:44.000000000 -0700
+++ gridengine/source/libs/spool/classic/Makefile	2008-02-01 14:38:52.000000000 -0700
@@ -87,7 +87,7 @@
 	$(RANLIB) libspoolc.a
 
 libspoolc$(SHAREDEXT): $(SPOOLCLIB_OBJS) $(SPOOLLIB) $(SCHEDLIB) $(SGEOBJLIB) $(SGEOBJDLIB) $(COMMLIB) $(COMMLISTSLIB) $(CULLLIB) $(UTILIB) $(RMONLIB) $(LCKLIB)
-	$(SHAREDLD) $(SHARED_LFLAGS) -o libspoolc$(SHAREDEXT) $(SPOOLCLIB_OBJS) -lspool -lsched -lsgeobj -lsgeobjd -lcull -lcomm -lcommlists -luti -lrmon -llck $(LIBS) -lc
+	$(SHAREDLD) $(SHARED_LFLAGS) -o libspoolc$(SHAREDEXT) $(SPOOLCLIB_OBJS) -lspool -lsched -lsgeobj -lsgeobjd -lcull -lcomm -lcommlists -luti -lrmon -llck
 
 ###############################################################################
 # include dependencies for object files generated by sge_depend
--- gridengine/source/libs/juti/Makefile.libs	2007-07-24 05:50:09.000000000 -0600
+++ gridengine/source/libs/juti/Makefile	2008-02-01 14:39:58.000000000 -0700
@@ -66,7 +66,7 @@
 ###############################################################################
 
 $(JUTILIB): $(JUTI_OBJS) $(JUTI_ADD_OBJS)
-	$(SHAREDLD) $(SHARED_LFLAGS) -o libjuti$(SHAREDEXT) $(JUTI_OBJS) $(JUTI_ADD_OBJS) $(SLIBs) $(LIBS) -lc
+	$(SHAREDLD) $(SHARED_LFLAGS) -o libjuti$(SHAREDEXT) $(JUTI_OBJS) $(JUTI_ADD_OBJS) $(SLIBs)
 	../scripts/link_jnilib.sh libjuti  $(SHAREDEXT) $(JAVA_SHAREDEXT)
 
 
--- gridengine/source/libs/japi/Makefile.libs	2007-01-20 00:18:31.000000000 -0700
+++ gridengine/source/libs/japi/Makefile	2008-02-01 14:41:37.000000000 -0700
@@ -102,12 +102,12 @@
 ###############################################################################
 libdrmaa$(SHAREDEXT).0.95: $(JAPILIB_95) $(JAPI_DEPEND_OBJS) $(DRMAALIB_OBJS) $(DRMAA_OBJS) $(WINGRIDLIB_DEP)
 	$(SHAREDLD) $(SHARED_LFLAGS) $(SONAME_LFLAG_DRMAA95) -o libdrmaa$(SHAREDEXT).0.95 $(DRMAALIB_95_OBJS) $(DRMAA_OBJS) $(JAPILIB_95) $(JAPI_ADD_OBJS) \
-      $(SECLIB) $(WINGRIDLIB) $(LIBS) $(DLLIB) -lc \
+      $(SECLIB) $(WINGRIDLIB) $(DLLIB) -lpthread \
    && ../scripts/nonreentrant.sh -a `../dist/util/arch` -w libdrmaa$(SHAREDEXT).0.95
 
 libdrmaa$(SHAREDEXT).1.0:  $(JAPILIB_10) $(JAPI_DEPEND_OBJS) $(DRMAALIB_OBJS) $(DRMAA_OBJS) $(WINGRIDLIB_DEP)
 	$(SHAREDLD) $(SHARED_LFLAGS) $(SONAME_LFLAG_DRMAA10) -o libdrmaa$(SHAREDEXT).1.0 $(DRMAALIB_10_OBJS) $(DRMAA_OBJS) $(JAPILIB_10) $(JAPI_ADD_OBJS) \
-      $(SECLIB) $(WINGRIDLIB) $(LIBS) $(DLLIB) -lc \
+      $(SECLIB) $(WINGRIDLIB) $(DLLIB) -lpthread \
    && ../scripts/nonreentrant.sh -a `../dist/util/arch` -w libdrmaa$(SHAREDEXT).1.0
 
 # Needed to compile howtos, examples, and unit tests

gridengine-6.1u3-open.patch:

--- NEW FILE gridengine-6.1u3-open.patch ---
--- gridengine/source/3rdparty/qtcsh/sh.dol.c.open	2001-07-18 05:06:04.000000000 -0600
+++ gridengine/source/3rdparty/qtcsh/sh.dol.c	2008-02-01 13:44:29.000000000 -0700
@@ -1008,7 +1008,7 @@
 #ifndef O_TEMPORARY
 # define O_TEMPORARY 0
 #endif
-    if (open(tmp, O_RDWR|O_CREAT|O_TEMPORARY) < 0) {
+    if (open(tmp, O_RDWR|O_CREAT|O_TEMPORARY, 0600) < 0) {
 	int     oerrno = errno;
 
 	(void) unlink(tmp);
--- gridengine/source/utilbin/work.c.open	2007-01-22 06:51:09.000000000 -0700
+++ gridengine/source/utilbin/work.c	2007-08-16 15:53:46.000000000 -0600
@@ -212,7 +212,7 @@
          argv++;
          if (argc== 1)
             usage(1);
-         if ((in = open(argv[1], O_CREAT|O_APPEND|O_WRONLY))<0) {
+         if ((in = open(argv[1], O_CREAT|O_APPEND|O_WRONLY, 0644))<0) {
             fprintf(stderr, "cannot write to \"%s\": %s\n", 
                argv[1], strerror(errno));
          }

gridengine-6.1u3-perm.patch:

--- NEW FILE gridengine-6.1u3-perm.patch ---
--- gridengine/source/scripts/distinst.perm	2008-02-01 10:15:34.000000000 -0700
+++ gridengine/source/scripts/distinst	2008-02-01 13:59:28.000000000 -0700
@@ -840,6 +840,7 @@
                         $DEST_SGE_ROOT/util/resources/starter_methods/*
 
       Execute chmod 644 $DEST_SGE_ROOT/util/install_modules/* \
+                        $DEST_SGE_ROOT/util/dl.sh \
                         $DEST_SGE_ROOT/util/sgeCA/*.cnf \
                         $DEST_SGE_ROOT/util/resources/calendars/* \
                         $DEST_SGE_ROOT/util/resources/centry/* \

gridengine-6.1u3-rctemplates.patch:

--- NEW FILE gridengine-6.1u3-rctemplates.patch ---
--- gridengine/source/scripts/distinst.rctemplates	2008-01-31 15:59:01.000000000 -0700
+++ gridengine/source/scripts/distinst	2008-02-01 10:15:34.000000000 -0700
@@ -803,15 +803,9 @@
       Execute cp -r dist/util $DEST_SGE_ROOT
       if [ $enforce_shlibpath = true ]; then
          Execute grep -v "#ENFORCE_SHLIBPATH#" dist/util/create_settings.sh > $DEST_SGE_ROOT/util/create_settings.sh
-         Execute grep -v "#ENFORCE_SHLIBPATH#" dist/util/rctemplates/sgemaster_template > $DEST_SGE_ROOT/util/rctemplates/sgemaster_template
-         Execute grep -v "#ENFORCE_SHLIBPATH#" dist/util/rctemplates/sgeexecd_template > $DEST_SGE_ROOT/util/rctemplates/sgeexecd_template
-         Execute grep -v "#ENFORCE_SHLIBPATH#" dist/util/rctemplates/sgebdb_template > $DEST_SGE_ROOT/util/rctemplates/sgebdb_template
          Execute grep -v "#ENFORCE_SHLIBPATH#" dist/util/install_modules/inst_common.sh > $DEST_SGE_ROOT/util/install_modules/inst_common.sh
       else
          Execute sed -e "s/#ENFORCE_SHLIBPATH#//" dist/util/create_settings.sh > $DEST_SGE_ROOT/util/create_settings.sh
-         Execute sed -e "s/#ENFORCE_SHLIBPATH#//" dist/util/rctemplates/sgemaster_template > $DEST_SGE_ROOT/util/rctemplates/sgemaster_template
-         Execute sed -e "s/#ENFORCE_SHLIBPATH#//" dist/util/rctemplates/sgeexecd_template > $DEST_SGE_ROOT/util/rctemplates/sgeexecd_template
-         Execute sed -e "s/#ENFORCE_SHLIBPATH#//" dist/util/rctemplates/sgebdb_template > $DEST_SGE_ROOT/util/rctemplates/sgebdb_template
          Execute sed -e "s/#ENFORCE_SHLIBPATH#//" dist/util/install_modules/inst_common.sh > $DEST_SGE_ROOT/util/install_modules/inst_common.sh
       fi
       Cleanup util
@@ -825,7 +819,6 @@
       Execute mv $DEST_SGE_ROOT/util/arch.dist $DEST_SGE_ROOT/util/arch
 
       Execute chmod 755 $DEST_SGE_ROOT/util/install_modules \
-                        $DEST_SGE_ROOT/util/rctemplates \
                         $DEST_SGE_ROOT/util/resources \
                         $DEST_SGE_ROOT/util/sgeCA \
                         $DEST_SGE_ROOT/util/resources/calendars \
@@ -847,7 +840,6 @@
                         $DEST_SGE_ROOT/util/resources/starter_methods/*
 
       Execute chmod 644 $DEST_SGE_ROOT/util/install_modules/* \
-                        $DEST_SGE_ROOT/util/rctemplates/* \
                         $DEST_SGE_ROOT/util/sgeCA/*.cnf \
                         $DEST_SGE_ROOT/util/resources/calendars/* \
                         $DEST_SGE_ROOT/util/resources/centry/* \
--- gridengine/source/dist/util/install_modules/inst_common.sh.rctemplates	2008-01-31 15:59:01.000000000 -0700
+++ gridengine/source/dist/util/install_modules/inst_common.sh	2008-02-01 10:17:00.000000000 -0700
@@ -1144,11 +1144,6 @@
    if [ $create = true ]; then
 
       if [ $hosttype = "master" ]; then
-         ExecuteAsAdmin sed -e "s%GENROOT%${SGE_ROOT_VAL}%g" \
-                            -e "s%GENCELL%${SGE_CELL_VAL}%g" \
-                            -e "/#+-#+-#+-#-/,/#-#-#-#-#-#/d" \
-                            util/rctemplates/sgemaster_template > ${TMP_SGE_STARTUP_FILE}.0
-
          if [ "$SGE_QMASTER_PORT" != "" ]; then
             ExecuteAsAdmin sed -e "s/=GENSGE_QMASTER_PORT/=$SGE_QMASTER_PORT/" \
                                ${TMP_SGE_STARTUP_FILE}.0 > $TMP_SGE_STARTUP_FILE.1
@@ -1165,11 +1160,6 @@
                                ${TMP_SGE_STARTUP_FILE}.1 > $TMP_SGE_STARTUP_FILE
          fi
       else
-         ExecuteAsAdmin sed -e "s%GENROOT%${SGE_ROOT_VAL}%g" \
-                            -e "s%GENCELL%${SGE_CELL_VAL}%g" \
-                            -e "/#+-#+-#+-#-/,/#-#-#-#-#-#/d" \
-                            util/rctemplates/sgeexecd_template > ${TMP_SGE_STARTUP_FILE}.0
-
          if [ "$SGE_QMASTER_PORT" != "" ]; then
             ExecuteAsAdmin sed -e "s/=GENSGE_QMASTER_PORT/=$SGE_QMASTER_PORT/" \
                                ${TMP_SGE_STARTUP_FILE}.0 > $TMP_SGE_STARTUP_FILE.1
--- gridengine/source/dist/util/install_modules/inst_berkeley.sh.rctemplates	2007-04-16 02:27:33.000000000 -0600
+++ gridengine/source/dist/util/install_modules/inst_berkeley.sh	2008-02-01 10:17:49.000000000 -0700
@@ -187,12 +187,6 @@
    TMP_RC=/tmp/$pid/sgebdb
    RPCSCRIPT=$SGE_ROOT/$COMMONDIR/sgebdb
    ExecuteAsAdmin mkdir -p $TMP_DIR
-   ExecuteAsAdmin sed -e "s%GENROOT%${SGE_ROOT_VAL}%g" \
-                      -e "s%GENCELL%${SGE_CELL_VAL}%g" \
-                      -e "s%GENADMINUSER%${ADMINUSER}%g" \
-                      -e "s%SPOOLING_DIR%${SPOOLING_DIR}%g" \
-                      -e "/#+-#+-#+-#-/,/#-#-#-#-#-#/d" \
-                      util/rctemplates/sgebdb_template > ${TMP_RC}
    ExecuteAsAdmin cp $TMP_RC $RPCSCRIPT
    ExecuteAsAdmin rm -fR $TMP_DIR 
    ExecuteAsAdmin $CHMOD a+x $RPCSCRIPT

gridengine-6.1u3-rpath.patch:

--- NEW FILE gridengine-6.1u3-rpath.patch ---
--- gridengine/source/aimk.rpath	2008-01-31 15:59:01.000000000 -0700
+++ gridengine/source/aimk	2008-02-01 09:25:50.000000000 -0700
@@ -1376,10 +1376,8 @@
    endif
    set JAVA_ARCH = "linux"
 
-   # due to -rpath relative_path the LD_LIBRARY_PATH not needed anymore
-   set RUNPATH       = -Wl,-rpath,'\$$ORIGIN'/../../lib/$buildarch
-   set LFLAGS        = "$LFLAGS $RUNPATH"
-   set SHARED_LFLAGS = "$SHARED_LFLAGS $RUNPATH"
+   set LFLAGS        = "$LFLAGS"
+   set SHARED_LFLAGS = "$SHARED_LFLAGS"
 
    breaksw
    


--- NEW FILE gridengine.spec ---
%bcond_without  fedora
%define uid 43
%define username sgeadmin
%define homedir %{_datadir}/gridengine
%define gecos Grid Engine

Name:    gridengine
Version: 6.1u3
Release: 6%{?dist}
Summary: Grid Engine - Distributed Computing Management software

Group:   Applications/System
# Only the file %{_libexecdir}/gridengine/bin/*/qmake is
# under GPLv2+, which is not used or linked by other parts
# of gridengine.
# The file %{_libexecdir}/gridengine/bin/*/qtcsh is
# under BSD with advertising, 
# which is not used or linked by other parts of gridengine.
License: (BSD and LGPLv2+ and MIT and SISSL) and GPLv2+ and BSD with advertising
URL:     http://gridengine.sunsource.net/
Source0: http://gridengine.sunsource.net/files/documents/7/161/ge-V61u3_TAG-src.tar.gz
Source1: gridengine-ppc.tar.gz
Source2: my_configuration.conf
Source3: sge.csh
Source4: sge.sh
Source5: sge_execd
Source6: sgemaster
Source7: bootstrap
Source8: Licenses
Source9: gridengine.sysconfig
Patch0: distinst.site.patch
Patch2: aimk.site.lib.patch
Patch3: gridengine-6.1u2-ppc.patch
Patch6: qtcsh.sh.h.patch
Patch7: gridengine-6.1pre-Werror.patch
Patch10: gridengine-6.1pre-depend.patch
Patch13: gridengine-6.0u8-buffer.patch
Patch14: gridengine-6.1u2-x86_64.patch
Patch15: gridengine-6.0u8-lesstif.patch
Patch16: gridengine-6.1u2-java.patch
Patch17: gridengine-6.1u3-open.patch
Patch18: gridengine-6.1u2-qmon.patch
Patch19: gridengine-6.1u2-auto.patch
Patch20: gridengine-6.1u2-qstat-xml.patch
Patch21: gridengine-6.1u3-execd.patch
Patch22: gridengine-6.1u3-rpath.patch
Patch23: gridengine-6.1u3-rctemplates.patch
Patch24: gridengine-6.1u3-perm.patch
Patch25: gridengine-6.1u3-libs.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires: /bin/csh, openssl-devel, db4-devel, ncurses-devel, pam-devel
BuildRequires: lesstif-devel, libXmu-devel, libXpm-devel
BuildRequires: java-devel, ant-junit, javacc, ant-nodeps
BuildRequires: elfutils-libelf-devel, net-tools
BuildRequires: fedora-usermgmt-devel
%{?FE_USERADD_REQ}


%description
In a typical network that does not have distributed resource management
software, workstations and servers are used from 5% to 20% of the time.
Even technical servers are generally less than fully utilized. This
means that there are a lot of cycles that can be used productively if
only users know where they are, can capture them, and put them to work.

Grid Engine finds a pool of idle resources and harnesses it
productively, so an organization gets as much as five to ten times the
usable power out of systems on the network. That can increase utilization
to as much as 98%.

Grid Engine software aggregates available compute resources and
delivers compute power as a network service.

These are the local files shared by both the qmaster and execd
daemons. You must install this package in order to use any one of them.


%package devel
Summary: Gridengine development files
Group: Development/Libraries
License: BSD and LGPLv2+ and MIT and SISSL
Requires: %{name} = %{version}-%{release}

%description devel
gridengine development headers and libraries.


%package qmon
Summary: Gridengine qmon monitor
Group: Development/Libraries
License: BSD and LGPLv2+ and MIT and SISSL
Requires: %{name} = %{version}-%{release}

%description qmon
The qmon graphical grid engine monitor


%package execd
Summary: Gridengine execd program
Group: Development/Libraries
License: BSD and LGPLv2+ and MIT and SISSL
Requires: %{name} = %{version}-%{release}
Requires(post): /sbin/chkconfig
Requires(postun): /sbin/service
Requires(postun): %{name} = %{version}-%{release}
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
Requires(preun): %{name} = %{version}-%{release}

%description execd
Programs needed to run a grid engine execution host


%package qmaster
Summary: Gridengine qmaster programs
Group: Development/Libraries
License: BSD and LGPLv2+ and MIT and SISSL
Requires: %{name} = %{version}-%{release}
Requires: db4-utils
Requires(post): /sbin/chkconfig
Requires(postun): /sbin/service
Requires(postun): %{name} = %{version}-%{release}
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
Requires(preun): %{name} = %{version}-%{release}

%description qmaster
Programs needed to run a grid engine qmaster host


%prep
%setup -q -n gridengine -a 1
#Copy Licenses file into build directory
cp %SOURCE8 .
#Remove unneeded shbangs
sed -i -e '/^#! *\/bin\/sh/d' source/dist/util/install_modules/*.sh
%patch0 -p1
%patch2 -p1 -b .lib
%patch3 -p1 -b .ppc
%patch6 -p1
%patch7 -p1 -b .Werror
%patch10 -p1 -b .depend
%patch13 -p1 -b .buffer
%patch14 -p1 -b .x86_64
%patch15 -p1 -b .lesstif
%patch16 -p1 -b .java
%patch17 -p1 -b .open
%patch18 -p1 -b .qmon
%patch19 -p1 -b .auto
%patch20 -p1 -b .qstat-xml
%patch21 -p1 -b .execd
%patch22 -p1 -b .rpath
%patch23 -p1 -b .rctemplates
%patch24 -p1 -b .perm
%patch25 -p1 -b .libs
sed -i.arch -e 's,/\$DSTARCH,,g' source/scripts/distinst
#Don't ship rctemplates
rm -rf source/dist/util/rctemplates
#Don't ship windows .bat scripts
find source -name \*.bat | xargs rm
#Fix permissions
chmod +x source/dist/util/dl?.*sh 
chmod -x source/dist/util/dl.*sh 
find source -name \*.c | xargs chmod -x
#Fix flags for qmake build
find source/3rdparty/qmake source/3rdparty/qtcsh -name Makefile | 
  xargs sed -i -e "/^CFLAGS *=/s/=/= $RPM_OPT_FLAGS/"


%build
export JAVA_HOME=%{java_home}
cd source
export SGE_INPUT_CFLAGS="$RPM_OPT_FLAGS"
touch aimk
./aimk -only-depend
scripts/zerodepend
./aimk depend
./aimk
./aimk -man 


%install 
rm -rf $RPM_BUILD_ROOT

#Set the gridengine arch
gearch=`%{_builddir}/gridengine/source/dist/util/arch`
# set up the target installation directory
export SGE_ROOT=$RPM_BUILD_ROOT%{_datadir}/gridengine
mkdir -p $SGE_ROOT
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/gridengine/default/qmaster
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/gridengine/default/spooldb
cd source
echo 'y'| scripts/distinst -nobdb -noopenssl -local -allall -noexit ${gearch}
install -p -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/gridengine
install -p -m755 `scripts/compilearch -c ${gearch}`/qevent $RPM_BUILD_ROOT%{_datadir}/gridengine/bin

# Move things to the right location, making links back
# bin
mv $RPM_BUILD_ROOT/%{_datadir}/gridengine/bin $RPM_BUILD_ROOT/%{_prefix}
rmdir $RPM_BUILD_ROOT%{_bindir}/${gearch}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/gridengine/bin/${gearch}
# move qmake out of %{_bindir} to avoid conflicts with Qt qmake
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/gridengine/bin/${gearch}
mv $RPM_BUILD_ROOT%{_bindir}/qmake $RPM_BUILD_ROOT%{_libexecdir}/gridengine/bin/${gearch}/
ln -s ../../../../libexec/gridengine/bin/${gearch}/qmake \
      $RPM_BUILD_ROOT%{_datadir}/gridengine/bin/${gearch}/
for bin in `find $RPM_BUILD_ROOT%{_bindir} -type f -o -type l`
do
    ln -s ../../../../bin/`basename $bin` \
          $RPM_BUILD_ROOT%{_datadir}/gridengine/bin/${gearch}/
done

# utilbin
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/gridengine/utilbin
mv $RPM_BUILD_ROOT%{_datadir}/gridengine/utilbin/* \
   $RPM_BUILD_ROOT%{_libexecdir}/gridengine/utilbin
ln -s ../../../libexec/gridengine/utilbin \
      $RPM_BUILD_ROOT%{_datadir}/gridengine/utilbin/${gearch}
# We also need some db utils
ln -s ../../../bin/db_dump ../../../bin/db_load \
      $RPM_BUILD_ROOT%{_datadir}/gridengine/utilbin/

# lib
mkdir -p $RPM_BUILD_ROOT/%{_prefix}
mv $RPM_BUILD_ROOT/%{_datadir}/gridengine/lib $RPM_BUILD_ROOT/%{_libdir}

# man
mkdir -p $RPM_BUILD_ROOT/%{_mandir}
mv $RPM_BUILD_ROOT/%{_datadir}/gridengine/man/man* $RPM_BUILD_ROOT/%{_mandir}

# include
mv $RPM_BUILD_ROOT/%{_datadir}/gridengine/include $RPM_BUILD_ROOT/%{_includedir}

# app-defaults
mkdir -p $RPM_BUILD_ROOT%{_datadir}/X11/app-defaults
mv $RPM_BUILD_ROOT/%{_datadir}/gridengine/qmon/*.ad \
   $RPM_BUILD_ROOT%{_datadir}/X11/app-defaults

# The default cell directories
mkdir -p $RPM_BUILD_ROOT%{_datadir}/gridengine/default/common

# Bootstrap file
#cp %SOURCE7 $RPM_BUILD_ROOT%{_datadir}/gridengine/default/common/

# These files get created during user setup (install_qmaster)
touch $RPM_BUILD_ROOT%{_datadir}/gridengine/default/common/act_qmaster
touch $RPM_BUILD_ROOT%{_datadir}/gridengine/default/common/bootstrap
touch $RPM_BUILD_ROOT%{_datadir}/gridengine/default/common/qtask
touch $RPM_BUILD_ROOT%{_datadir}/gridengine/default/common/settings.csh
touch $RPM_BUILD_ROOT%{_datadir}/gridengine/default/common/settings.sh
touch $RPM_BUILD_ROOT%{_datadir}/gridengine/default/common/sge_aliases
touch $RPM_BUILD_ROOT%{_datadir}/gridengine/default/common/sgeexecd
touch $RPM_BUILD_ROOT%{_datadir}/gridengine/default/common/sgemaster
touch $RPM_BUILD_ROOT%{_datadir}/gridengine/default/common/sge_request

# Environment (SGE_ROOT)
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
install -p -m644 %SOURCE3 %SOURCE4 $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/

# Startup scripts
mkdir -p $RPM_BUILD_ROOT%{_initrddir}
install -p -m755 %SOURCE5 %SOURCE6 $RPM_BUILD_ROOT%{_initrddir}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
install -p -m644 %SOURCE9 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/gridengine

# Don't package catman files
rm -rf $RPM_BUILD_ROOT/%{_datadir}/gridengine/catman

# Rename some man pages to avoid conflicts
pushd $RPM_BUILD_ROOT/%{_mandir}/man5
for f in *
do
   if [ ${f:0:4} != sge_ ]
   then
      mv $f sge_$f
   fi
done
popd

#Don't need these
rm -rf $RPM_BUILD_ROOT/%{_datadir}/gridengine/3rd_party
rm -rf $RPM_BUILD_ROOT/%{_datadir}/gridengine/dtrace

#Don't ship example binaries
rm -rf $RPM_BUILD_ROOT/%{_datadir}/gridengine/examples/jobsbin
rm -rf $RPM_BUILD_ROOT/%{_datadir}/gridengine/examples/worker.*

#Cleanup some patch backups that get shipped
rm $RPM_BUILD_ROOT/%{_datadir}/gridengine/util/install_modules/inst_*.sh.*


%clean
rm -rf $RPM_BUILD_ROOT


%pre
%__fe_groupadd %uid -r %username &>/dev/null || :
%__fe_useradd  %uid -r -s /sbin/nologin -d %homedir -M          \
                    -c '%gecos' -g %username %username &>/dev/null || :

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%post execd
/sbin/chkconfig --add sge_execd

%postun execd
if [ "$1" -ge "1" ]; then
        /sbin/service sge_execd condrestart >/dev/null 2>&1 || :
fi

%preun execd
if [ $1 -eq 0 ]; then
    /sbin/service sge_execd stop
    /sbin/chkconfig --del sge_execd
fi


%post qmaster
/sbin/chkconfig --add sgemaster

%postun qmaster
if [ "$1" -ge "1" ]; then
        /sbin/service sgemaster condrestart >/dev/null 2>&1 || :
fi

%preun qmaster
if [ $1 -eq 0 ]; then
    /sbin/service sgemaster stop
    /sbin/chkconfig --del sgemaster
fi


%files
%defattr(-,root,root,-)
%doc Licenses
%config(noreplace) %{_sysconfdir}/profile.d/sge.*
%config(noreplace) %{_sysconfdir}/sysconfig/gridengine
%{_bindir}/*
%exclude %{_bindir}/qacct
%exclude %{_bindir}/qmon
%exclude %{_bindir}/sge_execd
%exclude %{_bindir}/sge_qmaster
%exclude %{_bindir}/sge_schedd
%{_libdir}/libdrmaa.so.*
%{_libdir}/libspoolb.so
%{_libdir}/libspoolc.so
%{_libdir}/jgdi.jar
%{_libdir}/juti.jar
%{_libdir}/libjgdi.so
%{_libdir}/libjuti.so
# Only the file %{_libexecdir}/gridengine/bin/*/qmake is
# under GPLv2+
# Olny the file %{_libexecdir}/gridengine/bin/*/qtcsh is
# under BSD with advertising
%{_libexecdir}/gridengine/
%attr(-,%username,%username) %dir %{_datadir}/gridengine
%{_datadir}/gridengine/bin
%exclude %{_datadir}/gridengine/bin/*/qacct
%exclude %{_datadir}/gridengine/bin/*/qmon
%exclude %{_datadir}/gridengine/bin/*/sge_execd
%exclude %{_datadir}/gridengine/bin/*/sge_qmaster
%exclude %{_datadir}/gridengine/bin/*/sge_schedd
%{_datadir}/gridengine/ckpt
%attr(-,%username,%username) %dir %{_datadir}/gridengine/default
%attr(-,%username,%username) %dir %{_datadir}/gridengine/default/common
%attr(-,%username,%username) %ghost %{_datadir}/gridengine/default/common/*
%{_datadir}/gridengine/doc
%{_datadir}/gridengine/inst_sge
%{_datadir}/gridengine/mpi
%{_datadir}/gridengine/my_configuration.conf
%dir %{_datadir}/gridengine/pvm
%{_datadir}/gridengine/pvm/*
%exclude %{_datadir}/gridengine/pvm/src
%{_datadir}/gridengine/util
%dir %{_datadir}/gridengine/utilbin
%{_datadir}/gridengine/utilbin/*
%exclude %{_datadir}/gridengine/utilbin/db_*
%{_mandir}/man1/*.1*
%exclude %{_mandir}/man1/qmon.1*
%{_mandir}/man5/*.5*
%{_mandir}/man8/*.8*
%exclude %{_mandir}/man8/sge_qmaster.8*
%exclude %{_mandir}/man8/sge_schedd.8*
%exclude %{_mandir}/man8/sge_execd.8*
%attr(-,%username,%username) %dir %{_localstatedir}/spool/gridengine
%attr(-,%username,%username) %dir %{_localstatedir}/spool/gridengine/default

%files devel
%defattr(-,root,root,-)
%{_includedir}/*
%{_libdir}/libdrmaa.so
%{_datadir}/gridengine/examples
%{_datadir}/gridengine/pvm/src
%{_mandir}/man3/*.3*

%files qmon
%defattr(-,root,root,-)
%{_bindir}/qmon
%{_libdir}/libXltree.so
%{_datadir}/X11/app-defaults/*
%{_datadir}/gridengine/bin/*/qmon
%{_datadir}/gridengine/qmon/
%{_mandir}/man1/qmon.1*

%files execd
%defattr(-,root,root,-)
%{_initrddir}/sge_execd
%{_bindir}/sge_execd
%{_datadir}/gridengine/install_execd
%{_datadir}/gridengine/bin/*/sge_execd
%{_mandir}/man8/sge_execd.8*

%files qmaster
%defattr(-,root,root,-)
%{_initrddir}/sgemaster
%{_bindir}/qacct
%{_bindir}/sge_qmaster
%{_bindir}/sge_schedd
%{_datadir}/gridengine/bin/*/qacct
%{_datadir}/gridengine/bin/*/sge_qmaster
%{_datadir}/gridengine/bin/*/sge_schedd
%{_datadir}/gridengine/install_qmaster
%{_datadir}/gridengine/utilbin/db_*
%{_mandir}/man8/sge_qmaster.8*
%{_mandir}/man8/sge_schedd.8*
%attr(-,%username,%username) %ghost %{_localstatedir}/spool/gridengine/default/qmaster
%attr(-,%username,%username) %ghost %{_localstatedir}/spool/gridengine/default/spooldb


%changelog
* Fri Feb  8 2008 - Orion Poplawski <orion at cora.nwra.com> - 6.1u3-6
- Fixup subpackage License tags
- Service name change in scriptlets

* Thu Feb  7 2008 - Orion Poplawski <orion at cora.nwra.com> - 6.1u3-5
- Rewrite initscripts
- Remove spurious Requires(post): /sbin/ldconfig
- Add License explanation file and fix License tags

* Mon Feb  4 2008 - Orion Poplawski <orion at cora.nwra.com> - 6.1u3-4
- Drop arch from source
- Fix Requires() for main package
- Move man3 to -devel

* Fri Feb  1 2008 - Orion Poplawski <orion at cora.nwra.com> - 6.1u3-3
- Fix various review comments and rpmlint issues (bug #316141)

* Thu Jan 31 2008 - Orion Poplawski <orion at cora.nwra.com> - 6.1u3-2
- Actually ship sge_execd in the execd subpackage
- Don't complain about missing sge_execd during inst_sge -upd
- Link in db_dump and db_load into utilbin so that update scripts can find them

* Wed Jan  9 2008 - Orion Poplawski <orion at cora.nwra.com> - 6.1u3-1
- Update to 6.1u3
- Split execd into sub-package

* Thu Nov 15 2007 - Orion Poplawski <orion at cora.nwra.com> - 6.1u2-5
- Add BR net-tools for hostname for java build on devel

* Mon Nov 12 2007 - Orion Poplawski <orion at cora.nwra.com> - 6.1u2-4
- Add patch and source for ppc/ppc64 builds

* Fri Nov  1 2007 - Orion Poplawski <orion at cora.nwra.com> - 6.1u2-3
- Add patch to fix qstat xml output

* Thu Oct 18 2007 - Orion Poplawski <orion at cora.nwra.com> - 6.1u2-2
- Cleanup arch handling
- Install qevent

* Tue Oct  2 2007 - Orion Poplawski <orion at cora.nwra.com> - 6.1u2-1
- Fedora packaging


--- NEW FILE gridengine.sysconfig ---
SGE_ROOT=/usr/share/gridengine
SGE_CELL=default


--- NEW FILE my_configuration.conf ---
#-------------------------------------------------
# SGE default configuration file
#-------------------------------------------------

# Use always fully qualified pathnames, please

# SGE_ROOT Path, this is basic information
#(mandatory for qmaster and execd installation)
SGE_ROOT="/usr/share/gridengine"

# SGE_QMASTER_PORT is used by qmaster for communication
# Please enter the port in this way: 1300
# Please do not this: 1300/tcp
#(mandatory for qmaster installation)
SGE_QMASTER_PORT=6444

# SGE_EXECD_PORT is used by execd for communication
# Please enter the port in this way: 1300
# Please do not this: 1300/tcp
#(mandatory for qmaster installation)
SGE_EXECD_PORT=6445

# CELL_NAME, will be a dir in SGE_ROOT, contains the common dir
# Please enter only the name of the cell. No path, please
#(mandatory for qmaster and execd installation)
CELL_NAME="default"

# ADMIN_USER, if you want to use a different admin user than the owner,
# of SGE_ROOT, you have to enter the user name, here
# Leaving this blank, the owner of the SGE_ROOT dir will be used as admin user
ADMIN_USER=""

# The dir, where qmaster spools this parts, which are not spooled by DB
#(mandatory for qmaster installation)
QMASTER_SPOOL_DIR="/var/spool/gridengine/default/qmaster"

# The dir, where the execd spools (active jobs)
# This entry is needed, even if your are going to use
# berkeley db spooling. Only cluster configuration and jobs will
# be spooled in the database. The execution daemon still needs a spool
# directory  
#(mandatory for qmaster installation)
EXECD_SPOOL_DIR="/var/spool/gridengine"

# For monitoring and accounting of jobs, every job will get
# unique GID. So you have to enter a free GID Range, which
# is assigned to each job running on a machine.
# If you want to run 100 Jobs at the same time on one host you
# have to enter a GID-Range like that: 16000-16100
#(mandatory for qmaster installation)
GID_RANGE="16000-16100"

# If SGE is compiled with -spool-dynamic, you have to enter here, which
# spooling method should be used. (classic or berkeleydb)
#(mandatory for qmaster installation)
SPOOLING_METHOD="berkeleydb"

# Name of the Server, where the Spooling DB is running on
# if spooling methode is berkeleydb, it must be "none", when
# using no spooling server and it must containe the servername
# if a server should be used. In case of "classic" spooling,
# can be left out
DB_SPOOLING_SERVER="none"

# The dir, where the DB spools
# If berkeley db spooling is used, it must contain the path to
# the spooling db. Please enter the full path. (eg. /tmp/data/spooldb)
# Remember, this directory must be local on the qmaster host or on the
# Berkeley DB Server host. No NSF mount, please
DB_SPOOLING_DIR="/var/spool/gridengine/default/spooldb"

# This parameter set the number of parallel installation processes.
# The prevent a system overload, or exeeding the number of open file
# descriptors the user can limit the number of parallel install processes.
# eg. set PAR_EXECD_INST_COUNT="20", maximum 20 parallel execd are installed.
PAR_EXECD_INST_COUNT="20"

# A List of Host which should become admin hosts
# If you do not enter any host here, you have to add all of your hosts
# by hand, after the installation. The autoinstallation works without
# any entry
ADMIN_HOST_LIST=""

# A List of Host which should become submit hosts
# If you do not enter any host here, you have to add all of your hosts
# by hand, after the installation. The autoinstallation works without
# any entry
SUBMIT_HOST_LIST=""

# A List of Host which should become exec hosts
# If you do not enter any host here, you have to add all of your hosts
# by hand, after the installation. The autoinstallation works without
# any entry
# (mandatory for execution host installation)
EXEC_HOST_LIST=""

# The dir, where the execd spools (local configuration)
# If you want configure your execution daemons to spool in
# a local directory, you have to enter this directory here.
# If you do not want to configure a local execution host spool directory
# please leave this empty
EXECD_SPOOL_DIR_LOCAL="/var/spool/gridengine"

# If true, the domainnames will be ignored, during the hostname resolving
# if false, the fully qualified domain name will be used for name resolving
HOSTNAME_RESOLVING="true"

# Shell, which should be used for remote installation (rsh/ssh)
# This is only supported, if your hosts and rshd/sshd is configured,
# not to ask for a password, or promting any message.
SHELL_NAME="ssh"

# This remote copy command is used for csp installation.
# The script needs the remote copy command for distributing
# the csp certificates. Using ssl the command scp has to be entered,
# using  the not so secure rsh the command rcp has to be entered.
# Both need a passwordless ssh/rsh connection to the hosts, which
# should be connected to. (mandatory for csp installation mode)
COPY_COMMAND="scp"

# Enter your default domain, if you are using /etc/hosts or NIS configuration
DEFAULT_DOMAIN="none"

# If a job stops, fails, finnish, you can send a mail to this adress
ADMIN_MAIL="none"

# If true, the rc scripts (sgemaster, sgeexecd, sgebdb) will be added,
# to start automatically during boottime
ADD_TO_RC="false"

#If this is "true" the file permissions of executables will be set to 755
#and of ordenary file to 644.  
SET_FILE_PERMS="false"

# This option is not implemented, yet.
# When a exechost should be uninstalled, the running jobs will be rescheduled
RESCHEDULE_JOBS="wait"

# Enter a one of the three distributed scheduler tuning configuration sets
# (1=normal, 2=high, 3=max)
SCHEDD_CONF="1"

# The name of the shadow host. This host must have read/write permission
# to the qmaster spool directory
# If you want to setup a shadow host, you must enter the servername
# (mandatory for shadowhost installation)
#SHADOW_HOST="hostname"

# Remove this execution hosts in automatic mode
# (mandatory for unistallation of execution hosts)
EXEC_HOST_LIST_RM=""

# This option is used for startup script removing. 
# If true, all rc startup scripts will be removed during
# automatic deinstallation. If false, the scripts won't
# be touched.
# (mandatory for unistallation of execution/qmaster hosts)
REMOVE_RC="false"

# This is a Windows specific part of the auto isntallation template
# If you going to install windows executions hosts, you have to enable the
# windows support. To do this, please set the WINDOWS_SUPPORT variable
# to "true". ("false" is disabled)
# (mandatory for qmaster installation, by default WINDOWS_SUPPORT is
# disabled)
WINDOWS_SUPPORT="false"

# Enabling the WINDOWS_SUPPORT, recommends the following parameter.
# The WIN_ADMIN_NAME will be added to the list of SGE managers.
# Without adding the WIN_ADMIN_NAME the execution host installation
# won't install correctly.
# WIN_ADMIN_NAME is set to "Administrator" which is default on most
# Windows systems. In some cases the WIN_ADMIN_NAME can be prefixed with
# the windows domain name (eg. DOMAIN+Administrator)
# (mandatory for qmaster installation, if windows hosts should be installed)
WIN_ADMIN_NAME="Administrator"

# This parameter is used to switch between local ADMINUSER and Windows
# Domain Adminuser. Setting the WIN_DOMAIN_ACCESS variable to true, the
# Adminuser will be a Windows Domain User. It is recommended that 
# a Windows Domain Server is configured and the Windows Domain User is
# created. Setting this variable to false, the local Adminuser will be
# used as ADMINUSER. The install script tries to create this user account
# but we recommend, because it will be saver, to create this user, 
# before running the installation. 
# (mandatory for qmaster installation, if windows hosts should be installed)
WIN_DOMAIN_ACCESS="false"

# This section is used for csp installation mode.
# CSP_RECREATE recreates the certs on each installtion, if true.
# In case of false, the certs will be created, if not existing.
# Existing certs won't be overwritten. (mandatory for csp install)
CSP_RECREATE="true"

# The created certs won't be coppied, if this optin is set to false
# If true, the script tries to copy the generated certs. This
# requires passwordless ssh/rsh access for user root to the
# execution hosts
CSP_COPY_CERTS="false"

# csp information, your country code (only 2 characters)
# (mandatory for csp install)
CSP_COUNTRY_CODE="DE"

# your state (mandatory for csp install)
CSP_STATE="Germany"

# your location, eg. the building (mandatory for csp install)
CSP_LOCATION="Building"

# your arganisation (mandatory for csp install)
CSP_ORGA="Organisation"

# your organisation unit (mandatory for csp install)
CSP_ORGA_UNIT="Organisation_unit"

# your email (mandatory for csp install)
CSP_MAIL_ADDRESS="name at yourdomain.com"

qtcsh.sh.h.patch:

--- NEW FILE qtcsh.sh.h.patch ---
--- gridengine/source/3rdparty/qtcsh/sh.h.orig	2005-06-16 17:44:47.920091272 +0800
+++ gridengine/source/3rdparty/qtcsh/sh.h	2005-06-16 17:44:53.728208304 +0800
@@ -458,7 +458,7 @@
 extern pid_t getpgrp __P((void));
 #  endif	/* BSD || SUNOS4 || IRISD || DGUX */
 # endif /* POSIX */
-extern pid_t setpgrp __P((pid_t, pid_t));
+//extern pid_t setpgrp __P((pid_t, pid_t));
 #endif /* !WINNT */
 
 typedef sigret_t (*signalfun_t) __P((int));


--- NEW FILE sge.csh ---
# Make sure SGE_ROOT is set
if ( $?SGE_ROOT ) then
	exit
endif
setenv SGE_ROOT /usr/share/gridengine


--- NEW FILE sge.sh ---
# Make sure SGE_ROOT is set
[ -z "$SGE_ROOT" ] && SGE_ROOT="/usr/share/gridengine"
export SGE_ROOT


--- NEW FILE sge_execd ---
#!/bin/sh
#
# sge_execd Gridengine execution daemon
#
# chkconfig:   - 98 02
# description: The Gridexecution daemon starts and manages grid jobs

### BEGIN INIT INFO
# Provides: sge_execd
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Should-Start: 
# Should-Stop: 
# Default-Start: 
# Default-Stop: 0 1 6
# Short-Description: Gridengine execution daemon
# Description: The Gridexecution daemon starts and manages grid jobs
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

exec="/usr/bin/sge_execd"
prog="sge_execd"

#Defaults
SGE_ROOT=/usr/share/gridengine
SGE_CELL=default

#Configuration
config=/etc/sysconfig/gridengine
[ -e $config ] && . $config

#Export these
export SGE_ROOT SGE_CELL

utilbin_dir=/usr/libexec/gridengine/utilbin
# UQHOST is the local host name (unqualified name)
UQHOST=`$utilbin_dir/gethostname -name | cut -f1 -d.`
execd_spool_dir=`/usr/bin/qconf -sconf $UQHOST 2>&- | awk '$1 == "execd_spool_dir" { print $2 }'`
if [ -z "$execd_spool_dir" ]; then
    execd_spool_dir=`/usr/bin/qconf -sconf | awk '$1 == "execd_spool_dir" { print $2 }'`
fi
#Add the hostname to the spool directory
execd_spool_dir=${execd_spool_dir}/${UQHOST}
pidfile=${execd_spool_dir}/execd.pid


lockfile=/var/lock/subsys/$prog

start() {
    [ -x $exec ] || exit 5
    echo -n $"Starting $prog: "
    daemon --check $prog --pidfile=$pidfile $exec
    retval=$?
    echo
    [ $retval -eq 0 ] && touch $lockfile
    return $retval
}

stop() {
    echo -n $"Stopping $prog: "
    killproc -p $pidfile $prog
    retval=$?
    echo
    [ $retval -eq 0 ] && rm -f $lockfile
    if [ "$1" != "soft" ]; then
       for jobid in `ls $execd_spool_dir/active_jobs`; do
           echo "   Shutting down Grid Engine shepherd of job $jobid"
           killproc -p $execd_spool_dir/active_jobs/$jobid/pid sge_shepherd
       done
    fi
    return $retval
}

restart() {
    stop soft
    start
}

reload() {
    restart
}

force_reload() {
    restart
}

rh_status() {
    # run checks to determine if the service is running or use generic status
    status $prog
}

rh_status_q() {
    rh_status >/dev/null 2>&1
}


case "$1" in
    start)
        rh_status_q && exit 0
        $1
        ;;
    stop)
        rh_status_q || exit 0
        $1
        ;;
    softstop)
        rh_status_q || exit 0
        stop soft
        ;;
    restart)
        $1
        ;;
    reload)
        rh_status_q || exit 7
        $1
        ;;
    force-reload)
        force_reload
        ;;
    status)
        rh_status
        ;;
    condrestart|try-restart)
        rh_status_q || exit 0
        restart
        ;;
    *)
        echo $"Usage: $0 {start|stop|softstop|status|restart|try-restart|reload|force-reload}"
        exit 2
esac
exit $?


--- NEW FILE sgemaster ---
#!/bin/sh
#
# sgemaster Gridengine master daemon and scheduler
#
# chkconfig:   - 98 02
# description: The gridengine master daemon and scheduler

### BEGIN INIT INFO
# Provides: sge_qmaster sge_schedd
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Should-Start: 
# Should-Stop: 
# Default-Start: 
# Default-Stop: 0 1 6
# Short-Description: Gridengine master daemon and scheduler
# Description: The gridengine master daemon and scheduler
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

master_exec="/usr/bin/sge_qmaster"
master_prog="sge_qmaster"
schedd_exec="/usr/bin/sge_schedd"
schedd_prog="sge_schedd"
SGE_ROOT=/usr/share/gridengine; export SGE_ROOT
SGE_CELL=default; export SGE_CELL
qmaster_spool_dir=`awk '$1 == "qmaster_spool_dir" { print $2 }' $SGE_ROOT/$SGE_CELL/common/bootstrap`
master_pidfile=$qmaster_spool_dir/qmaster.pid
schedd_pidfile=$qmaster_spool_dir/schedd/schedd.pid

#---------------------------------------------------------------------------
# CheckIfQmasterHost
#    If our hostname given in $1 is the same as in the "act_qmaster" file
#    echo "true" else echo "false"
#
CheckIfQmasterHost()
{
   host=$1

   if [ "$host" = "`cat $SGE_ROOT/$SGE_CELL/common/act_qmaster`" ]; then
      echo true
   else
      echo false
   fi
}

#---------------------------------------------------------------------------
# CheckIfPrimaryQmasterHost
#    Check if our hostname given in $1 is the same as in the
#    "primary_qmaster" file
#    echo true if there is our hostname else echo false
#
CheckIfPrimaryQmasterHost()
{
   host=$1

   fname=$SGE_ROOT/$SGE_CELL/common/primary_qmaster

   if [ -f $fname ]; then
      if [ "$host" = "`cat $fname`" ]; then
         echo true
      else
         echo false
      fi
   else
      echo false
   fi
}


#---------------------------------------------------------------------------
# CheckIfShadowMasterHost
#    Check if our hostname given in $1 is contained in the
#    "shadow_masters" file
#    set shadow_host true if there is our hostname
#
CheckIfShadowMasterHost()
{
   host=$1

   fname=$SGE_ROOT/$SGE_CELL/common/shadow_masters

   if [ -f $fname ]; then
      grep -i $host $fname 2>&1 > /dev/null
      if [ $? = 0 ]; then
         shadow_host="true"
      else
         shadow_host="false"
      fi
   else
      shadow_host="false"
   fi
}

#---------------------------------------------------------------------------
# GetAdminUser
#    echo the name of the admin user on this system
#    echo "root" if admin user retrieval fails
GetAdminUser()
{
   cfgname=$SGE_ROOT/$SGE_CELL/common/bootstrap
   user=none

   if [ -f $cfgname ]; then
      user=`grep admin_user $cfgname | awk '{ print $2 }'`
   fi

   if [ `echo $user|tr "A-Z" "a-z"` = "none" ]; then
      user=root
   fi
   echo $user
}

#---------------------------------------------------------------------------
# CheckRunningQmaster
# checks, if sge_qmaster is running
# In error case the sge_qmaster didn't start, silently
#
CheckRunningQmaster()
{
   masterhost=`cat $SGE_ROOT/$SGE_CELL/common/act_qmaster`
   running=false
   loop=0

   if [ "$SGE_QMASTER_PORT" = "" ]; then
      SGE_QMASTER_PORT=`$utilbin_dir/getservbyname -number sge_qmaster`
   fi

   while [ $running = "false" -a $loop -ne 30 ]; do 
      qping -info $masterhost $SGE_QMASTER_PORT qmaster 1 > /dev/null 2>&1

      if [ "$?" = 0 ]; then
         running=true
      else
         sleep 2 
         masterhost=`cat $SGE_ROOT/$SGE_CELL/common/act_qmaster`
         loop=`expr $loop + 1`
      fi
   done

   if [ $running = "false" ]; then
      echo
      echo "sge_qmaster didn't start!"
      echo "Please check the messages file"
      echo
   fi
}

#---------------------------------------------------------------------------
usage()
{
   echo "Grid Engine start/stop script. Valid parameters are:"
   echo ""
   echo "   \"start\"        start qmaster and schedd daemon if applicable"
   echo "   \"stop\"         shutdown qmaster and schedd daemon if applicable"
   echo "   \"-qmaster\"     only start/stop qmaster and scheduler (if applicable)"
   echo "   \"-shadowd\"     only start/stop shadowd (if applicable)"   
   echo "   \"-migrate\"     shutdown qmaster/scheduler if it's running on another"
   echo "                    host and restart it on this host"
   echo "                    Migration only works if this host is an admin host"
   echo ""
   echo "Only one of the parameters \"start\", \"stop\" is allowed."
   echo "Only one of the parameters beginning  with \"-\" is allowed." 
   echo
   echo "Default for \"stop\" is shutting down all components."
   echo
   exit 1
}

CheckArgs() {
   if [ "$1" = -qmaster ]; then
      qmaster=true
      shadowd=false
   elif [ "$1" = -shadowd ]; then
      qmaster=false
      shadowd=true
   elif [ "$1" = -migrate ]; then
      migrate_qmaster=true
      qmaster=true
      shadowd=false
   else
      usage
   fi
}

utilbin_dir=/usr/libexec/gridengine/utilbin
if [ "$utilbin_dir" = "none" ]; then
   echo "can't determine path to Grid Engine utility binaries"
   exit 6
fi

HOST=`$utilbin_dir/gethostname -aname`
UQHOST=`$utilbin_dir/gethostname -aname | cut -f1 -d.`
CheckIfShadowMasterHost $HOST


lockfile=/var/lock/subsys/sgemaster

#Default actions
qmaster=true
shadowd=true
qstd=false
migrate_qmaster=false

start() {
    # qmaster_host=true if qmaster was running on this host the last time
    #                   this host is an execution host

    qmaster_host=`CheckIfQmasterHost $HOST`
    primary_qmaster_host=`CheckIfPrimaryQmasterHost $HOST`

    if [ $qmaster = true -a $qmaster_host = true -a $migrate_qmaster = true ]; then
        echo "   qmaster and scheduler running on this host. Will not migrate qmaster."
        exit 1
    fi

    [ -x $master_exec ] || exit 5
    [ -x $schedd_exec ] || exit 5

    if [ $qmaster = true -a $qmaster_host = false -a  \
         \( $primary_qmaster_host = true -o $migrate_qmaster = true \) ]; then
        actual_qmaster_host=`cat $SGE_ROOT/$SGE_CELL/common/act_qmaster`
        echo "   shutting down qmaster and scheduler on host \"$actual_qmaster_host\" ..."
        qconf_output=`qconf -ks 2>&1 | grep "denied"`
        if [ "$qconf_output" != "" ]; then
           echo "   denied: host \"$HOST\" is no admin host."
           exit 1
        fi
        qconf -km > /dev/null 2>&1
       
        qping_count=0
        qping_retries=10
        qping_exit_state=0
        while [ $qping_count -lt $qping_retries ]; do
            qping -info $actual_qmaster_host $SGE_QMASTER_PORT qmaster 1  > /dev/null 2>&1
            qping_exit_state=$?
            if [ $qping_exit_state -ne 0 ]; then
                break
            fi
            sleep 3
            qping_count=`expr $qping_count + 1`
        done

        if [ $qping_exit_state -eq 0 ]; then
        #  qmaster is still running
            echo "   qmaster on host $actual_qmaster_host still alive. Cannot migrate qmaster."
            exit 1
        fi

        lock_file_read_retries=10
        lock_file_read_count=0
        lock_file_found=0
        while [ $lock_file_read_count -lt $lock_file_read_retries ]; do
           if [ -f $qmaster_spool_dir/lock ]; then
              lock_file_found=1
              break
           fi
           sleep 3
           lock_file_read_count=`expr $lock_file_read_count + 1`
        done

        if [ $lock_file_found -eq 0 ]; then
        #  old qmaster did not write lock file 
           echo "   old qmaster did not write lock file. Cannot migrate qmaster."
           echo "   Please verify that qmaster on host $actual_qmaster_host is down"
           echo "   and make sure that the lock file in qmaster spool directory is"
           echo "   read-able."
           exit 1
        fi

        qmaster_host=true
    fi

    if [ $qmaster = true -a $qmaster_host = true ]; then
        echo -n $"Starting $master_prog: "
        daemon --check $master_prog --pidfile=$master_pidfile $master_exec
        retval=$?
        CheckRunningQmaster
        echo
        echo -n $"Starting $schedd_prog: "
        daemon --check $schedd_prog --pidfile=$schedd_pidfile $schedd_exec
        retval=`expr $retval + $?`
    elif [ $qmaster = true -a $qmaster_host = false ]; then
        echo
        echo "sge_qmaster didn't start!"
        echo "This is not a qmaster host!"
        echo "Please, check your act_qmaster file!" 
        echo
    fi
      
    if [ $shadowd = true -a $shadow_host = true ]; then
        pidfile=$qmaster_spool_dir/shadowd_$HOST.pid
        [ -f $pidfile ] || pidfile=$qmaster_spool_dir/shadowd_$UQHOST.pid

        echo -n $"Starting sge_shadowd: "
        daemon --check sge_shadowd --pidfile=$pidfile /usr/bin/sge_shadowd
        retval=$?
    fi

    echo
    [ $retval -eq 0 ] && touch $lockfile
    return $retval
}

stop() {
    if [ $shadow_host = true ]; then
        prog=sge_shadowd
        pidfile=$qmaster_spool_dir/shadowd_$UQHOST.pid
        [ -f $pidfile ] || pidfile=$qmaster_spool_dir/shadowd_$HOST.pid

        # Send SIGTERM to shadowd
        echo -n $"Stopping $prog: "
        killproc -p $pidfile $prog
        retval=$?
    fi

    if [ $qmaster = true ]; then
        if [ `CheckIfQmasterHost $HOST` = true ]; then
            # Send SIGTERM to scheduler
            echo -n $"Stopping $schedd_prog: "
            killproc -p $schedd_pidfile $schedd_prog
            retval=$?
            echo

            # Send SIGTERM to qmaster
            echo -n $"Stopping $master_prog: "
            killproc -p $master_pidfile $master_prog
            retval=`expr $retval + $?`
        fi
    fi
 
    echo
    [ $retval -eq 0 ] && rm -f $lockfile
    return $retval
}

restart() {
    stop
    start
}

reload() {
    restart
}

force_reload() {
    restart
}

rh_status() {
    # run checks to determine if the service is running or use generic status
    status $master_prog
    status $schedd_prog
}

rh_status_q() {
    rh_status >/dev/null 2>&1
}


case "$1" in
    start)
        rh_status_q && exit 0
        [ -n "$2" ] && CheckArgs $2
        $1
        ;;
    stop)
        rh_status_q || exit 0
        [ -n "$2" ] && CheckArgs $2
        $1
        ;;
    restart)
        $1
        ;;
    reload)
        rh_status_q || exit 7
        $1
        ;;
    force-reload)
        force_reload
        ;;
    status)
        rh_status
        ;;
    condrestart|try-restart)
        rh_status_q || exit 0
        restart
        ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
        exit 2
esac
exit $?


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/gridengine/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	8 Feb 2008 18:28:30 -0000	1.1
+++ .cvsignore	8 Feb 2008 21:57:23 -0000	1.2
@@ -0,0 +1,2 @@
+ge-V61u3_TAG-src.tar.gz
+gridengine-ppc.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/gridengine/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	8 Feb 2008 18:28:30 -0000	1.1
+++ sources	8 Feb 2008 21:57:24 -0000	1.2
@@ -0,0 +1,2 @@
+a0e8ff817ac79f1ad76aa7e100b3cd9c  ge-V61u3_TAG-src.tar.gz
+a03b0663e8a8912d67adf281c5c49eb4  gridengine-ppc.tar.gz




More information about the fedora-extras-commits mailing list