Package pdsh: Specfile

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
%def_with dshgroups
%def_with exec
%def_without mrsh
%def_without qshell
%def_without mqshell
%def_with readline
%def_without nodeupdown
%def_without genders
%def_with pam
%def_without slurm
%def_with ssh
%def_with rsh
%def_with machines

Name: pdsh
Version: 2.29
Release: alt2

Summary: Parallel remote shell program
License: GPL
Group: System/Base

Url: http://sourceforge.net/projects/pdsh
Source0: http://dl.sourceforge.net/sourceforge/pdsh/%name-%version.tar.bz2
Source1: dshdir.pl
Source2: dshdir.1
Source100: pdsh.watch
Packager: Michael Shigorin <mike@altlinux.org>

Requires: pdsh-rcmd

%{?_with_mrsh:BuildRequires: munge-devel}
%{?_with_qshell:BuildRequires: qsnetlibs}
%{?_with_mqshell:BuildRequires: qsnetlibs}
%{?_with_readline:BuildRequires: readline-devel}
%{?_with_readline:BuildRequires: libncurses-devel}
%{?_with_nodeupdown:BuildRequires: whatsup}
%{?_with_genders:BuildRequires: genders > 1.0}
%{?_with_pam:BuildRequires: libpam-devel}
%{?_with_slurm:BuildRequires: libslurm-devel}

##############################################################################
# Pdsh description

# Automatically added by buildreq on Wed Jan 13 2010
BuildRequires: gcc-c++

%description
Pdsh is a multithreaded remote shell client which executes commands
on multiple remote hosts in parallel.  Pdsh can use several different
remote shell services, including standard "rsh", Kerberos IV, and ssh.
##############################################################################

%package qshd
Summary: Remote shell daemon for pdsh/qshell/Quadrics QsNet
Group: System/Base
Requires: xinetd
%description qshd
Remote shell service for running Quadrics QsNet jobs under pdsh.
Sets up Elan capabilities and environment variables needed by Quadrics
MPICH executables.
##############################################################################

%package mqshd
Summary: Remote shell daemon for pdsh/mqshell/Quadrics QsNet
Group: System/Base
Requires: xinetd
%description mqshd
Remote shell service for running Quadrics QsNet jobs under pdsh with
mrsh authentication.  Sets up Elan capabilities and environment variables
needed by Quadrics MPICH executables.
##############################################################################

#
# Module packages:
#
%package rcmd-rsh
Summary: Provides bsd rcmd capability to pdsh
Group: System/Base
Provides: pdsh-rcmd
Autoreq: yes, noruby
%description rcmd-rsh
Pdsh module for bsd rcmd functionality. Note: This module
requires that the pdsh binary be installed setuid root.

%package rcmd-ssh
Summary: Provides ssh rcmd capability to pdsh
Group: System/Base
Provides: pdsh-rcmd
Autoreq: yes, noruby

%description rcmd-ssh
Pdsh module for ssh rcmd functionality.

%package rcmd-qshell
Summary: Provides qshell rcmd capability to pdsh
Group: System/Base
Provides: pdsh-rcmd
Conflicts: pdsh-rcmd-mqshell
%description rcmd-qshell
Pdsh module for running QsNet MPI jobs. Note: This module
requires that the pdsh binary be installed setuid root.

%package rcmd-mrsh
Summary: Provides mrsh rcmd capability to pdsh
Group: System/Base
Provides: pdsh-rcmd
%description rcmd-mrsh
Pdsh module for mrsh rcmd functionality.

%package rcmd-mqshell
Summary: Provides mqshell rcmd capability to pdsh
Group: System/Base
Provides: pdsh-rcmd
Conflicts: pdsh-rcmd-qshell
%description rcmd-mqshell
Pdsh module for mqshell rcmd functionality.

%package rcmd-xcpu
Summary: Provides xcpu rcmd capability to pdsh
Group: System/Base
Provides: pdsh-xcpu
%description rcmd-xcpu
Pdsh module for xcpu rcmd functionality.

%package rcmd-exec
Summary: Provides arbitrary command execution "rcmd" method to pdsh
Group: System/Base
Provides: pdsh-rcmd
Autoreq: yes, noruby
%description rcmd-exec
Pdsh module for generic exec capability. This module allows
execution of an arbitrary command line for each target host in
place of a more specific rcmd connect method (i.e. ssh, rsh, etc.).
The command executed for each host is built from the pdsh
"remote" command line: The first remote argument is the command
to execute, followed by any arguments including "%%h", "%%u", and
"%%n", which are the remote target, username, and rank respectively.

