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: ChangeLog torque-2.5.8.ebuild
Date: Wed, 28 Sep 2011 01:01:10
Message-Id: 20110928010059.9DB9320036@flycatcher.gentoo.org
1 jsbronder 11/09/28 01:00:59
2
3 Modified: ChangeLog
4 Added: torque-2.5.8.ebuild
5 Log:
6 bump 2.5 series
7
8 (Portage version: 2.1.10.11/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.123 sys-cluster/torque/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/ChangeLog?rev=1.123&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/ChangeLog?rev=1.123&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/ChangeLog?r1=1.122&r2=1.123
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v
20 retrieving revision 1.122
21 retrieving revision 1.123
22 diff -u -r1.122 -r1.123
23 --- ChangeLog 28 Sep 2011 00:47:10 -0000 1.122
24 +++ ChangeLog 28 Sep 2011 01:00:59 -0000 1.123
25 @@ -1,6 +1,11 @@
26 # ChangeLog for sys-cluster/torque
27 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v 1.122 2011/09/28 00:47:10 jsbronder Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v 1.123 2011/09/28 01:00:59 jsbronder Exp $
30 +
31 +*torque-2.5.8 (28 Sep 2011)
32 +
33 + 28 Sep 2011; Justin Bronder <jsbronder@g.o> +torque-2.5.8.ebuild:
34 + bump 2.5 series
35
36 28 Sep 2011; Justin Bronder <jsbronder@g.o> -torque-2.5.6.ebuild:
37 remove old
38
39
40
41 1.1 sys-cluster/torque/torque-2.5.8.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/torque-2.5.8.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/torque-2.5.8.ebuild?rev=1.1&content-type=text/plain
45
46 Index: torque-2.5.8.ebuild
47 ===================================================================
48 # Copyright 1999-2011 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/torque-2.5.8.ebuild,v 1.1 2011/09/28 01:00:59 jsbronder Exp $
51
52 EAPI=2
53 inherit flag-o-matic eutils linux-info
54
55 DESCRIPTION="Resource manager and queuing system based on OpenPBS"
56 HOMEPAGE="http://www.clusterresources.com/products/torque/"
57 SRC_URI="http://www.clusterresources.com/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 xml"
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-cpusets"
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-cpusets"
114 fi
115 fi
116 }
117
118 src_configure() {
119 local myconf="--with-rcp=mom_rcp"
120
121 use crypt && myconf="--with-rcp=scp"
122
123 econf \
124 $(use_enable tk gui) \
125 $(use_enable syslog) \
126 $(use_enable server) \
127 $(use_enable drmaa) \
128 $(use_enable threads high-availability) \
129 $(use_enable xml server-xml) \
130 $(use_enable munge munge-auth) \
131 --with-server-home=${PBS_SERVER_HOME} \
132 --with-environ=/etc/pbs_environment \
133 --with-default-server=${PBS_SERVER_NAME} \
134 --disable-gcc-warnings \
135 --with-tcp-retry-limit=2 \
136 ${USE_CPUSETS} \
137 ${myconf} \
138 || die "econf failed"
139 }
140
141 # WARNING
142 # OpenPBS is extremely stubborn about directory permissions. Sometimes it will
143 # just fall over with the error message, but in some spots it will just ignore
144 # you and fail strangely. Likewise it also barfs on our .keep files!
145 pbs_createspool() {
146 local root="$1"
147 local s="$(dirname "${PBS_SERVER_HOME}")"
148 local h="${PBS_SERVER_HOME}"
149 local sp="${h}/server_priv"
150 einfo "Building spool directory under ${D}${h}"
151 local a d m
152 local dir_spec="
153 0755:${h}/aux 0700:${h}/checkpoint
154 0755:${h}/mom_logs 0751:${h}/mom_priv 0751:${h}/mom_priv/jobs
155 1777:${h}/spool 1777:${h}/undelivered"
156
157 if use server; then
158 dir_spec="${dir_spec} 0755:${h}/sched_logs
159 0755:${h}/sched_priv/accounting 0755:${h}/server_logs
160 0750:${h}/server_priv 0755:${h}/server_priv/accounting
161 0750:${h}/server_priv/acl_groups 0750:${h}/server_priv/acl_hosts
162 0750:${h}/server_priv/acl_svr 0750:${h}/server_priv/acl_users
163 0750:${h}/server_priv/jobs 0750:${h}/server_priv/queues"
164 fi
165
166 for a in ${dir_spec}; do
167 d="${a/*:}"
168 m="${a/:*}"
169 if [[ ! -d "${root}${d}" ]]; then
170 install -d -m${m} "${root}${d}"
171 else
172 chmod ${m} "${root}${d}"
173 fi
174 # (#149226) If we're running in src_*, then keepdir
175 if [[ "${root}" = "${D}" ]]; then
176 keepdir ${d}
177 fi
178 done
179 }
180
181 src_install() {
182 # Make directories first
183 pbs_createspool "${D}"
184
185 make DESTDIR="${D}" install || die "make install failed"
186
187 dodoc CHANGELOG README.* Release_Notes || die "dodoc failed"
188 if use doc; then
189 dodoc doc/admin_guide.ps doc/*.pdf || die "dodoc failed"
190 fi
191
192 # The build script isn't alternative install location friendly,
193 # So we have to fix some hard-coded paths in tclIndex for xpbs* to work
194 for file in `find "${D}" -iname tclIndex`; do
195 sed -e "s/${D//\// }/ /" "${file}" > "${file}.new"
196 mv "${file}.new" "${file}"
197 done
198
199 if use server; then
200 newinitd "${FILESDIR}"/pbs_server-init.d-munge pbs_server
201 newinitd "${FILESDIR}"/pbs_sched-init.d pbs_sched
202 fi
203 newinitd "${FILESDIR}"/pbs_mom-init.d-munge pbs_mom
204 newconfd "${FILESDIR}"/torque-conf.d-munge torque
205 newenvd "${FILESDIR}"/torque-env.d 25torque
206 }
207
208 pkg_preinst() {
209 if [[ -f "${ROOT}etc/pbs_environment" ]]; then
210 cp "${ROOT}etc/pbs_environment" "${D}"/etc/pbs_environment
211 fi
212
213 echo "${PBS_SERVER_NAME}" > "${D}${PBS_SERVER_HOME}/server_name"
214
215 # Fix up the env.d file to use our set server home.
216 sed -i "s:/var/spool/torque:${PBS_SERVER_HOME}:g" "${D}"/etc/env.d/25torque
217
218 if use munge; then
219 sed -i 's,\(PBS_USE_MUNGE=\).*,\11,' "${D}"etc/conf.d/torque || die
220 fi
221 }
222
223 pkg_postinst() {
224 pbs_createspool "${ROOT}"
225 elog " If this is the first time torque has been installed, then you are not"
226 elog "ready to start the server. Please refer to the documentation located at:"
227 elog "http://www.clusterresources.com/wiki/doku.php?id=torque:torque_wiki"
228
229 elog " For a basic setup, you may use emerge --config ${PN}"
230 }
231
232 # root will be setup as the primary operator/manager, the local machine
233 # will be added as a node and we'll create a simple queue, batch.
234 pkg_config() {
235 local h="$(echo "${ROOT}/${PBS_SERVER_HOME}" | sed 's:///*:/:g')"
236 local rc=0
237
238 ebegin "Configuring Torque"
239 einfo "Using ${h} as the pbs homedir"
240 einfo "Using ${PBS_SERVER_NAME} as the pbs_server"
241
242 # Check for previous configuration and bail if found.
243 if [ -e "${h}/server_priv/acl_svr/operators" ] \
244 || [ -e "${h}/server_priv/nodes" ] \
245 || [ -e "${h}/mom_priv/config" ]; then
246 ewarn "Previous Torque configuration detected. Press any key to"
247 ewarn "continue or press Control-C to abort now"
248 read
249 fi
250
251 # pbs_mom configuration.
252 echo "\$pbsserver ${PBS_SERVER_NAME}" > "${h}/mom_priv/config"
253 echo "\$logevent 255" >> "${h}/mom_priv/config"
254
255 if use server; then
256 local qmgr="${ROOT}/usr/bin/qmgr -c"
257 # pbs_server bails on repeated backslashes.
258 if ! echo "y" | "${ROOT}"/usr/sbin/pbs_server -d "${h}" -t create; then
259 eerror "Failed to start pbs_server"
260 rc=1
261 else
262 ${qmgr} "set server operators = root@$(hostname -f)" ${PBS_SERVER_NAME}
263 ${qmgr} "create queue batch" ${PBS_SERVER_NAME}
264 ${qmgr} "set queue batch queue_type = Execution" ${PBS_SERVER_NAME}
265 ${qmgr} "set queue batch started = True" ${PBS_SERVER_NAME}
266 ${qmgr} "set queue batch enabled = True" ${PBS_SERVER_NAME}
267 ${qmgr} "set server default_queue = batch" ${PBS_SERVER_NAME}
268 ${qmgr} "set server resources_default.nodes = 1" ${PBS_SERVER_NAME}
269 ${qmgr} "set server scheduling = True" ${PBS_SERVER_NAME}
270
271 "${ROOT}"/usr/bin/qterm -t quick ${PBS_SERVER_NAME} || rc=1
272
273 # Add the local machine as a node.
274 echo "$(hostname -f) np=1" > "${h}/server_priv/nodes"
275 fi
276 fi
277 eend ${rc}
278 }