Hi all,
We had to apply a little set of modifications to the openmpi.spec file to
help us integrate openmpi in our cluster distribution.
So here is a patch which, as the changelog suggests, does a couple of
"improvements" :
- Fix a typo in Summary
- Replace openmpi by %{name} in a couple of places
- Add an %{opt_prefix} option to be able to install in a specific path
(e.g. in /opt/<vendor>/mpi/<mpilib>-<version>/ instead of
/opt/<mpilib>-<version>)
The patch is done with "hg extract" but should apply on the SVN trunk.
Sylvain
# HG changeset patch
# User Sylvain Jeaugey <sylvain.jeau...@bull.net>
# Date 1249043994 -7200
# Node ID c0ba098845e0d93abeb0e3915cb8aa41a73525cf
# Parent d5402dd00ab21be9afedc590c9e2f2f7da5d2ba8
Fixed typo, replaced hardcoded openmpi by %{name} and added %{opt_prefix} for vendor specific install paths.
diff -r d5402dd00ab2 -r c0ba098845e0 contrib/dist/linux/openmpi.spec
--- a/contrib/dist/linux/openmpi.spec Thu Jul 30 06:40:10 2009 +0200
+++ b/contrib/dist/linux/openmpi.spec Fri Jul 31 14:39:54 2009 +0200
@@ -58,6 +58,8 @@
# instead of the default /usr/
# type: bool (0/1)
%{!?install_in_opt: %define install_in_opt 0}
+# type: string (prefix for installation)
+%{!?opt_prefix: %define opt_prefix /opt}
# Define this if you want this RPM to install environment setup
# shell scripts.
@@ -170,7 +172,6 @@
%define use_mpi_selector 1
%endif
-
#############################################################################
#
# Configuration Logic
@@ -178,22 +179,22 @@
#############################################################################
%if %{install_in_opt}
-%define _prefix /opt/%{name}/%{version}
-%define _sysconfdir /opt/%{name}/%{version}/etc
-%define _libdir /opt/%{name}/%{version}/lib
-%define _includedir /opt/%{name}/%{version}/include
-%define _mandir /opt/%{name}/%{version}/man
+%define _prefix %{opt_prefix}/%{name}/%{version}
+%define _sysconfdir %{opt_prefix}/%{name}/%{version}/etc
+%define _libdir %{opt_prefix}/%{name}/%{version}/lib
+%define _includedir %{opt_prefix}/%{name}/%{version}/include
+%define _mandir %{opt_prefix}/%{name}/%{version}/man
# Note that the name "openmpi" is hard-coded in
# opal/mca/installdirs/config for pkgdatadir; there is currently no
# easy way to have OMPI change this directory name internally. So we
# just hard-code that name here as well (regardless of the value of
# %{name} or %{_name}).
-%define _pkgdatadir /opt/%{name}/%{version}/share/openmpi
+%define _pkgdatadir %{opt_prefix}/%{name}/%{version}/share/openmpi
# Per advice from Doug Ledford at Red Hat, docdir is supposed to be in
# a fixed location. But if you're installing a package in /opt, all
# bets are off. So feel free to install it anywhere in your tree. He
# suggests $prefix/doc.
-%define _defaultdocdir /opt/%{name}/%{version}/doc
+%define _defaultdocdir %{opt_prefix}/%{name}/%{version}/doc
%endif
%if !%{build_debuginfo_rpm}
@@ -229,19 +230,19 @@
#
#############################################################################
-Summary: A powerful implementaion of MPI
+Summary: A powerful implementation of MPI
Name: %{?_name:%{_name}}%{!?_name:openmpi}
Version: $VERSION
Release: 1
License: BSD
Group: Development/Libraries
-Source: openmpi-%{version}.tar.$EXTENSION
+Source: %{name}-%{version}.tar.$EXTENSION
Packager: %{?_packager:%{_packager}}%{!?_packager:%{_vendor}}
Vendor: %{?_vendorinfo:%{_vendorinfo}}%{!?_vendorinfo:%{_vendor}}
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
Prefix: %{_prefix}
Provides: mpi
-BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%if %{disable_auto_requires}
AutoReq: no
%endif
@@ -345,7 +346,7 @@
# there that are not meant to be packaged.
rm -rf $RPM_BUILD_ROOT
-%setup -q -n openmpi-%{version}
+%setup -q -n %{name}-%{version}
#############################################################################
#
@@ -616,11 +617,11 @@
%{_sysconfdir}
%endif
# If %{instal_in_opt}, then we're instaling OMPI to
-# /opt/openmpi/<version>. But be sure to also explicitly mention
-# /opt/openmpi so that it can be removed by RPM when everything under
+# %{opt_prefix}/openmpi/<version>. But be sure to also explicitly mention
+# %{opt_prefix}/openmpi so that it can be removed by RPM when everything under
# there is also removed.
%if %{install_in_opt}
-%dir /opt/%{name}
+%dir %{opt_prefix}/%{name}
%endif
# If we're installing the modulefile, get that, too
%if %{install_modulefile}
@@ -652,13 +653,13 @@
%{_sysconfdir}
%endif
# If %{instal_in_opt}, then we're instaling OMPI to
-# /opt/openmpi/<version>. But be sure to also explicitly mention
-# /opt/openmpi so that it can be removed by RPM when everything under
-# there is also removed. Also list /opt/openmpi/<version>/share so
+# %{opt_prefix}/<version>. But be sure to also explicitly mention
+# %{opt_prefix}/openmpi so that it can be removed by RPM when everything under
+# there is also removed. Also list %{opt_prefix}/openmpi/<version>/share so
# that it can be removed as well.
%if %{install_in_opt}
-%dir /opt/%{name}
-%dir /opt/%{name}/%{version}/share
+%dir %{opt_prefix}/%{name}
+%dir %{opt_prefix}/%{name}/%{version}/share
%endif
# If we're installing the modulefile, get that, too
%if %{install_modulefile}
@@ -671,7 +672,7 @@
%endif
%dir %{_bindir}
%dir %{_libdir}
-%dir %{_libdir}/openmpi
+%dir %{_libdir}/%{name}
%doc README INSTALL LICENSE
%{_pkgdatadir}
%{_bindir}/mpirun
@@ -708,6 +709,11 @@
#
#############################################################################
%changelog
+* Fri Jul 31 2009 Sylvain Jeaugey <sylvain.jeau...@bull.net>
+- Fixed typo in Summary.
+- Replaced "openmpi" by %{name} in some places.
+- Added %{opt_prefix} to permit vendor-specific install paths.
+
* Mon Feb 4 2008 Jeff Squyres <jsquy...@cisco.com>
- OFED 1.3 has a much better installer; remove all the
leave_build_root kludge nastyness. W00t!