File libhbalinux2.spec of Package libhbalinux2

#
# spec file for package libhbalinux2
#
# Copyright (c) 2012 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/
#


Name:           libhbalinux2
Version:        1.0.8
Release:        0
Summary:        FC-HBAAPI implementation using scsi_transport_fc interfaces
License:        LGPL-2.0+
Group:          System/Libraries
Url:            http://www.open-fcoe.org
Source0:        http://www.open-fcoe.org/openfc/libhbalinux-v%{version}.tar.bz2
Patch0:         libhbalinux-remove-install-data-hook
Patch1:         libhbalinux-fix-issue-preventi
Patch2:         hbalinux-automake.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  autoconf
BuildRequires:  libHBAAPI2-devel
BuildRequires:  libpciaccess0-devel
BuildRequires:  libtool
#Requires:       libHBAAPI2

%description
SNIA HBAAPI vendor library built on top of the scsi_transport_fc
interfaces



Authors:
--------
    Christoper Leech <christopher.leech@intel.com>

%prep
%setup -q -n libhbalinux-v%{version}
%patch -P 0 -P 1 -P 2 -p1

%build
autoreconf --install
%configure --disable-static
make %{?_smp_mflags}

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

%post
/sbin/ldconfig
ORG=org.open-fcoe.libhbalinux
LIB=%{_libdir}/libhbalinux.so.2
STR="$ORG       $LIB"
CONF=/etc/hba.conf
if test -f $CONF; then
    ORIG=$(sed -n "s/^[[:space:]]*$ORG[[:space:]]*\(.*\)/\1/p" $CONF)
    if [ "$ORIG" != "$LIB" ] ; then
        echo $STR >> $CONF
    else
        echo "** $CONF already configured"
        echo "** system configuration not updated"
    fi;
else
    echo "** WARNING: $CONF does not exist"
    echo "** system configuration not updated"
fi

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc README
%doc COPYING
%{_libdir}/*.so.*

%changelog