2010-12-08 11:38:22 +01:00
|
|
|
#
|
2012-03-29 07:42:45 +02:00
|
|
|
# spec file for package ipmiutil
|
2010-12-08 11:38:22 +01:00
|
|
|
#
|
2021-05-12 20:08:35 +02:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2012-03-29 07:42:45 +02:00
|
|
|
# Copyright (c) 2012 Andy Cress
|
2010-12-08 11:38:22 +01:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2020-02-03 20:40:23 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2010-12-08 11:38:22 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2020-09-08 18:03:26 +02:00
|
|
|
%{!?_unitdir: %define _unitdir %{_prefix}/lib/systemd/system}
|
2010-12-08 11:38:22 +01:00
|
|
|
Name: ipmiutil
|
2021-05-12 20:08:35 +02:00
|
|
|
Version: 3.1.7
|
2020-09-08 18:03:26 +02:00
|
|
|
Release: 0
|
2012-03-29 07:42:45 +02:00
|
|
|
Summary: Easy-to-use IPMI server management utilities
|
|
|
|
License: BSD-3-Clause
|
2010-12-08 11:38:22 +01:00
|
|
|
Group: System/Management
|
2020-02-03 20:40:23 +01:00
|
|
|
URL: http://ipmiutil.sourceforge.net
|
2021-05-12 20:08:35 +02:00
|
|
|
Source: https://sourceforge.net/projects/ipmiutil/files/%{name}-%{version}.tar.gz
|
2021-09-24 21:00:55 +02:00
|
|
|
Patch0: harden_ipmi_port.service.patch
|
|
|
|
Patch1: harden_ipmiutil_asy.service.patch
|
|
|
|
Patch2: harden_ipmiutil_evt.service.patch
|
|
|
|
Patch3: harden_ipmiutil_wdt.service.patch
|
2020-09-08 18:03:26 +02:00
|
|
|
BuildRequires: autoconf
|
|
|
|
BuildRequires: automake
|
2013-02-28 14:33:38 +01:00
|
|
|
BuildRequires: gcc
|
|
|
|
BuildRequires: gcc-c++
|
2020-09-08 18:03:26 +02:00
|
|
|
BuildRequires: libopenssl-devel
|
2013-02-28 14:33:38 +01:00
|
|
|
BuildRequires: libtool
|
2015-01-22 14:31:56 +01:00
|
|
|
BuildRequires: perl(Exporter)
|
2020-09-08 18:03:26 +02:00
|
|
|
BuildRequires: pkgconfig(systemd)
|
2010-12-08 11:38:18 +01:00
|
|
|
|
|
|
|
%description
|
2012-03-29 07:42:45 +02:00
|
|
|
The ipmiutil package provides easy-to-use utilities to view the SEL,
|
|
|
|
perform an IPMI chassis reset, set up the IPMI LAN and Platform Event Filter
|
2020-09-08 18:03:26 +02:00
|
|
|
entries to allow SNMP alerts, Serial-Over-LAN console, event daemon, and
|
2012-03-29 07:42:45 +02:00
|
|
|
other IPMI tasks.
|
|
|
|
These can be invoked with the metacommand ipmiutil, or via subcommand
|
2020-09-08 18:03:26 +02:00
|
|
|
shortcuts as well. IPMIUTIL can also write sensor thresholds, FRU asset tags,
|
2012-03-29 07:42:45 +02:00
|
|
|
and has a full IPMI configuration save/restore.
|
2010-12-08 11:38:18 +01:00
|
|
|
An IPMI driver can be provided by either the OpenIPMI driver (/dev/ipmi0)
|
|
|
|
or the Intel IPMI driver (/dev/imb), etc. If used locally and no driver is
|
|
|
|
detected, ipmiutil will use user-space direct I/Os instead.
|
|
|
|
|
2012-03-29 07:42:45 +02:00
|
|
|
%package devel
|
2017-12-05 19:07:12 +01:00
|
|
|
Summary: Includes libraries and headers for the ipmiutil package
|
2013-02-28 14:33:38 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
2017-12-07 15:04:26 +01:00
|
|
|
Requires: ipmiutil >= %{version}
|
2012-03-29 07:42:45 +02:00
|
|
|
|
|
|
|
%description devel
|
|
|
|
The ipmiutil-devel package contains headers and libraries which are
|
|
|
|
useful for building custom IPMI applications.
|
2010-12-08 11:38:18 +01:00
|
|
|
|
2017-12-05 19:07:12 +01:00
|
|
|
%package static
|
|
|
|
Summary: Includes static libraries for the ipmiutil package
|
|
|
|
Group: Development/Libraries/C and C++
|
2017-12-07 15:04:26 +01:00
|
|
|
Requires: ipmiutil >= %{version}
|
2017-12-05 19:07:12 +01:00
|
|
|
|
|
|
|
%description static
|
|
|
|
The ipmiutil-static package contains static libraries which are
|
|
|
|
useful for building custom IPMI applications.
|
|
|
|
|
2010-12-08 11:38:18 +01:00
|
|
|
%prep
|
|
|
|
%setup -q
|
2021-09-24 21:00:55 +02:00
|
|
|
%patch0 -p1
|
|
|
|
%patch1 -p1
|
|
|
|
%patch2 -p1
|
|
|
|
%patch3 -p1
|
2010-12-08 11:38:18 +01:00
|
|
|
|
|
|
|
%build
|
2012-03-29 07:42:45 +02:00
|
|
|
autoreconf -fiv
|
|
|
|
%configure --enable-systemd
|
2020-09-08 18:03:26 +02:00
|
|
|
%make_build
|
2010-12-08 11:38:18 +01:00
|
|
|
|
|
|
|
%install
|
2020-09-08 18:03:26 +02:00
|
|
|
%make_install
|
2010-12-08 11:38:18 +01:00
|
|
|
|
|
|
|
%files
|
|
|
|
%dir %{_datadir}/%{name}
|
|
|
|
%dir %{_var}/lib/%{name}
|
2012-03-29 07:42:45 +02:00
|
|
|
%{_bindir}/ipmiutil
|
|
|
|
%{_bindir}/idiscover
|
|
|
|
%{_bindir}/ievents
|
2017-12-05 19:07:12 +01:00
|
|
|
%{_sbindir}/iseltime
|
2010-12-08 11:38:18 +01:00
|
|
|
%{_sbindir}/ipmi_port
|
2020-09-08 18:03:26 +02:00
|
|
|
%{_sbindir}/ialarms
|
2010-12-08 11:38:18 +01:00
|
|
|
%{_sbindir}/iconfig
|
2020-09-08 18:03:26 +02:00
|
|
|
%{_sbindir}/icmd
|
|
|
|
%{_sbindir}/ifru
|
|
|
|
%{_sbindir}/igetevent
|
|
|
|
%{_sbindir}/ihealth
|
|
|
|
%{_sbindir}/ilan
|
|
|
|
%{_sbindir}/ireset
|
|
|
|
%{_sbindir}/isel
|
|
|
|
%{_sbindir}/isensor
|
|
|
|
%{_sbindir}/iserial
|
|
|
|
%{_sbindir}/isol
|
|
|
|
%{_sbindir}/iwdt
|
|
|
|
%{_sbindir}/ipicmg
|
|
|
|
%{_sbindir}/ifirewall
|
|
|
|
%{_sbindir}/ifwum
|
|
|
|
%{_sbindir}/ihpm
|
|
|
|
%{_sbindir}/iuser
|
2012-03-29 07:42:45 +02:00
|
|
|
%{_datadir}/%{name}/ipmiutil_evt
|
|
|
|
%{_datadir}/%{name}/ipmiutil_asy
|
|
|
|
%{_datadir}/%{name}/ipmiutil_wdt
|
|
|
|
%{_datadir}/%{name}/ipmi_port
|
2013-02-28 14:33:38 +01:00
|
|
|
%{_datadir}/%{name}/ipmi_info
|
2012-03-29 07:42:45 +02:00
|
|
|
%{_datadir}/%{name}/checksel
|
2020-09-08 18:03:26 +02:00
|
|
|
%{_unitdir}/ipmiutil_evt.service
|
|
|
|
%{_unitdir}/ipmiutil_asy.service
|
|
|
|
%{_unitdir}/ipmiutil_wdt.service
|
|
|
|
%{_unitdir}/ipmi_port.service
|
2012-03-29 07:42:45 +02:00
|
|
|
%{_datadir}/%{name}/ipmiutil.pre
|
|
|
|
%{_datadir}/%{name}/ipmiutil.setup
|
2010-12-08 11:38:18 +01:00
|
|
|
%{_datadir}/%{name}/ipmi_if.sh
|
|
|
|
%{_datadir}/%{name}/evt.sh
|
2013-10-04 10:08:03 +02:00
|
|
|
%{_datadir}/%{name}/ipmi.init.basic
|
2017-12-05 19:07:12 +01:00
|
|
|
%{_datadir}/%{name}/bmclanpet.mib
|
2020-09-08 18:03:26 +02:00
|
|
|
%{_datadir}/%{name}/ipmiutil.env.template
|
|
|
|
%{_mandir}/man8/isel.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/isensor.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/ireset.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/igetevent.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/ihealth.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/iconfig.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/ialarms.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/iwdt.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/ilan.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/iserial.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/ifru.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/icmd.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/isol.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/ipmiutil.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/idiscover.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/ievents.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/ipmi_port.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/ipicmg.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/ifirewall.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/ifwum.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/ihpm.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/isunoem.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/idelloem.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/ismcoem.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/iseltime.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/iekanalyzer.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/itsol.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/idcmi.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/iuser.8%{?ext_man}
|
|
|
|
%license COPYING
|
|
|
|
%doc AUTHORS ChangeLog NEWS README TODO
|
2010-12-08 11:38:18 +01:00
|
|
|
%doc doc/UserGuide
|
|
|
|
|
2012-03-29 07:42:45 +02:00
|
|
|
%files devel
|
2017-12-05 19:07:12 +01:00
|
|
|
%dir %{_datadir}/%{name}
|
2012-03-29 07:42:45 +02:00
|
|
|
%{_datadir}/%{name}/ipmi_sample.c
|
2017-12-05 19:07:12 +01:00
|
|
|
%{_datadir}/%{name}/ipmi_sample_evt.c
|
|
|
|
%{_datadir}/%{name}/isensor.c
|
|
|
|
%{_datadir}/%{name}/ievents.c
|
|
|
|
%{_datadir}/%{name}/isensor.h
|
|
|
|
%{_datadir}/%{name}/ievents.h
|
2012-03-29 07:42:45 +02:00
|
|
|
%{_datadir}/%{name}/Makefile
|
2017-12-06 08:17:46 +01:00
|
|
|
%{_libdir}/libipmiutil.so.1
|
2015-01-22 14:31:56 +01:00
|
|
|
%{_libdir}/libipmiutil.so
|
2017-12-05 19:07:12 +01:00
|
|
|
%{_includedir}/ipmicmd.h
|
|
|
|
|
|
|
|
%files static
|
|
|
|
%{_libdir}/libipmiutil.a
|
2012-03-29 07:42:45 +02:00
|
|
|
|
2020-09-08 18:03:26 +02:00
|
|
|
%post devel -p /sbin/ldconfig
|
|
|
|
%postun devel -p /sbin/ldconfig
|
2012-03-29 07:42:45 +02:00
|
|
|
%pre
|
|
|
|
%service_add_pre ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service
|
2010-12-08 11:38:18 +01:00
|
|
|
|
|
|
|
%post
|
|
|
|
# POST_INSTALL, $1 = 1 if rpm -i, $1 = 2 if rpm -U
|
2017-12-05 19:07:12 +01:00
|
|
|
/sbin/ldconfig
|
2010-12-08 11:38:18 +01:00
|
|
|
if [ "$1" = "1" ]
|
|
|
|
then
|
|
|
|
# doing rpm -i, first time
|
|
|
|
vardir=%{_var}/lib/%{name}
|
2012-03-29 07:42:45 +02:00
|
|
|
scr_dir=%{_datadir}/%{name}
|
|
|
|
|
|
|
|
%service_add_post ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service
|
2010-12-08 11:38:18 +01:00
|
|
|
|
2017-12-05 19:07:12 +01:00
|
|
|
# Test whether an IPMI interface is known to the motherboard
|
|
|
|
IPMIret=1
|
2017-12-06 08:17:46 +01:00
|
|
|
which dmidecode >/dev/null 2>&1 && IPMIret=0
|
2010-12-08 11:38:18 +01:00
|
|
|
if [ $IPMIret -eq 0 ]; then
|
2017-12-06 08:17:46 +01:00
|
|
|
%{_sbindir}/dmidecode |grep -q IPMI && IPMIret=0
|
|
|
|
if [ $IPMIret -eq 0 ]; then
|
|
|
|
# Run some ipmiutil command to see if any IPMI interface works.
|
|
|
|
# Some may not have IPMI on the motherboard, so need to check, but
|
|
|
|
# some kernels may have IPMI driver partially loaded, which breaks this
|
|
|
|
%{_bindir}/ipmiutil sel -v >/dev/null 2>&1 && IPMIret=0
|
|
|
|
if [ $IPMIret -eq 0 ]; then
|
2020-09-08 18:03:26 +02:00
|
|
|
if [ ! -x %{_initddir}/ipmi ]; then
|
|
|
|
cp -f %{scr_dir}/ipmi.init.basic %{_initddir}/ipmi
|
2017-12-05 19:07:12 +01:00
|
|
|
fi
|
2012-03-29 07:42:45 +02:00
|
|
|
# If IPMI is enabled, automate managing the IPMI SEL
|
|
|
|
if [ -d %{_sysconfdir}/cron.daily ]; then
|
|
|
|
cp -f %{_datadir}/%{name}/checksel %{_sysconfdir}/cron.daily
|
|
|
|
fi
|
2010-12-08 11:38:18 +01:00
|
|
|
# IPMI_IS_ENABLED, so enable services, but only if Red Hat
|
2020-09-08 18:03:26 +02:00
|
|
|
if [ -f %{_sysconfdir}/redhat-release ]; then
|
2012-08-24 22:18:37 +02:00
|
|
|
if [ -x /bin/systemctl ]; then
|
|
|
|
touch ${scr_dir}/ipmi_port.service
|
|
|
|
elif [ -x /sbin/chkconfig ]; then
|
2010-12-08 11:38:18 +01:00
|
|
|
/sbin/chkconfig --add ipmi_port
|
2017-12-05 19:07:12 +01:00
|
|
|
/sbin/chkconfig --add ipmi_info
|
|
|
|
# /sbin/chkconfig --add ipmiutil_wdt
|
2020-09-08 18:03:26 +02:00
|
|
|
# /sbin/chkconfig --add ipmiutil_evt
|
2010-12-08 11:38:18 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Capture a snapshot of IPMI sensor data once now for later reuse.
|
|
|
|
sensorout=$vardir/sensor_out.txt
|
|
|
|
if [ ! -f $sensorout ]; then
|
2017-12-05 19:07:12 +01:00
|
|
|
%{_bindir}/ipmiutil sensor -q >$sensorout || :
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
# remove file if error, try again in ipmi_port on reboot.
|
|
|
|
rm -f $sensorout
|
|
|
|
fi
|
|
|
|
fi
|
2017-12-06 08:17:46 +01:00
|
|
|
fi
|
|
|
|
fi
|
2017-12-05 19:07:12 +01:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
# postinstall, doing rpm update
|
2017-12-06 08:17:46 +01:00
|
|
|
IPMIret=1
|
|
|
|
which dmidecode >/dev/null 2>&1 && IPMIret=0
|
2017-12-05 19:07:12 +01:00
|
|
|
if [ $IPMIret -eq 0 ]; then
|
2017-12-06 08:17:46 +01:00
|
|
|
%{_sbindir}/dmidecode |grep -q IPMI && IPMIret=0
|
|
|
|
if [ $IPMIret -eq 0 ]; then
|
2017-12-05 19:07:12 +01:00
|
|
|
if [ -d %{_sysconfdir}/cron.daily ]; then
|
|
|
|
cp -f %{_datadir}/%{name}/checksel %{_sysconfdir}/cron.daily
|
2010-12-08 11:38:18 +01:00
|
|
|
fi
|
2017-12-06 08:17:46 +01:00
|
|
|
fi
|
2010-12-08 11:38:18 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
%preun
|
|
|
|
# before uninstall, $1 = 1 if rpm -U, $1 = 0 if rpm -e
|
|
|
|
if [ "$1" = "0" ]
|
|
|
|
then
|
2012-03-29 07:42:45 +02:00
|
|
|
%service_del_preun ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service
|
|
|
|
if [ -f %{_sysconfdir}/cron.daily/checksel ]; then
|
|
|
|
rm -f %{_sysconfdir}/cron.daily/checksel
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
%postun
|
2017-12-05 19:07:12 +01:00
|
|
|
# after uninstall, $1 = 1 if update, $1 = 0 if rpm -e
|
|
|
|
/sbin/ldconfig
|
2012-03-29 07:42:45 +02:00
|
|
|
%service_del_postun ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service
|
2010-12-08 11:38:18 +01:00
|
|
|
|
|
|
|
%changelog
|