-
Notifications
You must be signed in to change notification settings - Fork 59
/
pdsh.spec
425 lines (355 loc) · 12.4 KB
/
pdsh.spec
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
Name: pdsh
Version: 2.34
Release: 1
Summary: Parallel remote shell program
License: GPL
Url: https://github.com/chaos/pdsh
Group: System Environment/Base
Source: pdsh-%{version}-%{release}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: pdsh-rcmd
#
# Enabling and disabling pdsh options
# defaults:
# enabled: readline, rsh, ssh, dshgroup, netgroups, exec
# disabled: rms, mrsh, xcpu, genders, machines, nodeupdown
# To build the various module subpackages, pass --with <pkg> on
# the rpmbuild command line (if your rpm is a recent enough version)
#
# Similarly, to disable various pdsh options pass --without <pkg> on
# the rpmbuild command line.
#
# This specfile also supports passing the --with and --without through
# the environment variables PDSH_WITH_OPTIONS and PDSH_WITHOUT_OPTIONS.
# e.g. PDSH_WITH_OPTIONS="genders" rpmbuild ....
#
#
# Definition of default packages to build on various platforms:
#
%define _defaults ssh exec readline
# LLNL system defaults
%if 0%{?chaos}
%define _default_with %{_defaults} mrsh nodeupdown genders slurm
%else
# All other defaults
%define _default_with %{_defaults} dshgroups netgroup machines
%endif
#
# Environment variables can be used to override defaults above:
#
%define _env_without ${PDSH_WITHOUT_OPTIONS}
%define _env_with ${PDSH_WITH_OPTIONS}
# Shortcut for % global expansion
%define dstr "%%%%"global
# Check with/out env variables for any options
%define env() echo %_env_%{1}|grep -qw %%1 && echo %dstr _%{1}_%%1 --%{1}-%%1
# Check defaults
%define def() echo %_default_with | grep -qw %%1 || w=out; echo %dstr _with${w}_%%1 --with${w}-%%1
# Check env variables first. If they are not set use defaults.
%{expand: %%define pdsh_with() %%((%{env with})||(%{env without})||(%{def}))}
# Only check environment and defaults if a --with or --without wasn't
# used from the rpmbuild command line.
#
%define pdsh_opt() %%{!?_with_%1: %%{!?_without_%1: %%{expand: %%pdsh_with %1}}}
#
# Rcmd modules:
#
%{expand: %pdsh_opt exec}
%{expand: %pdsh_opt ssh}
%{expand: %pdsh_opt rsh}
%{expand: %pdsh_opt mrsh}
%{expand: %pdsh_opt xcpu}
#
# Misc modules:
#
%{expand: %pdsh_opt netgroup}
%{expand: %pdsh_opt dshgroups}
%{expand: %pdsh_opt genders}
%{expand: %pdsh_opt nodeupdown}
%{expand: %pdsh_opt machines}
%{expand: %pdsh_opt slurm}
%{expand: %pdsh_opt torque}
%{expand: %pdsh_opt rms}
#
# Other options:
#
%{expand: %pdsh_opt readline}
%{expand: %pdsh_opt debug}
#
# If "--with debug" is set compile with --enable-debug
# and try not to strip binaries.
#
# (See /usr/share/doc/rpm-*/conditionalbuilds)
#
%if %{?_with_debug:1}%{!?_with_debug:0}
%define _enable_debug --enable-debug
%endif
%{?_with_mrsh:BuildRequires: munge-devel}
%{?_with_readline:BuildRequires: readline-devel}
%{?_with_readline:BuildRequires: ncurses-devel}
%{?_with_nodeupdown:BuildRequires: whatsup}
%{?_with_genders:BuildRequires: genders > 1.0}
%{?_with_slurm:BuildRequires: slurm-devel}
%{?_with_torque:BuildRequires: torque-devel}
##############################################################################
# Pdsh description
%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.
##############################################################################
#
# Module packages:
#
%package rcmd-rsh
Summary: Provides bsd rcmd capability to pdsh
Group: System Environment/Base
Provides: pdsh-rcmd
%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 Environment/Base
Provides: pdsh-rcmd
%description rcmd-ssh
Pdsh module for ssh rcmd functionality.
%package rcmd-mrsh
Summary: Provides mrsh rcmd capability to pdsh
Group: System Environment/Base
Provides: pdsh-rcmd
%description rcmd-mrsh
Pdsh module for mrsh rcmd functionality.
%package rcmd-xcpu
Summary: Provides xcpu rcmd capability to pdsh
Group: System Environment/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 Environment/Base
Provides: pdsh-rcmd
%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 Environment/Base
Requires: genders >= 1.1
Conflicts: pdsh-mod-machines
%description mod-genders
Pdsh module for libgenders functionality.
%package mod-nodeupdown
Summary: Provides libnodeupdown support for pdsh
Group: System Environment/Base
Requires: whatsup
%description mod-nodeupdown
Pdsh module providing -v functionality using libnodeupdown.
%package mod-machines
Summary: Pdsh module for gathering list of target nodes from a machines file
Group: System Environment/Base
%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 Environment/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 Environment/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 Environment/Base
Requires: slurm
%description mod-slurm
Pdsh module providing support for gathering the list of target nodes
from an allocated SLURM job.
%package mod-torque
Summary: Provides support for running pdsh under Torque allocations
Group: System Environment/Base
Requires: torque
%description mod-torque
Pdsh module providing support for gathering the list of target nodes
from an allocated Torque job.
##############################################################################
%prep
%setup
##############################################################################
%build
%configure --program-prefix=%{?_program_prefix:%{_program_prefix}} \
%{?_enable_debug} \
%{?_with_rsh} \
%{?_without_rsh} \
%{?_with_ssh} \
%{?_without_ssh} \
%{?_with_exec} \
%{?_without_exec} \
%{?_with_readline} \
%{?_without_readline} \
%{?_with_machines} \
%{?_without_machines} \
%{?_with_genders} \
%{?_without_genders} \
%{?_with_nodeupdown} \
%{?_without_nodeupdown} \
%{?_with_mrsh} \
%{?_without_mrsh} \
%{?_with_xcpu} \
%{?_without_xcpu} \
%{?_with_slurm} \
%{?_without_slurm} \
%{?_with_torque} \
%{?_without_torque} \
%{?_with_dshgroups} \
%{?_without_dshgroups} \
%{?_with_netgroup} \
%{?_without_netgroup}
make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"
# Now run tests
make check
##############################################################################
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT
DESTDIR="$RPM_BUILD_ROOT" make install
#
# Remove all module .a's as they are not needed on any known RPM platform.
rm $RPM_BUILD_ROOT/%{_libdir}/pdsh/*.a
rm $RPM_BUILD_ROOT/%{_libdir}/pdsh/*.la
##############################################################################
%clean
rm -rf "$RPM_BUILD_ROOT"
##############################################################################
%files
%defattr(-,root,root)
%doc COPYING README NEWS DISCLAIMER.LLNS DISCLAIMER.UC
%doc README.KRB4 README.modules
%{_bindir}/pdsh
%{_bindir}/pdcp
%{_bindir}/rpdcp
%{_bindir}/dshbak
%dir %{_libdir}/pdsh
%{_mandir}/man1/*
##############################################################################
%if %{?_with_exec:1}%{!?_with_exec:0}
%files rcmd-exec
%defattr(-,root,root)
%{_libdir}/pdsh/execcmd.*
%endif
##############################################################################
%if %{?_with_rsh:1}%{!?_with_rsh:0}
%files rcmd-rsh
%defattr(-,root,root)
%{_libdir}/pdsh/xrcmd.*
%endif
##############################################################################
%if %{?_with_ssh:1}%{!?_with_ssh:0}
%files rcmd-ssh
%defattr(-,root,root)
%{_libdir}/pdsh/sshcmd.*
%endif
##############################################################################
%if %{?_with_mrsh:1}%{!?_with_mrsh:0}
%files rcmd-mrsh
%defattr(-,root,root)
%{_libdir}/pdsh/mcmd.*
%endif
##############################################################################
%if %{?_with_xcpu:1}%{!?_with_xcpu:0}
%files rcmd-xcpu
%defattr(-,root,root)
%{_libdir}/pdsh/xcpucmd.*
%endif
##############################################################################
%if %{?_with_genders:1}%{!?_with_genders:0}
%files mod-genders
%defattr(-,root,root)
%{_libdir}/pdsh/genders.*
%endif
##############################################################################
%if %{?_with_nodeupdown:1}%{!?_with_nodeupdown:0}
%files mod-nodeupdown
%defattr(-,root,root)
%{_libdir}/pdsh/nodeupdown.*
%endif
##############################################################################
%if %{?_with_rms:1}%{!?_with_rms:0}
%files mod-rms
%defattr(-,root,root)
%{_libdir}/pdsh/rms.*
%endif
##############################################################################
%if %{?_with_machines:1}%{!?_with_machines:0}
%files mod-machines
%defattr(-,root,root)
%{_libdir}/pdsh/machines.*
%endif
##############################################################################
%if %{?_with_dshgroups:1}%{!?_with_dshgroups:0}
%files mod-dshgroup
%defattr(-,root,root)
%{_libdir}/pdsh/dshgroup.*
%endif
##############################################################################
%if %{?_with_netgroup:1}%{!?_with_netgroup:0}
%files mod-netgroup
%defattr(-,root,root)
%{_libdir}/pdsh/netgroup.*
%endif
##############################################################################
%if %{?_with_slurm:1}%{!?_with_slurm:0}
%files mod-slurm
%defattr(-,root,root)
%{_libdir}/pdsh/slurm.*
%endif
##############################################################################
%if %{?_with_torque:1}%{!?_with_torque:0}
%files mod-torque
%defattr(-,root,root)
%{_libdir}/pdsh/torque.*
%endif
##############################################################################
%changelog
* Tue Jul 20 2016 Albert Chu <chu11@llnl.gov>
- update URL to point to github URL
- update Source to not point to sourceforge repo
* Fri Jun 22 2007 Mark Grondona <mgrondona@llnl.gov>
- reworked specfile conditionals to allow easy change of defaults
* Mon Jun 4 2007 Mark Grondona <mgrondona@llnl.gov>
- added rcmd-exec subpackage.
* Thu Feb 22 2007 Daniel J Blueman <daniel@quadrics.com>
- added 'rpmbuild ... --without pam' option passthrough
- generalised 'elan3' to 'Quadrics QsNet'
* Thu Dec 7 2006 Mark Grondona <mgrondona@llnl.gov>
- Package new rpdcp command.
* Fri Feb 23 2006 Ben Woodard <woodard@redhat.com>
- changed source location to point to main site not mirror.
* Thu Feb 22 2006 Ben Woodard <woodard@redhat.com>
- removed change of attributes of pdsh and pcp in files section
- removed .a files from packages.
* Wed Feb 22 2006 Ben Woodard <woodard@redhat.com>
- add parameters to make
- replace etc with _sysconfdir in most places
- remove post section with unexplained removing of cached man pages.
- removed dots at end of all summaries.
* Wed Feb 16 2006 Ben Woodard <woodard@redhat.com
- removed dot at end of summary
- removed unused/broken smp build
- changed to using initrddir macro
- changed depricated Prereq to Requires
* Thu Feb 9 2006 Ben Woodard <woodard@redhat.com>
- add in rpmlint fixes
- change buildroot
* Wed Feb 1 2006 Ben Woodard <woodard@redhat.com>
- Modified spec file to fix some problems uncovered by rpmlint