diff options
author | Justin Bronder <jsbronder@gentoo.org> | 2008-07-10 03:28:56 +0000 |
---|---|---|
committer | Justin Bronder <jsbronder@gentoo.org> | 2008-07-10 03:28:56 +0000 |
commit | 3c4ce27b6f1ff63b6d5e7689f4b1528d4213b8e9 (patch) | |
tree | d066cb233f86dcff35aab5f29cd68dc68acdd714 /sys-cluster | |
parent | I guess virtualization isn't a herd yet (diff) | |
download | historical-3c4ce27b6f1ff63b6d5e7689f4b1528d4213b8e9.tar.gz historical-3c4ce27b6f1ff63b6d5e7689f4b1528d4213b8e9.tar.bz2 historical-3c4ce27b6f1ff63b6d5e7689f4b1528d4213b8e9.zip |
Bump torque to 2.3.1, add some fixes from svn for newer gcc's.
Package-Manager: portage-2.1.4.4
Diffstat (limited to 'sys-cluster')
-rw-r--r-- | sys-cluster/torque/ChangeLog | 8 | ||||
-rw-r--r-- | sys-cluster/torque/Manifest | 15 | ||||
-rw-r--r-- | sys-cluster/torque/files/torque-2.3-fixes-r2221-2227.patch | 372 | ||||
-rw-r--r-- | sys-cluster/torque/torque-2.3.1.ebuild | 233 |
4 files changed, 626 insertions, 2 deletions
diff --git a/sys-cluster/torque/ChangeLog b/sys-cluster/torque/ChangeLog index 593bb2c88bfe..449e11ecf213 100644 --- a/sys-cluster/torque/ChangeLog +++ b/sys-cluster/torque/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-cluster/torque # Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v 1.69 2008/06/18 13:04:11 fmccor Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v 1.70 2008/07/10 03:28:56 jsbronder Exp $ + +*torque-2.3.1 (10 Jul 2008) + + 10 Jul 2008; Justin Bronder <jsbronder@gentoo.org> + +files/torque-2.3-fixes-r2221-2227.patch, +torque-2.3.1.ebuild: + Bump torque to 2.3.1, add some fixes from svn for newer gcc's. 18 Jun 2008; Ferris McCormick <fmccor@gentoo.org> torque-2.3.0-r1.ebuild: Sparc stable, required for bug #224099. diff --git a/sys-cluster/torque/Manifest b/sys-cluster/torque/Manifest index c43e90c4ccf0..920cd92fe8e4 100644 --- a/sys-cluster/torque/Manifest +++ b/sys-cluster/torque/Manifest @@ -1,3 +1,6 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + AUX 2.3.0-fixes_r2031.patch 8484 RMD160 58429355795ed3304c986b7b667d86486bb1c8cf SHA1 2a47b277277fcfc97a26ccad7c967c9f8bf72932 SHA256 9f847cc8273b2b227d7163299ea856830c4d333527e1566b13e989d980866398 AUX pbs_mom-init.d-2.2.1 1003 RMD160 97be9b485fabd022ff209c910ae3974a73ebbc30 SHA1 cf50bac5a12a07535104ff7f7dcdfd054c995b2b SHA256 ef010854efc7a5c310c34bc53d1d927b7928bfa0d48bb5d8ae76bd3453f37a25 AUX pbs_mom-init.d-2.2.1-r1 1093 RMD160 ade6389bcda7974fd17c56c5f6f7a1c5b19c7fda SHA1 051455da4526b908ddb2346c912b68ba22245209 SHA256 ce5dfb1db62de8611974dcf15698dce75ef289f2a13d6a95039aec724748e64d @@ -5,6 +8,7 @@ AUX pbs_sched-init.d-2.2.1 1084 RMD160 a4f8b42dc5e004cbd9f8168cc39520d8bc1168d6 AUX pbs_sched-init.d-2.2.1-r1 1174 RMD160 d39789a7675487065094083c1ebb6da6e8246818 SHA1 c550cd7606da18a74e736c7f0d26d04deea3d34b SHA256 b1edba8149cc3962e147d8e16148113ad629c5c7ab54ea629d5c106aea337afe AUX pbs_server-init.d-2.2.1 1576 RMD160 f57eeea595c8d609346c0d0d4645decfab76cb5c SHA1 90ad4ff42cac937929bde4cbcf7f69460c2f630e SHA256 43a1ea111ca161d8bd496291a28fe3201e9080b97d3c746a29d820ec2cfbd9d7 AUX pbs_server-init.d-2.2.1-r1 1666 RMD160 e757d58142dd2abc10cee6e016744336788bca5c SHA1 f1f0a3181265e7a0c0e59cfb51c53dfaf4f93dd8 SHA256 a7e05fa7b544b46d8e8a6fc2ed4fc843dd63496597fcd32a70f45c4ddcec18d3 +AUX torque-2.3-fixes-r2221-2227.patch 11583 RMD160 c9034c6ac160565837ce1d6a7ae847f9d5db7565 SHA1 d5b8cccefb50e1cbee4c57df86b78e569767bb3a SHA256 46907789798266695efbcb584bcae898be6f76554f68c42d9a3974b4c4ac6f5d AUX torque-conf.d-2.2.1 816 RMD160 8bd7fd0c6566445c761da96859d86fbdb11d40f9 SHA1 da49ef33b73cab88c37bea20d26361c7a69cfb12 SHA256 ed982717cb8334a0a43e8807166bc10b5cbf39848e5729b321e946b31fa1c0c1 AUX torque-conf.d-2.2.1-r1 649 RMD160 d8a8cec80a86fdea54545d64df9276db0386d688 SHA1 115fc52661a003b69be2dfb716e29f8d86461ca3 SHA256 4139da44a55dbcb4a8227fd0aedede8e091971fd63c0e08644712f4a91e7b174 AUX torque-env.d-2.2.1 337 RMD160 bb5341d647e6c4545077783dd2aa4135662276f8 SHA1 10910a42d419e552c42a098010d8360b496f7f72 SHA256 0c5abf36209d684e7c4f82749f6c06ad976f7c1f3f0e94731b42c1d1331c5bed @@ -14,8 +18,17 @@ AUX torque-setuid-safety.patch 1020 RMD160 199a8d543c6f0de0934211ca248b637f61f1a DIST torque-2.1.6.tar.gz 2708793 RMD160 6802c2d49a36624d34fce7b96b29551da3ff1106 SHA1 f0437e3f429c5cecb44a7f991f2b7bd58baa7a0a SHA256 e5ac494859df9951ca34149ae56b93fbfc83d7d4ba015bc8b67514b190e51c36 DIST torque-2.2.1.tar.gz 5370260 RMD160 219e5a4234a1bbf0241c15f568a720752e48587c SHA1 fafa9d66aa8bf8daa9e8f660903aa1105ff14bda SHA256 6d2674d471e300df6ebda56ef80c2a7be0de33fc619f98ee78eee69af1d179b8 DIST torque-2.3.0.tar.gz 5419629 RMD160 7dd4885cda583aa8ba16dce7b9001c009f264881 SHA1 e600b121aa6dae8e872935907311913cf8631d75 SHA256 eb5e694b6acdfe84249dfdf71552cb38d26e29fcda7ba09574b041e06290ec57 +DIST torque-2.3.1.tar.gz 5447820 RMD160 c4152ff383940965cd77274e4f94a0350f8fb87e SHA1 0fa5729f55fd309dde6b8163375e8968ca9cae89 SHA256 5f628c19155c2c5d2bb3cc45276637b80652304ea8c918c20b0d8591c02ac970 EBUILD torque-2.1.6.ebuild 4038 RMD160 b6c85175b08ec7fc389ad4503e7844c7aebf6402 SHA1 51784cd28f3dd838d52b502b123cb81cacdf4c1a SHA256 1d2fbc09c5ee0a7658f10c813d8f0015656930887ab28f2109a57da7a11e67d0 EBUILD torque-2.2.1-r2.ebuild 7202 RMD160 1bf67f7e5a7d2bd813ceca38739a873ac36c35d4 SHA1 37e2c5bd0c6bb3fcc90f8869a6eae0b299448dd5 SHA256 113a0e6629f1e7208b55edb7760f3ae8127f5ca4f3d8dea24cd10188a222e363 EBUILD torque-2.3.0-r1.ebuild 7304 RMD160 b7efed57577bf9f1ed063d743b083d1f5bfb3c3f SHA1 1301f8bdbd6144303e744e0768016da80c9ff141 SHA256 5d3b1df074eea6db5bb5f259f988b9530908e8be2a0371c88a60f23c3f0b317a -MISC ChangeLog 12239 RMD160 cc50cdafa0ec71e6de5cba3c7c46feef6b315a08 SHA1 414c6e881a7aba53dd3c01717b7b545500aed942 SHA256 8684863d657ae1f360fa0002c76417154945b51d344ec1b339a645b344e2dd72 +EBUILD torque-2.3.1.ebuild 7370 RMD160 888d9285336ee85a45c8c7ede2c9874ac5771696 SHA1 4ecdbd43c994d7e7d2d8f16ab48038ffb1d6c30c SHA256 01813f8c39a0c1cddc388009d1c38ae6297f93a5137aac0efa7ab330308e0c4a +MISC ChangeLog 12456 RMD160 ec580ebef159dccb43b85cb9696a0445c8e3aa33 SHA1 f2ff20017f2c2f569ad8f3d43bf77c3a1d54cdd2 SHA256 987759d0883509d988a97e69a69c701c3f47003dd42724a38a3fe0682e0c12b8 MISC metadata.xml 231 RMD160 37dd476ccaceaa37796cf29fd01af8fcfa2b4c61 SHA1 87cab1ccad4db7724c4292e4f32dd19accdcf2fa SHA256 b5305a12d2e3e9f9fdf645e98b0108c1bd8f5b5da32589a25bf7b0f0d74f1213 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.9 (GNU/Linux) + +iEYEARECAAYFAkh1gJ4ACgkQ4MrvBE1wQ8ktJwCaAhU1YsGgVS8a/MKdcpbXPNR5 +xQkAn3VoRIHsu1XYBpSvBagQXEAfOQqs +=Md7k +-----END PGP SIGNATURE----- diff --git a/sys-cluster/torque/files/torque-2.3-fixes-r2221-2227.patch b/sys-cluster/torque/files/torque-2.3-fixes-r2221-2227.patch new file mode 100644 index 000000000000..81af4a5e790c --- /dev/null +++ b/sys-cluster/torque/files/torque-2.3-fixes-r2221-2227.patch @@ -0,0 +1,372 @@ +Index: src/include/qmgr.h +=================================================================== +--- src/include/qmgr.h (revision 2221) ++++ src/include/qmgr.h (revision 2227) +@@ -166,30 +166,30 @@ + + + /* prototypes */ +-struct objname *commalist2objname(); +-struct server *find_server(); ++struct objname *commalist2objname(char *, int); ++struct server *find_server(char *); + struct server *make_connection(); + struct server *new_server(); + struct objname *new_objname(); +-struct objname *strings2objname( ); ++struct objname *strings2objname(char **, int, int); + struct objname *default_server_name(); +-struct objname *temp_objname(); +-int parse_request( ); +-void clean_up_and_exit(); +-void freeattrl(); +-void freeattropl(); +-void pstderr_big(); +-void free_objname_list(); +-void free_server(); +-void free_objname(); ++struct objname *temp_objname(char *, char *, struct server *); ++int parse_request(char *, char [][MAX_REQ_WORD_LEN]); ++void clean_up_and_exit(int); ++void freeattrl(struct attrl *); ++void freeattropl(struct attropl *); ++void pstderr_big(char *, char*, char *); ++void free_objname_list(struct objname *); ++void free_server(struct server *); ++void free_objname(struct objname *); + void close_non_ref_servers(); +-int connect_servers(); +-int set_active(); +-int get_request(); +-int parse(); +-int execute(); +-int is_attr(); +-int is_valid_object(); ++int connect_servers(struct objname *, int); ++int set_active(int, struct objname *); ++int get_request(char *); ++int parse(char *, int *, int *, char **, struct attropl **); ++int execute(int, int, int, char *, struct attropl *); ++int is_attr(int, char *, int); ++int is_valid_object(struct objname *, int); + void disconnect_from_server(); + + +Index: src/include/md5.h +=================================================================== +--- src/include/md5.h (revision 2221) ++++ src/include/md5.h (revision 2227) +@@ -55,9 +55,9 @@ + unsigned char digest[16]; /* actual digest after MD5Final call */ + } MD5_CTX; + +-void MD5Init (); +-void MD5Update (); +-void MD5Final (); ++void MD5Init (MD5_CTX *); ++void MD5Update (MD5_CTX *, unsigned char *, unsigned int); ++void MD5Final (MD5_CTX *); + + #define __MD5_INCLUDE__ + #endif /* __MD5_INCLUDE__ */ +Index: src/include/mom_func.h +=================================================================== +--- src/include/mom_func.h (revision 2221) ++++ src/include/mom_func.h (revision 2227) +@@ -149,7 +149,7 @@ + extern int set_mach_vars A_((job *, struct var_table *)); + extern char *set_shell A_((job *, struct passwd *)); + extern void start_exec A_((job *)); +-extern int open_master(); ++extern int open_master(char **); + extern int open_slave(); + extern char *rcvttype A_((int)); + extern int rcvwinsize A_((int)); +Index: src/include/pbs_config.h.in +=================================================================== +--- src/include/pbs_config.h.in (revision 2221) ++++ src/include/pbs_config.h.in (revision 2227) +@@ -316,6 +316,9 @@ + /* use nodemask-based scheduling on O2k */ + #undef NODEMASK + ++/* Define to disable posix memlock */ ++#undef NOPOSIXMEMLOCK ++ + /* Define to disable privileged ports */ + #undef NOPRIVPORTS + +Index: src/cmds/qstop.c +=================================================================== +--- src/cmds/qstop.c (revision 2221) ++++ src/cmds/qstop.c (revision 2227) +@@ -108,7 +108,7 @@ + + + int exitstatus = 0; /* Exit Status */ +-static void execute (); ++static void execute (char *, char *); + + + int main ( argc, argv ) +Index: src/cmds/qenable.c +=================================================================== +--- src/cmds/qenable.c (revision 2221) ++++ src/cmds/qenable.c (revision 2227) +@@ -109,7 +109,7 @@ + + + int exitstatus = 0; /* Exit Status */ +-static void execute (); ++static void execute (char *, char *); + + + int main( +Index: src/cmds/qsub.c +=================================================================== +--- src/cmds/qsub.c (revision 2221) ++++ src/cmds/qsub.c (revision 2227) +@@ -3823,7 +3823,7 @@ + { + strcat(submit_args_str,argv[argi]); + +- if (argi != optind - 1) ++ if (argi != argc - 1) + { + strcat(submit_args_str," "); + } +Index: src/cmds/qstart.c +=================================================================== +--- src/cmds/qstart.c (revision 2221) ++++ src/cmds/qstart.c (revision 2227) +@@ -108,7 +108,7 @@ + + + int exitstatus = 0; /* Exit Status */ +-static void execute (); ++static void execute (char *, char *); + + + int main ( +Index: src/cmds/qdisable.c +=================================================================== +--- src/cmds/qdisable.c (revision 2221) ++++ src/cmds/qdisable.c (revision 2227) +@@ -110,7 +110,7 @@ + + int exitstatus = 0; /* Exit Status */ + +-static void execute (); ++static void execute (char *, char *); + + int main ( argc, argv ) + int argc; +Index: src/cmds/qrun.c +=================================================================== +--- src/cmds/qrun.c (revision 2221) ++++ src/cmds/qrun.c (revision 2227) +@@ -101,7 +101,7 @@ + #include <pbs_config.h> /* the master config generated by configure */ + + int exitstatus = 0; /* Exit Status */ +-static void execute(); ++static void execute(char *, char *, char *, int); + + + +Index: src/cmds/qterm.c +=================================================================== +--- src/cmds/qterm.c (revision 2221) ++++ src/cmds/qterm.c (revision 2227) +@@ -113,7 +113,7 @@ + + int exitstatus = 0; /* Exit Status */ + +-static void execute(); ++static void execute(int, char *); + + int main( + +Index: src/resmom/start_exec.c +=================================================================== +--- src/resmom/start_exec.c (revision 2221) ++++ src/resmom/start_exec.c (revision 2227) +@@ -133,6 +133,10 @@ + #include "pbs_cpuset.h" + #endif + ++#ifdef NOPOSIXMEMLOCK ++#undef _POSIX_MEMLOCK ++#endif /* NOPOSIXMEMLOCK */ ++ + #define EXTRA_VARIABLE_SPACE 2000 + #define EXTRA_ENV_PTRS 32 + +@@ -4678,9 +4682,9 @@ + + MD5Init(&c); + +- MD5Update(&c,(caddr_t)&loopcnt,sizeof(loopcnt)); ++ MD5Update(&c,(unsigned char *)&loopcnt,sizeof(loopcnt)); + +- MD5Update(&c,(caddr_t)pjob,sizeof(job)); ++ MD5Update(&c,(unsigned char *)pjob,sizeof(job)); + + MD5Final(&c); + +@@ -5286,7 +5290,7 @@ + + /* don't do for checkpoint file names, only StdErr and StdOut */ + +- if (suffix != JOB_CKPT_SUFFIX) ++ if (strcmp(suffix, JOB_CKPT_SUFFIX) != 0) + { + pt = strstr(jobpath,"$HOME"); + +Index: src/resmom/mom_server.c +=================================================================== +--- src/resmom/mom_server.c (revision 2221) ++++ src/resmom/mom_server.c (revision 2227) +@@ -2533,7 +2533,7 @@ + { + int sindex; + +- for (sindex = 0; sindex < PBS_MAXSERVER || down_svraddrs[sindex] == 0; sindex++) ++ for (sindex = 0; sindex < PBS_MAXSERVER && down_svraddrs[sindex] != 0; sindex++) + { + if (down_svraddrs[sindex] == server_address) + { +Index: src/resmom/mom_main.c +=================================================================== +--- src/resmom/mom_main.c (revision 2221) ++++ src/resmom/mom_main.c (revision 2227) +@@ -146,6 +146,9 @@ + + #include "mcom.h" + ++#ifdef NOPOSIXMEMLOCK ++#undef _POSIX_MEMLOCK ++#endif /* NOPOSIXMEMLOCK */ + + #ifdef _POSIX_MEMLOCK + #include <sys/mman.h> +Index: src/server/req_stat.c +=================================================================== +--- src/server/req_stat.c (revision 2221) ++++ src/server/req_stat.c (revision 2227) +@@ -119,7 +119,7 @@ + extern int pbs_mom_port; + extern time_t time_now; + extern char *msg_init_norerun; +-extern struct pbsnode *tfind_addr(); ++extern struct pbsnode *tfind_addr(const u_long); + extern int LOGLEVEL; + + /* Extern Functions */ +Index: src/lib/Libnet/md5.c +=================================================================== +--- src/lib/Libnet/md5.c (revision 2221) ++++ src/lib/Libnet/md5.c (revision 2227) +@@ -49,7 +49,7 @@ + */ + + /* forward declaration */ +-static void Transform (); ++static void Transform (UINT4 *, UINT4 *); + + static unsigned char PADDING[64] = { + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +Index: src/lib/Libnet/net_server.c +=================================================================== +--- src/lib/Libnet/net_server.c (revision 2221) ++++ src/lib/Libnet/net_server.c (revision 2227) +@@ -115,7 +115,7 @@ + + extern void process_request A_((int)); + +-extern time_t time(); ++extern time_t time(time_t *); + + /* Global Data (I wish I could make it private to the library, sigh, but + * C don't support that scope of control.) +Index: configure.ac +=================================================================== +--- configure.ac (revision 2221) ++++ configure.ac (revision 2227) +@@ -79,7 +79,7 @@ + dnl + AC_MSG_CHECKING([whether to turn on the AUTORUN_JOBS flag]) + AC_ARG_ENABLE(autorun, +- [ --enable-autorun turn on the AUTORUN_JOBS flag], ++ [ --enable-autorun turn on the AUTORUN_JOBS flag], + enable_autorun=$enableval, enable_autorun=no) + AC_MSG_RESULT($enable_autorun) + if test "x$enable_autorun" = "xyes" ; then +@@ -94,7 +94,7 @@ + dnl + AC_MSG_CHECKING([whether to turn on the RESOURCEMAXNOTDEFAULT flag]) + AC_ARG_ENABLE(maxnotdefault, +- [ --enable-maxnotdefault turn on the RESOURCEMAXNOTDEFAULT flag], ++ [ --enable-maxnotdefault turn on the RESOURCEMAXNOTDEFAULT flag], + enable_maxnotdefault=$enableval, enable_maxnotdefault=no) + AC_MSG_RESULT($enable_maxnotdefault) + if test "x$enable_maxnotdefault" = "xyes" ; then +@@ -108,7 +108,7 @@ + dnl + AC_MSG_CHECKING([whether to turn on the QUICKCOMMIT flag]) + AC_ARG_ENABLE(quickcommit, +- [ --enable-quickcommit turn on the QUICKCOMMIT flag], ++ [ --enable-quickcommit turn on the QUICKCOMMIT flag], + enable_quickcommit=$enableval, enable_quickcommit=no) + AC_MSG_RESULT($enable_quickcommit) + if test "x$enable_quickcommit" = "xyes" ; then +@@ -122,7 +122,7 @@ + dnl + AC_MSG_CHECKING([whether to turn on the NO_SIGCHLD flag]) + AC_ARG_ENABLE(nochildsignal, +- [ --enable-nochildsignal turn on the NO_SIGCHLD flag], ++ [ --enable-nochildsignal turn on the NO_SIGCHLD flag], + enable_nochildsignal=$enableval, enable_nochildsignal=no) + AC_MSG_RESULT($enable_nochildsignal) + if test "x$enable_nochildsignal" = "xyes" ; then +@@ -709,6 +709,18 @@ + AC_DEFINE_UNQUOTED(SHELL_USE_ARGV, ${SHELL_USE_ARGV}, [job script name passed as the shell's arg]) + + ++ ++AC_ARG_ENABLE(posixmemlock, [ ++ --disable-posixmemlock disable the moms use of mlockall. ++ Some versions of OSs seem to have buggy POSIX MEMLOCK.], ++[case "${enableval}" in ++ yes) ;; ++ no) NOPOSIXMEMLOCK=1; AC_DEFINE(NOPOSIXMEMLOCK, 1, [Define to disable mlockall]) ;; ++ *) AC_MSG_ERROR(--enable-posixmemlock cannot take a value) ;; ++esac])dnl ++ ++ ++ + AC_ARG_ENABLE(privports, [ + --disable-privports disable the use of privileged ports for authentication. + Some versions of OSX have a buggy bind() and cannot +@@ -726,7 +738,7 @@ + [case "${enableval}" in + yes) MOMCHECKLOCALSPOOL=1 ;; + no) MOMCHECKLOCALSPOOL=0;; +- *) AC_MSG_ERROR(--enable-privports cannot take a value) ;; ++ *) AC_MSG_ERROR(--enable-mom-checkspool cannot take a value) ;; + esac],[MOMCHECKLOCALSPOOL=1])dnl + AC_DEFINE_UNQUOTED(MOMCHECKLOCALSPOOL, ${MOMCHECKLOCALSPOOL}, [Define to error if spool is full on MOM]) + +Index: doc/soelim.c +=================================================================== +--- doc/soelim.c (revision 2221) ++++ doc/soelim.c (revision 2227) +@@ -102,7 +102,7 @@ + int argc; + char *argv[]; + { +- int dofile(); ++ int dofile(FILE *); + int dirct = 0; + FILE *filein; + int i; diff --git a/sys-cluster/torque/torque-2.3.1.ebuild b/sys-cluster/torque/torque-2.3.1.ebuild new file mode 100644 index 000000000000..2a1a7c6bf5a7 --- /dev/null +++ b/sys-cluster/torque/torque-2.3.1.ebuild @@ -0,0 +1,233 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/torque-2.3.1.ebuild,v 1.1 2008/07/10 03:28:56 jsbronder Exp $ + +inherit autotools flag-o-matic eutils linux-info + +DESCRIPTION="Resource manager and queuing system based on OpenPBS" +HOMEPAGE="http://www.clusterresources.com/products/torque/" +SRC_URI="http://www.clusterresources.com/downloads/${PN}/${P}.tar.gz" + +LICENSE="openpbs" + +SLOT="0" +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="tk crypt server syslog doc cpusets kernel_linux" +PROVIDE="virtual/pbs" + +# ed is used by makedepend-sh +DEPEND_COMMON="virtual/libc + sys-libs/ncurses + sys-libs/readline + tk? ( dev-lang/tk ) + syslog? ( virtual/logger ) + !virtual/pbs + !sys-cluster/openpbs-common + !games-util/qstat" + +DEPEND="${DEPEND_COMMON} + sys-apps/ed" + +RDEPEND="${DEPEND_COMMON} + crypt? ( net-misc/openssh ) + !crypt? ( net-misc/netkit-rsh )" + +[ -n "${PBS_SERVER_HOME}" ] || PBS_SERVER_HOME="/var/spool/torque" + +pkg_setup() { + linux-info_pkg_setup + USE_CPUSETS="--disable-cpusets" + if use cpusets; then + if ! use kernel_linux; then + einfo + elog " Torque currently only has support for cpusets in linux." + elog "Assuming you didn't really want this USE flag." + einfo + else + einfo + elog " Torque support for cpusets is still in development, you may" + elog "wish to disable it for production use." + einfo + if ! linux_chkconfig_present CPUSETS; then + einfo + elog " Torque support for cpusets will require that you recompile" + elog "your kernel with CONFIG_CPUSETS enabled." + einfo + fi + USE_CPUSETS="--enable-cpusets" + fi + fi +} + +src_unpack() { + unpack ${A} + cd "${S}" + + # Fixes gcc-4.2 compile errors. Changes to configure and CHANGELOG had to + # be removed to get the patch to apply cleanly. + # TODO: Will not be required in 2.3.2 + epatch "${FILESDIR}"/torque-2.3-fixes-r2221-2227.patch +} + +src_compile() { + local myconf="--with-rcp=mom_rcp" + + use crypt && myconf="--with-rcp=scp" + + [ -n "${PBS_SERVER_NAME}" ] || PBS_SERVER_NAME=$(hostname -f) + + econf \ + $(use_enable tk gui) \ + $(use_enable syslog) \ + $(use_enable server) \ + --with-server-home=${PBS_SERVER_HOME} \ + --with-environ=/etc/pbs_environment \ + --with-default-server=${PBS_SERVER_NAME} \ + --disable-gcc-warnings \ + ${USE_CPUSETS} \ + ${myconf} \ + || die "econf 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() { + local root="$1" + local s="$(dirname "${PBS_SERVER_HOME}")" + local h="${PBS_SERVER_HOME}" + local sp="${h}/server_priv" + einfo "Building spool directory under ${D}${h}" + local a d m + local dir_spec=" + 0755:${h}/aux 0700:${h}/checkpoint + 0755:${h}/mom_logs 0751:${h}/mom_priv 0751:${h}/mom_priv/jobs + 1777:${h}/spool 1777:${h}/undelivered" + + if use server; then + dir_spec="${dir_spec} 0755:${h}/sched_logs + 0755:${h}/sched_priv/accounting 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" + fi + + for a in ${dir_spec}; do + d="${a/*:}" + m="${a/:*}" + if [[ ! -d "${root}${d}" ]]; then + install -d -m${m} "${root}${d}" + else + chmod ${m} "${root}${d}" + fi + # (#149226) If we're running in src_*, then keepdir + if [[ "${root}" = "${D}" ]]; then + keepdir ${d} + fi + done +} + +src_install() { + # Make directories first + pbs_createspool "${D}" + + make DESTDIR="${D}" install || die "make install failed" + + dodoc CHANGELOG DEVELOPMENT README.* Release_Notes || die "dodoc failed" + if use doc; then + dodoc doc/admin_guide.ps doc/*.pdf || die "dodoc failed" + 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 + + if use server; then + newinitd "${FILESDIR}"/pbs_server-init.d-2.2.1-r1 pbs_server + newinitd "${FILESDIR}"/pbs_sched-init.d-2.2.1-r1 pbs_sched + fi + newinitd "${FILESDIR}"/pbs_mom-init.d-2.2.1-r1 pbs_mom + newconfd "${FILESDIR}"/torque-conf.d-2.2.1-r1 torque + newenvd "${FILESDIR}"/torque-env.d-2.2.1-r1 25torque +} + +pkg_preinst() { + if [[ -f "${ROOT}etc/pbs_environment" ]]; then + cp "${ROOT}etc/pbs_environment" "${D}"/etc/pbs_environment + fi + + if [ -n "${PBS_SERVER_NAME}" ]; then + echo "${PBS_SERVER_NAME}" > "${D}${PBS_SERVER_HOME}/server_name" + elif [[ -f "${ROOT}${PBS_SERVER_HOME}/server_name" ]]; then + cp "${ROOT}${PBS_SERVER_HOME}/server_name" "${D}${PBS_SERVER_HOME}/server_name" + fi + + # Fix up the env.d file to use our set server home. + sed -i "s:/var/spool/torque:${PBS_SERVER_HOME}:g" "${D}"/etc/env.d/25torque +} + +pkg_postinst() { + pbs_createspool "${ROOT}" + elog " If this is the first time torque has been installed, then you are not" + elog "ready to start the server. Please refer to the documentation located at:" + elog "http://www.clusterresources.com/wiki/doku.php?id=torque:torque_wiki" + + elog " For a basic setup, you may use emerge --config ${PN}" +} + +# Either the correct PBS_SERVER_HOME and PBS_SERVER_NAME are set +# or we use the default HOME and the localhost as the server. +# root will be setup as the primary operator/manager, the local machine +# will be added as a node and we'll create a simple queue, batch. +pkg_config() { + local h="${ROOT}/${PBS_SERVER_HOME}" + local rc=0 + + ebegin "Configuring Torque" + [ -n "${PBS_SERVER_NAME}" ] || PBS_SERVER_NAME=$(hostname -f) + einfo "Using ${PBS_SERVER_HOME} as the pbs homedir" + einfo "Using ${PBS_SERVER_NAME} as the pbs_server" + + # Check for previous configuration and bail if found. + if [ -e "${h}/server_priv/acl_svr/operators" ] \ + || [ -e "${h}/server_priv/nodes" ] \ + || [ -e "${h}/mom_priv/config" ]; then + ewarn "Previous Torque configuration detected. Press any key to" + ewarn "continue or press Control-C to abort now" + read + fi + + # pbs_mom configuration. + echo "\$pbsserver ${PBS_SERVER_NAME}" > "${h}/mom_priv/config" + echo "\$logevent 255" >> "${h}/mom_priv/config" + + if use server; then + local qmgr="${ROOT}/usr/bin/qmgr -c" + if ! echo "y" | "${ROOT}"/usr/sbin/pbs_server \ + -d "${ROOT}${PBS_SERVER_HOME}" -t create &>/dev/null; then + eerror "Failed to start pbs_server" + rc=1 + else + ${qmgr} "set server operators = root@$(hostname -f)" ${PBS_SERVER_NAME} + ${qmgr} "create queue batch" ${PBS_SERVER_NAME} + ${qmgr} "set queue batch queue_type = Execution" ${PBS_SERVER_NAME} + ${qmgr} "set queue batch started = True" ${PBS_SERVER_NAME} + ${qmgr} "set queue batch enabled = True" ${PBS_SERVER_NAME} + ${qmgr} "set server default_queue = batch" ${PBS_SERVER_NAME} + ${qmgr} "set server resources_default.nodes = 1" ${PBS_SERVER_NAME} + ${qmgr} "set server scheduling = True" ${PBS_SERVER_NAME} + + "${ROOT}"/usr/bin/qterm -t quick ${PBS_SERVER_NAME} || rc=1 + + # Add the local machine as a node. + echo "$(hostname -f) np=1" > "${h}/server_priv/nodes" + fi + fi + eend ${rc} +} |