9
9
# University of Stuttgart. All rights reserved.
10
10
# Copyright (c) 2004-2005 The Regents of the University of California.
11
11
# All rights reserved.
12
- # Copyright (c) 2006-2020 Cisco Systems, Inc. All rights reserved.
12
+ # Copyright (c) 2006-2022 Cisco Systems, Inc. All rights reserved.
13
13
# Copyright (c) 2013 Mellanox Technologies, Inc.
14
14
# All rights reserved.
15
15
# Copyright (c) 2015 Research Organization for Information Science
43
43
#
44
44
# shell$ rpmbuild ... --define 'install_in_opt 1' ...
45
45
#
46
- # Or (a multi-token example):
47
- #
48
- # shell$ rpmbuild ... \
49
- # --define 'configure_options CFLAGS=-g --with-openib=/usr/local/ofed' ...
50
- #
51
46
#############################################################################
52
47
53
48
# Define this if you want to make this SRPM build in
58
53
# type: bool (0/1)
59
54
%{! ?install_in_opt: %define install_in_opt 0}
60
55
56
+ # This specfile expects to find all required 3rd party packages
57
+ # (Libevent, Hwloc, PMIx, PRRTE) externally, and will not use the
58
+ # internal/embedded copies of these packages. This behavior is
59
+ # strongly recomended for packagers. However, if you want to override
60
+ # this behavior, change the definition below to 0.
61
+ #
62
+ # NOTE: This option will cause "--with-libevent=external
63
+ # --with-hwloc=external --with-pmix=external --with-prrte=external" to
64
+ # be added to the arguments to configure. If you wish to use different
65
+ # CLI options, set this value to 0 and set configure_options to the
66
+ # CLI options you want.
67
+ %{! ?all_external_3rd_party: %define all_external_3rd_party 1}
68
+
61
69
# Define this if you want this RPM to install environment setup
62
70
# shell scripts.
63
71
# type: bool (0/1)
138
146
139
147
# On some platforms, Open MPI/SHMEM just flat-out doesn't work with
140
148
# -D_FORTIFY_SOURCE (e.g., some users have reported that there are
141
- # problems on ioa64 platforms). In this case, just turn it off
149
+ # problems on ia64 platforms). In this case, just turn it off
142
150
# (meaning: this specfile will strip out that flag from the
143
151
# OS-provided compiler flags). We already strip out _FORTIFY_SOURCE
144
152
# for non-GCC compilers; setting this option to 0 will *always* strip
145
153
# it out, even if you're using GCC.
146
154
# type: bool (0/1)
147
155
%{! ?allow_fortify_source: %define allow_fortify_source 1}
148
156
149
- # Select md5 packing algorithm, that src.rpm created on one distro can be read on another.
157
+ # Select md5 packing algorithm, that src.rpm created on one distro can
158
+ # be read on another.
150
159
%global _binary_filedigest_algorithm 1
151
160
%global _source_filedigest_algorithm 1
152
161
153
162
# Define this to 1 if you want to keep libtool achive files
154
163
# Default is 0 (remove *.la files)
155
164
# type: bool (0/1)
156
165
%{! ?install_libtool_archive: %define install_libtool_archive 0}
166
+
157
167
#############################################################################
158
168
#
159
169
# Configuration Logic
177
187
# Per advice from Doug Ledford at Red Hat, docdir is supposed to be in
178
188
# a fixed location. But if you're installing a package in /opt, all
179
189
# bets are off. So feel free to install it anywhere in your tree. He
180
- # suggests $prefix/doc.
181
- %define _defaultdocdir /opt/%{name }/%{version }/doc
190
+ # suggests $prefix/doc, but the GNU Autotools these days default to
191
+ # $prefix/share/doc.
192
+ %define _defaultdocdir /opt/%{name }/%{version }/share/doc
182
193
183
194
# Also put the modulefile in /opt (unless the user already specified
184
195
# where they want it to go -- the modulefile is a bit different in
185
196
# that the user may want it outside of /opt).
186
197
%{! ?modulefile_path: %define modulefile_path /opt/%{name }/%{version }/share/openmpi/modulefiles}
187
198
%endif
188
199
200
+ %if %{all_external_3rd_party }
201
+ %define _configure_3rd_party --with-libevent= external --with-hwloc= external --with-pmix= external --with-prrte= external
202
+ %else
203
+ %define _configure_3rd_party %{nil }
204
+ %endif
205
+
189
206
# Now that we have processed install_in_opt, we can see if
190
207
# modulefile_path was not set. If it was not, then set it to a
191
208
# default value.
212
229
%define __check_files %{nil }
213
230
%endif
214
231
232
+ # Set this to any options you want to pass in to configure.
215
233
%{! ?configure_options: %define configure_options %{nil }}
216
234
217
235
%if ! %{use_default_rpm_opt_flags }
@@ -245,6 +263,12 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
245
263
%if %{disable_auto_requires }
246
264
AutoReq: no
247
265
%endif
266
+ %if %{all_external_3rd_party }
267
+ # If we require all external 3rd party packages, then assume the use
268
+ # of the OS Libevent and Hwloc packages.
269
+ BuildRequires: libevent-devel hwloc-devel
270
+ Requires: libevent hwloc
271
+ %endif
248
272
%if %{install_modulefile }
249
273
Requires: %{modules_rpm_name }
250
274
%endif
@@ -284,6 +308,12 @@ Provides: openmpi-runtime = %{version}
284
308
%if %{disable_auto_requires }
285
309
AutoReq: no
286
310
%endif
311
+ %if %{all_external_3rd_party }
312
+ # If we require all external 3rd party packages, then assume the use
313
+ # of the OS Libevent and Hwloc packages.
314
+ BuildRequires: libevent-devel hwloc-devel
315
+ Requires: libevent hwloc
316
+ %endif
287
317
%if %{install_modulefile }
288
318
Requires: %{modules_rpm_name }
289
319
%endif
@@ -465,7 +495,7 @@ CXXFLAGS="%{?cxxflags:%{cxxflags}}%{!?cxxflags:$RPM_OPT_FLAGS}"
465
495
FCFLAGS= "%{?fcflags:%{fcflags }}%{! ?fcflags:$RPM_OPT_FLAGS}"
466
496
export CFLAGS CXXFLAGS FCFLAGS
467
497
468
- %configure %{configure_options }
498
+ %configure %{configure_options } %{ _configure_3rd_party }
469
499
%{__make} %{?mflags }
470
500
471
501
@@ -595,63 +625,34 @@ EOF
595
625
# always gives a 0 exit status.
596
626
597
627
# First, find all the files
598
- rm -f all.files runtime.files remaining.files devel.files docs.files
628
+ rm -f all.files runtime.files remaining.files devel.files
599
629
find $RPM_BUILD_ROOT -type f -o -type l | \
600
630
sed -e "s@$RPM_BUILD_ROOT@@" \
601
631
> all.files | /bin/true
602
632
603
633
# Runtime files. This should generally be library files and some
604
634
# executables (no man pages, no doc files, no header files). Do *not*
605
635
# include wrapper compilers.
606
- cat all.files | egrep '/lib/|/lib64/|/lib32/|/bin/|/etc/|/help-' > tmp.files | /bin/true
636
+ cat all.files | \
637
+ egrep '/lib/|/lib64/|/lib32/|/bin/|/etc/|/help-' \
638
+ > tmp.files | /bin/true
607
639
# Snip out a bunch of executables (e.g., wrapper compilers, pkgconfig
608
- # files, .la and .a files)
609
- egrep -vi 'mpic|mpif|ortec|f77|f90|pkgconfig|\.la$|\.a$' tmp.files > runtime.files | /bin/true
640
+ # files, .la and .a files) and docs
641
+ egrep -vi 'bin/mpic|bin/mpif|bin/mpif77|bin/mpif90|pkgconfig|wrapper|\.mod$|\.la$|\.a$' tmp.files > runtime.files | /bin/true
642
+
610
643
rm -f tmp.files
611
644
612
645
# Now take the runtime files out of all.files so that we don't get
613
646
# duplicates.
614
647
grep -v -f runtime.files all.files > remaining.files
615
648
616
- # Devel files, potentially including VT files. Basically -- just
617
- # exclude the man pages and doc files.
649
+ # Devel files. Basically -- just exclude the man pages and doc files.
618
650
cat remaining.files | \
619
651
egrep -v '/man/|/doc/' \
620
652
> devel.files | /bin/true
621
653
622
- # Now take those files out of reaming.files so that we don't get
623
- # duplicates.
624
- grep -v -f devel.files remaining.files > docs.files
625
-
626
- #################################################
627
-
628
- # Now that we have a final list of files for each of the runtime,
629
- # devel, and docs RPMs, snip even a few more files out of those lists
630
- # because for directories that are wholly in only one RPM, we just
631
- # list that directory in the file lists below, and RPM will pick up
632
- # all files in that tree. We therefore don't want to list any files
633
- # in those trees in our *.files file lists. Additionally, the man
634
- # pages may get compressed by rpmbuild after this "install" step, so we
635
- # might not even have their final filenames, anyway.
636
-
637
- # runtime sub package
638
- %if ! %{sysconfdir_in_prefix }
639
- grep -v %{_sysconfdir } runtime.files > tmp.files | /bin/true
640
- mv tmp.files runtime.files
641
654
%endif
642
- grep -v %{_pkgdatadir } runtime.files > tmp.files | /bin/true
643
- mv tmp.files runtime.files
644
-
645
- # devel sub package
646
- grep -v %{_includedir } devel.files > tmp.files | /bin/true
647
- mv tmp.files devel.files
648
-
649
- # docs sub package
650
- grep -v %{_mandir } docs.files > tmp.files | /bin/true
651
- mv tmp.files docs.files
652
-
653
- %endif
654
- # End of build_all_in_one_rpm
655
+ # End of !build_all_in_one_rpm
655
656
656
657
#############################################################################
657
658
#
@@ -713,15 +714,15 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
713
714
%{_bindir }/*
714
715
%{_includedir }/*
715
716
%{_libdir }/*
716
- %{_datadir }
717
+ %{_datadir }/ *
717
718
%else
718
719
%{_prefix }
719
720
%endif
720
721
# If the sysconfdir is not under the prefix, then list it explicitly.
721
722
%if ! %{sysconfdir_in_prefix }
722
723
%{_sysconfdir }
723
724
%endif
724
- # If %{ install_in_opt} , then we're instaling OMPI to
725
+ # If install_in_opt, then we're instaling OMPI to
725
726
# /opt/openmpi/<version>. But be sure to also explicitly mention
726
727
# /opt/openmpi so that it can be removed by RPM when everything under
727
728
# there is also removed.
@@ -737,33 +738,30 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
737
738
%{shell_scripts_path }/%{shell_scripts_basename }.sh
738
739
%{shell_scripts_path }/%{shell_scripts_basename }.csh
739
740
%endif
740
- %doc README.md INSTALL LICENSE
741
+ %doc README.md LICENSE
741
742
742
743
%else
743
744
744
745
#
745
746
# Sub-package RPMs
746
747
#
747
- # Harder than all-in-one. We list the directories specifically so
748
- # that if the RPM creates directories when it is installed, we will
749
- # remove them when the RPM is uninstalled. We also have to use
750
- # specific file lists.
751
- #
748
+ # Harder than all-in-one. Explicitly list all the files we want by
749
+ # the various *.files we generated above. Only list directories if
750
+ # they are not /usr (or assumedly any other location that does not
751
+ # already exist).
752
752
753
753
%files runtime -f runtime.files
754
754
%defattr(-, root, root, -)
755
- %if %(test " %{_prefix}" = " /usr" && echo 1 || echo 0)
756
- %{_bindir }/*
757
- %{_libdir }/*
758
- %{_datadir }
759
- %else
760
- %{_prefix }
761
- %endif
755
+ %if %(test " %{_prefix}" ! = " /usr" && echo 1 || echo 0)
756
+ %dir %{_prefix }
757
+ %dir %{_pkgdatadir }
762
758
# If the sysconfdir is not under the prefix, then list it explicitly.
763
759
%if ! %{sysconfdir_in_prefix }
764
- %{_sysconfdir }
760
+ %dir %{_sysconfdir }
761
+ %endif
765
762
%endif
766
- # If %{install_in_opt}, then we're instaling OMPI to
763
+
764
+ # If install_in_opt, then we're instaling OMPI to
767
765
# /opt/openmpi/<version>. But be sure to also explicitly mention
768
766
# /opt/openmpi so that it can be removed by RPM when everything under
769
767
# there is also removed. Also list /opt/openmpi/<version>/share so
@@ -781,21 +779,23 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
781
779
%{shell_scripts_path }/%{shell_scripts_basename }.sh
782
780
%{shell_scripts_path }/%{shell_scripts_basename }.csh
783
781
%endif
784
- %doc README.md INSTALL LICENSE
785
- %{_pkgdatadir }
782
+ %doc README.md LICENSE
786
783
787
784
%files devel -f devel.files
788
785
%defattr(-, root, root, -)
789
- %{_includedir }
790
786
787
+ %files docs
788
+ %defattr(-, root, root, -)
791
789
# Note that we list the mandir specifically here, because we want all
792
790
# files found in that tree, because rpmbuild may have compressed them
793
- # (e.g., foo.1.gz or foo.1.bz2) -- and we therefore don't know the
794
- # exact filenames.
795
- %files docs -f docs.files
796
- %defattr(-, root, root, -)
791
+ # after we installed them (e.g., foo.1.gz or foo.1.bz2), and we
792
+ # therefore don't know the exact filenames.
797
793
%{_mandir }
798
794
795
+ # Explicitly list the pkgdocdir so that it will be removed when the
796
+ # RPM is removed.
797
+ %{_pkgdocdir }
798
+
799
799
%endif
800
800
801
801
@@ -805,6 +805,15 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
805
805
#
806
806
#############################################################################
807
807
%changelog
808
+ *
Mon Apr 04 2022 Jeff Squyres <[email protected] >
809
+ - Updates for v5.0.0:
810
+ - Default all 3rd-party packages to be "external".
811
+ - Remove no-longer-existing INSTALL file.
812
+ - Tighten up files listings for the individual RPMs.
813
+ - Convert -docs sub-package to exclusively use mandir and pkgdocdir
814
+ (instead of docs.files).
815
+ - Remove some stale F77 and VT references.
816
+
808
817
*
Tue Mar 28 2017 Jeff Squyres <[email protected] >
809
818
- Reverting a decision from a prior changelog entry: if
810
819
install_in_opt==1, then even put the modulefile under /opt.
@@ -959,4 +968,3 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
959
968
960
969
*
Wed Mar 23 2005 Mezzanine <[email protected] >
961
970
- Specfile auto-generated by Mezzanine
962
-
0 commit comments