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.16.ebuild
Date: Wed, 28 Sep 2011 01:24:58
Message-Id: 20110928012448.4A55D20036@flycatcher.gentoo.org
1 jsbronder 11/09/28 01:24:48
2
3 Modified: ChangeLog
4 Added: torque-2.4.16.ebuild
5 Log:
6 bump 2.4 series
7
8 (Portage version: 2.1.10.11/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.125 sys-cluster/torque/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/ChangeLog?rev=1.125&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/ChangeLog?rev=1.125&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/ChangeLog?r1=1.124&r2=1.125
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v
20 retrieving revision 1.124
21 retrieving revision 1.125
22 diff -u -r1.124 -r1.125
23 --- ChangeLog 28 Sep 2011 01:09:17 -0000 1.124
24 +++ ChangeLog 28 Sep 2011 01:24:48 -0000 1.125
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.124 2011/09/28 01:09:17 jsbronder Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v 1.125 2011/09/28 01:24:48 jsbronder Exp $
30 +
31 +*torque-2.4.16 (28 Sep 2011)
32 +
33 + 28 Sep 2011; Justin Bronder <jsbronder@g.o> +torque-2.4.16.ebuild:
34 + bump 2.4 series
35
36 28 Sep 2011; Justin Bronder <jsbronder@g.o> -torque-2.5.6-r1.ebuild:
37 Remove old
38
39
40
41 1.1 sys-cluster/torque/torque-2.4.16.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/torque-2.4.16.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/torque/torque-2.4.16.ebuild?rev=1.1&content-type=text/plain
45
46 Index: torque-2.4.16.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.4.16.ebuild,v 1.1 2011/09/28 01:24:48 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.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 doc? ( drmaa? ( app-doc/doxygen[latex,-nodot] ) )
74 sys-apps/ed"
75
76 RDEPEND="${DEPEND_COMMON}
77 crypt? ( net-misc/openssh )
78 !crypt? ( net-misc/netkit-rsh )"
79
80 pkg_setup() {
81 PBS_SERVER_HOME="${PBS_SERVER_HOME:-/var/spool/torque}"
82
83 # Find a Torque server to use. Check environment, then
84 # current setup (if any), and fall back on current hostname.
85 if [ -z "${PBS_SERVER_NAME}" ]; then
86 if [ -f "${ROOT}${PBS_SERVER_HOME}/server_name" ]; then
87 PBS_SERVER_NAME="$(<${ROOT}${PBS_SERVER_HOME}/server_name)"
88 else
89 PBS_SERVER_NAME=$(hostname -f)
90 fi
91 fi
92
93 USE_CPUSETS="--disable-cpuset"
94 if use cpusets; then
95 if ! use kernel_linux; then
96 einfo
97 elog " Torque currently only has support for cpusets in linux."
98 elog "Assuming you didn't really want this USE flag."
99 einfo
100 else
101 linux-info_pkg_setup
102 einfo
103 elog " Torque support for cpusets is still in development, you may"
104 elog "wish to disable it for production use."
105 einfo
106 if ! linux_config_exists || ! linux_chkconfig_present CPUSETS; then
107 einfo
108 elog " Torque support for cpusets will require that you recompile"
109 elog "your kernel with CONFIG_CPUSETS enabled."
110 einfo
111 fi
112 USE_CPUSETS="--enable-cpuset"
113 fi
114 fi
115 }
116
117 src_prepare() {
118 epatch "${FILESDIR}"/0002-fix-implicit-declaration-warnings.patch
119 epatch "${FILESDIR}"/disable-automagic-doc-building-2.4.14.patch
120
121 sed -i \
122 -e 's,\(COMPACT_LATEX *=\).*,\1 NO,' \
123 -e 's,\(GENERATE_MAN *=\).*,\1 NO,' \
124 src/drmaa/Doxyfile.in || die
125 sed -i \
126 -e '/INSTALL_DATA/d' \
127 src/drmaa/Makefile.am || die
128 eautoreconf
129 }
130
131 src_configure() {
132 local myconf="--with-rcp=mom_rcp"
133
134 use crypt && myconf="--with-rcp=scp"
135
136 if use drmaa && use doc; then
137 myconf="${myconf} --enable-apidocs"
138 else
139 myconf="${myconf} --disable-apidocs"
140 fi
141
142 econf \
143 $(use_enable tk gui) \
144 $(use_enable syslog) \
145 $(use_enable server) \
146 $(use_enable drmaa) \
147 --with-server-home=${PBS_SERVER_HOME} \
148 --with-environ=/etc/pbs_environment \
149 --with-default-server=${PBS_SERVER_NAME} \
150 --disable-gcc-warnings \
151 ${USE_CPUSETS} \
152 ${myconf} \
153 || die "econf failed"
154 }
155
156 # WARNING
157 # OpenPBS is extremely stubborn about directory permissions. Sometimes it will
158 # just fall over with the error message, but in some spots it will just ignore
159 # you and fail strangely. Likewise it also barfs on our .keep files!
160 pbs_createspool() {
161 local root="$1"
162 local s="$(dirname "${PBS_SERVER_HOME}")"
163 local h="${PBS_SERVER_HOME}"
164 local sp="${h}/server_priv"
165 einfo "Building spool directory under ${D}${h}"
166 local a d m
167 local dir_spec="
168 0755:${h}/aux 0700:${h}/checkpoint
169 0755:${h}/mom_logs 0751:${h}/mom_priv 0751:${h}/mom_priv/jobs
170 1777:${h}/spool 1777:${h}/undelivered"
171
172 if use server; then
173 dir_spec="${dir_spec} 0755:${h}/sched_logs
174 0755:${h}/sched_priv/accounting 0755:${h}/server_logs
175 0750:${h}/server_priv 0755:${h}/server_priv/accounting
176 0750:${h}/server_priv/acl_groups 0750:${h}/server_priv/acl_hosts
177 0750:${h}/server_priv/acl_svr 0750:${h}/server_priv/acl_users
178 0750:${h}/server_priv/jobs 0750:${h}/server_priv/queues"
179 fi
180
181 for a in ${dir_spec}; do
182 d="${a/*:}"
183 m="${a/:*}"
184 if [[ ! -d "${root}${d}" ]]; then
185 install -d -m${m} "${root}${d}"
186 else
187 chmod ${m} "${root}${d}"
188 fi
189 # (#149226) If we're running in src_*, then keepdir
190 if [[ "${root}" = "${D}" ]]; then
191 keepdir ${d}
192 fi
193 done
194 }
195
196 src_install() {
197 # Make directories first
198 pbs_createspool "${D}"
199
200 emake DESTDIR="${D}" install || die "make install failed"
201
202 dodoc CHANGELOG README.* Release_Notes || die "dodoc failed"
203 if use doc; then
204 dodoc doc/admin_guide.ps doc/*.pdf || die "dodoc failed"
205 if use drmaa; then
206 dohtml -r src/drmaa/doc/html/* || die
207 dodoc src/drmaa/drmaa.pdf || die
208 fi
209 fi
210
211 # The build script isn't alternative install location friendly,
212 # So we have to fix some hard-coded paths in tclIndex for xpbs* to work
213 for file in `find "${D}" -iname tclIndex`; do
214 sed -e "s/${D//\// }/ /" "${file}" > "${file}.new" || die
215 mv "${file}.new" "${file}" || die
216 done
217
218 if use server; then
219 newinitd "${FILESDIR}"/pbs_server-init.d pbs_server
220 newinitd "${FILESDIR}"/pbs_sched-init.d pbs_sched
221 fi
222 newinitd "${FILESDIR}"/pbs_mom-init.d pbs_mom
223 newconfd "${FILESDIR}"/torque-conf.d torque
224 newenvd "${FILESDIR}"/torque-env.d 25torque
225
226 [ -d "${D}"/usr/share/doc/torque-drmaa ] && \
227 rm -rf "${D}"/usr/share/doc/torque-drmaa
228 }
229
230 pkg_preinst() {
231 if [[ -f "${ROOT}etc/pbs_environment" ]]; then
232 cp "${ROOT}etc/pbs_environment" "${D}"/etc/pbs_environment
233 fi
234
235 echo "${PBS_SERVER_NAME}" > "${D}${PBS_SERVER_HOME}/server_name"
236
237 # Fix up the env.d file to use our set server home.
238 sed -i "s:/var/spool/torque:${PBS_SERVER_HOME}:g" \
239 "${D}"/etc/env.d/25torque || die
240 }
241
242 pkg_postinst() {
243 pbs_createspool "${ROOT}"
244 elog " If this is the first time torque has been installed, then you are not"
245 elog "ready to start the server. Please refer to the documentation located at:"
246 elog "http://www.clusterresources.com/wiki/doku.php?id=torque:torque_wiki"
247
248 elog " For a basic setup, you may use emerge --config ${PN}"
249 }
250
251 # root will be setup as the primary operator/manager, the local machine
252 # will be added as a node and we'll create a simple queue, batch.
253 pkg_config() {
254 local h="$(echo "${ROOT}/${PBS_SERVER_HOME}" | sed 's:///*:/:g')"
255 local rc=0
256
257 ebegin "Configuring Torque"
258 einfo "Using ${h} as the pbs homedir"
259 einfo "Using ${PBS_SERVER_NAME} as the pbs_server"
260
261 # Check for previous configuration and bail if found.
262 if [ -e "${h}/server_priv/acl_svr/operators" ] \
263 || [ -e "${h}/server_priv/nodes" ] \
264 || [ -e "${h}/mom_priv/config" ]; then
265 ewarn "Previous Torque configuration detected. Press any key to"
266 ewarn "continue or press Control-C to abort now"
267 read
268 fi
269
270 # pbs_mom configuration.
271 echo "\$pbsserver ${PBS_SERVER_NAME}" > "${h}/mom_priv/config"
272 echo "\$logevent 255" >> "${h}/mom_priv/config"
273
274 if use server; then
275 local qmgr="${ROOT}/usr/bin/qmgr -c"
276 # pbs_server bails on repeated backslashes.
277 if ! echo "y" | "${ROOT}"/usr/sbin/pbs_server -d "${h}" -t create; then
278 eerror "Failed to start pbs_server"
279 rc=1
280 else
281 ${qmgr} "set server operators = root@$(hostname -f)" ${PBS_SERVER_NAME}
282 ${qmgr} "create queue batch" ${PBS_SERVER_NAME}
283 ${qmgr} "set queue batch queue_type = Execution" ${PBS_SERVER_NAME}
284 ${qmgr} "set queue batch started = True" ${PBS_SERVER_NAME}
285 ${qmgr} "set queue batch enabled = True" ${PBS_SERVER_NAME}
286 ${qmgr} "set server default_queue = batch" ${PBS_SERVER_NAME}
287 ${qmgr} "set server resources_default.nodes = 1" ${PBS_SERVER_NAME}
288 ${qmgr} "set server scheduling = True" ${PBS_SERVER_NAME}
289
290 "${ROOT}"/usr/bin/qterm -t quick ${PBS_SERVER_NAME} || rc=1
291
292 # Add the local machine as a node.
293 echo "$(hostname -f) np=1" > "${h}/server_priv/nodes"
294 fi
295 fi
296 eend ${rc}
297 }