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