Gentoo Archives: gentoo-commits

From: "Justin Bronder (jsbronder)" <jsbronder@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-cluster/torque: torque-2.4.16-r1.ebuild torque-2.5.12-r1.ebuild ChangeLog torque-4.1.5.1-r1.ebuild torque-2.4.16.ebuild torque-2.5.12.ebuild torque-4.1.5.1.ebuild
Date: Mon, 23 Dec 2013 18:01:41
Message-Id: 20131223180136.1CB3E2004E@flycatcher.gentoo.org
1 jsbronder 13/12/23 18:01:35
2
3 Modified: ChangeLog torque-2.4.16.ebuild
4 Added: torque-2.4.16-r1.ebuild torque-2.5.12-r1.ebuild
5 torque-4.1.5.1-r1.ebuild
6 Removed: torque-2.5.12.ebuild torque-4.1.5.1.ebuild
7 Log:
8 Add patches for CVE-2013-4319 (#484320).
9
10 (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 4D7043C9)
11
12 Revision Changes Path
13 1.157 sys-cluster/torque/ChangeLog
14
15 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/ChangeLog?rev=1.157&view=markup
16 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/ChangeLog?rev=1.157&content-type=text/plain
17 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/ChangeLog?r1=1.156&r2=1.157
18
19 Index: ChangeLog
20 ===================================================================
21 RCS file: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v
22 retrieving revision 1.156
23 retrieving revision 1.157
24 diff -u -r1.156 -r1.157
25 --- ChangeLog 23 Dec 2013 17:35:39 -0000 1.156
26 +++ ChangeLog 23 Dec 2013 18:01:35 -0000 1.157
27 @@ -1,6 +1,17 @@
28 # ChangeLog for sys-cluster/torque
29 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
30 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v 1.156 2013/12/23 17:35:39 jsbronder Exp $
31 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v 1.157 2013/12/23 18:01:35 jsbronder Exp $
32 +
33 +*torque-4.1.5.1-r1 (23 Dec 2013)
34 +*torque-2.5.12-r1 (23 Dec 2013)
35 +*torque-2.4.16-r1 (23 Dec 2013)
36 +
37 + 23 Dec 2013; Justin Bronder <jsbronder@g.o> torque-2.4.16.ebuild,
38 + +torque-2.4.16-r1.ebuild, -torque-2.5.12.ebuild, +torque-2.5.12-r1.ebuild,
39 + -torque-4.1.5.1.ebuild, +torque-4.1.5.1-r1.ebuild,
40 + +files/CVE-2013-4319-2.x-root-submit-fix.patch,
41 + +files/CVE-2013-4319-4.x-root-submit-fix.patch:
42 + Add patches for CVE-2013-4319 (#484320).
43
44 23 Dec 2013; Justin Bronder <jsbronder@g.o> -torque-2.3.13.ebuild,
45 -torque-3.0.6-r1.ebuild:
46
47
48
49 1.14 sys-cluster/torque/torque-2.4.16.ebuild
50
51 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/torque-2.4.16.ebuild?rev=1.14&view=markup
52 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/torque-2.4.16.ebuild?rev=1.14&content-type=text/plain
53 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/torque-2.4.16.ebuild?r1=1.13&r2=1.14
54
55 Index: torque-2.4.16.ebuild
56 ===================================================================
57 RCS file: /var/cvsroot/gentoo-x86/sys-cluster/torque/torque-2.4.16.ebuild,v
58 retrieving revision 1.13
59 retrieving revision 1.14
60 diff -u -r1.13 -r1.14
61 --- torque-2.4.16.ebuild 1 Jun 2013 19:49:33 -0000 1.13
62 +++ torque-2.4.16.ebuild 23 Dec 2013 18:01:35 -0000 1.14
63 @@ -1,6 +1,6 @@
64 # Copyright 1999-2013 Gentoo Foundation
65 # Distributed under the terms of the GNU General Public License v2
66 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/torque-2.4.16.ebuild,v 1.13 2013/06/01 19:49:33 jsbronder Exp $
67 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/torque-2.4.16.ebuild,v 1.14 2013/12/23 18:01:35 jsbronder Exp $
68
69 EAPI=2
70 WANT_AUTOMAKE="1.12"
71 @@ -77,6 +77,7 @@
72
73 epatch "${FILESDIR}"/0002-fix-implicit-declaration-warnings.patch
74 epatch "${FILESDIR}"/disable-automagic-doc-building-2.4.14.patch
75 + epatch "${FILESDIR}"/CVE-2013-4319-2.x-root-submit-fix.patch
76
77 sed -i \
78 -e 's,\(COMPACT_LATEX *=\).*,\1 NO,' \
79
80
81
82 1.1 sys-cluster/torque/torque-2.4.16-r1.ebuild
83
84 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/torque-2.4.16-r1.ebuild?rev=1.1&view=markup
85 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/torque-2.4.16-r1.ebuild?rev=1.1&content-type=text/plain
86
87 Index: torque-2.4.16-r1.ebuild
88 ===================================================================
89 # Copyright 1999-2013 Gentoo Foundation
90 # Distributed under the terms of the GNU General Public License v2
91 # $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/torque-2.4.16-r1.ebuild,v 1.1 2013/12/23 18:01:35 jsbronder Exp $
92
93 EAPI=2
94 WANT_AUTOMAKE="1.12"
95 inherit flag-o-matic eutils linux-info autotools
96
97 DESCRIPTION="Resource manager and queuing system based on OpenPBS"
98 HOMEPAGE="http://www.adaptivecomputing.com/products/open-source/torque"
99 SRC_URI="http://www.adaptivecomputing.com/resources/downloads/${PN}/${P}.tar.gz"
100
101 LICENSE="openpbs"
102
103 SLOT="0"
104 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
105 IUSE="tk +crypt drmaa server +syslog doc cpusets kernel_linux"
106
107 # ed is used by makedepend-sh
108 DEPEND_COMMON="sys-libs/ncurses
109 sys-libs/readline
110 tk? ( dev-lang/tk )
111 syslog? ( virtual/logger )
112 !games-util/qstat"
113
114 DEPEND="${DEPEND_COMMON}
115 doc? ( drmaa? (
116 || ( <app-doc/doxygen-1.7.6.1[latex,-nodot] >=app-doc/doxygen-1.7.6.1[latex,dot] )
117 ) )
118 sys-apps/ed"
119
120 RDEPEND="${DEPEND_COMMON}
121 crypt? ( net-misc/openssh )
122 !crypt? ( net-misc/netkit-rsh )"
123
124 pkg_setup() {
125 PBS_SERVER_HOME="${PBS_SERVER_HOME:-/var/spool/torque}"
126
127 # Find a Torque server to use. Check environment, then
128 # current setup (if any), and fall back on current hostname.
129 if [ -z "${PBS_SERVER_NAME}" ]; then
130 if [ -f "${ROOT}${PBS_SERVER_HOME}/server_name" ]; then
131 PBS_SERVER_NAME="$(<${ROOT}${PBS_SERVER_HOME}/server_name)"
132 else
133 PBS_SERVER_NAME=$(hostname -f)
134 fi
135 fi
136
137 USE_CPUSETS="--disable-cpuset"
138 if use cpusets; then
139 if ! use kernel_linux; then
140 einfo
141 elog " Torque currently only has support for cpusets in linux."
142 elog "Assuming you didn't really want this USE flag."
143 einfo
144 else
145 linux-info_pkg_setup
146 einfo
147 elog " Torque support for cpusets is still in development, you may"
148 elog "wish to disable it for production use."
149 einfo
150 if ! linux_config_exists || ! linux_chkconfig_present CPUSETS; then
151 einfo
152 elog " Torque support for cpusets will require that you recompile"
153 elog "your kernel with CONFIG_CPUSETS enabled."
154 einfo
155 fi
156 USE_CPUSETS="--enable-cpuset"
157 fi
158 fi
159 }
160
161 src_prepare() {
162 # Unused and causes breakage when switching from glibc to tirpc.
163 # https://github.com/adaptivecomputing/torque/pull/148
164 sed -i '/rpc\/rpc\.h/d' src/lib/Libnet/net_client.c || die
165
166 epatch "${FILESDIR}"/0002-fix-implicit-declaration-warnings.patch
167 epatch "${FILESDIR}"/disable-automagic-doc-building-2.4.14.patch
168 epatch "${FILESDIR}"/CVE-2013-4319-2.x-root-submit-fix.patch
169
170 sed -i \
171 -e 's,\(COMPACT_LATEX *=\).*,\1 NO,' \
172 -e 's,\(GENERATE_MAN *=\).*,\1 NO,' \
173 src/drmaa/Doxyfile.in || die
174 sed -i \
175 -e '/INSTALL_DATA/d' \
176 src/drmaa/Makefile.am || die
177 eautoreconf
178 }
179
180 src_configure() {
181 local myconf="--with-rcp=mom_rcp"
182
183 use crypt && myconf="--with-rcp=scp"
184
185 if use drmaa && use doc; then
186 myconf="${myconf} --enable-apidocs"
187 else
188 myconf="${myconf} --disable-apidocs"
189 fi
190
191 econf \
192 $(use_enable tk gui) \
193 $(use_enable syslog) \
194 $(use_enable server) \
195 $(use_enable drmaa) \
196 --with-server-home=${PBS_SERVER_HOME} \
197 --with-environ=/etc/pbs_environment \
198 --with-default-server=${PBS_SERVER_NAME} \
199 --disable-gcc-warnings \
200 ${USE_CPUSETS} \
201 ${myconf}
202 }
203
204 # WARNING
205 # OpenPBS is extremely stubborn about directory permissions. Sometimes it will
206 # just fall over with the error message, but in some spots it will just ignore
207 # you and fail strangely. Likewise it also barfs on our .keep files!
208 pbs_createspool() {
209 local root="$1"
210 local s="$(dirname "${PBS_SERVER_HOME}")"
211 local h="${PBS_SERVER_HOME}"
212 local sp="${h}/server_priv"
213 einfo "Building spool directory under ${D}${h}"
214 local a d m
215 local dir_spec="
216 0755:${h}/aux 0700:${h}/checkpoint
217 0755:${h}/mom_logs 0751:${h}/mom_priv 0751:${h}/mom_priv/jobs
218 1777:${h}/spool 1777:${h}/undelivered"
219
220 if use server; then
221 dir_spec="${dir_spec} 0755:${h}/sched_logs
222 0755:${h}/sched_priv/accounting 0755:${h}/server_logs
223 0750:${h}/server_priv 0755:${h}/server_priv/accounting
224 0750:${h}/server_priv/acl_groups 0750:${h}/server_priv/acl_hosts
225 0750:${h}/server_priv/acl_svr 0750:${h}/server_priv/acl_users
226 0750:${h}/server_priv/jobs 0750:${h}/server_priv/queues"
227 fi
228
229 for a in ${dir_spec}; do
230 d="${a/*:}"
231 m="${a/:*}"
232 if [[ ! -d "${root}${d}" ]]; then
233 install -d -m${m} "${root}${d}"
234 else
235 chmod ${m} "${root}${d}"
236 fi
237 # (#149226) If we're running in src_*, then keepdir
238 if [[ "${root}" = "${D}" ]]; then
239 keepdir ${d}
240 fi
241 done
242 }
243
244 src_install() {
245 # Make directories first
246 pbs_createspool "${D}"
247
248 emake DESTDIR="${D}" install || die "make install failed"
249
250 dodoc CHANGELOG README.* Release_Notes || die "dodoc failed"
251 if use doc; then
252 dodoc doc/admin_guide.ps doc/*.pdf || die "dodoc failed"
253 if use drmaa; then
254 dohtml -r src/drmaa/doc/html/* || die
255 dodoc src/drmaa/drmaa.pdf || die
256 fi
257 fi
258
259 # The build script isn't alternative install location friendly,
260 # So we have to fix some hard-coded paths in tclIndex for xpbs* to work
261 for file in `find "${D}" -iname tclIndex`; do
262 sed -e "s/${D//\// }/ /" "${file}" > "${file}.new" || die
263 mv "${file}.new" "${file}" || die
264 done
265
266 if use server; then
267 newinitd "${FILESDIR}"/pbs_server-init.d pbs_server
268 newinitd "${FILESDIR}"/pbs_sched-init.d pbs_sched
269 fi
270 newinitd "${FILESDIR}"/pbs_mom-init.d pbs_mom
271 newconfd "${FILESDIR}"/torque-conf.d torque
272 newenvd "${FILESDIR}"/torque-env.d 25torque
273
274 [ -d "${D}"/usr/share/doc/torque-drmaa ] && \
275 rm -rf "${D}"/usr/share/doc/torque-drmaa
276 }
277
278 pkg_preinst() {
279 if [[ -f "${ROOT}etc/pbs_environment" ]]; then
280 cp "${ROOT}etc/pbs_environment" "${D}"/etc/pbs_environment
281 fi
282
283 echo "${PBS_SERVER_NAME}" > "${D}${PBS_SERVER_HOME}/server_name"
284
285 # Fix up the env.d file to use our set server home.
286 sed -i "s:/var/spool/torque:${PBS_SERVER_HOME}:g" \
287 "${D}"/etc/env.d/25torque || die
288 }
289
290 pkg_postinst() {
291 pbs_createspool "${ROOT}"
292 elog " If this is the first time torque has been installed, then you are not"
293 elog "ready to start the server. Please refer to the documentation located at:"
294 elog "http://www.clusterresources.com/wiki/doku.php?id=torque:torque_wiki"
295
296 elog " For a basic setup, you may use emerge --config ${PN}"
297 }
298
299 # root will be setup as the primary operator/manager, the local machine
300 # will be added as a node and we'll create a simple queue, batch.
301 pkg_config() {
302 local h="$(echo "${ROOT}/${PBS_SERVER_HOME}" | sed 's:///*:/:g')"
303 local rc=0
304
305 ebegin "Configuring Torque"
306 einfo "Using ${h} as the pbs homedir"
307 einfo "Using ${PBS_SERVER_NAME} as the pbs_server"
308
309 # Check for previous configuration and bail if found.
310 if [ -e "${h}/server_priv/acl_svr/operators" ] \
311 || [ -e "${h}/server_priv/nodes" ] \
312 || [ -e "${h}/mom_priv/config" ]; then
313 ewarn "Previous Torque configuration detected. Press any key to"
314 ewarn "continue or press Control-C to abort now"
315 read
316 fi
317
318 # pbs_mom configuration.
319 echo "\$pbsserver ${PBS_SERVER_NAME}" > "${h}/mom_priv/config"
320 echo "\$logevent 255" >> "${h}/mom_priv/config"
321
322 if use server; then
323 local qmgr="${ROOT}/usr/bin/qmgr -c"
324 # pbs_server bails on repeated backslashes.
325 if ! echo "y" | "${ROOT}"/usr/sbin/pbs_server -d "${h}" -t create; then
326 eerror "Failed to start pbs_server"
327 rc=1
328 else
329 ${qmgr} "set server operators = root@$(hostname -f)" ${PBS_SERVER_NAME}
330 ${qmgr} "create queue batch" ${PBS_SERVER_NAME}
331 ${qmgr} "set queue batch queue_type = Execution" ${PBS_SERVER_NAME}
332 ${qmgr} "set queue batch started = True" ${PBS_SERVER_NAME}
333 ${qmgr} "set queue batch enabled = True" ${PBS_SERVER_NAME}
334 ${qmgr} "set server default_queue = batch" ${PBS_SERVER_NAME}
335 ${qmgr} "set server resources_default.nodes = 1" ${PBS_SERVER_NAME}
336 ${qmgr} "set server scheduling = True" ${PBS_SERVER_NAME}
337
338 "${ROOT}"/usr/bin/qterm -t quick ${PBS_SERVER_NAME} || rc=1
339
340 # Add the local machine as a node.
341 echo "$(hostname -f) np=1" > "${h}/server_priv/nodes"
342 fi
343 fi
344 eend ${rc}
345 }
346
347
348
349 1.1 sys-cluster/torque/torque-2.5.12-r1.ebuild
350
351 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/torque-2.5.12-r1.ebuild?rev=1.1&view=markup
352 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/torque-2.5.12-r1.ebuild?rev=1.1&content-type=text/plain
353
354 Index: torque-2.5.12-r1.ebuild
355 ===================================================================
356 # Copyright 1999-2013 Gentoo Foundation
357 # Distributed under the terms of the GNU General Public License v2
358 # $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/torque-2.5.12-r1.ebuild,v 1.1 2013/12/23 18:01:35 jsbronder Exp $
359
360 EAPI=4
361
362 inherit autotools-utils eutils flag-o-matic linux-info
363
364 DESCRIPTION="Resource manager and queuing system based on OpenPBS"
365 HOMEPAGE="http://www.adaptivecomputing.com/products/open-source/torque"
366 SRC_URI="http://www.adaptivecomputing.com/resources/downloads/${PN}/${P}.tar.gz"
367
368 LICENSE="torque-2.5"
369
370 SLOT="0"
371 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
372 IUSE="cpusets +crypt doc drmaa kernel_linux munge server static-libs +syslog threads tk xml"
373
374 # ed is used by makedepend-sh
375 DEPEND_COMMON="sys-libs/ncurses
376 sys-libs/readline
377 munge? ( sys-auth/munge )
378 tk? ( dev-lang/tk )
379 syslog? ( virtual/logger )
380 !games-util/qstat"
381
382 DEPEND="${DEPEND_COMMON}
383 sys-apps/ed
384 !sys-cluster/slurm"
385
386 RDEPEND="${DEPEND_COMMON}
387 crypt? ( net-misc/openssh )
388 !crypt? ( net-misc/netkit-rsh )"
389
390 DOCS=( Release_Notes )
391
392 PATCHES=( "${FILESDIR}"/tcl8.6.patch )
393
394 AUTOTOOLS_IN_SOURCE_BUILD=1
395
396 pkg_setup() {
397 PBS_SERVER_HOME="${PBS_SERVER_HOME:-/var/spool/torque}"
398
399 # Find a Torque server to use. Check environment, then
400 # current setup (if any), and fall back on current hostname.
401 if [ -z "${PBS_SERVER_NAME}" ]; then
402 if [ -f "${ROOT}${PBS_SERVER_HOME}/server_name" ]; then
403 PBS_SERVER_NAME="$(<${ROOT}${PBS_SERVER_HOME}/server_name)"
404 else
405 PBS_SERVER_NAME=$(hostname -f)
406 fi
407 fi
408
409 USE_CPUSETS="--disable-cpuset"
410 if use cpusets; then
411 if ! use kernel_linux; then
412 einfo
413 elog " Torque currently only has support for cpusets in linux."
414 elog "Assuming you didn't really want this USE flag."
415 einfo
416 else
417 linux-info_pkg_setup
418 einfo
419 elog " Torque support for cpusets is still in development, you may"
420 elog "wish to disable it for production use."
421 einfo
422 if ! linux_config_exists || ! linux_chkconfig_present CPUSETS; then
423 einfo
424 elog " Torque support for cpusets will require that you recompile"
425 elog "your kernel with CONFIG_CPUSETS enabled."
426 einfo
427 fi
428 USE_CPUSETS="--enable-cpuset"
429 fi
430 fi
431 }
432
433 src_prepare() {
434 epatch "${FILESDIR}"/CVE-2013-4319-2.x-root-submit-fix.patch
435
436 # Unused and causes breakage when switching from glibc to tirpc.
437 # https://github.com/adaptivecomputing/torque/pull/148
438 sed -i '/rpc\/rpc\.h/d' src/lib/Libnet/net_client.c || die
439 }
440
441 src_configure() {
442 local myeconfargs=( --with-rcp=mom_rcp )
443
444 use crypt && myeconfargs=( --with-rcp=scp )
445
446 myeconfargs+=(
447 $(use_enable tk gui)
448 $(use_enable tk tcl-qstat)
449 $(use_enable syslog)
450 $(use_enable server)
451 $(use_enable drmaa)
452 $(use_enable threads high-availability)
453 $(use_enable xml server-xml)
454 $(use_enable munge munge-auth)
455 --with-server-home=${PBS_SERVER_HOME}
456 --with-environ=/etc/pbs_environment
457 --with-default-server=${PBS_SERVER_NAME}
458 --disable-gcc-warnings
459 --with-tcp-retry-limit=2
460 ${USE_CPUSETS}
461 )
462 autotools-utils_src_configure
463 }
464
465 # WARNING
466 # OpenPBS is extremely stubborn about directory permissions. Sometimes it will
467 # just fall over with the error message, but in some spots it will just ignore
468 # you and fail strangely. Likewise it also barfs on our .keep files!
469 pbs_createspool() {
470 local root="$1"
471 local s="$(dirname "${PBS_SERVER_HOME}")"
472 local h="${PBS_SERVER_HOME}"
473 local sp="${h}/server_priv"
474 einfo "Building spool directory under ${D}${h}"
475 local a d m
476 local dir_spec="
477 0755:${h}/aux 0700:${h}/checkpoint
478 0755:${h}/mom_logs 0751:${h}/mom_priv 0751:${h}/mom_priv/jobs
479 1777:${h}/spool 1777:${h}/undelivered"
480
481 if use server; then
482 dir_spec="${dir_spec} 0755:${h}/sched_logs
483 0755:${h}/sched_priv/accounting 0755:${h}/server_logs
484 0750:${h}/server_priv 0755:${h}/server_priv/accounting
485 0750:${h}/server_priv/acl_groups 0750:${h}/server_priv/acl_hosts
486 0750:${h}/server_priv/acl_svr 0750:${h}/server_priv/acl_users
487 0750:${h}/server_priv/jobs 0750:${h}/server_priv/queues"
488 fi
489
490 for a in ${dir_spec}; do
491 d="${a/*:}"
492 m="${a/:*}"
493 if [[ ! -d "${root}${d}" ]]; then
494 install -d -m${m} "${root}${d}" || die
495 else
496 chmod ${m} "${root}${d}" || die
497 fi
498 # (#149226) If we're running in src_*, then keepdir
499 if [[ "${root}" = "${D}" ]]; then
500 keepdir ${d}
501 fi
502 done
503 }
504
505 src_install() {
506 # Make directories first
507 pbs_createspool "${D}"
508
509 autotools-utils_src_install
510
511 use doc && dodoc doc/admin_guide.ps doc/*.pdf
512
513 # The build script isn't alternative install location friendly,
514 # So we have to fix some hard-coded paths in tclIndex for xpbs* to work
515 for file in `find "${D}" -iname tclIndex`; do
516 sed -e "s/${D//\// }/ /" "${file}" > "${file}.new"
517 mv "${file}.new" "${file}" || die
518 done
519
520 if use server; then
521 newinitd "${FILESDIR}"/pbs_server-init.d-munge pbs_server
522 newinitd "${FILESDIR}"/pbs_sched-init.d pbs_sched
523 fi
524 newinitd "${FILESDIR}"/pbs_mom-init.d-munge pbs_mom
525 newconfd "${FILESDIR}"/torque-conf.d-munge torque
526 newenvd "${FILESDIR}"/torque-env.d 25torque
527 }
528
529 pkg_preinst() {
530 if [[ -f "${ROOT}etc/pbs_environment" ]]; then
531 cp "${ROOT}etc/pbs_environment" "${D}"/etc/pbs_environment || die
532 fi
533
534 echo "${PBS_SERVER_NAME}" > "${D}${PBS_SERVER_HOME}/server_name" || die
535
536 # Fix up the env.d file to use our set server home.
537 sed -i \
538 "s:/var/spool/torque:${PBS_SERVER_HOME}:g" "${D}"/etc/env.d/25torque \
539 || die
540
541 if use munge; then
542 sed -i 's,\(PBS_USE_MUNGE=\).*,\11,' "${D}"etc/conf.d/torque || die
543 fi
544 }
545
546 pkg_postinst() {
547 pbs_createspool "${ROOT}"
548 elog " If this is the first time torque has been installed, then you are not"
549 elog "ready to start the server. Please refer to the documentation located at:"
550 elog "http://www.clusterresources.com/wiki/doku.php?id=torque:torque_wiki"
551 echo
552 elog " For a basic setup, you may use emerge --config ${PN}"
553 }
554
555 # root will be setup as the primary operator/manager, the local machine
556 # will be added as a node and we'll create a simple queue, batch.
557 pkg_config() {
558 local h="$(echo "${ROOT}/${PBS_SERVER_HOME}" | sed 's:///*:/:g')"
559 local rc=0
560
561 ebegin "Configuring Torque"
562 einfo "Using ${h} as the pbs homedir"
563 einfo "Using ${PBS_SERVER_NAME} as the pbs_server"
564
565 # Check for previous configuration and bail if found.
566 if [ -e "${h}/server_priv/acl_svr/operators" ] \
567 || [ -e "${h}/server_priv/nodes" ] \
568 || [ -e "${h}/mom_priv/config" ]; then
569 ewarn "Previous Torque configuration detected. Press Enter to"
570 ewarn "continue or Control-C to abort now"
571 read
572 fi
573
574 # pbs_mom configuration.
575 echo "\$pbsserver ${PBS_SERVER_NAME}" > "${h}/mom_priv/config" || die
576 echo "\$logevent 255" >> "${h}/mom_priv/config" || die
577
578 if use server; then
579 local qmgr="${ROOT}/usr/bin/qmgr -c"
580 # pbs_server bails on repeated backslashes.
581 if ! "${ROOT}"/usr/sbin/pbs_server -f -d "${h}" -t create; then
582 eerror "Failed to start pbs_server"
583 rc=1
584 else
585 ${qmgr} "set server operators = root@$(hostname -f)" ${PBS_SERVER_NAME} \
586 && ${qmgr} "create queue batch" ${PBS_SERVER_NAME} \
587 && ${qmgr} "set queue batch queue_type = Execution" ${PBS_SERVER_NAME} \
588 && ${qmgr} "set queue batch started = True" ${PBS_SERVER_NAME} \
589 && ${qmgr} "set queue batch enabled = True" ${PBS_SERVER_NAME} \
590 && ${qmgr} "set server default_queue = batch" ${PBS_SERVER_NAME} \
591 && ${qmgr} "set server resources_default.nodes = 1" ${PBS_SERVER_NAME} \
592 && ${qmgr} "set server scheduling = True" ${PBS_SERVER_NAME} \
593 || die
594
595 "${ROOT}"/usr/bin/qterm -t quick ${PBS_SERVER_NAME} || rc=1
596
597 # Add the local machine as a node.
598 echo "$(hostname -f) np=1" > "${h}/server_priv/nodes" || die
599 fi
600 fi
601 eend ${rc}
602 }
603
604
605
606 1.1 sys-cluster/torque/torque-4.1.5.1-r1.ebuild
607
608 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/torque-4.1.5.1-r1.ebuild?rev=1.1&view=markup
609 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/torque-4.1.5.1-r1.ebuild?rev=1.1&content-type=text/plain
610
611 Index: torque-4.1.5.1-r1.ebuild
612 ===================================================================
613 # Copyright 1999-2013 Gentoo Foundation
614 # Distributed under the terms of the GNU General Public License v2
615 # $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/torque-4.1.5.1-r1.ebuild,v 1.1 2013/12/23 18:01:35 jsbronder Exp $
616
617 EAPI=4
618 inherit flag-o-matic eutils linux-info
619
620 DESCRIPTION="Resource manager and queuing system based on OpenPBS"
621 HOMEPAGE="http://www.adaptivecomputing.com/products/open-source/torque"
622 # TODO: hopefully moving to github tags soon
623 # http://www.supercluster.org/pipermail/torquedev/2013-May/004519.html
624 SRC_URI="http://www.adaptivecomputing.com/index.php?wpfb_dl=1058 -> ${P}.tar.gz"
625 LICENSE="torque-2.5"
626
627 SLOT="0"
628 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
629 IUSE="cpusets +crypt doc drmaa kernel_linux munge nvidia server +syslog tk"
630
631 DEPEND_COMMON="sys-libs/ncurses
632 sys-libs/readline
633 cpusets? ( sys-apps/hwloc )
634 munge? ( sys-auth/munge )
635 nvidia? ( >=x11-drivers/nvidia-drivers-275 )
636 tk? ( dev-lang/tk )
637 syslog? ( virtual/logger )
638 !games-util/qstat"
639
640 DEPEND="${DEPEND_COMMON}
641 !sys-cluster/slurm"
642
643 RDEPEND="${DEPEND_COMMON}
644 crypt? ( net-misc/openssh )
645 !crypt? ( net-misc/netkit-rsh )"
646
647 pkg_setup() {
648 PBS_SERVER_HOME="${PBS_SERVER_HOME:-/var/spool/torque}"
649
650 # Find a Torque server to use. Check environment, then
651 # current setup (if any), and fall back on current hostname.
652 if [ -z "${PBS_SERVER_NAME}" ]; then
653 if [ -f "${ROOT}${PBS_SERVER_HOME}/server_name" ]; then
654 PBS_SERVER_NAME="$(<${ROOT}${PBS_SERVER_HOME}/server_name)"
655 else
656 PBS_SERVER_NAME=$(hostname -f)
657 fi
658 fi
659
660 USE_CPUSETS="--disable-cpuset"
661 if use cpusets; then
662 if ! use kernel_linux; then
663 einfo
664 elog " Torque currently only has support for cpusets in linux."
665 elog "Assuming you didn't really want this USE flag."
666 einfo
667 else
668 linux-info_pkg_setup
669 if ! linux_config_exists || ! linux_chkconfig_present CPUSETS; then
670 einfo
671 elog " Torque support for cpusets will require that you recompile"
672 elog "your kernel with CONFIG_CPUSETS enabled."
673 einfo
674 fi
675 USE_CPUSETS="--enable-cpuset"
676 fi
677 fi
678 }
679
680 src_prepare() {
681 # Unused and causes breakage when switching from glibc to tirpc.
682 # https://github.com/adaptivecomputing/torque/pull/148
683 sed -i '/rpc\/rpc\.h/d' src/lib/Libnet/net_client.c || die
684
685 # We install to a valid location, no need to muck with ld.so.conf
686 # --without-loadlibfile is supposed to do this for us...
687 sed -i '/mk_default_ld_lib_file || return 1/d' buildutils/pbs_mkdirs.in || die
688
689 epatch "${FILESDIR}"/${P}-tcl8.6.patch
690 epatch "${FILESDIR}"/CVE-2013-4319-4.x-root-submit-fix.patch
691 }
692
693 src_configure() {
694 local myconf="--with-rcp=mom_rcp"
695
696 use crypt && myconf="--with-rcp=scp"
697
698 econf \
699 $(use_enable tk gui) \
700 $(use_enable syslog) \
701 $(use_enable server) \
702 $(use_enable drmaa) \
703 $(use_enable munge munge-auth) \
704 $(use_enable nvidia nvidia-gpus) \
705 --with-server-home=${PBS_SERVER_HOME} \
706 --with-environ=/etc/pbs_environment \
707 --with-default-server=${PBS_SERVER_NAME} \
708 --disable-gcc-warnings \
709 --with-tcp-retry-limit=2 \
710 --without-loadlibfile \
711 ${USE_CPUSETS} \
712 ${myconf}
713 }
714
715 src_install() {
716 local dir
717
718 emake DESTDIR="${D}" install || die "make install failed"
719
720 dodoc CHANGELOG README.* Release_Notes || die "dodoc failed"
721 if use doc; then
722 dodoc doc/admin_guide.ps doc/*.pdf || die "dodoc failed"
723 fi
724
725 # The build script isn't alternative install location friendly,
726 # So we have to fix some hard-coded paths in tclIndex for xpbs* to work
727 for file in `find "${D}" -iname tclIndex`; do
728 sed -e "s/${D//\// }/ /" "${file}" > "${file}.new"
729 mv "${file}.new" "${file}" || die
730 done
731
732 for dir in $(find "${D}/${PBS_SERVER_HOME}" -type d); do
733 keepdir "${dir#${D}}"
734 done
735
736 if use server; then
737 newinitd "${FILESDIR}"/pbs_server-init.d-munge pbs_server || die
738 newinitd "${FILESDIR}"/pbs_sched-init.d pbs_sched || die
739 fi
740 newinitd "${FILESDIR}"/pbs_mom-init.d-munge pbs_mom || die
741 newconfd "${FILESDIR}"/torque-conf.d-munge torque || die
742 newinitd "${FILESDIR}"/trqauthd-init.d trqauthd || die
743 newenvd "${FILESDIR}"/torque-env.d 25torque || die
744 }
745
746 pkg_preinst() {
747 if [[ -f "${ROOT}etc/pbs_environment" ]]; then
748 cp "${ROOT}etc/pbs_environment" "${D}"/etc/pbs_environment || die
749 fi
750
751 if [[ -f "${ROOT}${PBS_SERVER_HOME}/server_priv/nodes" ]]; then
752 cp "${ROOT}${PBS_SERVER_HOME}/server_priv/nodes" \
753 "${D}"/${PBS_SERVER_HOME}/server_priv/nodes || die
754 fi
755
756 echo "${PBS_SERVER_NAME}" > "${D}${PBS_SERVER_HOME}/server_name" || die
757
758 # Fix up the env.d file to use our set server home.
759 sed -i \
760 "s:/var/spool/torque:${PBS_SERVER_HOME}:g" "${D}"/etc/env.d/25torque \
761 || die
762
763 if use munge; then
764 sed -i 's,\(PBS_USE_MUNGE=\).*,\11,' "${D}"etc/conf.d/torque || die
765 fi
766 }
767
768 pkg_postinst() {
769 elog " If this is the first time torque has been installed, then you are not"
770 elog "ready to start the server. Please refer to the documentation located at:"
771 elog "http://www.clusterresources.com/wiki/doku.php?id=torque:torque_wiki"
772
773 elog " For a basic setup, you may use emerge --config ${PN}"
774
775 elog "Important 4.0+ updates"
776 elog " - The on-wire protocol version has been changed."
777 elog " Versions of Torque before 4.0.0 are no longer able to communicate."
778 elog " - pbs_iff has been replaced by trqauthd, you will now need to add"
779 elog " trqauthd to your default runlevel."
780 }
781
782 # root will be setup as the primary operator/manager, the local machine
783 # will be added as a node and we'll create a simple queue, batch.
784 pkg_config() {
785 local h="$(echo "${ROOT}/${PBS_SERVER_HOME}" | sed 's:///*:/:g')"
786 local rc=0
787
788 ebegin "Configuring Torque"
789 einfo "Using ${h} as the pbs homedir"
790 einfo "Using ${PBS_SERVER_NAME} as the pbs_server"
791
792 # Check for previous configuration and bail if found.
793 if [ -e "${h}/server_priv/acl_svr/operators" ] \
794 || [ -e "${h}/server_priv/nodes" ] \
795 || [ -e "${h}/mom_priv/config" ]; then
796 ewarn "Previous Torque configuration detected. Press Enter to"
797 ewarn "continue or Control-C to abort now"
798 read
799 fi
800
801 # pbs_mom configuration.
802 echo "\$pbsserver ${PBS_SERVER_NAME}" > "${h}/mom_priv/config" || die
803 echo "\$logevent 255" >> "${h}/mom_priv/config" || die
804
805 if use server; then
806 local qmgr="${ROOT}/usr/bin/qmgr -c"
807 # pbs_server bails on repeated backslashes.
808 if ! "${ROOT}"/usr/sbin/pbs_server -f -d "${h}" -t create; then
809 eerror "Failed to start pbs_server"
810 rc=1
811 else
812 ${qmgr} "set server operators = root@$(hostname -f)" ${PBS_SERVER_NAME} \
813 && ${qmgr} "create queue batch" ${PBS_SERVER_NAME} \
814 && ${qmgr} "set queue batch queue_type = Execution" ${PBS_SERVER_NAME} \
815 && ${qmgr} "set queue batch started = True" ${PBS_SERVER_NAME} \
816 && ${qmgr} "set queue batch enabled = True" ${PBS_SERVER_NAME} \
817 && ${qmgr} "set server default_queue = batch" ${PBS_SERVER_NAME} \
818 && ${qmgr} "set server resources_default.nodes = 1" ${PBS_SERVER_NAME} \
819 && ${qmgr} "set server scheduling = True" ${PBS_SERVER_NAME} \
820 || die
821
822 "${ROOT}"/usr/bin/qterm -t quick ${PBS_SERVER_NAME} || rc=1
823
824 # Add the local machine as a node.
825 echo "$(hostname -f) np=1" > "${h}/server_priv/nodes" || die
826 fi
827 fi
828 eend ${rc}
829 }