Skip to content

Commit 4e59d97

Browse files
authored
Merge pull request #7811 from zhngaj/remove-la
openmpi.spec: Remove libtool archive files in packaging
2 parents 3accffc + 9f385a0 commit 4e59d97

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

contrib/dist/linux/openmpi.spec

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@
150150
%global _binary_filedigest_algorithm 1
151151
%global _source_filedigest_algorithm 1
152152

153+
# Define this to 1 if you want to keep libtool achive files
154+
# Default is 0 (remove *.la files)
155+
# type: bool (0/1)
156+
%{!?install_libtool_archive: %define install_libtool_archive 0}
153157
#############################################################################
154158
#
155159
# Configuration Logic
@@ -478,6 +482,18 @@ export CFLAGS CXXFLAGS FCFLAGS
478482
# We don't need that in an RPM.
479483
find $RPM_BUILD_ROOT -name config.log -exec rm -f {} \;
480484

485+
%if !%{install_libtool_archive}
486+
# Libtool archive files (.la files) create an unnecessary dependency
487+
# between linked applications and the development versions of packages
488+
# upon which Open MPI depends. For example, when building an application
489+
# which uses Libtool, Open MPI would create a dependency not just on
490+
# the HWLOC libs package, but the HWLOC devel package
491+
# (to get the .so.1 -> .so symlink). Best practice in package builders
492+
# appears to be to skip shipping .la files because of this issue.
493+
find $RPM_BUILD_ROOT/%{_libdir} -name \*.la -exec rm -f {} \;
494+
%endif
495+
# End of libotool_archive if
496+
481497
# First, the [optional] modulefile
482498

483499
%if %{install_modulefile}

0 commit comments

Comments
 (0)