From d4483601df385d8b97ef253e4011ff39b8fd0026 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 28 Apr 2020 05:37:22 -0400 Subject: [PATCH] import libzfcphbaapi-2.2.0-2.el8 --- SPECS/libzfcphbaapi.spec | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/SPECS/libzfcphbaapi.spec b/SPECS/libzfcphbaapi.spec index 5f948b3..f6027f5 100644 --- a/SPECS/libzfcphbaapi.spec +++ b/SPECS/libzfcphbaapi.spec @@ -4,7 +4,7 @@ Name: libzfcphbaapi Summary: HBA API for the zFCP device driver Group: System Environment/Libraries Version: 2.2.0 -Release: 1%{?dist} +Release: 2%{?dist} License: CPL URL: http://www.ibm.com/developerworks/linux/linux390/zfcp-hbaapi.html # http://www.ibm.com/developerworks/linux/linux390/zfcp-hbaapi-%%{hbaapiver}.html @@ -20,8 +20,8 @@ BuildRequires: libsysfs-devel BuildRequires: sg3_utils-devel BuildRequires: libhbaapi-devel Requires: libhbaapi -Requires(post): grep -Requires(preun): grep sed +Requires(post): grep sed +Requires(postun): grep sed Provides: s390utils-libzfcphbaapi = 2:1.20.0-4 Obsoletes: s390utils-libzfcphbaapi <= 2:1.20.0-3 @@ -66,13 +66,23 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}.* %post +# remove old entry from hba.conf on upgrade +if [ $1 == 2 ]; then + grep -q -e "^libzfcphbaapi" /etc/hba.conf && + sed -i.orig -e "/^libzfcphbaapi/d" /etc/hba.conf +fi +# add entry to hba.conf on install and upgrade (resulting in a refresh together with ^) +# the grep ensures there won't be a duplicate entry after reinstall grep -q -e "^libzfcphbaapi" /etc/hba.conf || echo "libzfcphbaapi %{_libdir}/libzfcphbaapi-%{version}.so" >> /etc/hba.conf : -%preun -grep -q -e "^libzfcphbaapi" /etc/hba.conf && - sed -i.orig -e "/^libzfcphbaapi/d" /etc/hba.conf +%postun +# remove entry from hba.conf on uninstall +if [ $1 == 0 ]; then + grep -q -e "^libzfcphbaapi" /etc/hba.conf && + sed -i.orig -e "/^libzfcphbaapi/d" /etc/hba.conf +fi : @@ -95,6 +105,10 @@ grep -q -e "^libzfcphbaapi" /etc/hba.conf && %changelog +* Wed Nov 27 2019 Dan Horák - 2.2.0-2 +- fix scriptlets so they work correctly on upgrades +- Resolves: #1765520 + * Wed Mar 20 2019 Dan Horák - 2.2.0-1 - updated to 2.2.0 - add port speed capabilities - Resolves: #1612775