# Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 S=${WORKDIR}/`echo ${A} | sed -e 's/\.tar\.gz//g'` DESCRIPTION="Improved cluster resource manager and queuing system based on OpenPBS" HOMEPAGE="http://www.supercluster.org/torque/" SRC_URI="http://supercluster.org/downloads/torque/torque-1.1.0p5.tar.gz" LICENSE="openpbs" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="X tcltk debug" DEPEND="virtual/libc X? ( virtual/x11 ) tcltk? ( dev-lang/tcl )" RDEPEND="net-misc/openssh" src_unpack() { cd ${WORKDIR} unpack ${A} cd ${S} # this thing doesn't use make install, but rather it's own install script # fix it here so the install dirs are set to the ${D} directory cd buildutils mv pbs_mkdirs.in pbs_mkdirs.in-orig sed -e "s|prefix=@prefix@|prefix=\${D}@prefix@| ; \ s|PBS_SERVER_HOME=@PBS_SERVER_HOME@|PBS_SERVER_HOME=\${D}@PBS_SERVER_HOME@| ; \ s|PBS_DEFAULT_FILE=@PBS_DEFAULT_FILE@|PBS_DEFAULT_FILE=\${D}@PBS_DEFAULT_FILE@| ; \ s|PBS_ENVIRON=@PBS_ENVIRON@|PBS_ENVIRON=\${D}@PBS_ENVIRON@|" \ pbs_mkdirs.in-orig > pbs_mkdirs.in } src_compile() { local myconf # set default parameters myconf="--prefix=/usr --exec-prefix=/usr" myconf="${myconf} --mandir=/usr/share/man" myconf="${myconf} --enable-docs" myconf="${myconf} --enable-server" myconf="${myconf} --enable-mom" myconf="${myconf} --enable-clients" myconf="${myconf} --enable-syslog" myconf="${myconf} --set-server-home=/usr/spool/PBS" myconf="${myconf} --set-environ=/etc/pbs_environment" if use X then myconf="${myconf} --enable-gui" else myconf="${myconf} --disable-gui" fi use tcltk && myconf="${myconf} --with-tcl --enable-tcl-qstat" use debug && myconf="${myconf} --enable-debug" ./configure ${myconf} || die "./configure failed" # compile & install emake || die "emake failed" } src_install() { make prefix=${D}/usr \ mandir=${D}/usr/share/man \ PBS_SERVER_HOME=${D}/usr/spool/PBS \ install || die dodoc INSTALL PBS_License.txt README.torque Release_Notes CHANGELOG exeinto /etc/init.d ; newexe ${FILESDIR}/pbs.rc pbs } pkg_postinst() { einfo einfo "####################################################################" einfo " 1. configuring torque:" einfo " - edit \"/usr/spool/PBS/server_name\" and put name of the" einfo " PBS server (if local host is not the server)" einfo einfo " 2. running torque:" einfo " - use \"/etc/init.d/pbs\" script to start/stop" einfo " (i.e. add it to default runlevel \"rc-update add pbs default\")" einfo einfo "NOTE: for handling of MPI jobs, torque perform best with " einfo " \"sys-cluster/mpich\" and \"sys-cluster/mpiexec\"" einfo " (instead of starting MPI jobs with mpirun, you use mpiexec)" einfo "####################################################################" einfo }