aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbicatali <bicatali@32389bae-6d03-0410-99cf-db05cde120eb>2006-03-15 18:02:56 +0000
committerbicatali <bicatali@32389bae-6d03-0410-99cf-db05cde120eb>2006-03-15 18:02:56 +0000
commit8173aad72f070c7cfda949a948a68ea8dd62f53f (patch)
treebf79cc81c6b355fbf2e787cbce673ff00ce6a5eb /sys-cluster/torque
parentopenmpi-1.0.1.ebuild: removed pic flag, forced -fPIC for amd64 (diff)
downloadsci-8173aad72f070c7cfda949a948a68ea8dd62f53f.tar.gz
sci-8173aad72f070c7cfda949a948a68ea8dd62f53f.tar.bz2
sci-8173aad72f070c7cfda949a948a68ea8dd62f53f.zip
added torque-2.0.0_p8.ebuild and patches
git-svn-id: http://overlays.gentoo.org/svn/proj/science/overlay@124 32389bae-6d03-0410-99cf-db05cde120eb
Diffstat (limited to 'sys-cluster/torque')
-rw-r--r--sys-cluster/torque/ChangeLog144
-rw-r--r--sys-cluster/torque/Manifest9
-rw-r--r--sys-cluster/torque/files/digest-torque-2.0.0_p81
-rw-r--r--sys-cluster/torque/files/torque-2.0.0_p8-destdir-fixes.patch13
-rw-r--r--sys-cluster/torque/files/torque-2.0.0_p8-makedepend.patch17
-rw-r--r--sys-cluster/torque/files/torque-2.0.0_p8-respect-destdir.patch493
-rw-r--r--sys-cluster/torque/files/torque-2.0.0_p8-respect-ldflags.patch61
-rw-r--r--sys-cluster/torque/files/torque-2.0.0_p8-setuid-safety.patch25
-rw-r--r--sys-cluster/torque/metadata.xml14
-rw-r--r--sys-cluster/torque/torque-2.0.0_p8.ebuild156
10 files changed, 933 insertions, 0 deletions
diff --git a/sys-cluster/torque/ChangeLog b/sys-cluster/torque/ChangeLog
new file mode 100644
index 000000000..7ed38ea4e
--- /dev/null
+++ b/sys-cluster/torque/ChangeLog
@@ -0,0 +1,144 @@
+# ChangeLog for sys-cluster/torque
+# Copyright 2000-2006 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v 1.25 2006/01/18 07:51:39 spyderous Exp $
+
+*torque-2.0.0_p8 (15 Mar 2006)
+
+ 15 Mar 2006; Sebastien Fabbro <seb@ist.utl.pt>;
+ +torque-2.0.0_p8.ebuild
+ +files/torque-2.0.0_p8-destdir-fixes.patch
+ +files/torque-2.0.0_p8-makedepend.patch
+ +files/torque-2.0.0_p8-respect-ldflags.patch
+ +files/torque-2.0.0_p8-setuid-safety.patch
+ +files/torque-2.0.0_p8-respect-destdir.patch
+ Version bump. Closes bug #115189. Updated metadata.xml.
+ Thanks to Lukasz Flis <foxman@krosno24.pl> and everyone on the bug.
+
+ 18 Jan 2006; Donnie Berkholz <spyderous@gentoo.org>;
+ torque-1.2.0_p5-r2.ebuild:
+ Add modular X dependencies. Untested, since torque won't compile for me
+ right now, but expected to be the same as openpbs.
+
+*torque-1.2.0_p5-r2 (03 Jan 2006)
+
+ 03 Jan 2006; Joel Martin <kanaka@gentoo.org> +torque-1.2.0_p5-r2.ebuild:
+ Add doc USE to enable docs install
+
+ 05 Sep 2005; Michael Imhof <tantive@gentoo.org> ChangeLog:
+ Stable on x86.
+
+ 15 Aug 2005; Robin H. Johnson <robbat2@gentoo.org>
+ -files/1.2.0_p1-respect-destdir.patch,
+ -files/1.2.0_p1-respect-ldflags.patch, -torque-1.2.0_p1.ebuild,
+ -torque-1.2.0_p1-r1.ebuild, -torque-1.2.0_p1-r2.ebuild,
+ -torque-1.2.0_p1-r3.ebuild:
+ Remove old 1.2.0_p1 ebuilds so we can ditch their overly large patch, and
+ the tree gets ~40k smaller.
+
+ 13 Aug 2005; Robin H. Johnson <robbat2@gentoo.org>
+ torque-1.2.0_p5-r1.ebuild:
+ USE=X needs to bring in Tk for the xpbs interface.
+
+*torque-1.2.0_p5-r1 (13 Aug 2005)
+
+ 13 Aug 2005; Robin H. Johnson <robbat2@gentoo.org>
+ +files/torque-1.2.0_p5-destdir-fixes.patch,
+ +files/torque-1.2.0_p5-setuid-safety.patch, +torque-1.2.0_p5-r1.ebuild:
+ Audit ebuild and package build system, fix more DESTDIR cases (bug #101326),
+ and some setXid linking stuff.
+
+*torque-1.2.0_p5 (11 Aug 2005)
+
+ 11 Aug 2005; Robin H. Johnson <robbat2@gentoo.org>
+ +torque-1.2.0_p5.ebuild:
+ Version bump.
+
+ 11 Aug 2005; Robin H. Johnson <robbat2@gentoo.org>
+ torque-1.2.0_p1-r3.ebuild:
+ Preserve server_name where possible.
+
+ 21 Jul 2005; Robin H. Johnson <robbat2@gentoo.org>
+ torque-1.2.0_p1-r3.ebuild:
+ More directory fun with torque. Now using an env.d file to keep the
+ directories their, otherwise the unmerge phase of the old package zaps them.
+
+*torque-1.2.0_p1-r3 (21 Jul 2005)
+
+ 21 Jul 2005; Robin H. Johnson <robbat2@gentoo.org>
+ +torque-1.2.0_p1-r3.ebuild:
+ Redo spool directory stuff again, as torque still complains at me. Also move
+ patches to mirrors, esp as the one is larger than the size limit.
+
+ 12 Jul 2005; Robin H. Johnson <robbat2@gentoo.org>
+ torque-1.2.0_p1-r2.ebuild:
+ Missed one more directory. Make sure it exists else you get strange errors.
+
+ 12 Jul 2005; Robin H. Johnson <robbat2@gentoo.org>
+ torque-1.2.0_p1-r2.ebuild:
+ Ensure that torque directories exist always. keepdir is not safe on them
+ either.
+
+ 07 Jul 2005; Markus Rothe <corsair@gentoo.org> torque-1.2.0_p1-r2.ebuild:
+ added ~ppc64
+
+*torque-1.2.0_p1-r2 (05 Jul 2005)
+
+ 05 Jul 2005; Robin H. Johnson <robbat2@gentoo.org>
+ +torque-1.2.0_p1-r2.ebuild:
+ Revision bump for new virtual/pbs and shared init scripts. Fix libpbs location.
+
+*torque-1.2.0_p1-r1 (05 Jul 2005)
+
+ 05 Jul 2005; Robin H. Johnson <robbat2@gentoo.org>
+ +files/1.2.0_p1-respect-destdir.patch, +torque-1.2.0_p1-r1.ebuild:
+ Fix bugs #97548 and #97552 - use proper DESTDIR for install and libs into
+ /usr/$libdir/torque/.
+
+ 10 Jun 2005; Robin H. Johnson <robbat2@gentoo.org> torque-1.0.1_p6.ebuild,
+ torque-1.2.0_p1.ebuild:
+ Add DEPEND on sys-apps/ed, and make sure makedepend-sh uses $TMPDIR.
+
+*torque-1.0.1_p6 (15 Mar 2005)
+
+ 15 Mar 2005; Seemant Kulleen <seemant@gentoo.org> -torque-1.0.1-r6.ebuild,
+ +torque-1.0.1_p6.ebuild:
+ This update to _p6 from -r6 changes nothing functionally. Just a saner
+ nameing convention, and no clobbering the global context with the cat | sed
+ business, and also no overriding of and so on
+
+ 15 Mar 2005; Seemant Kulleen <seemant@gentoo.org> torque-1.0.1-r6.ebuild:
+ fix the sed in global scope nonsense, though I do believe the package itself
+ should not depend on the revision number
+
+ 20 Feb 2005; Donnie Berkholz <spyderous@gentoo.org>; +metadata.xml:
+ Add metadata -- owned by cluster herd.
+
+*torque-1.2.0_p1 (20 Feb 2005)
+
+ 20 Feb 2005; Donnie Berkholz <spyderous@gentoo.org>;
+ +files/1.2.0_p1-respect-ldflags.patch, +torque-1.2.0_p1.ebuild:
+ (#74483) Version bump. Also cleaned up the ebuild a bit and silenced QA
+ warnings about lazily bound suid binaries.
+
+ 08 Aug 2004; Tom Martin <slarti@gentoo.org> torque-1.0.1-r6.ebuild:
+ Typo in DESCRIPTION: queueing -> queuing. Bug 59717.
+
+ 01 Jul 2004; Jeremy Huddleston <eradicator@gentoo.org>
+ torque-1.0.1-r6.ebuild:
+ virtual/glibc -> virtual/libc
+
+ 13 Jun 2004; Donnie Berkholz <spyderous@gentoo.org>; torque-1.0.1-r6.ebuild:
+ Change x11-base/xfree dependency to virtual/x11 (#52153). This package still
+ seems broken in other ways though -- for example xpbsmon looks for something
+ in $D.
+
+ 25 Apr 2004; David Holm <dholm@gentoo.org> torque-1.0.1-r6.ebuild:
+ Added to ~ppc.
+
+*torque-1.0.1-r6 (23 Apr 2004)
+
+ 23 Apr 2004; Michael Imhof <tantive@gentoo.org> torque-1.0.1-r6.ebuild, files/pbs.rc:
+ New ebuild. Submitted by Joseph Spadavecchia <j.spadavecchia@ed.ac.uk>.
+ Closes #47986.
+
+
diff --git a/sys-cluster/torque/Manifest b/sys-cluster/torque/Manifest
index a4015e643..bddc5ce02 100644
--- a/sys-cluster/torque/Manifest
+++ b/sys-cluster/torque/Manifest
@@ -1,7 +1,16 @@
+MD5 8f4ec2f75f76444de417537a72180200 ChangeLog 5441
MD5 a86d41db4f868c9baa3365bb96c60e5f files/digest-torque-2.0.0_p7 67
+MD5 cf4938ca2752c9563ec72aac156f6b47 files/digest-torque-2.0.0_p8 67
MD5 7647c23d0d5189ae7a9c2a4322ce1bb6 files/torque-2.0.0_p5-destdir-fixes.patch 539
MD5 5f41eb14cea3408472c133849550faef files/torque-2.0.0_p5-makedepend.patch 754
MD5 3ea9d3a2e1cff3ccd224f0e0b33da6d5 files/torque-2.0.0_p5-respect-ldflags.patch 2710
MD5 f362dc4addcab08a5d537913b99c9484 files/torque-2.0.0_p5-setuid-safety.patch 997
MD5 b551147a374f034bf251490ce985be6b files/torque-2.0.0_p7-respect-destdir.patch 21832
+MD5 7647c23d0d5189ae7a9c2a4322ce1bb6 files/torque-2.0.0_p8-destdir-fixes.patch 539
+MD5 5f41eb14cea3408472c133849550faef files/torque-2.0.0_p8-makedepend.patch 754
+MD5 b551147a374f034bf251490ce985be6b files/torque-2.0.0_p8-respect-destdir.patch 21832
+MD5 3ea9d3a2e1cff3ccd224f0e0b33da6d5 files/torque-2.0.0_p8-respect-ldflags.patch 2710
+MD5 f362dc4addcab08a5d537913b99c9484 files/torque-2.0.0_p8-setuid-safety.patch 997
+MD5 1d77d1dcb8d09671b9a4a67d07ada6ef metadata.xml 647
MD5 c9bcf93e9f31d3c5968db2365e5c621c torque-2.0.0_p7.ebuild 4583
+MD5 7c3b36c81c31d96bbee3f05fd5134787 torque-2.0.0_p8.ebuild 4561
diff --git a/sys-cluster/torque/files/digest-torque-2.0.0_p8 b/sys-cluster/torque/files/digest-torque-2.0.0_p8
new file mode 100644
index 000000000..0fbf11a9c
--- /dev/null
+++ b/sys-cluster/torque/files/digest-torque-2.0.0_p8
@@ -0,0 +1 @@
+MD5 fb6b41305dde9124951164e55f025da4 torque-2.0.0p8.tar.gz 2301494
diff --git a/sys-cluster/torque/files/torque-2.0.0_p8-destdir-fixes.patch b/sys-cluster/torque/files/torque-2.0.0_p8-destdir-fixes.patch
new file mode 100644
index 000000000..f13af48d0
--- /dev/null
+++ b/sys-cluster/torque/files/torque-2.0.0_p8-destdir-fixes.patch
@@ -0,0 +1,13 @@
+diff -urN torque-2.0.0p2/src/gui/Makefile.in torque-2.0.0p20patched/src/gui/Makefile.in
+--- torque-2.0.0p2/src/gui/Makefile.in 2005-12-11 14:05:12.000000000 +0100
++++ torque-2.0.0p2patched/src/gui/Makefile.in 2005-12-11 14:03:23.000000000 +0100
+@@ -155,7 +155,7 @@
+ #
+ @echo Install xpbs
+ $(INSTALL) -m 755 xpbs $(DESTDIR)$(bindir)/xpbs
+- @chmod 755 $(bindir)/xpbs 2> /dev/null
++ @chmod 755 $(DESTDIR)$(bindir)/xpbs 2> /dev/null
+ #
+ $(INSTALL) -m 755 buildindex $(DESTDIR)$(XPBS_LIB)
+ $(INSTALL) -m 644 xpbsrc $(DESTDIR)$(XPBS_LIB)
+
diff --git a/sys-cluster/torque/files/torque-2.0.0_p8-makedepend.patch b/sys-cluster/torque/files/torque-2.0.0_p8-makedepend.patch
new file mode 100644
index 000000000..7e707c0c8
--- /dev/null
+++ b/sys-cluster/torque/files/torque-2.0.0_p8-makedepend.patch
@@ -0,0 +1,17 @@
+--- torque-2.0.0p5/buildutils/makedepend-sh.old 2005-12-15 21:14:28.000000000 -0500
++++ torque-2.0.0p5/buildutils/makedepend-sh 2006-01-23 12:39:36.000000000 -0500
+@@ -572,11 +572,11 @@
+ #
+ test -n "$mksrcs" && echo $d/$s >> $SRCS
+ test "$verbose" -lt 2 && errout='2> /dev/null'
+-
++
+ eval $CPP $arg_cc $d/$s $errout | \
+ sed -n -e "s;^\# [0-9][0-9 ]*\"\(.*\)\";$f: \1;p" | \
+- grep -v "//\$" | \
+- grep -v "$s\$" | grep -v command | grep -v built-in | \
++ grep -v "$s\$" | \
++ grep -v ">$" | \
+ sed -e 's;\([^ :]*: [^ ]*\).*;\1;' \
+ >> $TMP
+ ;;
diff --git a/sys-cluster/torque/files/torque-2.0.0_p8-respect-destdir.patch b/sys-cluster/torque/files/torque-2.0.0_p8-respect-destdir.patch
new file mode 100644
index 000000000..69831bad4
--- /dev/null
+++ b/sys-cluster/torque/files/torque-2.0.0_p8-respect-destdir.patch
@@ -0,0 +1,493 @@
+diff -urN torque-2.0.0p2.orig/buildutils/mkincludes/lib.mk.in torque-2.0.0p2/buildutils/mkincludes/lib.mk.in
+--- torque-2.0.0p2.orig/buildutils/mkincludes/lib.mk.in 2005-11-09 18:30:21.000000000 +0100
++++ torque-2.0.0p2/buildutils/mkincludes/lib.mk.in 2005-12-11 02:51:06.000000000 +0100
+@@ -16,7 +16,7 @@
+
+ install:: $(TARGET)
+ @# a two step process is best to work around broken installs
+- $(INSTALL) -d $(libdir) && \
+- $(INSTALL) -m 644 $(TARGET) $(libdir)/$(TARGET)
++ $(INSTALL) -d $(DESTDIR)$(libdir) && \
++ $(INSTALL) -m 644 $(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
+
+ # END lib.mk
+diff -urN torque-2.0.0p2.orig/buildutils/pbs_mkdirs.in torque-2.0.0p2/buildutils/pbs_mkdirs.in
+--- torque-2.0.0p2.orig/buildutils/pbs_mkdirs.in 2005-11-09 18:30:21.000000000 +0100
++++ torque-2.0.0p2/buildutils/pbs_mkdirs.in 2005-12-11 02:51:06.000000000 +0100
+@@ -140,6 +140,7 @@
+ # dlist will contain a list of directory names to make
+ id_dlist=""
+
++ id_dname=${DESTDIR}$id_dname
+ while [ ! \( -z "$id_dname" -o "$id_dname" = / -o \
+ "$id_dname" = "." \) ]; do
+
+@@ -188,15 +189,15 @@
+ echo $idv_dvarname exists and is not a directory 1>&2
+ return 1
+ elif [ -d $idv_dname ] ; then
+- chmod $idv_mode $idv_dname
+- test -n "$idv_owner" && chown $idv_owner $idv_dname
++ chmod $idv_mode ${DESTDIR}$idv_dname > /dev/null 2>&1
++ test -n "$idv_owner" && chown $idv_owner ${DESTDIR}$idv_dname > /dev/null 2>&1
+ return 0
+ elif [ ! -d $idv_dname ] ; then
+ test -n "$verbose" && echo Creating $idv_dname
+ install_dir `dirname $idv_dname` 755 $idv_owner && \
+- mkdir $idv_dname && chmod $idv_mode $idv_dname || return 1
++ mkdir ${DESTDIR}$idv_dname && chmod $idv_mode ${DESTDIR}$idv_dname || return 1
+ if test -n "$idv_owner"; then
+- chown $idv_owner $idv_name || return 1
++ chown $idv_owner ${DESTDIR}$idv_name || return 1
+ fi
+
+ fi
+@@ -207,6 +208,7 @@
+ check_env()
+ {
+ test -n "$verbose" && echo Making environment file
++ PBS_ENVIRON="${DESTDIR}${PBS_ENVIRON}"
+ if [ ! -f $PBS_ENVIRON ] ; then
+ install_dir `dirname $PBS_ENVIRON`
+ echo "PATH=/bin:/usr/bin" > $PBS_ENVIRON
+@@ -324,6 +326,7 @@
+ # if default already exists, leave alone
+
+ # solaris fails on '-e', use '-f'
++ PBS_DEFAULT_FILE="${DESTDIR}${PBS_DEFAULT_FILE}"
+ if [ ! -f $PBS_DEFAULT_FILE ]; then
+ rm -f $PBS_DEFAULT_FILE > /dev/null 2>&1
+ echo $PBS_DEFAULT_SERVER > $PBS_DEFAULT_FILE && \
+diff -urN torque-2.0.0p2.orig/doc/Makefile.in torque-2.0.0p2/doc/Makefile.in
+--- torque-2.0.0p2.orig/doc/Makefile.in 2005-11-11 20:49:57.000000000 +0100
++++ torque-2.0.0p2/doc/Makefile.in 2005-12-11 02:56:26.000000000 +0100
+@@ -196,49 +196,49 @@
+
+ install1: ${MAN1}
+ @echo Installing section 1 man pages
+- @$(INSTALL) -d -m 755 $(PBS_MAN) && \
+- $(INSTALL) -d -m 755 $(PBS_MAN1) && \
++ @$(INSTALL) -d -m 755 $(DESTDIR)$(PBS_MAN) && \
++ $(INSTALL) -d -m 755 $(DESTDIR)$(PBS_MAN1) && \
+ for t in $?; do \
+ tt=`basename $$t B`; \
+- ${SOELIM} -d $(DOCSRC)/ers $$t | sed -e 's/^\.Sh/.SH/' >${PBS_MAN1}/$${tt}$(MAN_SUFFIX); \
+- chmod 644 ${PBS_MAN1}/$${tt}$(MAN_SUFFIX); \
++ ${SOELIM} -d $(DOCSRC)/ers $$t | sed -e 's/^\.Sh/.SH/' >$(DESTDIR)${PBS_MAN1}/$${tt}$(MAN_SUFFIX); \
++ chmod 644 $(DESTDIR)${PBS_MAN1}/$${tt}$(MAN_SUFFIX); \
+ done
+
+ install3: $(MAN3)
+ @echo Installing section 3 man pages
+- @$(INSTALL) -d -m 755 $(PBS_MAN) && \
+- $(INSTALL) -d -m 755 $(PBS_MAN3) && \
++ @$(INSTALL) -d -m 755 $(DESTDIR)$(PBS_MAN) && \
++ $(INSTALL) -d -m 755 $(DESTDIR)$(PBS_MAN3) && \
+ for t in $?; do \
+ tt=`basename $$t B`; \
+- ${SOELIM} -d $(DOCSRC)/ers $$t | sed -e 's/^\.Sh/.SH/' >${PBS_MAN3}/$${tt}$(MAN_SUFFIX); \
+- chmod 644 ${PBS_MAN3}/$${tt}$(MAN_SUFFIX); \
++ ${SOELIM} -d $(DOCSRC)/ers $$t | sed -e 's/^\.Sh/.SH/' >$(DESTDIR)${PBS_MAN3}/$${tt}$(MAN_SUFFIX); \
++ chmod 644 $(DESTDIR)${PBS_MAN3}/$${tt}$(MAN_SUFFIX); \
+ done
+
+ install7: $(MAN7)
+ @echo Installing section 7 man pages
+- @$(INSTALL) -d -m 755 $(PBS_MAN) && \
+- $(INSTALL) -d -m 755 $(PBS_MAN7) && \
++ @$(INSTALL) -d -m 755 $(DESTDIR)$(PBS_MAN) && \
++ $(INSTALL) -d -m 755 $(DESTDIR)$(PBS_MAN7) && \
+ for t in $?; do \
+ tt=`basename $$t B`; \
+- ${SOELIM} -d $(DOCSRC)/ers $$t | sed -e 's/^\.Sh/.SH/' >${PBS_MAN7}/$${tt}$(MAN_SUFFIX); \
+- chmod 644 ${PBS_MAN7}/$${tt}$(MAN_SUFFIX); \
++ ${SOELIM} -d $(DOCSRC)/ers $$t | sed -e 's/^\.Sh/.SH/' >$(DESTDIR)${PBS_MAN7}/$${tt}$(MAN_SUFFIX); \
++ chmod 644 $(DESTDIR)${PBS_MAN7}/$${tt}$(MAN_SUFFIX); \
+ done
+- @rm -f ${PBS_MAN7}/pbs_resources.7$(MAN_SUFFIX)
+- @if test -f ${PBS_MAN7}/pbs_resources_$(DEFAULT_MAN_RESOURCE_TYPE).7$(MAN_SUFFIX) ;then \
+- ln ${PBS_MAN7}/pbs_resources_$(DEFAULT_MAN_RESOURCE_TYPE).7$(MAN_SUFFIX) ${PBS_MAN7}/pbs_resources.7$(MAN_SUFFIX); \
++ @rm -f $(DESTDIR)${PBS_MAN7}/pbs_resources.7$(MAN_SUFFIX)
++ @if test -f $(DESTDIR)${PBS_MAN7}/pbs_resources_$(DEFAULT_MAN_RESOURCE_TYPE).7$(MAN_SUFFIX) ;then \
++ ln $(DESTDIR)${PBS_MAN7}/pbs_resources_$(DEFAULT_MAN_RESOURCE_TYPE).7$(MAN_SUFFIX) $(DESTDIR)${PBS_MAN7}/pbs_resources.7$(MAN_SUFFIX); \
+ fi
+
+ install8: $(MAN8)
+ @echo Installing section 8 man pages
+- @$(INSTALL) -d -m 755 $(PBS_MAN) && \
+- $(INSTALL) -d -m 755 $(PBS_MAN8) && \
++ @$(INSTALL) -d -m 755 $(DESTDIR)$(PBS_MAN) && \
++ $(INSTALL) -d -m 755 $(DESTDIR)$(PBS_MAN8) && \
+ for t in $?; do \
+ tt=`basename $$t B`; \
+- ${SOELIM} -d $(DOCSRC)/ers $$t | sed -e 's/^\.Sh/.SH/' >${PBS_MAN8}/$${tt}$(MAN_SUFFIX); \
+- chmod 644 ${PBS_MAN8}/$${tt}$(MAN_SUFFIX); \
++ ${SOELIM} -d $(DOCSRC)/ers $$t | sed -e 's/^\.Sh/.SH/' >$(DESTDIR)${PBS_MAN8}/$${tt}$(MAN_SUFFIX); \
++ chmod 644 $(DESTDIR)${PBS_MAN8}/$${tt}$(MAN_SUFFIX); \
+ done
+- @rm -f ${PBS_MAN8}/pbs_sched.8$(MAN_SUFFIX)
+- @case ${SCHD_TYPE} in cc|tcl|basl) ln ${PBS_MAN8}/pbs_sched_${SCHD_TYPE}.8$(MAN_SUFFIX) ${PBS_MAN8}/pbs_sched.8$(MAN_SUFFIX);; esac
++ @rm -f $(DESTDIR)${PBS_MAN8}/pbs_sched.8$(MAN_SUFFIX)
++ @case ${SCHD_TYPE} in cc|tcl|basl) ln $(DESTDIR)${PBS_MAN8}/pbs_sched_${SCHD_TYPE}.8$(MAN_SUFFIX) $(DESTDIR)${PBS_MAN8}/pbs_sched.8$(MAN_SUFFIX);; esac
+
+ depend::
+
+diff -urN torque-2.0.0p2.orig/src/cmds/Makefile.in torque-2.0.0p2/src/cmds/Makefile.in
+--- torque-2.0.0p2.orig/src/cmds/Makefile.in 2005-11-09 18:30:13.000000000 +0100
++++ torque-2.0.0p2/src/cmds/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -135,12 +135,12 @@
+ $(PBS_MKDIRS) clients
+ $(PBS_MKDIRS) aux
+ $(PBS_MKDIRS) default
+- $(INSTALL) -d -m 755 $(bindir) && \
++ $(INSTALL) -d -m 755 $(DESTDIR)$(bindir) && \
+ for f in $(USER) $(OPER) $(ADMN) $(SCRIPTS) ; do \
+- $(INSTALL) -m 755 $$f $(bindir)/$$f ; \
++ $(INSTALL) -m 755 $$f $(DESTDIR)$(bindir)/$$f ; \
+ done
+ for f in $(SUPP) ; do \
+- $(INSTALL) -m 755 $$f $(sbindir)/$$f ; \
++ $(INSTALL) -m 755 $$f $(DESTDIR)$(sbindir)/$$f ; \
+ done
+
+ #
+diff -urN torque-2.0.0p2.orig/src/gui/Ccode/Makefile.in torque-2.0.0p2/src/gui/Ccode/Makefile.in
+--- torque-2.0.0p2.orig/src/gui/Ccode/Makefile.in 2005-11-09 18:30:12.000000000 +0100
++++ torque-2.0.0p2/src/gui/Ccode/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -115,9 +115,9 @@
+ build: $(TARGETS)
+
+ install: build
+- -test -d $(XPBS_LIB)/bin || $(INSTALL) -d $(XPBS_LIB)/bin
++ -test -d $(DESTDIR)$(XPBS_LIB)/bin || $(INSTALL) -d $(DESTDIR)$(XPBS_LIB)/bin
+ for f in $(TARGETS); do \
+- $(INSTALL) -m 755 $$f $(XPBS_LIB)/bin; \
++ $(INSTALL) -m 755 $$f $(DESTDIR)$(XPBS_LIB)/bin; \
+ done
+
+ DFLT_ACTION = $(CC) $(CFLAGS) $@.o -o $@ $(LIBRARIES)
+diff -urN torque-2.0.0p2.orig/src/gui/Makefile.in torque-2.0.0p2/src/gui/Makefile.in
+--- torque-2.0.0p2.orig/src/gui/Makefile.in 2005-11-09 18:30:12.000000000 +0100
++++ torque-2.0.0p2/src/gui/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -133,34 +133,34 @@
+ @MAKE_POSIX_PLUS@@echo Making in Ccode for xpbs; cd Ccode; $(MAKE) all
+
+ install: build
+- test -d $(XPBS_LIB) || $(INSTALL) -m 755 -d $(XPBS_LIB)
+- test -d $(XPBS_LIB)/bitmaps || $(INSTALL) -m 755 -d $(XPBS_LIB)/bitmaps
+- test -d $(XPBS_LIB)/help || $(INSTALL) -m 755 -d $(XPBS_LIB)/help
++ test -d $(DESTDIR)$(XPBS_LIB) || $(INSTALL) -m 755 -d $(DESTDIR)$(XPBS_LIB)
++ test -d $(DESTDIR)$(XPBS_LIB)/bitmaps || $(INSTALL) -m 755 -d $(DESTDIR)$(XPBS_LIB)/bitmaps
++ test -d $(DESTDIR)$(XPBS_LIB)/help || $(INSTALL) -m 755 -d $(DESTDIR)$(XPBS_LIB)/help
+ #
+ for f in $(srcdir)/bitmaps/*; do \
+- test -f $$f && $(INSTALL) -m 644 $$f $(XPBS_LIB)/bitmaps; \
++ test -f $$f && $(INSTALL) -m 644 $$f $(DESTDIR)$(XPBS_LIB)/bitmaps; \
+ done
+ #
+ for f in $(srcdir)/help/*.hlp; do \
+- $(INSTALL) -m 644 $$f $(XPBS_LIB)/help; \
++ $(INSTALL) -m 644 $$f $(DESTDIR)$(XPBS_LIB)/help; \
+ done
+ #
+ @cd Ccode; $(MAKE) install
+ #
+ for f in $(srcdir)/*.tcl $(srcdir)/*.tk; do \
+- $(INSTALL) -m 644 $$f $(XPBS_LIB); \
++ $(INSTALL) -m 644 $$f $(DESTDIR)$(XPBS_LIB); \
+ done
+ #
+ # install xpbs changing the location of libdir and appdefdir
+ #
+ @echo Install xpbs
+- $(INSTALL) -m 755 xpbs $(bindir)/xpbs
++ $(INSTALL) -m 755 xpbs $(DESTDIR)$(bindir)/xpbs
+ @chmod 755 $(bindir)/xpbs 2> /dev/null
+ #
+- $(INSTALL) -m 755 buildindex $(XPBS_LIB)
+- $(INSTALL) -m 644 xpbsrc $(XPBS_LIB)
++ $(INSTALL) -m 755 buildindex $(DESTDIR)$(XPBS_LIB)
++ $(INSTALL) -m 644 xpbsrc $(DESTDIR)$(XPBS_LIB)
+ #
+- cd $(XPBS_LIB) && ./buildindex $(XPBS_LIB) && chmod 644 tclIndex
++ cd $(DESTDIR)$(XPBS_LIB) && ./buildindex $(DESTDIR)$(XPBS_LIB) && chmod 644 tclIndex
+
+
+ distclean clean::
+diff -urN torque-2.0.0p2.orig/src/iff/Makefile.in torque-2.0.0p2/src/iff/Makefile.in
+--- torque-2.0.0p2.orig/src/iff/Makefile.in 2005-11-09 18:30:16.000000000 +0100
++++ torque-2.0.0p2/src/iff/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -110,8 +110,8 @@
+ build: $(TARGET)
+
+ install: $(TARGET)
+- @$(INSTALL) -d -m 755 $(sbindir) && \
+- $(INSTALL) -m 4755 $(TARGET) $(sbindir)
++ @$(INSTALL) -d -m 755 $(DESTDIR)$(sbindir) && \
++ $(INSTALL) -m 4755 $(TARGET) $(DESTDIR)$(sbindir)
+
+ pbs_iff: $(OBJS) $(PBS_LIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(PBS_LIBS) $(LIBS)
+diff -urN torque-2.0.0p2.orig/src/include/Makefile.in torque-2.0.0p2/src/include/Makefile.in
+--- torque-2.0.0p2.orig/src/include/Makefile.in 2005-11-09 18:30:14.000000000 +0100
++++ torque-2.0.0p2/src/include/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -146,9 +146,9 @@
+
+
+ install:
+- @$(INSTALL) -d -m 755 $(includedir) && \
++ @$(INSTALL) -d -m 755 $(DESTDIR)$(includedir) && \
+ for f in $(USERH); do \
+- $(INSTALL) -m 444 $$f $(includedir); \
++ $(INSTALL) -m 444 $$f $(DESTDIR)$(includedir); \
+ done
+
+ clean::
+diff -urN torque-2.0.0p2.orig/src/mom_rcp/Makefile.in torque-2.0.0p2/src/mom_rcp/Makefile.in
+--- torque-2.0.0p2.orig/src/mom_rcp/Makefile.in 2005-11-09 18:30:17.000000000 +0100
++++ torque-2.0.0p2/src/mom_rcp/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -111,8 +111,8 @@
+ build: $(TARGET)
+
+ install: $(TARGET)
+- $(INSTALL) -d $(sbindir)
+- $(INSTALL) -m 4755 $(TARGET) $(sbindir)
++ $(INSTALL) -d $(DESTDIR)$(sbindir)
++ $(INSTALL) -m 4755 $(TARGET) $(DESTDIR)$(sbindir)
+
+ $(TARGET): $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
+diff -urN torque-2.0.0p2.orig/src/resmom/Makefile.in torque-2.0.0p2/src/resmom/Makefile.in
+--- torque-2.0.0p2.orig/src/resmom/Makefile.in 2005-11-09 18:30:10.000000000 +0100
++++ torque-2.0.0p2/src/resmom/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -142,8 +142,8 @@
+ install: build
+ $(PBS_MKDIRS) mom
+ $(PBS_MKDIRS) aux
+- @$(INSTALL) -d -m 755 $(sbindir) && \
+- $(INSTALL) -m 700 $(TARGET) $(sbindir)
++ @$(INSTALL) -d -m 755 $(DESTDIR)$(sbindir) && \
++ $(INSTALL) -m 700 $(TARGET) $(DESTDIR)$(sbindir)
+
+ pbs_mom: $(OBJS) $(PBSLIBS)
+ $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(PBSLIBS) $(LIBS) $(MOMLIBS)
+diff -urN torque-2.0.0p2.orig/src/scheduler.basl/Makefile.in torque-2.0.0p2/src/scheduler.basl/Makefile.in
+--- torque-2.0.0p2.orig/src/scheduler.basl/Makefile.in 2005-11-09 18:30:20.000000000 +0100
++++ torque-2.0.0p2/src/scheduler.basl/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -124,10 +124,10 @@
+ build: $(TARGETS)
+
+ install: build
+- $(INSTALL) -d -m 755 $(bindir) && \
+- $(INSTALL) -m 755 basl2c $(bindir) ; \
+- $(INSTALL) -d -m 755 $(sbindir) && \
+- $(INSTALL) -m 700 pbs_sched $(sbindir)
++ $(INSTALL) -d -m 755 $(DESTDIR)$(bindir) && \
++ $(INSTALL) -m 755 basl2c $(DESTDIR)$(bindir) ; \
++ $(INSTALL) -d -m 755 $(DESTDIR)$(sbindir) && \
++ $(INSTALL) -m 700 pbs_sched $(DESTDIR)$(sbindir)
+
+ basl2c: $(OBJS_COMMON) $(OBJS_COMP)
+ $(CC) $(CFLAGS) -o $@ $(OBJS_COMMON) $(OBJS_COMP) $(LIBRARIES)
+diff -urN torque-2.0.0p2.orig/src/scheduler.cc/Makefile.in torque-2.0.0p2/src/scheduler.cc/Makefile.in
+--- torque-2.0.0p2.orig/src/scheduler.cc/Makefile.in 2005-11-09 18:30:17.000000000 +0100
++++ torque-2.0.0p2/src/scheduler.cc/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -123,8 +123,8 @@
+
+ install: build
+ @MAKE_POSIX_PLUS@@cd $(SCHD_BUILD) && $(MAKE) install
+- @$(INSTALL) -d -m 755 $(sbindir) && \
+- $(INSTALL) -m 700 $(TARGET) $(sbindir)
++ @$(INSTALL) -d -m 755 $(DESTDIR)$(sbindir) && \
++ $(INSTALL) -m 700 $(TARGET) $(DESTDIR)$(sbindir)
+
+ $(TARGET): $(OBJS) $(SCHEDLIB)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(SCHEDLIB) $(PBSLIBS) $(LIBS)
+diff -urN torque-2.0.0p2.orig/src/scheduler.cc/samples/cray_t3e/Makefile.in torque-2.0.0p2/src/scheduler.cc/samples/cray_t3e/Makefile.in
+--- torque-2.0.0p2.orig/src/scheduler.cc/samples/cray_t3e/Makefile.in 2005-11-09 18:30:17.000000000 +0100
++++ torque-2.0.0p2/src/scheduler.cc/samples/cray_t3e/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -161,11 +161,11 @@
+
+ install:: $(TARGET)
+ @# a two step process is best to work around broken installs
+- $(INSTALL) -d $(libdir) && \
+- $(INSTALL) -m 644 $(TARGET) $(libdir)/$(TARGET)
++ $(INSTALL) -d $(DESTDIR)$(libdir) && \
++ $(INSTALL) -m 644 $(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
+ @for f in $(SCHD_CONFIGS); do \
+- test -f $(PBS_SERVER_HOME)/sched_priv/$$f || \
+- $(INSTALL) -m 644 $(srcdir)/$$f $(PBS_SERVER_HOME)/sched_priv; \
++ test -f $(DESTDIR)$(PBS_SERVER_HOME)/sched_priv/$$f || \
++ $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(PBS_SERVER_HOME)/sched_priv; \
+ done
+
+ @mk_cleanup@
+diff -urN torque-2.0.0p2.orig/src/scheduler.cc/samples/dec_cluster/Makefile.in torque-2.0.0p2/src/scheduler.cc/samples/dec_cluster/Makefile.in
+--- torque-2.0.0p2.orig/src/scheduler.cc/samples/dec_cluster/Makefile.in 2005-11-09 18:30:18.000000000 +0100
++++ torque-2.0.0p2/src/scheduler.cc/samples/dec_cluster/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -109,8 +109,8 @@
+ install::
+ @echo Installing scheduler config file
+ @for f in $(SCHD_CONFIG); do \
+- test -f $(PBS_SERVER_HOME)/sched_priv/$$f || \
+- $(INSTALL) -m 644 $(srcdir)/$$f $(PBS_SERVER_HOME)/sched_priv; \
++ test -f $(DESTDIR)$(PBS_SERVER_HOME)/sched_priv/$$f || \
++ $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(PBS_SERVER_HOME)/sched_priv; \
+ done
+
+ @mk_cleanup@
+diff -urN torque-2.0.0p2.orig/src/scheduler.cc/samples/fifo/Makefile.in torque-2.0.0p2/src/scheduler.cc/samples/fifo/Makefile.in
+--- torque-2.0.0p2.orig/src/scheduler.cc/samples/fifo/Makefile.in 2005-11-09 18:30:17.000000000 +0100
++++ torque-2.0.0p2/src/scheduler.cc/samples/fifo/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -110,8 +110,8 @@
+ install::
+ @echo Installing other scheduler config files
+ @for f in $(SCHD_CONFIGS); do \
+- test -f $(PBS_SERVER_HOME)/sched_priv/$$f || \
+- $(INSTALL) -m 644 $(srcdir)/$$f $(PBS_SERVER_HOME)/sched_priv; \
++ test -f $(DESTDIR)$(PBS_SERVER_HOME)/sched_priv/$$f || \
++ $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(PBS_SERVER_HOME)/sched_priv; \
+ done
+
+ @mk_cleanup@
+diff -urN torque-2.0.0p2.orig/src/scheduler.cc/samples/msic_cluster/Makefile.in torque-2.0.0p2/src/scheduler.cc/samples/msic_cluster/Makefile.in
+--- torque-2.0.0p2.orig/src/scheduler.cc/samples/msic_cluster/Makefile.in 2005-11-09 18:30:19.000000000 +0100
++++ torque-2.0.0p2/src/scheduler.cc/samples/msic_cluster/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -130,8 +130,8 @@
+ install::
+ @echo Installing scheduler config file
+ @for f in $(SCHD_CONFIG); do \
+- test -f $(PBS_SERVER_HOME)/sched_priv/$$f || \
+- $(INSTALL) -m 644 $(srcdir)/$$f $(PBS_SERVER_HOME)/sched_priv; \
++ test -f $(DESTDIR)$(PBS_SERVER_HOME)/sched_priv/$$f || \
++ $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(PBS_SERVER_HOME)/sched_priv; \
+ done
+
+ @mk_cleanup@
+diff -urN torque-2.0.0p2.orig/src/scheduler.cc/samples/sgi_origin/Makefile.in torque-2.0.0p2/src/scheduler.cc/samples/sgi_origin/Makefile.in
+--- torque-2.0.0p2.orig/src/scheduler.cc/samples/sgi_origin/Makefile.in 2005-11-09 18:30:19.000000000 +0100
++++ torque-2.0.0p2/src/scheduler.cc/samples/sgi_origin/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -165,11 +165,11 @@
+
+ install:: $(TARGET)
+ @# a two step process is best to work around broken installs
+- $(INSTALL) -d $(libdir) && \
+- $(INSTALL) -m 644 $(TARGET) $(libdir)/$(TARGET)
++ $(INSTALL) -d $(DESTDIR)$(libdir) && \
++ $(INSTALL) -m 644 $(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
+ @for f in $(SCHD_CONFIGS); do \
+- test -f $(PBS_SERVER_HOME)/sched_priv/$$f || \
+- $(INSTALL) -m 644 $(srcdir)/$$f $(PBS_SERVER_HOME)/sched_priv; \
++ test -f $(DESTDIR)$(PBS_SERVER_HOME)/sched_priv/$$f || \
++ $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(PBS_SERVER_HOME)/sched_priv; \
+ done
+
+ @mk_cleanup@
+diff -urN torque-2.0.0p2.orig/src/scheduler.cc/samples/umn_cluster/Makefile.in torque-2.0.0p2/src/scheduler.cc/samples/umn_cluster/Makefile.in
+--- torque-2.0.0p2.orig/src/scheduler.cc/samples/umn_cluster/Makefile.in 2005-11-09 18:30:18.000000000 +0100
++++ torque-2.0.0p2/src/scheduler.cc/samples/umn_cluster/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -120,8 +120,8 @@
+ install::
+ @echo Installing scheduler config file
+ @for f in $(SCHD_CONFIG); do \
+- test -f $(PBS_SERVER_HOME)/sched_priv/$$f || \
+- $(INSTALL) -m 644 $(srcdir)/$$f $(PBS_SERVER_HOME)/sched_priv; \
++ test -f $(DESTDIR)$(PBS_SERVER_HOME)/sched_priv/$$f || \
++ $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(PBS_SERVER_HOME)/sched_priv; \
+ done
+
+ qschedule:
+diff -urN torque-2.0.0p2.orig/src/scheduler.tcl/Makefile.in torque-2.0.0p2/src/scheduler.tcl/Makefile.in
+--- torque-2.0.0p2.orig/src/scheduler.tcl/Makefile.in 2005-11-09 18:30:11.000000000 +0100
++++ torque-2.0.0p2/src/scheduler.tcl/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -115,8 +115,8 @@
+
+
+ install: build
+- @$(INSTALL) -d -m 755 $(sbindir) && \
+- $(INSTALL) -m 700 $(TARGET) $(sbindir)
++ @$(INSTALL) -d -m 755 $(DESTDIR)$(sbindir) && \
++ $(INSTALL) -m 700 $(TARGET) $(DESTDIR)$(sbindir)
+
+ $(TARGET): $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBRARIES)
+diff -urN torque-2.0.0p2.orig/src/server/Makefile.in torque-2.0.0p2/src/server/Makefile.in
+--- torque-2.0.0p2.orig/src/server/Makefile.in 2005-11-09 18:30:21.000000000 +0100
++++ torque-2.0.0p2/src/server/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -168,8 +168,8 @@
+ install: build
+ $(PBS_MKDIRS) server
+ $(PBS_MKDIRS) aux
+- @$(INSTALL) -d -m 755 $(sbindir) && \
+- $(INSTALL) -m 700 $(TARGET) $(sbindir)
++ @$(INSTALL) -d -m 755 $(DESTDIR)$(sbindir) && \
++ $(INSTALL) -m 700 $(TARGET) $(DESTDIR)$(sbindir)
+
+ pbs_server: $(OBJS) $(PBSLIBS)
+ $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(PBSLIBS) $(LIBS)
+diff -urN torque-2.0.0p2.orig/src/tools/Makefile.in torque-2.0.0p2/src/tools/Makefile.in
+--- torque-2.0.0p2.orig/src/tools/Makefile.in 2005-11-09 18:30:11.000000000 +0100
++++ torque-2.0.0p2/src/tools/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -130,9 +130,9 @@
+ build: $(TARGETS)
+
+ install: build
+- test -d $(bindir) || $(INSTALL) -m 755 -d $(bindir)
++ test -d $(bindir) || $(INSTALL) -m 755 -d $(DESTDIR)$(bindir)
+ for f in $(TARGETS); do \
+- $(INSTALL) -m 755 $$f $(bindir); \
++ $(INSTALL) -m 755 $$f $(DESTDIR)$(bindir); \
+ done
+ @MAKE_POSIX_PLUS@@if test -n "$(TK_VER)"; then { cd xpbsmon && $(MAKE) install;} ; fi
+
+diff -urN torque-2.0.0p2.orig/src/tools/xpbsmon/Makefile.in torque-2.0.0p2/src/tools/xpbsmon/Makefile.in
+--- torque-2.0.0p2.orig/src/tools/xpbsmon/Makefile.in 2005-11-09 18:30:11.000000000 +0100
++++ torque-2.0.0p2/src/tools/xpbsmon/Makefile.in 2005-12-11 02:51:06.000000000 +0100
+@@ -129,33 +129,33 @@
+
+
+ install: build
+- test -d $(XPBSMON_LIB) || $(INSTALL) -m 755 -d $(XPBSMON_LIB)
+- test -d $(XPBSMON_LIB)/bitmaps || \
+- $(INSTALL) -m 755 -d $(XPBSMON_LIB)/bitmaps
+- test -d $(XPBSMON_LIB)/help || \
+- $(INSTALL) -m 755 -d $(XPBSMON_LIB)/help
++ test -d $(DESTDIR)$(XPBSMON_LIB) || $(INSTALL) -m 755 -d $(DESTDIR)$(XPBSMON_LIB)
++ test -d $(DESTDIR)$(XPBSMON_LIB)/bitmaps || \
++ $(INSTALL) -m 755 -d $(DESTDIR)$(XPBSMON_LIB)/bitmaps
++ test -d $(DESTDIR)$(XPBSMON_LIB)/help || \
++ $(INSTALL) -m 755 -d $(DESTDIR)$(XPBSMON_LIB)/help
+ #
+ for f in $(srcdir)/bitmaps/*; do \
+- test -f $$f && $(INSTALL) -m 644 $$f $(XPBSMON_LIB)/bitmaps; \
++ test -f $$f && $(INSTALL) -m 644 $$f $(DESTDIR)$(XPBSMON_LIB)/bitmaps; \
+ done
+ #
+ for f in $(srcdir)/help/*.hlp; do \
+- $(INSTALL) -m 644 $$f $(XPBSMON_LIB)/help; \
++ $(INSTALL) -m 644 $$f $(DESTDIR)$(XPBSMON_LIB)/help; \
+ done
+ #
+ for f in $(srcdir)/*.tcl $(srcdir)/*.tk; do \
+- $(INSTALL) -m 644 $$f $(XPBSMON_LIB); \
++ $(INSTALL) -m 644 $$f $(DESTDIR)$(XPBSMON_LIB); \
+ done
+ #
+ # install xpbsmon changing the location of pbs_tclsh and libdir
+ #
+- $(INSTALL) -m 755 xpbsmon $(bindir)/xpbsmon
+- chmod 755 $(bindir)/xpbsmon 2> /dev/null
++ $(INSTALL) -m 755 xpbsmon $(DESTDIR)$(bindir)/xpbsmon
++ chmod 755 $(DESTDIR)$(bindir)/xpbsmon 2> /dev/null
+ #
+- $(INSTALL) -m 755 buildindex $(XPBSMON_LIB)
+- $(INSTALL) -m 644 xpbsmonrc $(XPBSMON_LIB)
++ $(INSTALL) -m 755 buildindex $(DESTDIR)$(XPBSMON_LIB)
++ $(INSTALL) -m 644 xpbsmonrc $(DESTDIR)$(XPBSMON_LIB)
+ #
+- cd $(XPBSMON_LIB) && ./buildindex $(XPBSMON_LIB) && chmod 644 tclIndex
++ cd $(DESTDIR)$(XPBSMON_LIB) && ./buildindex $(DESTDIR)$(XPBSMON_LIB) && chmod 644 tclIndex
+
+ clean::
+ $(RM) tclIndex; exit 0
+
diff --git a/sys-cluster/torque/files/torque-2.0.0_p8-respect-ldflags.patch b/sys-cluster/torque/files/torque-2.0.0_p8-respect-ldflags.patch
new file mode 100644
index 000000000..d60cc5a87
--- /dev/null
+++ b/sys-cluster/torque/files/torque-2.0.0_p8-respect-ldflags.patch
@@ -0,0 +1,61 @@
+diff -urN torque-2.0.0p2.orig/src/iff/Makefile.in torque-2.0.0p2/src/iff/Makefile.in
+--- torque-2.0.0p2.orig/src/iff/Makefile.in 2005-11-09 18:30:16.000000000 +0100
++++ torque-2.0.0p2/src/iff/Makefile.in 2005-12-11 03:01:15.000000000 +0100
+@@ -114,7 +114,7 @@
+ $(INSTALL) -m 4755 $(TARGET) $(sbindir)
+
+ pbs_iff: $(OBJS) $(PBS_LIBS)
+- $(CC) $(CFLAGS) -o $@ $(OBJS) $(PBS_LIBS) $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(PBS_LIBS) $(LIBS)
+
+ @mk_cleanup@
+ @mk_tail@
+diff -urN torque-2.0.0p2.orig/src/mom_rcp/Makefile.in torque-2.0.0p2/src/mom_rcp/Makefile.in
+--- torque-2.0.0p2.orig/src/mom_rcp/Makefile.in 2005-11-09 18:30:17.000000000 +0100
++++ torque-2.0.0p2/src/mom_rcp/Makefile.in 2005-12-11 03:01:15.000000000 +0100
+@@ -115,7 +115,7 @@
+ $(INSTALL) -m 4755 $(TARGET) $(sbindir)
+
+ $(TARGET): $(OBJS)
+- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
+
+
+ # needed for make depend
+diff -urN torque-2.0.0p2.orig/src/scheduler.basl/Makefile.in torque-2.0.0p2/src/scheduler.basl/Makefile.in
+--- torque-2.0.0p2.orig/src/scheduler.basl/Makefile.in 2005-11-09 18:30:20.000000000 +0100
++++ torque-2.0.0p2/src/scheduler.basl/Makefile.in 2005-12-11 03:01:15.000000000 +0100
+@@ -133,7 +133,7 @@
+ $(CC) $(CFLAGS) -o $@ $(OBJS_COMMON) $(OBJS_COMP) $(LIBRARIES)
+
+ pbs_sched: $(OBJS_COMMON) $(OBJS_SCHED)
+- $(CC) $(CFLAGS) -o $@ $(OBJS_COMMON) $(OBJS_SCHED) $(LIBRARIES)
++ $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS_COMMON) $(OBJS_SCHED) $(LIBRARIES)
+
+ pbs_sched.o: $(SCHD_SRC) $(srcdir)/af_system.h $(srcdir)/af_server.h basl2c
+ @if expr $(SCHD_SRC) : '.*\.basl$$' > /dev/null 2>&1; then \
+diff -urN torque-2.0.0p2.orig/src/scheduler.cc/Makefile.in torque-2.0.0p2/src/scheduler.cc/Makefile.in
+--- torque-2.0.0p2.orig/src/scheduler.cc/Makefile.in 2005-11-09 18:30:17.000000000 +0100
++++ torque-2.0.0p2/src/scheduler.cc/Makefile.in 2005-12-11 03:01:15.000000000 +0100
+@@ -127,7 +127,7 @@
+ $(INSTALL) -m 700 $(TARGET) $(sbindir)
+
+ $(TARGET): $(OBJS) $(SCHEDLIB)
+- $(CC) $(CFLAGS) -o $@ $(OBJS) $(SCHEDLIB) $(PBSLIBS) $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(SCHEDLIB) $(PBSLIBS) $(LIBS)
+
+ distclean::
+ -(cd $(SCHD_BUILD) && $(MAKE) $@; exit 0) > /dev/null 2>&1
+diff -urN torque-2.0.0p2.orig/src/scheduler.tcl/Makefile.in torque-2.0.0p2/src/scheduler.tcl/Makefile.in
+--- torque-2.0.0p2.orig/src/scheduler.tcl/Makefile.in 2005-11-09 18:30:11.000000000 +0100
++++ torque-2.0.0p2/src/scheduler.tcl/Makefile.in 2005-12-11 03:01:15.000000000 +0100
+@@ -119,7 +119,7 @@
+ $(INSTALL) -m 700 $(TARGET) $(sbindir)
+
+ $(TARGET): $(OBJS)
+- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBRARIES)
++ $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBRARIES)
+
+ @mk_cleanup@
+ @mk_tail@
+
diff --git a/sys-cluster/torque/files/torque-2.0.0_p8-setuid-safety.patch b/sys-cluster/torque/files/torque-2.0.0_p8-setuid-safety.patch
new file mode 100644
index 000000000..2f4cb28e8
--- /dev/null
+++ b/sys-cluster/torque/files/torque-2.0.0_p8-setuid-safety.patch
@@ -0,0 +1,25 @@
+diff -urN torque-2.0.0p2.org/src/iff/Makefile.in torque-2.0.0p2/src/iff/Makefile.in
+--- torque-2.0.0p2.org/src/iff/Makefile.in 2005-12-11 14:03:23.000000000 +0100
++++ torque-2.0.0p2/src/iff/Makefile.in 2005-12-11 14:12:44.000000000 +0100
+@@ -114,7 +114,7 @@
+ $(INSTALL) -m 4755 $(TARGET) $(DESTDIR)$(sbindir)
+
+ pbs_iff: $(OBJS) $(PBS_LIBS)
+- $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(PBS_LIBS) $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) -Wl,-z,now -o $@ $(OBJS) $(PBS_LIBS) $(LIBS)
+
+ @mk_cleanup@
+ @mk_tail@
+diff -urN torque-2.0.0p2.org/src/mom_rcp/Makefile.in torque-2.0.0p2/src/mom_rcp/Makefile.in
+--- torque-2.0.0p2.org/src/mom_rcp/Makefile.in 2005-12-11 14:03:23.000000000 +0100
++++ torque-2.0.0p2/src/mom_rcp/Makefile.in 2005-12-11 14:13:21.000000000 +0100
+@@ -115,7 +115,7 @@
+ $(INSTALL) -m 4755 $(TARGET) $(DESTDIR)$(sbindir)
+
+ $(TARGET): $(OBJS)
+- $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) -Wl,-z,now -o $@ $(OBJS) $(LIBS)
+
+
+# needed for make depend
+
diff --git a/sys-cluster/torque/metadata.xml b/sys-cluster/torque/metadata.xml
new file mode 100644
index 000000000..9ef5969ba
--- /dev/null
+++ b/sys-cluster/torque/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>cluster</herd>
+<longdescription>
+TORQUE is an open source resource manager providing control over batch
+jobs and distributed compute nodes. It is a community effort based on
+the original *PBS project and, with more than 1,200 patches, has
+incorporated significant advances in the areas of scalability, fault
+tolerance, and feature extensions contributed by NCSA, OSC, USC , the
+U.S. Dept of Energy, Sandia, PNNL, U of Buffalo, TeraGrid, and many
+other leading edge HPC organizations.
+<longdescription>
+</pkgmetadata>
diff --git a/sys-cluster/torque/torque-2.0.0_p8.ebuild b/sys-cluster/torque/torque-2.0.0_p8.ebuild
new file mode 100644
index 000000000..537364a93
--- /dev/null
+++ b/sys-cluster/torque/torque-2.0.0_p8.ebuild
@@ -0,0 +1,156 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+
+inherit flag-o-matic eutils
+
+MY_P="${P/_}"
+DESCRIPTION="Resource manager and queuing system based on OpenPBS"
+HOMEPAGE="http://www.clusterresources.com/products/torque/"
+SRC_URI="http://www.clusterresources.com/downloads/torque/${MY_P}.tar.gz"
+
+LICENSE="openpbs"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="tcltk X scp server doc"
+PROVIDE="virtual/pbs"
+
+# ed is used by makedepend-sh
+DEPEND_COMMON="virtual/libc
+ X? ( virtual/x11 dev-lang/tk )
+ tcltk? ( dev-lang/tcl )
+ !virtual/pbs"
+DEPEND="${DEPEND_COMMON}
+ sys-apps/ed"
+RDEPEND="${DEPEND_COMMON}
+ net-misc/openssh"
+PDEPEND=">=sys-cluster/openpbs-common-1.1.0"
+
+S="${WORKDIR}/${MY_P}"
+
+SPOOL_LOCATION="/var/spool" # this needs to move to /var later on
+PBS_SERVER_HOME="${SPOOL_LOCATION}/PBS/"
+
+src_unpack() {
+ unpack ${MY_P}.tar.gz
+ export EPATCH_OPTS="-p1 -d ${S}"
+ epatch ${FILESDIR}/${P}-respect-ldflags.patch \
+ || die "epatch for ldflags failed"
+ epatch ${FILESDIR}/${P}-respect-destdir.patch \
+ || die "epatch for DESTDIR failed"
+ epatch ${FILESDIR}/${P}-destdir-fixes.patch \
+ || die "epatch for gui DESTDIR failed"
+ epatch ${FILESDIR}/${P}-setuid-safety.patch \
+ || die "epatch for setuid failed"
+ epatch ${FILESDIR}/${P}-makedepend.patch \
+ || die "epatch for makedepend failed"
+
+ sed -i \
+ -e "s|/tmp/|\${TMPDIR}/|g" \
+ ${S}/buildutils/makedepend-sh || die "sed for makedepend failed"
+}
+
+src_compile() {
+
+ local myconf
+# use X || myconf="--disable-gui"
+# use tcltk && myconf="${myconf} --with-tcl"
+ use doc && myconf="${myconf} --enable-docs"
+ append-flags -DJOB_DELETE_NANNY
+ use amd64 && append-flags -fPIC
+
+ ./configure ${myconf} \
+ $(use_enable X gui) \
+ $(use_enable server) \
+ $(use_with tcltk tcl) \
+ --prefix=/usr \
+ --mandir=/usr/share/man \
+ --libdir="\${exec_prefix}/$(get_libdir)/pbs" \
+ --enable-mom \
+ --enable-clients \
+ --enable-shared \
+ --enable-depend-cache \
+ $(use_with scp) \
+ $(use_enable tcltk tcl-qstat) \
+ --set-server-home=${PBS_SERVER_HOME} \
+ --set-environ=/etc/pbs_environment || die "./configure failed"
+
+ emake || die "emake failed"
+}
+
+# WARNING
+# OpenPBS is extremely stubborn about directory permissions. Sometimes it will
+# just fall over with the error message, but in some spots it will just ignore
+# you and fail strangely. Likewise it also barfs on our .keep files!
+pbs_createspool() {
+ root="$1"
+ s="${SPOOL_LOCATION}"
+ h="${PBS_SERVER_HOME}"
+ sp="${h}/server_priv"
+ einfo "Building spool directory under ${D}${h}"
+ for a in \
+ 0755:${s} 0755:${h} 0755:${h}/aux 0700:${h}/checkpoint \
+ 0755:${h}/mom_logs 0751:${h}/mom_priv 0751:${h}/mom_priv/jobs \
+ 0755:${h}/sched_logs 0750:${h}/sched_priv \
+ 0755:${h}/server_logs \
+ 0750:${h}/server_priv 0755:${h}/server_priv/accounting \
+ 0750:${h}/server_priv/acl_groups 0750:${h}/server_priv/acl_hosts \
+ 0750:${h}/server_priv/acl_svr 0750:${h}/server_priv/acl_users \
+ 0750:${h}/server_priv/jobs 0750:${h}/server_priv/queues \
+ 1777:${h}/spool 1777:${h}/undelivered ;
+ do
+ d="${a/*:}"
+ m="${a/:*}"
+ if [ ! -d "${root}${d}" ]; then
+ install -d -m${m} ${root}${d}
+ else
+ chmod ${m} ${root}${d}
+ fi
+ done
+}
+
+src_install() {
+ # Make directories first
+ pbs_createspool "${D}"
+
+ einfo "Running make install"
+ make DESTDIR=${D} install || die
+
+ einfo "Doing docs & lib symlinks"
+ dodoc INSTALL PBS_License.txt README.torque Release_Notes
+ # Init scripts come from openpbs-common
+ #newinitd ${FILESDIR}/pbs-init.d pbs
+ #newconfd ${FILESDIR}/pbs-conf.d pbs
+ dosym /usr/$(get_libdir)/pbs/libpbs.a /usr/$(get_libdir)/libpbs.a
+
+ einfo "Handling /etc/pbs_environment and /var/spool/PBS/server_name"
+ # this file MUST exist for PBS/Torque to work
+ # but try to preserve any customatizations that the user has made
+ dodir /etc
+ if [ -f ${ROOT}/etc/pbs_environment ]; then
+ cp ${ROOT}/etc/pbs_environment ${D}/etc/pbs_environment
+ else
+ touch ${D}/etc/pbs_environment
+ fi
+
+ if [ -f "${ROOT}/var/spool/PBS/server_name" ]; then
+ cp "${ROOT}/var/spool/PBS/server_name" "${D}/var/spool/PBS/server_name"
+ fi
+
+ # The build script isn't alternative install location friendly,
+ # So we have to fix some hard-coded paths in tclIndex for xpbs* to work
+ for file in `find ${D} -iname tclIndex`
+ do
+ sed -e "s/${D//\// }/ /" "${file}" > "${file}.new"
+ mv "${file}.new" "${file}"
+ done
+}
+
+pkg_postinst() {
+ # make sure the damn directories exist
+ pbs_createspool "${ROOT}"
+ [ ! -f "${ROOT}/etc/pbs_environment" ] && touch "${ROOT}/etc/pbs_environment"
+}
+