Blame SPECS/libzfcphbaapi.spec

6ef316
%global srcname lib-zfcp-hbaapi
6ef316
6ef316
Name:           libzfcphbaapi
6ef316
Summary:        HBA API for the zFCP device driver
6ef316
Group:          System Environment/Libraries
6ef316
Version:        2.1
6ef316
Release:        6%{?dist}
6ef316
License:        CPL
6ef316
URL:            http://www.ibm.com/developerworks/linux/linux390/zfcp-hbaapi.html
6ef316
# http://www.ibm.com/developerworks/linux/linux390/zfcp-hbaapi-%%{hbaapiver}.html
6ef316
Source0:        http://download.boulder.ibm.com/ibmdl/pub/software/dw/linux390/ht_src/%{srcname}-%{version}.tar.gz
6ef316
ExclusiveArch:  s390 s390x
6ef316
6ef316
BuildRequires:  automake
6ef316
BuildRequires:  doxygen
6ef316
BuildRequires:  libsysfs-devel
6ef316
BuildRequires:  sg3_utils-devel
6ef316
BuildRequires:  libhbaapi-devel
6ef316
Requires:       libhbaapi
6ef316
Requires(post): grep sed
6ef316
Requires(postun): grep sed
6ef316
Provides:       s390utils-libzfcphbaapi = 2:1.20.0-4
6ef316
Obsoletes:      s390utils-libzfcphbaapi <= 2:1.20.0-3
6ef316
6ef316
# exclude plugin soname from Provides
6ef316
%global __provides_exclude ^(libzfcphbaapi-%{version}[.]so.*)$
6ef316
6ef316
# build the library as a module
6ef316
Patch1:         %{srcname}-2.1-module.patch
6ef316
# fix linking of the tools when using vendor library mode
6ef316
Patch2:         %{srcname}-2.1-vendorlib.patch
6ef316
# fix crash on HBA_FreeLibrary call (#713817)
6ef316
Patch3:         %{srcname}-2.1-HBA_FreeLibrary.patch
6ef316
# https://bugzilla.redhat.com/show_bug.cgi?id=951586
6ef316
Patch4:         %{srcname}-2.1-parse-u64-as-ull.patch
6ef316
# https://bugzilla.redhat.com/show_bug.cgi?id=949099
6ef316
Patch5:         %{srcname}-2.1-find-sg-without-sysfs-deprecated.patch
6ef316
6ef316
%description
6ef316
zFCP HBA API Library is an implementation of FC-HBA (see www.t11.org) for
6ef316
the zFCP device driver.
6ef316
6ef316
6ef316
%package docs
6ef316
License:  CPL
6ef316
Summary:  zFCP HBA API Library -- Documentation
6ef316
Group:    Development/Libraries
6ef316
URL:      http://www.ibm.com/developerworks/linux/linux390/zfcp-hbaapi.html
6ef316
Requires: %{name} = %{version}-%{release}
6ef316
Provides:       s390utils-libzfcphbaapi-docs = 2:1.20.0-4
6ef316
Obsoletes:      s390utils-libzfcphbaapi-docs <= 2:1.20.0-3
6ef316
6ef316
%description docs
6ef316
Documentation for the zFCP HBA API Library.
6ef316
6ef316
6ef316
%prep
6ef316
%setup -q -n %{srcname}-%{version}
6ef316
6ef316
%patch1 -p1 -b .module
6ef316
%patch2 -p1 -b .vendorlib
6ef316
%patch3 -p2 -b .HBA_FreeLibrary
6ef316
%patch4 -p2 -b .parse-as-ull
6ef316
%patch5 -p2 -b .find-sg
6ef316
6ef316
# lib-zfcp-hbaapi: fix perms
6ef316
chmod a-x *.h AUTHORS README ChangeLog LICENSE
6ef316
6ef316
6ef316
%build
6ef316
%configure --disable-static --enable-vendor-lib
6ef316
make EXTRA_CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
6ef316
6ef316
6ef316
%install
6ef316
%makeinstall docdir=$RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
6ef316
# keep only html docs
6ef316
rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/latex
6ef316
# remove unwanted files
6ef316
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}.*
6ef316
6ef316
6ef316
%post
6ef316
# remove old entry from hba.conf on upgrade
6ef316
if [ $1 == 2 ]; then
6ef316
    grep -q -e "^libzfcphbaapi" /etc/hba.conf &&
6ef316
        sed -i.orig -e "/^libzfcphbaapi/d" /etc/hba.conf
6ef316
fi
6ef316
# add entry to hba.conf on install and upgrade (resulting in a refresh together with ^)
6ef316
# the grep ensures there won't be a duplicate entry after reinstall
6ef316
grep -q -e "^libzfcphbaapi" /etc/hba.conf ||
6ef316
    echo "libzfcphbaapi %{_libdir}/libzfcphbaapi-%{version}.so" >> /etc/hba.conf
6ef316
:
6ef316
6ef316
%postun
6ef316
# remove entry from hba.conf on uninstall
6ef316
if [ $1 == 0 ]; then
6ef316
    grep -q -e "^libzfcphbaapi" /etc/hba.conf &&
6ef316
        sed -i.orig -e "/^libzfcphbaapi/d" /etc/hba.conf
6ef316
fi
6ef316
:
6ef316
6ef316
6ef316
%files
6ef316
%doc README COPYING ChangeLog AUTHORS LICENSE
6ef316
%{_bindir}/zfcp_ping
6ef316
%{_bindir}/zfcp_show
6ef316
%{_libdir}/%{name}-%{version}.so
6ef316
%{_mandir}/man3/libzfcphbaapi.3*
6ef316
%{_mandir}/man3/SupportedHBAAPIs.3*
6ef316
%{_mandir}/man3/UnSupportedHBAAPIs.3*
6ef316
%{_mandir}/man8/zfcp_ping.8*
6ef316
%{_mandir}/man8/zfcp_show.8*
6ef316
%exclude %{_mandir}/man3/hbaapi.h.3*
6ef316
%exclude %{_docdir}/%{name}-%{version}/html
6ef316
6ef316
%files docs
6ef316
%docdir %{_docdir}/%{name}-%{version}
6ef316
%{_docdir}/%{name}-%{version}/
6ef316
6ef316
6ef316
%changelog
6ef316
* Thu Dec 01 2016 Dan Horák <dhorak@redhat.com> - 2.1-6
6ef316
- fix scriptlets (#1395330)
6ef316
- Resolves: #1395330
6ef316
6ef316
* Fri Mar 18 2016 Dan Horák <dhorak@redhat.com> - 2.1-5
6ef316
- do not include full docs in main package (#1076199)
6ef316
- Resolves: #1076199
6ef316
6ef316
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 2.1-4
6ef316
- Mass rebuild 2014-01-24
6ef316
6ef316
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 2.1-3
6ef316
- Mass rebuild 2013-12-27
6ef316
6ef316
* Wed May 29 2013 Dan Horák <dan[at]danny.cz> - 2.1-2
6ef316
- add missing compatibility Provides
6ef316
- exclude plugin soname from Provides
6ef316
6ef316
* Thu May 16 2013 Dan Horák <dan[at]danny.cz> - 2.1-1
6ef316
- move libzfcphbaapi to own package from s390utils