PageRenderTime 109ms CodeModel.GetById 33ms app.highlight 70ms RepoModel.GetById 1ms app.codeStats 0ms

/pdsh.spec

https://code.google.com/
Unknown | 553 lines | 469 code | 84 blank | 0 comment | 0 complexity | 6b00117019d561aeb24c4ab3f0eac1a3 MD5 | raw file
  1Name: pdsh
  2Version: 
  3Release: 
  4
  5Summary: Parallel remote shell program
  6
  7License: GPL
  8Url: http://sourceforge.net/projects/pdsh
  9Group: System Environment/Base
 10Source: http://dl.sourceforge.net/sourceforge/pdsh/pdsh-%{version}-1.tar.gz
 11BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 12Requires: pdsh-rcmd
 13
 14#
 15# Enabling and disabling pdsh options
 16#  defaults:
 17#  enabled:  readline, rsh, ssh, dshgroup, netgroups, exec
 18#  disabled: rms, mrsh, qshell, mqshell, xcpu, genders, nodeattr, machines,
 19#            nodeupdown
 20
 21#  To build the various module subpackages, pass --with <pkg> on
 22#   the rpmbuild command line (if your rpm is a recent enough version)
 23#  
 24#  Similarly, to disable various pdsh options pass --without <pkg> on
 25#   the rpmbuild command line.
 26#
 27#  This specfile also supports passing the --with and --without through
 28#   the environment variables PDSH_WITH_OPTIONS and PDSH_WITHOUT_OPTIONS.
 29#   e.g. PDSH_WITH_OPTIONS="qshell genders" rpmbuild ....
 30#
 31
 32#
 33#  Definition of default packages to build on various platforms:
 34# 
 35%define _defaults ssh exec readline pam 
 36
 37#   LLNL system defaults
 38%if 0%{?chaos}
 39%define _default_with %{_defaults} mrsh nodeupdown genders slurm 
 40%else
 41#   All other defaults
 42%define _default_with %{_defaults} dshgroups netgroup machines 
 43%endif
 44
 45#
 46#   Environment variables can be used to override defaults above:
 47#
 48%define _env_without ${PDSH_WITHOUT_OPTIONS}
 49%define _env_with    ${PDSH_WITH_OPTIONS} 
 50
 51#   Shortcut for % global expansion
 52%define dstr "%%%%"global
 53
 54#    Check with/out env variables for any options
 55%define env() echo %_env_%{1}|grep -qw %%1 && echo %dstr _%{1}_%%1 --%{1}-%%1
 56#    Check defaults
 57%define def() echo %_default_with | grep -qw %%1 || w=out; echo %dstr _with${w}_%%1 --with${w}-%%1
 58
 59#    Check env variables first. If they are not set use defaults.
 60%{expand: %%define pdsh_with() %%((%{env with})||(%{env without})||(%{def}))}
 61
 62#    Only check environment and defaults if a --with or --without wasn't
 63#     used from the rpmbuild command line.
 64#
 65%define pdsh_opt() %%{!?_with_%1: %%{!?_without_%1: %%{expand: %%pdsh_with %1}}}
 66
 67
 68#
 69# Rcmd modules:
 70#
 71%{expand: %pdsh_opt exec}
 72%{expand: %pdsh_opt ssh}
 73%{expand: %pdsh_opt rsh}
 74%{expand: %pdsh_opt mrsh}
 75%{expand: %pdsh_opt qshell}
 76%{expand: %pdsh_opt mqshell}
 77%{expand: %pdsh_opt xcpu}
 78
 79#
 80# Misc modules:
 81#
 82%{expand: %pdsh_opt netgroup}
 83%{expand: %pdsh_opt dshgroups}
 84%{expand: %pdsh_opt genders}
 85%{expand: %pdsh_opt nodeattr}
 86%{expand: %pdsh_opt nodeupdown}
 87%{expand: %pdsh_opt machines}
 88%{expand: %pdsh_opt slurm}
 89%{expand: %pdsh_opt torque}
 90%{expand: %pdsh_opt rms}
 91
 92#
 93# Other options:
 94#
 95%{expand: %pdsh_opt readline}
 96%{expand: %pdsh_opt debug}
 97%{expand: %pdsh_opt pam}
 98
 99#
