%global tar_name hfi1-psm-0.7-1
Summary: Intel PSM Libraries
Name: libpsm2
Version: 0.7
Release: 4%{?dist}
License: GPLv2 or BSD
Group: System Environment/Libraries
URL: http://www.intel.com/
# Source tarball obtained by:
# git clone https://github.com/01org/opa-psm2
# cd opa-psm2
# git checkout 25bbc387f4b5054a479ddb2670fa02e2e8a7421f
# make dist
Source0: %{tar_name}.tar.gz
# Once we have hfi1 in our kernels, we'll build against kernel-headers
# instead of using this internal copy of hfi1_user.h.
Source1: hfi1_user.h
# https://github.com/01org/opa-psm2/pull/1
Patch0001: 0001-avoid-executable-flag-on-installed-header-files.patch
Patch0002: 0002-avoid-calling-memset-with-zero-length.patch
Patch0003: 0003-use-pkg-config-to-find-udev-rules-dir.patch
# https://github.com/01org/opa-psm2/pull/2
Patch0004: 0004-prevent-having-executable-stack.patch
BuildRequires: libuuid-devel
BuildRequires: pkgconfig(udev)
# OPA HFI is Intel's thing
ExclusiveArch: x86_64
%description
The PSM Messaging API, or PSM API, is Intel's low-level
user-level communications interface for the Truescale
family of products. PSM users are enabled with mechanisms
necessary to implement higher level communications
interfaces in parallel environments.
%package devel
Summary: Development files for Intel PSM
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: libuuid-devel
%description devel
Development files for the libpsm2 library
%package compat
Summary: Support for MPIs linked with PSM1
Group: System Environment/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
%description compat
Support for MPIs linked with PSM1.
The compat library is installed in a non-standard directory to avoid
conflicting with infinipath-psm. To use it, set:
LD_LIBRARY_PATH=%{_libdir}/psm2
%package compat-devel
Summary: Development files for unmodified PSM1 MPIs
Group: Development/Libraries
Requires: %{name}-compat%{?_isa} = %{version}-%{release}
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Conflicts: infinipath-psm-devel
%description compat-devel
Support for compiling unmodified PSM1 MPIs.
%prep
%setup -q -n %{tar_name}
%patch0001 -p1
%patch0002 -p1
%patch0003 -p1
%patch0004 -p1
mkdir -p include/rdma/hfi
cp %{SOURCE1} include/rdma/hfi/
%build
CFLAGS="%{optflags}" make %{?_smp_mflags}
%install
%make_install
# Avoid conflict with infinipath-psm.
# Move the compat symlink to a non-default directory, so that explicit
# LD_LIBRARY_PATH setting is required to use it.
test -L %{buildroot}/%{_libdir}/libpsm_infinipath.so.1 || exit 1
mkdir %{buildroot}/%{_libdir}/psm2
rm %{buildroot}/%{_libdir}/libpsm_infinipath.so.1
ln -s ../libpsm2.so.2.0 %{buildroot}/%{_libdir}/psm2/libpsm_infinipath.so.1
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%doc COPYING README
%{_libdir}/libpsm2.so.2.0
%{_libdir}/libpsm2.so.2
%files devel
%{_libdir}/libpsm2.so
%{_includedir}/psm2.h
%{_includedir}/psm2_mq.h
%{_includedir}/psm2_am.h
%files compat
%{_udevrulesdir}/40-psm-compat.rules
%{_libdir}/psm2
%{_libdir}/psm2/libpsm_infinipath.so.1
%files compat-devel
%{_includedir}/psm.h
%{_includedir}/psm_am.h
%{_includedir}/psm_mq.h
%{_libdir}/libpsm_infinipath.so
%changelog
* Tue Sep 01 2015 Michal Schmidt <mschmidt@redhat.com> - 0.7-4
- Prevent executable stack.
- Related: bz1173296
* Wed Aug 19 2015 Michal Schmidt <mschmidt@redhat.com> - 0.7-3
- Move the compat lib to /usr/lib64/psm2, drop Conflict with infinipath-psm.
* Tue Aug 18 2015 Michal Schmidt <mschmidt@redhat.com> - 0.7-2
- Conflict with rather than Obsolete infinipath-psm.
* Wed Aug 12 2015 Michal Schmidt <mschmidt@redhat.com> - 0.7-1
- Initial packaging for RHEL, based on upstream spec.