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.4.6.ebuild
Date: Tue, 02 Mar 2010 02:15:29
Message-Id: E1NmHdu-0007hZ-Or@stork.gentoo.org
1 jsbronder 10/03/02 02:15:26
2
3 Modified: ChangeLog
4 Added: torque-2.4.6.ebuild
5 Log:
6 Add 2.4 series finally.
7 (Portage version: 2.2_rc61/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.90 sys-cluster/torque/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/torque/ChangeLog?rev=1.90&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/torque/ChangeLog?rev=1.90&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/torque/ChangeLog?r1=1.89&r2=1.90
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v
19 retrieving revision 1.89
20 retrieving revision 1.90
21 diff -u -r1.89 -r1.90
22 --- ChangeLog 2 Mar 2010 02:06:21 -0000 1.89
23 +++ ChangeLog 2 Mar 2010 02:15:25 -0000 1.90
24 @@ -1,6 +1,12 @@
25 # ChangeLog for sys-cluster/torque
26 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v 1.89 2010/03/02 02:06:21 jsbronder Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v 1.90 2010/03/02 02:15:25 jsbronder Exp $
29 +
30 +*torque-2.4.6 (02 Mar 2010)
31 +
32 + 02 Mar 2010; Justin Bronder <jsbronder@g.o> +torque-2.4.6.ebuild:
33 + Add 2.4 series finally. Users should be aware bugs are frequently reported
34 + upstream.
35
36 *torque-2.3.10 (02 Mar 2010)
37
38
39
40
41 1.1 sys-cluster/torque/torque-2.4.6.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/torque/torque-2.4.6.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/torque/torque-2.4.6.ebuild?rev=1.1&content-type=text/plain
45
46 Index: torque-2.4.6.ebuild
47 ===================================================================
48 # Copyright 1999-2010 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.4.6.ebuild,v 1.1 2010/03/02 02:15:25 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="openpbs"
60
61 SLOT="0"
62 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
63 IUSE="tk +crypt drmaa server +syslog doc cpusets kernel_linux"
64
65 # ed is used by makedepend-sh
66 DEPEND_COMMON="sys-libs/ncurses
67 sys-libs/readline
68 tk? ( dev-lang/tk )
69 syslog? ( virtual/logger )
70 !games-util/qstat"
71
72 DEPEND="${DEPEND_COMMON}
73 sys-apps/ed"
74
75 RDEPEND="${DEPEND_COMMON}
76 crypt? ( net-misc/openssh )
77 !crypt? ( net-misc/netkit-rsh )"
78
79 pkg_setup() {
80 PBS_SERVER_HOME="${PBS_SERVER_HOME:-/var/spool/torque}"
81
82 # Find a Torque server to use. Check environment, then
83 # current setup (if any), and fall back on current hostname.
84 if [ -z "${PBS_SERVER_NAME}" ]; then
85 if [ -f "${ROOT}${PBS_SERVER_HOME}/server_name" ]; then
86 PBS_SERVER_NAME="$(<${ROOT}${PBS_SERVER_HOME}/server_name)"
87 else
88 PBS_SERVER_NAME=$(hostname -f)
89 fi
90 fi
91
92 USE_CPUSETS="--disable-cpusets"
93 if use cpusets; then
94 if ! use kernel_linux; then
95 einfo
96 elog " Torque currently only has support for cpusets in linux."
97 elog "Assuming you didn't really want this USE flag."
98 einfo
99 else
100 linux-info_pkg_setup
101 einfo
102 elog " Torque support for cpusets is still in development, you may"
103 elog "wish to disable it for production use."
104 einfo
105 if ! linux_config_exists || ! linux_chkconfig_present CPUSETS; then
106 einfo
107 elog " Torque support for cpusets will require that you recompile"
108 elog "your kernel with CONFIG_CPUSETS enabled."
109 einfo
110 fi
111 USE_CPUSETS="--enable-cpusets"
112 fi
113 fi
114 }
115
116 src_configure() {
117 local myconf="--with-rcp=mom_rcp"
118
119 use crypt && myconf="--with-rcp=scp"
120
121 econf \
122 $(use_enable tk gui) \
123 $(use_enable syslog) \
124 $(use_enable server) \
125 $(use_enable drmaa) \
126 --with-server-home=${PBS_SERVER_HOME} \
127 --with-environ=/etc/pbs_environment \
128 --with-default-server=${PBS_SERVER_NAME} \
129 --disable-gcc-warnings \
130 ${USE_CPUSETS} \
131 ${myconf} \
132 || die "econf failed"
133 }
134
135 # WARNING
136 # OpenPBS is extremely stubborn about directory permissions. Sometimes it will
137 # just fall over with the error message, but in some spots it will just ignore
138 # you and fail strangely. Likewise it also barfs on our .keep files!
139 pbs_createspool() {
140 local root="$1"
141 local s="$(dirname "${PBS_SERVER_HOME}")"
142 local h="${PBS_SERVER_HOME}"
143 local sp="${h}/server_priv"
144 einfo "Building spool directory under ${D}${h}"
145 local a d m
146 local dir_spec="
147 0755:${h}/aux 0700:${h}/checkpoint
148 0755:${h}/mom_logs 0751:${h}/mom_priv 0751:${h}/mom_priv/jobs
149 1777:${h}/spool 1777:${h}/undelivered"
150
151 if use server; then
152 dir_spec="${dir_spec} 0755:${h}/sched_logs
153 0755:${h}/sched_priv/accounting 0755:${h}/server_logs
154 0750:${h}/server_priv 0755:${h}/server_priv/accounting
155 0750:${h}/server_priv/acl_groups 0750:${h}/server_priv/acl_hosts
156 0750:${h}/server_priv/acl_svr 0750:${h}/server_priv/acl_users
157 0750:${h}/server_priv/jobs 0750:${h}/server_priv/queues"
158 fi
159
160 for a in ${dir_spec}; do
161 d="${a/*:}"
162 m="${a/:*}"
163 if [[ ! -d "${root}${d}" ]]; then
164 install -d -m${m} "${root}${d}"
165 else
166 chmod ${m} "${root}${d}"
167 fi
168 # (#149226) If we're running in src_*, then keepdir
169 if [[ "${root}" = "${D}" ]]; then
170 keepdir ${d}
171 fi
172 done
173 }
174
175 src_install() {
176 # Make directories first
177 pbs_createspool "${D}"
178
179 make DESTDIR="${D}" install || die "make install failed"
180
181 dodoc CHANGELOG DEVELOPMENT README.* Release_Notes || die "dodoc failed"
182 if use doc; then
183 dodoc doc/admin_guide.ps doc/*.pdf || die "dodoc failed"
184 fi
185
186 # The build script isn't alternative install location friendly,
187 # So we have to fix some hard-coded paths in tclIndex for xpbs* to work
188 for file in `find "${D}" -iname tclIndex`; do
189 sed -e "s/${D//\// }/ /" "${file}" > "${file}.new"
190 mv "${file}.new" "${file}"
191 done
192
193 if use server; then
194 newinitd "${FILESDIR}"/pbs_server-init.d-2.2.1-r1 pbs_server
195 newinitd "${FILESDIR}"/pbs_sched-init.d-2.2.1-r1 pbs_sched
196 fi
197 newinitd "${FILESDIR}"/pbs_mom-init.d-2.2.1-r1 pbs_mom
198 newconfd "${FILESDIR}"/torque-conf.d-2.2.1-r1 torque
199 newenvd "${FILESDIR}"/torque-env.d-2.2.1-r1 25torque
200 }
201
202 pkg_preinst() {
203 if [[ -f "${ROOT}etc/pbs_environment" ]]; then
204 cp "${ROOT}etc/pbs_environment" "${D}"/etc/pbs_environment
205 fi
206
207 echo "${PBS_SERVER_NAME}" > "${D}${PBS_SERVER_HOME}/server_name"
208
209 # Fix up the env.d file to use our set server home.
210 sed -i "s:/var/spool/torque:${PBS_SERVER_HOME}:g" "${D}"/etc/env.d/25torque
211 }
212
213 pkg_postinst() {
214 pbs_createspool "${ROOT}"
215 elog " If this is the first time torque has been installed, then you are not"
216 elog "ready to start the server. Please refer to the documentation located at:"
217 elog "http://www.clusterresources.com/wiki/doku.php?id=torque:torque_wiki"
218
219 elog " For a basic setup, you may use emerge --config ${PN}"
220 }
221
222 # root will be setup as the primary operator/manager, the local machine
223 # will be added as a node and we'll create a simple queue, batch.
224 pkg_config() {
225 local h="$(echo "${ROOT}/${PBS_SERVER_HOME}" | sed 's:///*:/:g')"
226 local rc=0
227
228 ebegin "Configuring Torque"
229 einfo "Using ${h} as the pbs homedir"
230 einfo "Using ${PBS_SERVER_NAME} as the pbs_server"
231
232 # Check for previous configuration and bail if found.
233 if [ -e "${h}/server_priv/acl_svr/operators" ] \
234 || [ -e "${h}/server_priv/nodes" ] \
235 || [ -e "${h}/mom_priv/config" ]; then
236 ewarn "Previous Torque configuration detected. Press any key to"
237 ewarn "continue or press Control-C to abort now"
238 read
239 fi
240
241 # pbs_mom configuration.
242 echo "\$pbsserver ${PBS_SERVER_NAME}" > "${h}/mom_priv/config"
243 echo "\$logevent 255" >> "${h}/mom_priv/config"
244
245 if use server; then
246 local qmgr="${ROOT}/usr/bin/qmgr -c"
247 # pbs_server bails on repeated backslashes.
248 if ! echo "y" | "${ROOT}"/usr/sbin/pbs_server -d "${h}" -t create; then
249 eerror "Failed to start pbs_server"
250 rc=1
251 else
252 ${qmgr} "set server operators = root@$(hostname -f)" ${PBS_SERVER_NAME}
253 ${qmgr} "create queue batch" ${PBS_SERVER_NAME}
254 ${qmgr} "set queue batch queue_type = Execution" ${PBS_SERVER_NAME}
255 ${qmgr} "set queue batch started = True" ${PBS_SERVER_NAME}
256 ${qmgr} "set queue batch enabled = True" ${PBS_SERVER_NAME}
257 ${qmgr} "set server default_queue = batch" ${PBS_SERVER_NAME}
258 ${qmgr} "set server resources_default.nodes = 1" ${PBS_SERVER_NAME}
259 ${qmgr} "set server scheduling = True" ${PBS_SERVER_NAME}
260
261 "${ROOT}"/usr/bin/qterm -t quick ${PBS_SERVER_NAME} || rc=1
262
263 # Add the local machine as a node.
264 echo "$(hostname -f) np=1" > "${h}/server_priv/nodes"
265 fi
266 fi
267 eend ${rc}
268 }