100# If "--with debug" is set compile with --enable-debug
101#   and try not to strip binaries.
102#
103# (See /usr/share/doc/rpm-*/conditionalbuilds)
104#
105%if %{?_with_debug:1}%{!?_with_debug:0}
106  %define _enable_debug --enable-debug
107%endif
108
109
110%{?_with_mrsh:BuildRequires: munge-devel}
111%{?_with_qshell:BuildRequires: qsnetlibs}
112%{?_with_mqshell:BuildRequires: qsnetlibs}
113%{?_with_readline:BuildRequires: readline-devel}
114%{?_with_readline:BuildRequires: ncurses-devel}
115%{?_with_nodeupdown:BuildRequires: whatsup}
116%{?_with_genders:BuildRequires: genders > 1.0}
117%{?_with_pam:BuildRequires: pam-devel}
118%{?_with_slurm:BuildRequires: slurm-devel}
119%{?_with_torque:BuildRequires: torque-devel}
120
121
122##############################################################################
123# Pdsh description
124
125%description
126Pdsh is a multithreaded remote shell client which executes commands
127on multiple remote hosts in parallel.  Pdsh can use several different
128remote shell services, including standard "rsh", Kerberos IV, and ssh.
129##############################################################################
130
131%package qshd
132Summary: Remote shell daemon for pdsh/qshell/Quadrics QsNet
133Group:   System Environment/Base
134Requires:  xinetd
135%description qshd
136Remote shell service for running Quadrics QsNet jobs under pdsh.
137Sets up Elan capabilities and environment variables needed by Quadrics
138MPICH executables.
139##############################################################################
140
141%package mqshd
142Summary: Remote shell daemon for pdsh/mqshell/Quadrics QsNet
143Group:   System Environment/Base
144Requires:  xinetd
145%description mqshd
146Remote shell service for running Quadrics QsNet jobs under pdsh with
147mrsh authentication.  Sets up Elan capabilities and environment variables 
148needed by Quadrics MPICH executables.
149##############################################################################
150
151#
152# Module packages:
153#
154%package   rcmd-rsh
155Summary:   Provides bsd rcmd capability to pdsh
156Group:     System Environment/Base
157Provides:  pdsh-rcmd
158%description rcmd-rsh
159Pdsh module for bsd rcmd functionality. Note: This module
160requires that the pdsh binary be installed setuid root.
161
162%package   rcmd-ssh
163Summary:   Provides ssh rcmd capability to pdsh
164Group:     System Environment/Base
165Provides:  pdsh-rcmd
166%description rcmd-ssh
167Pdsh module for ssh rcmd functionality.
168
169%package   rcmd-qshell
170Summary:   Provides qshell rcmd capability to pdsh
171Group:     System Environment/Base
172Provides:  pdsh-rcmd
173Conflicts: pdsh-rcmd-mqshell
174%description rcmd-qshell
175Pdsh module for running QsNet MPI jobs. Note: This module
176requires that the pdsh binary be installed setuid root.
177
178%package   rcmd-mrsh
179Summary:   Provides mrsh rcmd capability to pdsh
180Group:     System Environment/Base
181Provides:  pdsh-rcmd
182%description rcmd-mrsh
183Pdsh module for mrsh rcmd functionality.
184
185%package   rcmd-mqshell
186Summary:   Provides mqshell rcmd capability to pdsh
187Group:     System Environment/Base
188Provides:  pdsh-rcmd
189Conflicts: pdsh-rcmd-qshell
190%description rcmd-mqshell
191Pdsh module for mqshell rcmd functionality.
192
193%package   rcmd-xcpu
194Summary:   Provides xcpu rcmd capability to pdsh
195Group:     System Environment/Base
196Provides:  pdsh-xcpu
197%description rcmd-xcpu
198Pdsh module for xcpu rcmd functionality.
199
200%package   rcmd-exec
201Summary:   Provides arbitrary command execution "rcmd" method to pdsh
202Group:     System Environment/Base
203Provides:  pdsh-rcmd
204%description rcmd-exec
205Pdsh module for generic exec capability. This module allows
206execution of an arbitrary command line for each target host in
207place of a more specific rcmd connect method (i.e. ssh, rsh, etc.).
208The command executed for each host is built from the pdsh
209"remote" command line: The first remote argument is the command
210to execute, followed by any arguments including "%h", "%u", and
211"%n", which are the remote target, username, and rank respectively.
212
213%package   mod-genders
214Summary:   Provides libgenders support for pdsh
215Group:     System Environment/Base
216Requires:  genders >= 1.1
217Conflicts: pdsh-mod-nodeattr
218Conflicts: pdsh-mod-machines
219%description mod-genders
220Pdsh module for libgenders functionality.
221
222%package   mod-nodeattr
223Summary:   Provides genders support for pdsh using the nodeattr program
224Group:     System Environment/Base
225Requires:  genders 
226Conflicts: pdsh-mod-genders
227Conflicts: pdsh-mod-machines
228%description mod-nodeattr
229Pdsh module for genders functionality using the nodeattr program.
230
231%package   mod-nodeupdown
232Summary:   Provides libnodeupdown support for pdsh
233Group:     System Environment/Base
234Requires:  whatsup
235%description mod-nodeupdown
236Pdsh module providing -v functionality using libnodeupdown.
237
238%package   mod-rms
239Summary:   Provides RMS support for pdsh
240Group:     System Environment/Base
241Requires:  qsrmslibs
242%description mod-rms
243Pdsh module providing support for gathering the list of target nodes
244from an allocated RMS resource.
245
246%package   mod-machines
247Summary:   Pdsh module for gathering list of target nodes from a machines file
248Group:     System Environment/Base
249%description mod-machines
250Pdsh module for gathering list of all target nodes from a machines file.
251
252%package   mod-dshgroup
253Summary:   Provides dsh-style group file support for pdsh
254Group:     System Environment/Base
255%description mod-dshgroup
256Pdsh module providing dsh (Dancer's shell) style "group" file support.
257Provides -g groupname and -X groupname options to pdsh.
258
259%package   mod-netgroup
260Summary:   Provides netgroup support for pdsh
261Group:     System Environment/Base
262%description mod-netgroup
263Pdsh module providing support for targeting hosts based on netgroup.
264Provides -g groupname and -X groupname options to pdsh.
265
266%package   mod-slurm
267Summary:   Provides support for running pdsh under SLURM allocations
268Group:     System Environment/Base
269Requires:  slurm
270%description mod-slurm
271Pdsh module providing support for gathering the list of target nodes
272from an allocated SLURM job.
273
274%package   mod-torque
275Summary:   Provides support for running pdsh under Torque allocations
276Group:     System Environment/Base
277Requires:  torque
278%description mod-torque
279Pdsh module providing support for gathering the list of target nodes
280from an allocated Torque job.
281
282
283
284##############################################################################
285
286%prep
287%setup 
288##############################################################################
289
290%build
291%configure --program-prefix=%{?_program_prefix:%{_program_prefix}} \
292    %{?_enable_debug}       \
293    %{?_with_pam}           \
294    %{?_without_pam}        \
295    %{?_with_rsh}           \
296    %{?_without_rsh}        \
297    %{?_with_ssh}           \
298    %{?_without_ssh}        \
299    %{?_with_exec}          \
300    %{?_without_exec}       \
301    %{?_with_qshell}        \
302    %{?_without_qshell}     \
303    %{?_with_readline}      \
304    %{?_without_readline}   \
305    %{?_with_machines}      \
306    %{?_without_machines}   \
307    %{?_with_genders}       \
308    %{?_without_genders}    \
309    %{?_with_rms}           \
310    %{?_without_rms}        \
311    %{?_with_nodeupdown}    \
312    %{?_without_nodeupdown} \
313    %{?_with_nodeattr}      \
314    %{?_without_nodeattr}   \
315    %{?_with_mrsh}          \
316    %{?_without_mrsh}       \
317    %{?_with_mqshell}       \
318    %{?_without_mqshell}    \
319    %{?_with_xcpu}       \
320    %{?_without_xcpu}    \
321    %{?_with_slurm}         \
322    %{?_without_slurm}      \
323    %{?_with_torque}        \
324    %{?_without_torque}     \
325    %{?_with_dshgroups}     \
326    %{?_without_dshgroups}  \
327    %{?_with_netgroup}      \
328    %{?_without_netgroup} 
329    
330           
331# FIXME: build fails when trying to build with _smp_mflags if qsnet is enabled
332# make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"
333make CFLAGS="$RPM_OPT_FLAGS"
334
335# Now run tests
336make check
337##############################################################################
338
339%install
340rm -rf $RPM_BUILD_ROOT
341mkdir -p $RPM_BUILD_ROOT
342DESTDIR="$RPM_BUILD_ROOT" make install
343if [ -x $RPM_BUILD_ROOT/%{_sbindir}/in.qshd ]; then
344   install -D -m644 etc/qshell.xinetd $RPM_BUILD_ROOT/%{_sysconfdir}/xinetd.d/qshell
345fi
346if [ -x $RPM_BUILD_ROOT/%{_sbindir}/in.mqshd ]; then
347   install -D -m644 etc/mqshell.xinetd $RPM_BUILD_ROOT/%{_sysconfdir}/xinetd.d/mqshell
348fi
349
350# 
351# Remove all module .a's as they are not needed on any known RPM platform.
352rm $RPM_BUILD_ROOT/%{_libdir}/pdsh/*.a 
353rm $RPM_BUILD_ROOT/%{_libdir}/pdsh/*.la
354
355##############################################################################
356
357%clean
358rm -rf "$RPM_BUILD_ROOT"
359##############################################################################
360
361%files
362%defattr(-,root,root)
363%doc COPYING README NEWS DISCLAIMER 
364%doc README.KRB4 README.modules README.QsNet
365%{_bindir}/pdsh
366%{_bindir}/pdcp
367%{_bindir}/rpdcp
368%{_bindir}/dshbak
369%dir %{_libdir}/pdsh
370%{_mandir}/man1/*
371##############################################################################
372
373%if %{?_with_exec:1}%{!?_with_exec:0}
374%files rcmd-exec
375%defattr(-,root,root)
376%{_libdir}/pdsh/execcmd.*
377%endif
378##############################################################################
379
380%if %{?_with_rsh:1}%{!?_with_rsh:0}
381%files rcmd-rsh
382%defattr(-,root,root)
383%{_libdir}/pdsh/xrcmd.*
384%endif
385##############################################################################
386
387%if %{?_with_ssh:1}%{!?_with_ssh:0}
388%files rcmd-ssh
389%defattr(-,root,root)
390%{_libdir}/pdsh/sshcmd.*
391%endif
392##############################################################################
393
394%if %{?_with_qshell:1}%{!?_with_qshell:0}
395%files rcmd-qshell
396%defattr(-,root,root)
397%{_libdir}/pdsh/qcmd.*
398%endif
399##############################################################################
400
401%if %{?_with_mrsh:1}%{!?_with_mrsh:0}
402%files rcmd-mrsh
403%defattr(-,root,root)
404%{_libdir}/pdsh/mcmd.*
405%endif
406##############################################################################
407
408%if %{?_with_mqshell:1}%{!?_with_mqshell:0}
409%files rcmd-mqshell
410%defattr(-,root,root)
411%{_libdir}/pdsh/mqcmd.*
412%endif
413##############################################################################
414
415%if %{?_with_xcpu:1}%{!?_with_xcpu:0}
416%files rcmd-xcpu
417%defattr(-,root,root)
418%{_libdir}/pdsh/xcpucmd.*
419%endif
420##############################################################################
421
422%if %{?_with_genders:1}%{!?_with_genders:0}
423%files mod-genders
424%defattr(-,root,root)
425%{_libdir}/pdsh/genders.*
426%endif
427##############################################################################
428
429%if %{?_with_nodeattr:1}%{!?_with_nodeattr:0}
430%files mod-nodeattr
431%defattr(-,root,root)
432%{_libdir}/pdsh/nodeattr.*
433%endif
434##############################################################################
435
436%if %{?_with_nodeupdown:1}%{!?_with_nodeupdown:0}
437%files mod-nodeupdown
438%defattr(-,root,root)
439%{_libdir}/pdsh/nodeupdown.*
440%endif
441##############################################################################
442
443%if %{?_with_rms:1}%{!?_with_rms:0}
444%files mod-rms
445%defattr(-,root,root)
446%{_libdir}/pdsh/rms.*
447%endif
448##############################################################################
449
450%if %{?_with_machines:1}%{!?_with_machines:0}
451%files mod-machines
452%defattr(-,root,root)
453%{_libdir}/pdsh/machines.*
454%endif
455##############################################################################
456
457%if %{?_with_dshgroups:1}%{!?_with_dshgroups:0}
458%files mod-dshgroup
459%defattr(-,root,root)
460%{_libdir}/pdsh/dshgroup.*
461%endif
462##############################################################################
463
464%if %{?_with_netgroup:1}%{!?_with_netgroup:0}
465%files mod-netgroup
466%defattr(-,root,root)
467%{_libdir}/pdsh/netgroup.*
468%endif
469##############################################################################
470
471%if %{?_with_slurm:1}%{!?_with_slurm:0}
472%files mod-slurm
473%defattr(-,root,root)
474%{_libdir}/pdsh/slurm.*
475%endif
476##############################################################################
477
478%if %{?_with_torque:1}%{!?_with_torque:0}
479%files mod-torque
480%defattr(-,root,root)
481%{_libdir}/pdsh/torque.*
482%endif
483##############################################################################
484
485%if %{?_with_qshell:1}%{!?_with_qshell:0}
486%files qshd
487%defattr(-,root,root)
488%{_sbindir}/in.qshd
489%{_sysconfdir}/xinetd.d/qshell
490
491%post qshd
492if ! grep "^qshell" /etc/services >/dev/null; then
493  echo "qshell            523/tcp                  # pdsh/qshell/Quadrics QsNet" >>/etc/services
494fi
495%{_initrddir}/xinetd reload
496
497%endif
498##############################################################################
499
500%if %{?_with_mqshell:1}%{!?_with_mqshell:0}
501%files mqshd
502%defattr(-,root,root)
503%{_sbindir}/in.mqshd
504%{_sysconfdir}/xinetd.d/mqshell
505
506%post mqshd
507if ! grep "^mqshell" /etc/services >/dev/null; then
508  echo "mqshell         21234/tcp                  # pdsh/mqshell/Quadrics QsNet" >>/etc/services
509fi
510%{_initrddir}/xinetd reload
511
512%endif
513##############################################################################
514
515%changelog
516* Fri Jun 22 2007 Mark Grondona <mgrondona@llnl.gov>
517- reworked specfile conditionals to allow easy change of defaults
518
519* Mon Jun  4 2007 Mark Grondona <mgrondona@llnl.gov>
520- added rcmd-exec subpackage.
521
522* Thu Feb 22 2007 Daniel J Blueman <daniel@quadrics.com>
523- added 'rpmbuild ... --without pam' option passthrough
524- generalised 'elan3' to 'Quadrics QsNet'
525
526* Thu Dec  7 2006 Mark Grondona <mgrondona@llnl.gov>
527- Package new rpdcp command.
528
529* Fri Feb 23 2006 Ben Woodard <woodard@redhat.com> 
530- changed source location to point to main site not mirror.
531
532* Thu Feb 22 2006 Ben Woodard <woodard@redhat.com>
533- removed change of attributes of pdsh and pcp in files section
534- removed .a files from packages.
535
536* Wed Feb 22 2006 Ben Woodard <woodard@redhat.com> 
537- add parameters to make
538- replace etc with _sysconfdir in most places
539- remove post section with unexplained removing of cached man pages.
540- removed dots at end of all summaries.
541
542* Wed Feb 16 2006 Ben Woodard <woodard@redhat.com
543- removed dot at end of summary
544- removed unused/broken smp build
545- changed to using initrddir macro
546- changed depricated Prereq to Requires
547
548* Thu Feb 9 2006 Ben Woodard <woodard@redhat.com> 
549- add in rpmlint fixes
550- change buildroot
551
552* Wed Feb 1 2006 Ben Woodard <woodard@redhat.com> 
553- Modified spec file to fix some problems uncovered by rpmlint