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