create rtas subpackage to avoid the perl dependency

This commit is contained in:
Than Ngo 2020-03-28 13:27:57 +01:00
parent b0f4d0f940
commit 01215790c0

View File

@ -1,6 +1,6 @@
Name: ppc64-diag Name: ppc64-diag
Version: 2.7.6 Version: 2.7.6
Release: 3%{?dist} Release: 4%{?dist}
Summary: PowerLinux Platform Diagnostics Summary: PowerLinux Platform Diagnostics
URL: https://github.com/power-ras/%{name} URL: https://github.com/power-ras/%{name}
License: GPLv2 License: GPLv2
@ -18,10 +18,9 @@ BuildRequires: systemd-devel
BuildRequires: libtool BuildRequires: libtool
BuildRequires: bison BuildRequires: bison
Requires: servicelog, lsvpd Requires: ppc64-diag-rtas >= 2.7.6
# PCI hotplug support on PowerKVM guest depends on below Requires: servicelog
# powerpc-utils version. Requires: lsvpd
Requires: powerpc-utils >= 1.3.0
Source0: https://github.com/power-ras/p%{name}/archive/v%{version}/%{name}-%{version}.tar.gz Source0: https://github.com/power-ras/p%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
# fix paths and permissions # fix paths and permissions
@ -40,19 +39,22 @@ predictive failures, if appropriate modifies the FRUs fault
indicator(s) and provides event notification to system indicator(s) and provides event notification to system
administrators or connected service frameworks. administrators or connected service frameworks.
# BZ#860040: %package rtas
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}\/usr\/libexec\/ppc64-diag\/servevent_parse.pl Summary: rtas_errd daemon
# PCI hotplug support on PowerKVM guest depends on below powerpc-utils version.
Requires: powerpc-utils-core >= 1.3.0
%description rtas
This package contains only rtas_errd daemon.
%prep %prep
%autosetup -p1 %autosetup -p1
%build %build
./autogen.sh ./autogen.sh
%configure %configure
LDFLAGS="%{build_ldflags}" CFLAGS="%{build_cflags}" CXXFLAGS="%{build_cflags}" make %{?_smp_mflags} V=1 LDFLAGS="%{build_ldflags}" CFLAGS="%{build_cflags}" CXXFLAGS="%{build_cflags}" make %{?_smp_mflags} V=1
%install %install
make install DESTDIR=$RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT
chmod 644 COPYING chmod 644 COPYING
@ -74,7 +76,6 @@ ln -sfv %{_sbindir}/usysattn $RPM_BUILD_ROOT/%{_sbindir}/usysfault
%dir %{_localstatedir}/log/dump %dir %{_localstatedir}/log/dump
%dir %{_localstatedir}/log/opal-elog %dir %{_localstatedir}/log/opal-elog
%{_mandir}/man8/* %{_mandir}/man8/*
%config(noreplace) %{_sysconfdir}/%{name}/ppc64-diag.config
%{_sbindir}/* %{_sbindir}/*
%dir %{_datadir}/%{name} %dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/message_catalog/ %dir %{_datadir}/%{name}/message_catalog/
@ -86,36 +87,54 @@ ln -sfv %{_sbindir}/usysattn $RPM_BUILD_ROOT/%{_sbindir}/usysfault
%{_libexecdir}/%{name}/lp_diag_notify %{_libexecdir}/%{name}/lp_diag_notify
%{_libexecdir}/%{name}/servevent_parse.pl %{_libexecdir}/%{name}/servevent_parse.pl
%{_datadir}/%{name}/message_catalog/* %{_datadir}/%{name}/message_catalog/*
%{_sysconfdir}/rc.powerfail
%{_libexecdir}/%{name}/rtas_errd
%{_libexecdir}/%{name}/opal_errd
%{_unitdir}/rtas_errd.service
%{_unitdir}/opal_errd.service %{_unitdir}/opal_errd.service
%{_sysconfdir}/cron.daily/run_diag_encl %{_sysconfdir}/cron.daily/run_diag_encl
# get rid of obsolete initscripts for rhel >=7
%exclude %{_libexecdir}/%{name}/rtas_errd
%exclude %{_libexecdir}/%{name}/opal_errd
# exclude stuffs which are moved to rtas
%exclude %{_mandir}/man8/convert_dt_node_props*
%exclude %{_mandir}/man8/extract_platdump*
%exclude %{_mandir}/man8/rtas_errd*
%exclude %{_sbindir}/convert_dt_node_props
%exclude %{_sbindir}/extract_platdump
%exclude %{_sbindir}/rtas_errd
%files rtas
%license COPYING
%dir %{_sysconfdir}/%{name}
%{_mandir}/man8/convert_dt_node_props*
%{_mandir}/man8/extract_platdump*
%{_mandir}/man8/rtas_errd*
%config(noreplace) %{_sysconfdir}/%{name}/ppc64-diag.config
%{_sbindir}/convert_dt_node_props
%{_sbindir}/extract_platdump
%{_sbindir}/rtas_errd
%{_sysconfdir}/rc.powerfail
%{_unitdir}/rtas_errd.service
%post %post
# Post-install script -------------------------------------------------- # Post-install script --------------------------------------------------
%{_libexecdir}/%{name}/lp_diag_setup --register >/dev/null 2>&1 %{_libexecdir}/%{name}/lp_diag_setup --register >/dev/null 2>&1
%{_libexecdir}/%{name}/ppc64_diag_setup --register >/dev/null 2>&1 %{_libexecdir}/%{name}/ppc64_diag_setup --register >/dev/null 2>&1
if [ "$1" = "1" ]; then # first install if [ "$1" = "1" ]; then # first install
systemctl -q enable opal_errd.service >/dev/null systemctl -q enable opal_errd.service >/dev/null
systemctl -q enable rtas_errd.service >/dev/null
systemctl start opal_errd.service >/dev/null systemctl start opal_errd.service >/dev/null
systemctl start rtas_errd.service >/dev/null
elif [ "$1" = "2" ]; then # upgrade elif [ "$1" = "2" ]; then # upgrade
systemctl restart opal_errd.service >/dev/null systemctl restart opal_errd.service >/dev/null
systemctl restart rtas_errd.service >/dev/null systemctl daemon-reload > /dev/null 2>&1
fi fi
%preun %preun
# Pre-uninstall script ------------------------------------------------- # Pre-uninstall script -------------------------------------------------
if [ "$1" = "0" ]; then # last uninstall if [ "$1" = "0" ]; then # last uninstall
systemctl stop opal_errd.service >/dev/null systemctl stop opal_errd.service >/dev/null
systemctl stop rtas_errd.service >/dev/null
systemctl -q disable opal_errd.service systemctl -q disable opal_errd.service
systemctl -q disable rtas_errd.service
%{_libexecdir}/%{name}/ppc64_diag_setup --unregister >/dev/null %{_libexecdir}/%{name}/ppc64_diag_setup --unregister >/dev/null
%{_libexecdir}/%{name}/lp_diag_setup --unregister >/dev/null %{_libexecdir}/%{name}/lp_diag_setup --unregister >/dev/null
systemctl daemon-reload > /dev/null 2>&1
fi fi
%triggerin -- librtas %triggerin -- librtas
@ -126,7 +145,26 @@ if [ "$2" = "2" ]; then
fi fi
%post rtas
if [ "$1" = "1" ]; then # first install
systemctl -q enable rtas_errd.service >/dev/null
systemctl start rtas_errd.service >/dev/null
elif [ "$1" = "2" ]; then # upgrade
systemctl restart rtas_errd.service >/dev/null
systemctl daemon-reload > /dev/null 2>&1
fi
%preun rtas
if [ "$1" = "0" ]; then # last uninstall
systemctl stop rtas_errd.service >/dev/null
systemctl -q disable rtas_errd.service
systemctl daemon-reload > /dev/null 2>&1
fi
%changelog %changelog
* Sat Mar 28 2020 Than Ngo <than@redhat.com> - 2.7.6-4
- create rtas subpackage to avoid the perl dependency
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.6-3 * Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild