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.5.13.ebuild ChangeLog
Date: Thu, 19 Jun 2014 19:55:05
Message-Id: 20140619195500.576A22004E@flycatcher.gentoo.org
1 jsbronder 14/06/19 19:55:00
2
3 Modified: ChangeLog
4 Added: torque-2.5.13.ebuild
5 Log:
6 Bump 2.5.13 with additional patches for CVE-2013-4495 (#491270) and CVE-2014-0749 (#510726)
7
8 (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 4D7043C9)
9
10 Revision Changes Path
11 1.167 sys-cluster/torque/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/ChangeLog?rev=1.167&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/ChangeLog?rev=1.167&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/ChangeLog?r1=1.166&r2=1.167
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v
20 retrieving revision 1.166
21 retrieving revision 1.167
22 diff -u -r1.166 -r1.167
23 --- ChangeLog 19 Jan 2014 20:36:30 -0000 1.166
24 +++ ChangeLog 19 Jun 2014 19:55:00 -0000 1.167
25 @@ -1,6 +1,13 @@
26 # ChangeLog for sys-cluster/torque
27 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v 1.166 2014/01/19 20:36:30 jsbronder Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v 1.167 2014/06/19 19:55:00 jsbronder Exp $
30 +
31 +*torque-2.5.13 (19 Jun 2014)
32 +
33 + 19 Jun 2014; Justin Bronder <jsbronder@g.o> +torque-2.5.13.ebuild,
34 + +files/CVE-2013-4495.patch, +files/CVE-2014-0749.patch:
35 + Bump 2.5.13 with additional patches for CVE-2013-4495 (#491270) and
36 + CVE-2014-0749 (#510726)
37
38 19 Jan 2014; Justin Bronder <jsbronder@g.o> -torque-2.4.16.ebuild,
39 -torque-2.4.16-r1.ebuild, -files/0001-fix-parallel-doc-install.patch,
40
41
42
43 1.1 sys-cluster/torque/torque-2.5.13.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/torque-2.5.13.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/torque-2.5.13.ebuild?rev=1.1&content-type=text/plain
47
48 Index: torque-2.5.13.ebuild
49 ===================================================================
50 # Copyright 1999-2014 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/torque-2.5.13.ebuild,v 1.1 2014/06/19 19:55:00 jsbronder Exp $
53
54 EAPI=4
55
56 inherit autotools-utils eutils flag-o-matic linux-info
57
58 DESCRIPTION="Resource manager and queuing system based on OpenPBS"
59 HOMEPAGE="http://www.adaptivecomputing.com/products/open-source/torque"
60 SRC_URI="http://www.adaptivecomputing.com/index.php?wpfb_dl=1643 -> ${P}.tar.gz"
61
62 LICENSE="torque-2.5"
63
64 SLOT="0"
65 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
66 IUSE="cpusets +crypt doc drmaa kernel_linux munge server static-libs +syslog threads tk xml"
67
68 # ed is used by makedepend-sh
69 DEPEND_COMMON="sys-libs/ncurses
70 sys-libs/readline
71 munge? ( sys-auth/munge )
72 tk? ( dev-lang/tk )
73 syslog? ( virtual/logger )
74 !games-util/qstat"
75
76 DEPEND="${DEPEND_COMMON}
77 sys-apps/ed
78 !sys-cluster/slurm"
79
80 RDEPEND="${DEPEND_COMMON}
81 crypt? ( net-misc/openssh )
82 !crypt? ( net-misc/netkit-rsh )"
83
84 DOCS=( Release_Notes )
85
86 AUTOTOOLS_IN_SOURCE_BUILD=1
87
88 pkg_setup() {
89 PBS_SERVER_HOME="${PBS_SERVER_HOME:-/var/spool/torque}"
90
91 # Find a Torque server to use. Check environment, then
92 # current setup (if any), and fall back on current hostname.
93 if [ -z "${PBS_SERVER_NAME}" ]; then
94 if [ -f "${ROOT}${PBS_SERVER_HOME}/server_name" ]; then
95 PBS_SERVER_NAME="$(<${ROOT}${PBS_SERVER_HOME}/server_name)"
96 else
97 PBS_SERVER_NAME=$(hostname -f)
98 fi
99 fi
100
101 USE_CPUSETS="--disable-cpuset"
102 if use cpusets; then
103 if ! use kernel_linux; then
104 einfo
105 elog " Torque currently only has support for cpusets in linux."
106 elog "Assuming you didn't really want this USE flag."
107 einfo
108 else
109 linux-info_pkg_setup
110 einfo
111 elog " Torque support for cpusets is still in development, you may"
112 elog "wish to disable it for production use."
113 einfo
114 if ! linux_config_exists || ! linux_chkconfig_present CPUSETS; then
115 einfo
116 elog " Torque support for cpusets will require that you recompile"
117 elog "your kernel with CONFIG_CPUSETS enabled."
118 einfo
119 fi
120 USE_CPUSETS="--enable-cpuset"
121 fi
122 fi
123 }
124
125 src_prepare() {
126 epatch "${FILESDIR}"/CVE-2013-4319-2.x-root-submit-fix.patch
127 epatch "${FILESDIR}"/tcl8.6.patch
128
129 # 510726
130 epatch "${FILESDIR}"/CVE-2014-0749.patch
131
132 # 491270
133 epatch "${FILESDIR}"/CVE-2013-4495.patch
134
135 # Unused and causes breakage when switching from glibc to tirpc.
136 # https://github.com/adaptivecomputing/torque/pull/148
137 sed -i '/rpc\/rpc\.h/d' src/lib/Libnet/net_client.c || die
138 }
139
140 src_configure() {
141 local myeconfargs=( --with-rcp=mom_rcp )
142
143 use crypt && myeconfargs=( --with-rcp=scp )
144
145 myeconfargs+=(
146 $(use_enable tk gui)
147 $(use_enable tk tcl-qstat)
148 $(use_enable syslog)
149 $(use_enable server)
150 $(use_enable drmaa)
151 $(use_enable threads high-availability)
152 $(use_enable xml server-xml)
153 $(use_enable munge munge-auth)
154 --with-server-home=${PBS_SERVER_HOME}
155 --with-environ=/etc/pbs_environment
156 --with-default-server=${PBS_SERVER_NAME}
157 --disable-gcc-warnings
158 --with-tcp-retry-limit=2
159 ${USE_CPUSETS}
160 )
161 autotools-utils_src_configure
162 }
163
164 # WARNING
165 # OpenPBS is extremely stubborn about directory permissions. Sometimes it will
166 # just fall over with the error message, but in some spots it will just ignore
167 # you and fail strangely. Likewise it also barfs on our .keep files!
168 pbs_createspool() {
169 local root="$1"
170 local s="$(dirname "${PBS_SERVER_HOME}")"
171 local h="${PBS_SERVER_HOME}"
172 local sp="${h}/server_priv"
173 einfo "Building spool directory under ${D}${h}"
174 local a d m
175 local dir_spec="
176 0755:${h}/aux 0700:${h}/checkpoint
177 0755:${h}/mom_logs 0751:${h}/mom_priv 0751:${h}/mom_priv/jobs
178 1777:${h}/spool 1777:${h}/undelivered"
179
180 if use server; then
181 dir_spec="${dir_spec} 0755:${h}/sched_logs
182 0755:${h}/sched_priv/accounting 0755:${h}/server_logs
183 0750:${h}/server_priv 0755:${h}/server_priv/accounting
184 0750:${h}/server_priv/acl_groups 0750:${h}/server_priv/acl_hosts
185 0750:${h}/server_priv/acl_svr 0750:${h}/server_priv/acl_users
186 0750:${h}/server_priv/jobs 0750:${h}/server_priv/queues"
187 fi
188
189 for a in ${dir_spec}; do
190 d="${a/*:}"
191 m="${a/:*}"
192 if [[ ! -d "${root}${d}" ]]; then
193 install -d -m${m} "${root}${d}" || die
194 else
195 chmod ${m} "${root}${d}" || die
196 fi
197 # (#149226) If we're running in src_*, then keepdir
198 if [[ "${root}" = "${D}" ]]; then
199 keepdir ${d}
200 fi
201 done
202 }
203
204 src_install() {
205 # Make directories first
206 pbs_createspool "${D}"
207
208 autotools-utils_src_install
209
210 use doc && dodoc doc/admin_guide.ps doc/*.pdf
211
212 # The build script isn't alternative install location friendly,
213 # So we have to fix some hard-coded paths in tclIndex for xpbs* to work
214 for file in `find "${D}" -iname tclIndex`; do
215 sed -e "s/${D//\// }/ /" "${file}" > "${file}.new"
216 mv "${file}.new" "${file}" || die
217 done
218
219 if use server; then
220 newinitd "${FILESDIR}"/pbs_server-init.d-munge pbs_server
221 newinitd "${FILESDIR}"/pbs_sched-init.d pbs_sched
222 fi
223 newinitd "${FILESDIR}"/pbs_mom-init.d-munge pbs_mom
224 newconfd "${FILESDIR}"/torque-conf.d-munge torque
225 newenvd "${FILESDIR}"/torque-env.d 25torque
226 }
227
228 pkg_preinst() {
229 if [[ -f "${ROOT}etc/pbs_environment" ]]; then
230 cp "${ROOT}etc/pbs_environment" "${D}"/etc/pbs_environment || die
231 fi
232
233 echo "${PBS_SERVER_NAME}" > "${D}${PBS_SERVER_HOME}/server_name" || die
234
235 # Fix up the env.d file to use our set server home.
236 sed -i \
237 "s:/var/spool/torque:${PBS_SERVER_HOME}:g" "${D}"/etc/env.d/25torque \
238 || die
239
240 if use munge; then
241 sed -i 's,\(PBS_USE_MUNGE=\).*,\11,' "${D}"etc/conf.d/torque || die
242 fi
243 }
244
245 pkg_postinst() {
246 pbs_createspool "${ROOT}"
247 elog " If this is the first time torque has been installed, then you are not"
248 elog "ready to start the server. Please refer to the documentation located at:"
249 elog "http://www.clusterresources.com/wiki/doku.php?id=torque:torque_wiki"
250 echo
251 elog " For a basic setup, you may use emerge --config ${PN}"
252 }
253
254 # root will be setup as the primary operator/manager, the local machine
255 # will be added as a node and we'll create a simple queue, batch.
256 pkg_config() {
257 local h="$(echo "${ROOT}/${PBS_SERVER_HOME}" | sed 's:///*:/:g')"
258 local rc=0
259
260 ebegin "Configuring Torque"
261 einfo "Using ${h} as the pbs homedir"
262 einfo "Using ${PBS_SERVER_NAME} as the pbs_server"
263
264 # Check for previous configuration and bail if found.
265 if [ -e "${h}/server_priv/acl_svr/operators" ] \
266 || [ -e "${h}/server_priv/nodes" ] \
267 || [ -e "${h}/mom_priv/config" ]; then
268 ewarn "Previous Torque configuration detected. Press Enter to"
269 ewarn "continue or Control-C to abort now"
270 read
271 fi
272
273 # pbs_mom configuration.
274 echo "\$pbsserver ${PBS_SERVER_NAME}" > "${h}/mom_priv/config" || die
275 echo "\$logevent 255" >> "${h}/mom_priv/config" || die
276
277 if use server; then
278 local qmgr="${ROOT}/usr/bin/qmgr -c"
279 # pbs_server bails on repeated backslashes.
280 if ! "${ROOT}"/usr/sbin/pbs_server -f -d "${h}" -t create; then
281 eerror "Failed to start pbs_server"
282 rc=1
283 else
284 ${qmgr} "set server operators = root@$(hostname -f)" ${PBS_SERVER_NAME} \
285 && ${qmgr} "create queue batch" ${PBS_SERVER_NAME} \
286 && ${qmgr} "set queue batch queue_type = Execution" ${PBS_SERVER_NAME} \
287 && ${qmgr} "set queue batch started = True" ${PBS_SERVER_NAME} \
288 && ${qmgr} "set queue batch enabled = True" ${PBS_SERVER_NAME} \
289 && ${qmgr} "set server default_queue = batch" ${PBS_SERVER_NAME} \
290 && ${qmgr} "set server resources_default.nodes = 1" ${PBS_SERVER_NAME} \
291 && ${qmgr} "set server scheduling = True" ${PBS_SERVER_NAME} \
292 || die
293
294 "${ROOT}"/usr/bin/qterm -t quick ${PBS_SERVER_NAME} || rc=1
295
296 # Add the local machine as a node.
297 echo "$(hostname -f) np=1" > "${h}/server_priv/nodes" || die
298 fi
299 fi
300 eend ${rc}
301 }