%ifos darwin %define __rootgrp wheel %define __chkconfig true %else %define __rootgrp root %define __chkconfig /sbin/chkconfig %endif # comment out snap if building a real release %define name torque %define version 2.3.6 %define release 10.5hepx1a %define torquehomedir %{_var}/spool/torque %define server_name localhost %define drmaadocdir %{_docdir}/torque-drmaa %define use_tcl 1 %define build_server yes %define build_mom yes %define build_clients yes %define build_gui yes %define build_pbs_rcp no %define build_drmaa no %define build_drmaa_docs no %define pammoddir disabled %define modulefiles_dir no %define configure_args --prefix=%{_usr} --with-server-home=%{torquehomedir} --mandir=%{_mandir} ############################################ ## no user serviceable parts below this line %if "%build_gui" == "yes" %if "%use_tcl" == "0" %error GUI cannot be built without TCL support %endif %endif %define shared_description %(echo -e "TORQUE (Tera-scale Open-source Resource and QUEue manager) is a resource \\nmanager providing control over batch jobs and distributed compute nodes. \\nTorque is based on OpenPBS version 2.3.12 and incorporates scalability, \\nfault tolerance, and feature extension patches provided by USC, NCSA, OSC, \\nthe U.S. Dept of Energy, Sandia, PNNL, U of Buffalo, TeraGrid, and many \\nother leading edge HPC organizations.\\n\\nThis build was configured with:\\n %{?configure_args}\\n \\n") Summary: Tera-scale Open-source Resource and QUEue manager Name: %{name} Version: %{version} Release: %{?snap:snap.%snap.}%{release} Source: torque-%{version}%{?snap:-snap.%snap}.tar.gz Patch0: torque-%{version}%{?snap:-snap.%snap}.patch License: OpenPBS Group: System Environment/Daemons URL: http://www.clusterresources.com/products/torque/ BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot Provides: pbs %ifnos darwin BuildRequires: ed %endif Conflicts: pbspro, openpbs, openpbs-oscar Obsoletes: scatorque %if "%build_gui" == "no" Obsoletes: %{name}-gui %endif %description %shared_description This package holds just a few shared files and directories. %prep %setup -n torque-%{version}%{?snap:-snap.%snap} %patch0 -p1 -b .osx %build CFLAGS="%{optflags}" ./configure %{?configure_args} %{__make} %{?_smp_mflags} %install [ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf "$RPM_BUILD_ROOT" %ifos darwin %endif %{__make} install DESTDIR=$RPM_BUILD_ROOT INSTALL="%{__install} -p" env DESTDIR=$RPM_BUILD_ROOT sh ./buildutils/pbs_mkdirs common if [ -f /etc/SuSE-release ];then initpre="suse." else initpre="" fi # install initscripts serverinit="`test "%build_server" == "yes" && echo pbs_sched pbs_server || echo`" mominit="`test "%build_mom" == "yes" && echo pbs_mom || echo`" %{__mkdir_p} $RPM_BUILD_ROOT%{_initrddir} for initscript in $serverinit $mominit; do %__sed -e 's|^PBS_HOME=.*|PBS_HOME=%{torquehomedir}|' \ -e 's|^PBS_DAEMON=.*|PBS_DAEMON=%{_sbindir}/'$initscript'|' \ < contrib/init.d/$initpre$initscript > $RPM_BUILD_ROOT%{_initrddir}/$initscript %__chmod 755 $RPM_BUILD_ROOT%{_initrddir}/$initscript done # remove libtool droppings %{__rm} -vf $RPM_BUILD_ROOT/%pammoddir/pam_pbssimpleauth.{a,la} $RPM_BUILD_ROOT/%{_libdir}/*.la %clean [ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT %post if %__grep -q "PBS services" /etc/services;then : PBS services already installed else cat<<-__EOF__>>/etc/services # Standard PBS services pbs 15001/tcp # pbs server (pbs_server) pbs 15001/udp # pbs server (pbs_server) pbs_mom 15002/tcp # mom to/from server pbs_mom 15002/udp # mom to/from server pbs_resmom 15003/tcp # mom resource management requests pbs_resmom 15003/udp # mom resource management requests pbs_sched 15004/tcp # scheduler pbs_sched 15004/udp # scheduler __EOF__ fi %files %defattr(-, root, %{__rootgrp}) %doc INSTALL README.torque torque.setup Release_Notes CHANGELOG PBS_License.txt %config(noreplace) %{torquehomedir}/server_name %config(noreplace) %{torquehomedir}/pbs_environment %{torquehomedir}/spool %{torquehomedir}/aux %ifos darwin %{_libdir}/libtorque*.*.dylib %else %{_libdir}/libtorque*.so.* %endif %if "%modulefiles_dir" != "no" %modulefiles_dir/%{name} %endif %package docs Group: Documentation Summary: docs for Torque Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} Provides: pbs-docs %description docs %shared_description This package holds the documentation files. %files docs %defattr(-, root, %{__rootgrp}) %doc doc/admin_guide.ps %{_mandir}/man*/* %package scheduler Group: System Environment/Daemons Summary: scheduler part of Torque Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} Provides: pbs-scheduler %description scheduler %shared_description This package holds the fifo C scheduler. %if "%build_server" == "yes" %files scheduler %defattr(-, root, %{__rootgrp}) %{_sbindir}/pbs_sched %{_sbindir}/qschedd %{_initrddir}/pbs_sched %dir %{torquehomedir}/sched_priv %config(noreplace) %{torquehomedir}/sched_priv/* %{torquehomedir}/sched_logs %endif %post scheduler %{__chkconfig} --add pbs_sched %preun scheduler [ $1 = 0 ] || exit 0 %{__chkconfig} --del pbs_sched %package server Group: System Environment/Daemons Summary: server part of Torque Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} Provides: pbs-server %description server %shared_description This package holds the server. %if "%build_server" == "yes" %files server %defattr(-, root, %{__rootgrp}) %{_sbindir}/pbs_server %{_sbindir}/qserverd %{_initrddir}/pbs_server %{torquehomedir}/server_logs %{torquehomedir}/server_priv %endif %post server %{__chkconfig} --add pbs_server %preun server [ $1 = 0 ] || exit 0 %{__chkconfig} --del pbs_server %package mom Group: System Environment/Daemons Summary: execution part of Torque Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} Provides: pbs-mom %description mom %shared_description This package holds the execute daemon required on every node. %if "%build_mom" == "yes" %files mom %defattr(-, root, %{__rootgrp}) %{_sbindir}/pbs_mom %{_sbindir}/qnoded %{_sbindir}/pbs_demux %{_bindir}/pbs_track %{_initrddir}/pbs_mom %if "%build_pbs_rcp" == "yes" %attr(4755 root root) %{_sbindir}/pbs_rcp %endif %{torquehomedir}/mom_priv/* %{torquehomedir}/mom_logs %{torquehomedir}/checkpoint %{torquehomedir}/undelivered %endif %post mom %{__chkconfig} --add pbs_mom %preun mom [ $1 = 0 ] || exit 0 %{__chkconfig} --del pbs_mom %package client Group: Applications/System Summary: client part of Torque Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} Provides: pbs-client %description client %shared_description This package holds the command-line client programs. %if "%build_clients" == "yes" %files client %defattr(-, root, %{__rootgrp}) %{_bindir}/q* %{_bindir}/chk_tree %{_bindir}/hostn %{_bindir}/nqs2pbs %{_bindir}/pbsdsh %{_bindir}/pbsnodes %{_bindir}/printjob %{_bindir}/printtracking %{_bindir}/printserverdb %{_bindir}/tracejob %{_sbindir}/momctl %attr(4755 root root) %{_sbindir}/pbs_iff %if "%use_tcl" == "1" %{_bindir}/pbs_tclsh %endif %endif %package gui Group: Applications/System Summary: graphical client part of Torque Requires: %{name}-client = %{?epoch:%{epoch}:}%{version}-%{release} Provides: xpbs xpbsmon %description gui %shared_description This package holds the graphical clients. %if "%build_gui" == "yes" %files gui %defattr(-, root, %{__rootgrp}) %{_bindir}/pbs_wish %{_bindir}/xpbs %{_bindir}/xpbsmon %{_libdir}/xpbs %{_libdir}/xpbsmon %endif %package localhost Group: Applications/System Summary: installs and configures a minimal localhost-only batch queue system PreReq: pbs-mom pbs-server pbs-client pbs-scheduler %description localhost %shared_description This package installs and configures a minimal localhost-only batch queue system. %files localhost %defattr(-, root, %{__rootgrp}) %post localhost %{__chkconfig} pbs_mom on %{__chkconfig} pbs_server on %{__chkconfig} pbs_sched on /bin/hostname --long > %{torquehomedir}/server_priv/nodes /bin/hostname --long > %{torquehomedir}/server_name /bin/hostname --long > %{torquehomedir}/mom_priv/config pbs_server -t create qmgr -c "s s scheduling=true" qmgr -c "c q batch queue_type=execution" qmgr -c "s q batch started=true" qmgr -c "s q batch enabled=true" qmgr -c "s q batch resources_default.nodes=1" qmgr -c "s q batch resources_default.walltime=3600" qmgr -c "s s default_queue=batch" %{_initrddir}/pbs_mom restart %{_initrddir}/pbs_sched restart %{_initrddir}/pbs_server restart qmgr -c "s n `/bin/hostname --long` state=free" -e %package devel Summary: Development tools for programs which will use the %{name} library Group: Development/Libraries Provides: lib%{name}-devel Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} %description devel %shared_description This package includes the header files and static libraries necessary for developing programs which will use %{name}. %files devel %defattr(-, root, %{__rootgrp}) %{_libdir}/libtorque*.a %ifos darwin %{_libdir}/libtorque*.dylib %exclude %{_libdir}/libtorque.*.dylib %else %{_libdir}/libtorque*.so %endif %{_includedir}/pbs_error.h %{_includedir}/pbs_ifl.h %{_includedir}/rm.h %{_includedir}/rpp.h %{_includedir}/tm_.h %{_includedir}/tm.h %{_bindir}/pbs-config %package pam Summary: PAM module for PBS MOM nodes Group: System Environment/Base %description pam %shared_description A simple PAM module to authorize users on PBS MOM nodes with a running job. %if "%pammoddir" != "disabled" %files pam %defattr(-, root, %{__rootgrp}) %doc src/pam/README.pam %ifos darwin %pammoddir/pam_pbssimpleauth.dylib %else %pammoddir/pam_pbssimpleauth.so %endif %endif %package drmaa Summary: DRMAA 1.0 implementation for PBS/TORQUE Group: System Environment/Base %description drmaa %shared_description An API specification for the submission and control of jobs to one or more Distributed Resource Management (DRM) systems. %if "%build_drmaa" == "yes" %files drmaa %defattr(-, root, %{__rootgrp}) %{_libdir}/libdrmaa.* %{_includedir}/drmaa.h %endif %package drmaa-docs Summary: DRMAA 1.0 implementation for PBS/TORQUE Group: System Environment/Base %description drmaa-docs %shared_description An API specification for the submission and control of jobs to one or more Distributed Resource Management (DRM) systems. %if "%build_drmaa_docs" == "yes" %files drmaa-docs %defattr(-, root, %{__rootgrp}) %{drmaadocdir} %endif %changelog * Thu Mar 26 2009 Keisuke Fujii 2.3.6-10.5hepx1a - 1st release on MacOS X 10.5 for Intel Macs.