2004-02-01 06:40:53 +00:00
# Ports collection makefile for: sge
# Date created: Fri Jul 11, 2003
# Whom: Brooks Davis <brooks@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME = sge
2005-09-09 23:13:26 +00:00
PORTVERSION = ${ SGE_VERSION }
2007-02-15 22:30:10 +00:00
PORTREVISION = 1
2004-02-01 06:40:53 +00:00
CATEGORIES = sysutils parallel
2007-02-05 17:33:22 +00:00
MASTER_SITES = http://gridengine.sunsource.net/files/documents/7/122/
2005-09-09 23:13:26 +00:00
MASTER_SITES += ${ MASTER_SITE_LOCAL }
2005-10-07 18:11:04 +00:00
MASTER_SITE_SUBDIR = brooks
2007-02-05 17:33:22 +00:00
DISTNAME = sge-V60u10_TAG-src
2004-02-01 06:40:53 +00:00
MAINTAINER = brooks@FreeBSD.org
2005-07-29 02:13:32 +00:00
COMMENT = Sun Grid Engine, a batch queueing system
2005-09-13 23:16:33 +00:00
FETCH_DEPENDS = wget:${ PORTSDIR } /ftp/wget
# We have to use wget because the master site required cookies to
# download the file.
DISABLE_SIZE = yes
FETCH_CMD = wget -c
2007-01-09 08:26:10 +00:00
OPTIONS = BDB "Use DB based spooler" on \
2005-07-29 02:13:32 +00:00
DRMAA "Support the Java DRMAA API (requires native Java)" on \
QMON "Qmon support (requires X and Motif)" on
2006-08-07 07:08:21 +00:00
CONFLICTS = sge-5* sgeee-[ 0-9] * sge-0.*
2005-07-29 02:13:32 +00:00
2006-04-14 05:38:33 +00:00
EXTRA_PATCHES = ${ FILESDIR } /sge-freebsd-pdc.diff
2005-07-29 02:13:32 +00:00
. i f ! e x i s t s ( / u s r / i n c l u d e / s y s / _ p t h r e a d t y p e s . h )
EXTRA_PATCHES = ${ FILESDIR } /pthread-types.diff
. e n d i f
NOT_FOR_ARCHS = alpha
2004-02-01 06:40:53 +00:00
2004-02-25 19:35:41 +00:00
USE_GETTEXT = yes
2004-02-01 06:40:53 +00:00
USE_GMAKE = yes
2004-02-25 19:35:41 +00:00
USE_OPENSSL = yes
2007-02-15 22:30:10 +00:00
USE_LDCONFIG = ${ SGE_ROOT } /lib/${ SGE_ARCH }
2006-01-11 02:33:30 +00:00
2004-02-01 06:40:53 +00:00
SGE_BASE ?= sge
2006-08-04 12:34:50 +00:00
SGE_ROOT = ${ TARGETDIR } /${ SGE_BASE }
2004-02-01 06:40:53 +00:00
SGE_ARCH = fbsd-${ ARCH }
2007-02-15 22:30:10 +00:00
SGE_BUILD_ARCH = FREEBSD_${ ARCH : U }
2007-02-05 17:33:22 +00:00
SGE_VERSION = 6.0.10
SGE_RELEASE = 6.0u10
2004-02-01 06:40:53 +00:00
PLIST_SUB += SGE_ARCH = ${ SGE_ARCH }
PLIST_SUB += SGE_BASE = ${ SGE_BASE }
2005-07-29 02:13:32 +00:00
SUB_FILES = pkg-message pkg-install
SUB_LIST += SGE_BASE = ${ SGE_BASE }
USE_RC_SUBR = sge.sh
2004-02-01 06:40:53 +00:00
PKGMESSAGE = ${ WRKDIR } /pkg-message
2005-07-29 02:13:32 +00:00
PKGINSTALL = ${ WRKDIR } /pkg-install
2005-09-09 23:13:26 +00:00
WRKSRC = ${ WRKDIR } /gridengine/source
2005-07-29 02:13:32 +00:00
TMP_SGE_ROOT = ${ WRKDIR } /sgeroot
AIMK_CMD = ${ SETENV } ${ AIMK_ENV } ./aimk ${ AIMK_ARGS }
INST_PROGS = man common \
sge_qmaster \
sge_execd \
sge_shadowd \
sge_schedd \
sge_shepherd \
sge_coshepherd \
qstat \
qsub \
qalter \
qconf \
qdel \
qacct \
qmod \
qsh \
utilbin \
jobs \
qhost \
qmake \
qtcsh \
qping \
qloadsensor.exe \
sgepasswd \
${ QMON }
2004-02-01 06:40:53 +00:00
MANPREFIX = ${ SGE_ROOT }
2005-07-29 02:13:32 +00:00
. i n c l u d e "${.CURDIR}/Makefile.man"
EXCEPTFILES = arc_depend_irix.asc arc_depend_solaris.asc man testsuite
2004-02-01 06:40:53 +00:00
2004-12-08 23:42:02 +00:00
. i n c l u d e < b s d . p o r t . p r e . m k >
2005-07-29 02:13:32 +00:00
. i f d e f i n e d ( W I T H _ B D B )
LIB_DEPENDS = db-4.2:${ PORTSDIR } /databases/db42
PLIST_SUB += BDB_SPOOL =
. e l s e
AIMK_ARGS += -spool-classic
PLIST_SUB += BDB_SPOOL = "@comment "
. e n d i f
. i f d e f i n e d ( W I T H _ D R M A A )
USE_JAVA = yes
JAVA_VERSION = 1.4+
JAVA_OS = native
JAVA_BUILD = jdk
JAVA_RUN = jre
ANT ?= ${ LOCALBASE } /bin/ant
BUILD_DEPENDS += ${ ANT } :${ PORTSDIR } /devel/apache-ant
PLIST_SUB += DRMAA =
AIMK_ENV += JAVA_HOME = ${ JAVA_HOME }
2007-02-15 22:30:10 +00:00
CATEGORIES += java
2005-07-29 02:13:32 +00:00
. e l s e
AIMK_ARGS += -no-java -no-jni
PLIST_SUB += DRMAA = "@comment "
. e n d i f
. i f d e f i n e d ( W I T H _ Q M O N )
USE_MOTIF = yes
PLIST_SUB += QMON =
QMON = qmon
. e l s e
AIMK_ARGS += -no-qmon
PLIST_SUB += QMON = "@comment "
QMON = noqmon
2004-12-08 23:42:02 +00:00
. e n d i f
2004-02-01 06:40:53 +00:00
post-patch :
@${ REINPLACE_CMD } -e " s|%%PREFIX%%| ${ PREFIX } |g " \
-e " s|%%X11BASE%%| ${ X11BASE } |g " \
-e " s|%%LOCALBASE%%| ${ LOCALBASE } |g " \
${ WRKSRC } /dist/util/arch_variables \
${ WRKSRC } /dist/pvm/src/aimk
2006-12-04 16:39:10 +00:00
@${ REINPLACE_CMD } -e " s|%%CC%%| ${ CC } |g " \
-e " s|%%CXX%%| ${ CXX } |g " \
-e " s|%%CFLAGS%%| ${ CFLAGS } |g " \
-e " s|%%CXXFLAGS%%| ${ CXXFLAGS } |g " \
-e " s|%%X11BASE%%| ${ X11BASE } |g " \
2004-02-01 06:40:53 +00:00
${ WRKSRC } /aimk \
${ WRKSRC } /dist/pvm/src/aimk
2007-02-15 22:30:10 +00:00
@test -d ${ WRKSRC } /3rdparty/qtcsh/${ SGE_BUILD_ARCH } || \
( ${ CP } -r ${ WRKSRC } /3rdparty/qtcsh/FREEBSD_I386 \
${ WRKSRC } /3rdparty/qtcsh/${ SGE_BUILD_ARCH } && \
${ REINPLACE_CMD } -e 's|FREEBSD_I386|${SGE_BUILD_ARCH}|' \
${ WRKSRC } /3rdparty/qtcsh/${ SGE_BUILD_ARCH } /Makefile)
2004-02-25 19:35:41 +00:00
@${ REINPLACE_CMD } -e 's|^CC = gcc|CC = ${CC}|' \
-e 's|^CPP = gcc -E|CPP = ${CPP}|' \
${ WRKSRC } /3rdparty/qmake/FREEBSD_*/Makefile \
${ WRKSRC } /3rdparty/qmake/FREEBSD_*/glob/Makefile \
2007-02-15 22:30:10 +00:00
${ WRKSRC } /3rdparty/qtcsh/${ SGE_BUILD_ARCH } /Makefile
2004-02-01 06:40:53 +00:00
@${ RM } ${ WRKSRC } /dist/util/arch_variables.orig
2005-07-30 17:39:23 +00:00
@${ RM } ${ WRKSRC } /dist/util/install_modules/inst_common.sh.orig
2004-02-01 06:40:53 +00:00
@${ FIND } ${ WRKSRC } -name Makefile | ${ XARGS } \
${ REINPLACE_CMD } " s|-g -O2| ${ CFLAGS } | "
2005-07-29 02:13:32 +00:00
@${ SED } -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
2007-02-05 17:33:22 +00:00
-e 's|%%OPENSSLBASE%%|${OPENSSLBASE}|g' \
-e 's|%%X11BASE%%|${X11BASE}|g' \
2005-07-29 02:13:32 +00:00
${ FILESDIR } /aimk.private > ${ WRKSRC } /aimk.private
2007-01-09 08:26:10 +00:00
@${ SED } -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
-e 's|%%OPENSSLBASE%%|${OPENSSLBASE}|g' < \
${ FILESDIR } /distinst.private > ${ WRKSRC } /distinst.private
2004-02-01 06:40:53 +00:00
do-build :
2005-07-29 02:13:32 +00:00
cd ${ WRKSRC } && ${ AIMK_CMD } -only-depend
cd ${ WRKSRC } && ./scripts/zerodepend
cd ${ WRKSRC } && ${ AIMK_CMD } depend
cd ${ WRKSRC } && \
2006-01-11 02:33:30 +00:00
${ AIMK_CMD } -debug && \
2005-07-29 02:13:32 +00:00
${ AIMK_CMD } -man ${ SGE_PRODUCT } &&
${ MKDIR } ${ TMP_SGE_ROOT }
cd ${ WRKSRC } && ${ SETENV } SGE_ROOT = ${ TMP_SGE_ROOT } \
./scripts/distinst -local -libs ${ SGE_ARCH } -- ${ INST_PROGS }
2004-02-01 06:40:53 +00:00
do-install :
${ MKDIR } ${ SGE_ROOT }
2005-07-29 02:13:32 +00:00
cd ${ TMP_SGE_ROOT } && \
${ FIND } . | ${ TAR } cTf - - | ${ TAR } xUCf ${ SGE_ROOT } -
cd ${ SGE_ROOT } && ${ SETENV } SGE_ROOT = ${ SGE_ROOT } util/setfileperm.sh -auto ${ SGE_ROOT }
2004-02-01 06:40:53 +00:00
. i f ! d e f i n e d ( N O P O R T D O C S )
${ MKDIR } ${ DOCSDIR }
2005-09-12 22:54:48 +00:00
cd ${ WRKSRC } /../doc && ${ FIND } * \( -name CVS \
${ EXCEPTFILES : S /^/-o -name / } \) -a -prune -o -type f -print \
2004-02-01 06:40:53 +00:00
| ${ TAR } cTf - - | ${ TAR } xUCf ${ DOCSDIR } -
. e n d i f
post-install :
2005-07-29 02:13:32 +00:00
@${ SH } ${ PKGINSTALL } ${ PKGNAME } POST-INSTALL
2004-02-01 06:40:53 +00:00
@${ CAT } ${ PKGMESSAGE }
@${ ECHO }
2005-07-29 02:13:32 +00:00
# Automaticly produce the offical machine dependent bits tarball from
# the temporary root. This can be used if FreeBSD machines are to be
# included in a shared SGE installation.
release-tar : build
cd ${ TMP_SGE_ROOT } && \
2004-02-25 19:35:41 +00:00
${ TAR } cfvz ${ .CURDIR } /sge-${ SGE_RELEASE } -bin-${ SGE_ARCH } .tar.gz \
2005-07-29 02:13:32 +00:00
` ${ FIND } . -name ${ SGE_ARCH } `
#########################################################################
# Maintainer support below this line. No user servicable parts inside. #
#########################################################################
2004-02-25 19:35:41 +00:00
2005-07-29 02:13:32 +00:00
# Build a pkg-plist and Makefile.man
build-plist : build
#.if defined(WITHOUT_BDB) || defined(WITHOUT_JAVA) || defined(WITHOUT_QMON)
# @echo "ERROR: All OPTIONS must be enabled to build plist!" && ${FALSE}
#.endif
@${ FIND } ${ TMP_SGE_ROOT } /* -name man -prune -o \
\( -type f -o -type l \) -print | \
${ SORT } | \
${ SED } -e 's|^${TMP_SGE_ROOT}|%%SGE_BASE%%|' \
-e 's|${SGE_ARCH}|%%SGE_ARCH%%|' \
-e 's|\(.*libspool[bc].so\)|%%BDB_SPOOL%%\1|' \
2007-01-09 08:26:10 +00:00
-e 's|\(.*libdb-4.2.so\)|%%BDB_SPOOL%%\1|' \
-e 's|\(.*utilbin.*db_.*\)|%%BDB_SPOOL%%\1|' \
2005-07-29 02:13:32 +00:00
-e 's|\(.*libXltree.so\)|%%QMON%%\1|' \
-e 's|\(.*qmon.*\)|%%QMON%%\1|' \
> ${ PLIST }
2005-09-09 23:13:26 +00:00
@${ FIND } ${ WRKSRC } /../doc \( -name CVS \
2005-07-29 02:13:32 +00:00
${ EXCEPTFILES : S /^/-o -name / } \) -a -prune -o -type f -print | \
${ SORT } | \
${ SED } -e 's|${WRKSRC}/../doc|%%PORTDOCS%%%%DOCSDIR%%|' \
>> ${ PLIST }
@${ FIND } ${ TMP_SGE_ROOT } /* -type d | \
${ SORT } -r | \
${ SED } -e 's|^${TMP_SGE_ROOT}|@dirrm %%SGE_BASE%%|' \
-e 's|${SGE_ARCH}|%%SGE_ARCH%%|' \
-e 's|\(.*qmon.*\)|%%QMON%%\1|' \
>> ${ PLIST }
2005-09-09 23:13:26 +00:00
@${ FIND } ${ WRKSRC } /../doc \( -name CVS \
2005-07-29 02:13:32 +00:00
${ EXCEPTFILES : S /^/-o -name / } \) -a -prune -o -type d -print | \
${ SORT } -r | \
${ SED } -e 's|${WRKSRC}/../doc|%%PORTDOCS%%@dirrm %%DOCSDIR%%|' \
>> ${ PLIST }
2007-02-15 22:30:10 +00:00
@echo '@dirrmtry %%SGE_BASE%%' >> ${ PLIST }
@echo '@unexec test -d %D/%%SGE_BASE%% && ( echo "Configuration information saved. If you will *NOT* use this package anymore," && echo "please remove %D/%%SGE_BASE%% and its contents manually.")' >> ${ PLIST }
2005-07-29 02:13:32 +00:00
@echo "# Do not edit! Auto-generated file." > ${ .CURDIR } /Makefile.man
@echo "# See build-plist target in Makefile." >> ${ .CURDIR } /Makefile.man
@echo "#" >> ${ .CURDIR } /Makefile.man
@${ FIND } ${ TMP_SGE_ROOT } /man -type f | ${ XARGS } ${ GREP } -H ^\\ .so | \
${ SED } \
-e 's|.*/\([^ :/][^ :/]*\):.*/\([^ :/][^ :/]*\)$$|MLINKS+=\2 \1|' \
>> ${ .CURDIR } /Makefile.man
@${ FIND } ${ TMP_SGE_ROOT } /man -type f | ${ XARGS } ${ GREP } -L ^\\ .so | \
${ SED } -e 's|.*man\([0-9LN]\)/\(.*\)|MAN\1+=\2|' \
>> ${ .CURDIR } /Makefile.man
2004-12-08 23:42:02 +00:00
. i n c l u d e < b s d . p o r t . p o s t . m k >