File libocrdma-rdmav2.spec of Package libocrdma-rdmav2

#
# spec file for package libocrdma (Version 1.0.1)
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           libocrdma-rdmav2
Summary:        Userspace Library for Emulex ROCEE Device
Version:        1.0.2
Release:        1
License:        GPL-2.0 or BSD-2-Clause
Group:          System/Libraries
Source0:        http://www.openfabrics.org/downloads/ocrdma/libocrdma-%{version}.tar.gz
Url:            http://www.openfabrics.org
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  libibverbs-devel
BuildRequires:  automake autoconf libtool

Supplements:    modalias()

%description
libocrdma provides a device-specific userspace driver for Emulex One Command RoCE Adapters
for use with the libibverbs library.

%prep
%setup -q -n libocrdma-%{version}

%build
%configure --disable-static --with-pic
make %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} install
rm -f %{buildroot}%{_libdir}/*.la

%post
/sbin/ldconfig
if [ -e %{_sysconfdir}/dat.conf ]; then
    sed -i -e '/ofa-v2-scm-roe-ocrdma.* u2/d' %{_sysconfdir}/dat.conf
    dapl_ver=$(rpm -q dapl|cut -c6-8)
    echo ofa-v2-scm-roe-ocrdma0-1 u${dapl_ver} nonthreadsafe default libdaploscm.so.2 dapl.${dapl_ver} '"ocrdma0 1" ""' >> %{_sysconfdir}/dat.conf
    echo ofa-v2-scm-roe-ocrdma1-1 u${dapl_ver} nonthreadsafe default libdaploscm.so.2 dapl.${dapl_ver} '"ocrdma1 1" ""' >> %{_sysconfdir}/dat.conf
    echo ofa-v2-scm-roe-ocrdma2-1 u${dapl_ver} nonthreadsafe default libdaploscm.so.2 dapl.${dapl_ver} '"ocrdma2 1" ""' >> %{_sysconfdir}/dat.conf
    echo ofa-v2-scm-roe-ocrdma3-1 u${dapl_ver} nonthreadsafe default libdaploscm.so.2 dapl.${dapl_ver} '"ocrdma3 1" ""' >> %{_sysconfdir}/dat.conf
fi

%postun
/sbin/ldconfig
if [ -e %{_sysconfdir}/dat.conf ]; then
    sed -i -e '/ofa-v2-scm-roe-ocrdma.* u2/d' %{_sysconfdir}/dat.conf
fi

%files
%defattr(-,root,root,-)
%{_libdir}/libocrdma*.so
%doc AUTHORS COPYING README
%config %{_sysconfdir}/libibverbs.d/ocrdma.driver

%changelog