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.2.1-r2.ebuild
Date: Thu, 06 Dec 2007 00:18:46
Message-Id: E1J04Rt-0004WR-8C@stork.gentoo.org
1 jsbronder 07/12/06 00:18:41
2
3 Modified: ChangeLog
4 Added: torque-2.2.1-r2.ebuild
5 Log:
6 Revbump to get fixes to env.d out, also added blocker with x11-misc/qterm (Bug #176533)
7 (Portage version: 2.1.3.19)
8
9 Revision Changes Path
10 1.55 sys-cluster/torque/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/torque/ChangeLog?rev=1.55&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/torque/ChangeLog?rev=1.55&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/torque/ChangeLog?r1=1.54&r2=1.55
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v
19 retrieving revision 1.54
20 retrieving revision 1.55
21 diff -u -r1.54 -r1.55
22 --- ChangeLog 4 Dec 2007 21:38:12 -0000 1.54
23 +++ ChangeLog 6 Dec 2007 00:18:40 -0000 1.55
24 @@ -1,6 +1,12 @@
25 # ChangeLog for sys-cluster/torque
26 # Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v 1.54 2007/12/04 21:38:12 jsbronder Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v 1.55 2007/12/06 00:18:40 jsbronder Exp $
29 +
30 +*torque-2.2.1-r2 (06 Dec 2007)
31 +
32 + 06 Dec 2007; <jbronder@g.o> +torque-2.2.1-r2.ebuild:
33 + Revbump to get fixes to env.d out, also added blocker with x11-misc/qterm
34 + (Bug #176533)
35
36 04 Dec 2007; <jsbronder@g.o> files/torque-env.d-2.2.1-r1,
37 torque-2.2.1-r1.ebuild:
38
39
40
41 1.1 sys-cluster/torque/torque-2.2.1-r2.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/torque/torque-2.2.1-r2.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/torque/torque-2.2.1-r2.ebuild?rev=1.1&content-type=text/plain
45
46 Index: torque-2.2.1-r2.ebuild
47 ===================================================================
48 # Copyright 1999-2007 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.2.1-r2.ebuild,v 1.1 2007/12/06 00:18:40 jsbronder Exp $
51
52 inherit autotools flag-o-matic eutils
53
54 DESCRIPTION="Resource manager and queuing system based on OpenPBS"
55 HOMEPAGE="http://www.clusterresources.com/products/torque/"
56 SRC_URI="http://www.clusterresources.com/downloads/${PN}/${P}.tar.gz"
57
58 LICENSE="openpbs"
59
60 SLOT="0"
61 KEYWORDS="~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
62 IUSE="tk crypt server syslog doc"
63 PROVIDE="virtual/pbs"
64
65 # ed is used by makedepend-sh
66 DEPEND_COMMON="virtual/libc
67 sys-libs/ncurses
68 sys-libs/readline
69 tk? ( dev-lang/tk )
70 syslog? ( virtual/logger )
71 !virtual/pbs
72 !sys-cluster/openpbs-common
73 !x11-misc/qterm"
74
75 DEPEND="${DEPEND_COMMON}
76 sys-apps/ed"
77
78 RDEPEND="${DEPEND_COMMON}
79 crypt? ( net-misc/openssh )
80 !crypt? ( net-misc/netkit-rsh )"
81
82 [ -n "${PBS_SERVER_HOME}" ] || PBS_SERVER_HOME="/var/spool/torque"
83
84 src_unpack() {
85 unpack "${A}"
86 cd "${S}"
87 epatch "${FILESDIR}"/${PN}-setuid-safety-am.patch
88 # Otherwise we'll fail due to strings over ISO C89 defined length 509
89 sed -i 's:gcc_warning_flags="\(.*\)-Werror":gcc_warning_flags="\1":' configure.ac
90 eautoreconf || die "eautoreconf failed"
91 }
92
93 src_compile() {
94 local myconf
95
96 if use crypt; then
97 myconf="--with-rcp=scp"
98 else
99 myconf="--with-rcp=mom_rcp"
100 fi
101
102 [ -n "${PBS_SERVER_NAME}" ] || PBS_SERVER_NAME=$(hostname -f)
103
104 # TODO: Allow cpusets
105 econf \
106 $(use_enable tk gui) \
107 $(use_enable syslog) \
108 $(use_enable server) \
109 --with-server-home=${PBS_SERVER_HOME} \
110 --with-environ=/etc/pbs_environment \
111 --with-default-server=${PBS_SERVER_NAME} \
112 ${myconf} \
113 || die "econf failed"
114 emake || die "emake failed"
115 }
116
117 # WARNING
118 # OpenPBS is extremely stubborn about directory permissions. Sometimes it will
119 # just fall over with the error message, but in some spots it will just ignore
120 # you and fail strangely. Likewise it also barfs on our .keep files!
121 pbs_createspool() {
122 local root="$1"
123 local s="$(dirname "${PBS_SERVER_HOME}")"
124 local h="${PBS_SERVER_HOME}"
125 local sp="${h}/server_priv"
126 einfo "Building spool directory under ${D}${h}"
127 local a d m
128 local dir_spec="
129 0755:${h}/aux 0700:${h}/checkpoint
130 0755:${h}/mom_logs 0751:${h}/mom_priv 0751:${h}/mom_priv/jobs
131 1777:${h}/spool 1777:${h}/undelivered"
132
133 if use server; then
134 dir_spec="${dir_spec} 0755:${h}/sched_logs
135 0755:${h}/sched_priv/accounting 0755:${h}/server_logs
136 0750:${h}/server_priv 0755:${h}/server_priv/accounting
137 0750:${h}/server_priv/acl_groups 0750:${h}/server_priv/acl_hosts
138 0750:${h}/server_priv/acl_svr 0750:${h}/server_priv/acl_users
139 0750:${h}/server_priv/jobs 0750:${h}/server_priv/queues"
140 fi
141
142 for a in ${dir_spec}; do
143 d="${a/*:}"
144 m="${a/:*}"
145 if [[ ! -d "${root}${d}" ]]; then
146 install -d -m${m} "${root}${d}"
147 else
148 chmod ${m} "${root}${d}"
149 fi
150 # (#149226) If we're running in src_*, then keepdir
151 if [[ "${root}" = "${D}" ]]; then
152 keepdir ${d}
153 fi
154 done
155 }
156
157 src_install() {
158 # Make directories first
159 pbs_createspool "${D}"
160
161 make DESTDIR="${D}" install || die "make install failed"
162
163 dodoc CHANGELOG DEVELOPMENT README.* Release_Notes || die "dodoc failed"
164 if use doc; then
165 dodoc doc/admin_guide.ps doc/*.pdf || die "dodoc failed"
166 fi
167
168 # this file MUST exist for PBS/Torque to work
169 # but try to preserve any customatizations that the user has made
170 dodir /etc
171 mv "${D}"${PBS_SERVER_HOME}/pbs_environment "${D}"/etc/
172
173 # The build script isn't alternative install location friendly,
174 # So we have to fix some hard-coded paths in tclIndex for xpbs* to work
175 for file in `find "${D}" -iname tclIndex`; do
176 sed -e "s/${D//\// }/ /" "${file}" > "${file}.new"
177 mv "${file}.new" "${file}"
178 done
179
180 if use server; then
181 newinitd "${FILESDIR}"/pbs_server-init.d-2.2.1-r1 pbs_server
182 newinitd "${FILESDIR}"/pbs_sched-init.d-2.2.1-r1 pbs_sched
183 fi
184 newinitd "${FILESDIR}"/pbs_mom-init.d-2.2.1-r1 pbs_mom
185 newconfd "${FILESDIR}"/torque-conf.d-2.2.1-r1 torque
186 newenvd "${FILESDIR}"/torque-env.d-2.2.1-r1 25torque
187 }
188
189 pkg_preinst() {
190 if [[ -f "${ROOT}etc/pbs_environment" ]]; then
191 cp "${ROOT}etc/pbs_environment" "${D}"/etc/pbs_environment
192 fi
193
194 if [ -n "${PBS_SERVER_NAME}" ]; then
195 echo "${PBS_SERVER_NAME}" > "${D}${PBS_SERVER_HOME}/server_name"
196 elif [[ -f "${ROOT}${PBS_SERVER_HOME}/server_name" ]]; then
197 cp "${ROOT}${PBS_SERVER_HOME}/server_name" "${D}${PBS_SERVER_HOME}/server_name"
198 fi
199
200 # Fix up the env.d file to use our set server home.
201 sed -i "s:/var/spool/torque:${PBS_SERVER_HOME}:g" "${D}"/etc/env.d/25torque
202 }
203
204 pkg_postinst() {
205 pbs_createspool "${ROOT}"
206 elog "If this is the first time torque has been installed, then you are not"
207 elog "ready to start the server. Please refer to the documentation located at:"
208 elog "http://www.clusterresources.com/wiki/doku.php?id=torque:torque_wiki"
209
210 elog "For a basic setup, you may use emerge --config ${PN}"
211
212 elog "There are a couple of changes in this ebuild."
213 elog "1.) The pbs-server-home has been moved from /var/spool/PBS to /var/spool/torque."
214 elog "2.) pbs_server, pbs_mom and pbs_sched now have separate init scripts"
215
216 elog "Be sure to run env-update if this is your first install or you"
217 elog "changed PBS_SERVER_HOME!"
218 }
219
220 # Either the correct PBS_SERVER_HOME and PBS_SERVER_NAME are set
221 # or we use the default HOME and the localhost as the server.
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="${ROOT}/${PBS_SERVER_HOME}"
226 local rc=0
227
228 ebegin "Configuring Torque"
229 [ -n "${PBS_SERVER_NAME}" ] || PBS_SERVER_NAME=$(hostname -f)
230 einfo "Using ${PBS_SERVER_HOME} as the pbs homedir"
231 einfo "Using ${PBS_SERVER_NAME} as the pbs_server"
232
233 # Check for previous configuration and bail if found.
234 if [ -e "${h}/server_priv/acl_svr/operators" ] \
235 || [ -e "${h}/server_priv/nodes" ] \
236 || [ -e "${h}/mom_priv/config" ]; then
237 ewarn "Previous Torque configuration detected. Press any key to"
238 ewarn "continue or press Control-C to abort now"
239 read
240 fi
241
242 # pbs_mom configuration.
243 echo "\$pbsserver ${PBS_SERVER_NAME}" > "${h}/mom_priv/config"
244 echo "\$logevent 255" >> "${h}/mom_priv/config"
245
246 if use server; then
247 local qmgr="${ROOT}/usr/bin/qmgr -c"
248 if ! echo "y" | "${ROOT}"/usr/sbin/pbs_server \
249 -d "${ROOT}${PBS_SERVER_HOME}" -t create &>/dev/null; then
250 eerror "Failed to start pbs_server"
251 rc=1
252 else
253 ${qmgr} "set server operators = root@$(hostname -f)" ${PBS_SERVER_NAME}
254 ${qmgr} "create queue batch" ${PBS_SERVER_NAME}
255 ${qmgr} "set queue batch queue_type = Execution" ${PBS_SERVER_NAME}
256 ${qmgr} "set queue batch started = True" ${PBS_SERVER_NAME}
257 ${qmgr} "set queue batch enabled = True" ${PBS_SERVER_NAME}
258 ${qmgr} "set server default_queue = batch" ${PBS_SERVER_NAME}
259 ${qmgr} "set server resources_default.nodes = 1" ${PBS_SERVER_NAME}
260 ${qmgr} "set server scheduling = True" ${PBS_SERVER_NAME}
261
262 "${ROOT}"/usr/bin/qterm -t quick ${PBS_SERVER_NAME} || rc=1
263
264 # Add the local machine as a node.
265 echo "$(hostname -f) np=1" > "${h}/server_priv/nodes"
266 fi
267 fi
268 eend ${rc}
269 }
270
271
272
273 --
274 gentoo-commits@g.o mailing list