|
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-2016 Cisco Systems, Inc. All rights reserved. |
| 12 | +# Copyright (c) 2006-2019 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
|
|
51 | 51 | #############################################################################
|
52 | 52 |
|
53 | 53 | # Define this if you want to make this SRPM build in
|
54 |
| -# /opt/NAME/VERSION-RELEASE instead of the default /usr/. |
| 54 | +# /opt/NAME/VERSION-RELEASE instead of the default /usr/. Note that |
| 55 | +# Open MPI will be *entirely* installed in /opt. One possible |
| 56 | +# exception is the modulefile -- see the description of |
| 57 | +# modulefile_path, below. |
55 | 58 | # type: bool (0/1)
|
56 | 59 | %{!?install_in_opt: %define install_in_opt 0}
|
57 | 60 |
|
|
67 | 70 | # Define this to 1 if you want this RPM to install a modulefile.
|
68 | 71 | # type: bool (0/1)
|
69 | 72 | %{!?install_modulefile: %define install_modulefile 0}
|
70 |
| -# type: string (root path to install modulefiles) |
71 |
| -%{!?modulefile_path: %define modulefile_path /usr/share/Modules/modulefiles} |
| 73 | + |
| 74 | +# Root path to install modulefiles. If the value modulefile_path is |
| 75 | +# set, that directory is the root path for where the modulefile will |
| 76 | +# be installed there (assuming install_modulefile==1), even if |
| 77 | +# install_in_opt==1. type: string (root path to install modulefile) |
| 78 | +# |
| 79 | +# NOTE: modulefile_path is not actually defined here, because we have |
| 80 | +# to check/process install_in_opt first. |
| 81 | + |
72 | 82 | # type: string (subdir to install modulefile)
|
73 | 83 | %{!?modulefile_subdir: %define modulefile_subdir %{name}}
|
74 | 84 | # type: string (name of modulefile)
|
|
152 | 162 | %define _libdir /opt/%{name}/%{version}/lib
|
153 | 163 | %define _includedir /opt/%{name}/%{version}/include
|
154 | 164 | %define _mandir /opt/%{name}/%{version}/man
|
| 165 | + |
155 | 166 | # Note that the name "openmpi" is hard-coded in
|
156 | 167 | # opal/mca/installdirs/config for pkgdatadir; there is currently no
|
157 | 168 | # easy way to have OMPI change this directory name internally. So we
|
158 | 169 | # just hard-code that name here as well (regardless of the value of
|
159 | 170 | # %{name} or %{_name}).
|
160 | 171 | %define _pkgdatadir /opt/%{name}/%{version}/share/openmpi
|
| 172 | + |
161 | 173 | # Per advice from Doug Ledford at Red Hat, docdir is supposed to be in
|
162 | 174 | # a fixed location. But if you're installing a package in /opt, all
|
163 | 175 | # bets are off. So feel free to install it anywhere in your tree. He
|
164 | 176 | # suggests $prefix/doc.
|
165 | 177 | %define _defaultdocdir /opt/%{name}/%{version}/doc
|
166 |
| -# Also put the modulefile in /opt. |
167 |
| -%define modulefile_path /opt/%{name}/%{version}/share/openmpi/modulefiles |
| 178 | + |
| 179 | +# Also put the modulefile in /opt (unless the user already specified |
| 180 | +# where they want it to go -- the modulefile is a bit different in |
| 181 | +# that the user may want it outside of /opt). |
| 182 | +%{!?modulefile_path: %define modulefile_path /opt/%{name}/%{version}/share/openmpi/modulefiles} |
168 | 183 | %endif
|
169 | 184 |
|
| 185 | +# Now that we have processed install_in_opt, we can see if |
| 186 | +# modulefile_path was not set. If it was not, then set it to a |
| 187 | +# default value. |
| 188 | +%{!?modulefile_path: %define modulefile_path /usr/share/Modules/modulefiles} |
| 189 | + |
170 | 190 | %if !%{build_debuginfo_rpm}
|
171 | 191 | %define debug_package %{nil}
|
172 | 192 | %endif
|
|
0 commit comments