%package mod-genders
Summary: Provides libgenders support for pdsh
Group: System/Base
Requires: genders >= 1.1
Conflicts: pdsh-mod-nodeattr
Conflicts: pdsh-mod-machines
%description mod-genders
Pdsh module for libgenders functionality.

%package mod-nodeattr
Summary: Provides genders support for pdsh using the nodeattr program
Group: System/Base
Requires: genders
Conflicts: pdsh-mod-genders
Conflicts: pdsh-mod-machines
%description mod-nodeattr
Pdsh module for genders functionality using the nodeattr program.

%package mod-nodeupdown
Summary: Provides libnodeupdown support for pdsh
Group: System/Base
Requires: whatsup
%description mod-nodeupdown
Pdsh module providing -v functionality using libnodeupdown.

%package mod-rms
Summary: Provides RMS support for pdsh
Group: System/Base
Requires: qsrmslibs
%description mod-rms
Pdsh module providing support for gathering the list of target nodes
from an allocated RMS resource.

%package mod-machines
Summary: Pdsh module for gathering list of target nodes from a machines file
Group: System/Base
Autoreq: yes, noruby
%description mod-machines
Pdsh module for gathering list of all target nodes from a machines file.

%package mod-dshgroup
Summary: Provides dsh-style group file support for pdsh
Group: System/Base
%description mod-dshgroup
Pdsh module providing dsh (Dancer's shell) style "group" file support.
Provides -g groupname and -X groupname options to pdsh.

%package mod-netgroup
Summary: Provides netgroup support for pdsh
Group: System/Base
%description mod-netgroup
Pdsh module providing support for targeting hosts based on netgroup.
Provides -g groupname and -X groupname options to pdsh.

%package mod-slurm
Summary: Provides support for running pdsh under SLURM allocations
Group: System/Base
Requires: slurm
Autoreq: yes, noruby
%description mod-slurm
Pdsh module providing support for gathering the list of target nodes
from an allocated SLURM job.

##############################################################################

%prep
%setup
##############################################################################

%build
%configure --program-prefix=%{?_program_prefix:%_program_prefix} \
%{?_enable_debug}       \
%{?_with_pam}           \
%{?_without_pam}        \
%{?_with_rsh}           \
%{?_without_rsh}        \
%{?_with_ssh}           \
%{?_without_ssh}        \
%{?_with_exec}          \
%{?_without_exec}       \
%{?_with_qshell}        \
%{?_without_qshell}     \
%{?_with_readline}      \
%{?_without_readline}   \
%{?_with_machines}      \
%{?_without_machines}   \
%{?_with_genders}       \
%{?_without_genders}    \
%{?_with_rms}           \
%{?_without_rms}        \
%{?_with_nodeupdown}    \
%{?_without_nodeupdown} \
%{?_with_nodeattr}      \
%{?_without_nodeattr}   \
%{?_with_mrsh}          \
%{?_without_mrsh}       \
%{?_with_mqshell}       \
%{?_without_mqshell}    \
%{?_with_xcpu}       \
%{?_without_xcpu}    \
%{?_with_slurm}         \
%{?_without_slurm}      \
%{?_with_dshgroups}     \
%{?_without_dshgroups}  \
%{?_with_netgroup}      \
%{?_without_netgroup}

# FIXME: build fails when trying to build with _smp_mflags if qsnet is enabled
# make %_smp_mflags CFLAGS="$RPM_OPT_FLAGS"
%make CFLAGS="%optflags"
##############################################################################

%install
%makeinstall_std
if [ -x %buildroot%_sbindir/in.qshd ]; then
   install -pDm644 etc/qshell.xinetd %buildroot%_sysconfdir/xinetd.d/qshell
fi
if [ -x %buildroot%_sbindir/in.mqshd ]; then
   install -pDm644 etc/mqshell.xinetd %buildroot%_sysconfdir/xinetd.d/mqshell
fi

#
# Remove all module .a's as they are not needed on any known RPM platform.
rm %buildroot%_libdir/pdsh/*.a
rm %buildroot%_libdir/pdsh/*.la

# add dshdir script/manpage
install -pDm755 %SOURCE1 %buildroot%_bindir/dshdir
install -pDm644 %SOURCE1 %buildroot%_man1dir/dshdir.1

##############################################################################

##############################################################################

%files
%doc COPYING README NEWS DISCLAIMER
%doc README.KRB4 README.modules README.QsNet
%_bindir/pdsh
%_bindir/pdcp
%_bindir/rpdcp
%_bindir/dshbak
%_bindir/dshdir
%_man1dir/*
##############################################################################

%if %{?_with_exec:1}%{!?_with_exec:0}
%files rcmd-exec
%_libdir/pdsh/execcmd.*
%endif
##############################################################################

%if %{?_with_rsh:1}%{!?_with_rsh:0}
%files rcmd-rsh
%_libdir/pdsh/xrcmd.*
%endif
##############################################################################

%if %{?_with_ssh:1}%{!?_with_ssh:0}
%files rcmd-ssh
%_libdir/pdsh/sshcmd.*
%endif
##############################################################################

%if %{?_with_qshell:1}%{!?_with_qshell:0}
%files rcmd-qshell
%_libdir/pdsh/qcmd.*
%endif
##############################################################################

%if %{?_with_mrsh:1}%{!?_with_mrsh:0}
%files rcmd-mrsh
%_libdir/pdsh/mcmd.*
%endif
##############################################################################

%if %{?_with_mqshell:1}%{!?_with_mqshell:0}
%files rcmd-mqshell
%_libdir/pdsh/mqcmd.*
%endif
##############################################################################

%if %{?_with_xcpu:1}%{!?_with_xcpu:0}
%files rcmd-xcpu
%_libdir/pdsh/xcpucmd.*
%endif
##############################################################################

%if %{?_with_genders:1}%{!?_with_genders:0}
%files mod-genders
%_libdir/pdsh/genders.*
%endif
##############################################################################

%if %{?_with_nodeattr:1}%{!?_with_nodeattr:0}
%files mod-nodeattr
%_libdir/pdsh/nodeattr.*
%endif
##############################################################################

%if %{?_with_nodeupdown:1}%{!?_with_nodeupdown:0}
%files mod-nodeupdown
%_libdir/pdsh/nodeupdown.*
%endif
##############################################################################

%if %{?_with_rms:1}%{!?_with_rms:0}
%files mod-rms
%_libdir/pdsh/rms.*
%endif
##############################################################################

%if %{?_with_machines:1}%{!?_with_machines:0}
%files mod-machines
%_libdir/pdsh/machines.*
%endif
##############################################################################

%if %{?_with_dshgroups:1}%{!?_with_dshgroups:0}
%files mod-dshgroup
%_libdir/pdsh/dshgroup.*
%endif
##############################################################################

%if %{?_with_netgroup:1}%{!?_with_netgroup:0}
%files mod-netgroup
%_libdir/pdsh/netgroup.*
%endif
##############################################################################

%if %{?_with_slurm:1}%{!?_with_slurm:0}
%files mod-slurm
%_libdir/pdsh/slurm.*
%endif
##############################################################################

%if %{?_with_qshell:1}%{!?_with_qshell:0}
%files qshd
%_sbindir/in.qshd
%_sysconfdir/xinetd.d/qshell

%post qshd
if ! grep "^qshell" %_sysconfdir/services >/dev/null; then
  echo "qshell            523/tcp                  # pdsh/qshell/Quadrics QsNet" >>%_sysconfdir/services
fi
%_initdir/xinetd reload

%endif
##############################################################################

%if %{?_with_mqshell:1}%{!?_with_mqshell:0}
%files mqshd
%_sbindir/in.mqshd
%_sysconfdir/xinetd.d/mqshell

%post mqshd
if ! grep "^mqshell" %_sysconfdir/services >/dev/null; then
  echo "mqshell         21234/tcp                  # pdsh/mqshell/Quadrics QsNet" >>%_sysconfdir/services
fi
%_initdir/xinetd reload

%endif
##############################################################################

%changelog
* Tue Feb 05 2019 Michael Shigorin <mike@altlinux.org> 2.29-alt2
- rebuilt against readline7

* Thu Jun 19 2014 Michael Shigorin <mike@altlinux.org> 2.29-alt1
- new version (watch file uupdate)

* Thu Mar 13 2014 Michael Shigorin <mike@altlinux.org> 2.26-alt3
- enabled dshgroups per legion@'s request

* Wed May 09 2012 Michael Shigorin <mike@altlinux.org> 2.26-alt2
- added watch file

* Sun Sep 25 2011 Michael Shigorin <mike@altlinux.org> 2.26-alt1
- 2.26

* Thu Mar 10 2011 Michael Shigorin <mike@altlinux.org> 2.25-alt1
- 2.25

* Tue Mar 1 2011 Michael Shigorin <mike@altlinux.org> 2.24-alt1
- 2.24 (our contribs merged upstream)

* Fri Feb 25 2011 Michael Shigorin <mike@altlinux.org> 2.22-alt2
- added dshdir output processing script by Alexander Bandura
  (splits it into node-specific files in a directory)

* Sun Sep 19 2010 Michael Shigorin <mike@altlinux.org> 2.22-alt1
- 2.22

* Fri Jul 09 2010 Michael Shigorin <mike@altlinux.org> 2.18-alt1
- TMC package rebuilt for Sisyphus
- minor spec cleanup
- disabled slurm subpackage in the meanwhile