/pdsh.spec

https://code.google.com/ · Unknown · 553 lines · 469 code · 84 blank · 0 comment · 0 complexity · 6b00117019d561aeb24c4ab3f0eac1a3 MD5 · raw file

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