# 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/tk )" 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" 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 && use tcltk 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 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() { # Since we introduced changes in installation, gui version doesn't # work properly, since "make install" puts bad paths in certain files # This affects xpbs & xpbsmon functioning. # only perform this if GUI was enabled during installation if use X && use tcltk then # xpbs - remove wrong paths from related files sed -e "s|${D}||g" /usr/bin/xpbs > /usr/bin/xpbs.new mv /usr/bin/xpbs.new /usr/bin/xpbs cd /usr/lib/xpbs && rm tclIndex && ./buildindex /usr/lib/xpbs # xpbsmon - remove wrong paths from related files sed -e "s|${D}||g" /usr/bin/xpbsmon > /usr/bin/xpbsmon.new mv /usr/bin/xpbsmon.new /usr/bin/xpbsmon cd /usr/lib/xpbsmon && rm tclIndex && ./buildindex /usr/lib/xpbsmon # change permissions chmod 755 /usr/bin/xpbs* fi # solve missing folders problem (service will not start without them) if [ ! -e /usr/spool/PBS/spool ]; then mkdir /usr/spool/PBS/spool fi if [ ! -e /usr/spool/PBS/mom_priv/jobs ]; then mkdir /usr/spool/PBS/mom_priv/jobs fi # print some info on the screen einfo einfo "####################################################################" einfo " 1. configuring torque as server:" einfo " - edit \"/usr/spool/PBS/server_name\" and put name of the" einfo " PBS server (if local host is not the server)" einfo " - edit \"/usr/spool/PBS/server_priv/nodes\" and put names of" einfo " the nodes" einfo einfo " 2. configuring torque as client (node):" einfo " - edit \"/usr/spool/PBS/mom_priv/config\" and set \"\$clienthost\"" einfo " variable" einfo einfo " 3. 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 "check documentation: http://www.clusterresources.com/products/torque" einfo "####################################################################" einfo }