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
|
|
|
#
|
2013-02-28 14:33:38 +01:00
|
|
|
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
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.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
Name: ipmiutil
|
2013-10-04 10:08:03 +02:00
|
|
|
Version: 2.9.1
|
2012-03-29 07:42:45 +02:00
|
|
|
Release: 1%{?dist}
|
|
|
|
Summary: Easy-to-use IPMI server management utilities
|
|
|
|
License: BSD-3-Clause
|
2010-12-08 11:38:22 +01:00
|
|
|
Group: System/Management
|
|
|
|
Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
|
2013-02-28 14:35:29 +01:00
|
|
|
Patch: automake-1_13.patch
|
2010-12-08 11:38:22 +01:00
|
|
|
Url: http://ipmiutil.sourceforge.net
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2012-03-29 07:42:45 +02:00
|
|
|
%if 0%{?suse_version} >= 1210
|
|
|
|
%define req_systemd 1
|
|
|
|
%endif
|
|
|
|
%if 0%{?req_systemd}
|
2013-02-28 14:33:38 +01:00
|
|
|
BuildRequires: gcc
|
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: libtool
|
|
|
|
BuildRequires: openssl-devel
|
|
|
|
BuildRequires: systemd
|
2012-03-29 07:42:45 +02:00
|
|
|
%define systemd_fls %{_unitdir}
|
|
|
|
%else
|
2013-02-28 14:33:38 +01:00
|
|
|
BuildRequires: gcc
|
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: libtool
|
|
|
|
BuildRequires: openssl-devel
|
2012-03-29 07:42:45 +02:00
|
|
|
%define systemd_fls %{_datadir}/%{name}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%define init_dir %{_initrddir}
|
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
|
|
|
|
entries to allow SNMP alerts, Serial-Over-LAN console, event daemon, and
|
|
|
|
other IPMI tasks.
|
|
|
|
These can be invoked with the metacommand ipmiutil, or via subcommand
|
|
|
|
shortcuts as well. IPMIUTIL can also write sensor thresholds, FRU asset tags,
|
|
|
|
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
|
|
|
|
Summary: The includes headers and static libraries from the ipmiutil package
|
2013-02-28 14:33:38 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
2012-03-29 07:42:45 +02:00
|
|
|
Requires: ipmiutil
|
|
|
|
|
|
|
|
%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
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
2013-02-28 14:35:29 +01:00
|
|
|
%patch -p1
|
2010-12-08 11:38:18 +01:00
|
|
|
|
|
|
|
%build
|
2012-03-29 07:42:45 +02:00
|
|
|
autoreconf -fiv
|
|
|
|
%if 0%{?req_systemd}
|
|
|
|
%configure --enable-systemd
|
|
|
|
%else
|
2010-12-08 11:38:18 +01:00
|
|
|
%configure
|
2012-03-29 07:42:45 +02:00
|
|
|
%endif
|
2010-12-08 11:38:18 +01:00
|
|
|
make
|
|
|
|
|
|
|
|
%install
|
|
|
|
rm -rf %{buildroot}
|
|
|
|
make install DESTDIR=%{buildroot}
|
2013-02-28 14:33:38 +01:00
|
|
|
rm -rf %{buildroot}%{_datadir}/%{name}/ievents.[ch]
|
|
|
|
rm -rf %{buildroot}%{_datadir}/%{name}/ipmi_sample_evt.[ch]
|
|
|
|
rm -rf %{buildroot}%{_datadir}/%{name}/isensor.[ch]
|
2010-12-08 11:38:18 +01:00
|
|
|
|
2012-03-29 07:42:45 +02:00
|
|
|
%clean
|
|
|
|
rm -rf %{buildroot}
|
|
|
|
|
2010-12-08 11:38:18 +01:00
|
|
|
%files
|
|
|
|
%defattr(-, root, root, -)
|
|
|
|
%dir %{_datadir}/%{name}
|
|
|
|
%dir %{_var}/lib/%{name}
|
2012-03-29 07:42:45 +02:00
|
|
|
%{_bindir}/ipmiutil
|
|
|
|
%{_bindir}/idiscover
|
|
|
|
%{_bindir}/ievents
|
2010-12-08 11:38:18 +01:00
|
|
|
%{_sbindir}/ipmi_port
|
|
|
|
%{_sbindir}/ialarms
|
|
|
|
%{_sbindir}/iconfig
|
|
|
|
%{_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
|
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
|
|
|
|
%{systemd_fls}/ipmiutil_evt.service
|
|
|
|
%{systemd_fls}/ipmiutil_asy.service
|
|
|
|
%{systemd_fls}/ipmiutil_wdt.service
|
|
|
|
%{systemd_fls}/ipmi_port.service
|
|
|
|
%{_datadir}/%{name}/ipmiutil.env
|
|
|
|
%{_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
|
|
|
|
%{_datadir}/%{name}/bmclanpet.mib
|
2013-10-04 10:08:03 +02:00
|
|
|
%{_datadir}/%{name}/ipmi.init.basic
|
2010-12-08 11:38:18 +01:00
|
|
|
%{_mandir}/man8/isel.8*
|
|
|
|
%{_mandir}/man8/isensor.8*
|
|
|
|
%{_mandir}/man8/ireset.8*
|
|
|
|
%{_mandir}/man8/igetevent.8*
|
|
|
|
%{_mandir}/man8/ihealth.8*
|
|
|
|
%{_mandir}/man8/iconfig.8*
|
|
|
|
%{_mandir}/man8/ialarms.8*
|
|
|
|
%{_mandir}/man8/iwdt.8*
|
|
|
|
%{_mandir}/man8/ilan.8*
|
|
|
|
%{_mandir}/man8/iserial.8*
|
|
|
|
%{_mandir}/man8/ifru.8*
|
|
|
|
%{_mandir}/man8/icmd.8*
|
|
|
|
%{_mandir}/man8/isol.8*
|
|
|
|
%{_mandir}/man8/ipmiutil.8*
|
|
|
|
%{_mandir}/man8/idiscover.8*
|
|
|
|
%{_mandir}/man8/ievents.8*
|
|
|
|
%{_mandir}/man8/ipmi_port.8*
|
|
|
|
%{_mandir}/man8/ipicmg.8*
|
|
|
|
%{_mandir}/man8/ifirewall.8*
|
|
|
|
%{_mandir}/man8/ifwum.8*
|
|
|
|
%{_mandir}/man8/ihpm.8*
|
|
|
|
%{_mandir}/man8/isunoem.8*
|
2012-03-29 07:42:45 +02:00
|
|
|
%{_mandir}/man8/idelloem.8*
|
2010-12-08 11:38:18 +01:00
|
|
|
%{_mandir}/man8/iekanalyzer.8*
|
2012-03-29 07:42:45 +02:00
|
|
|
%{_mandir}/man8/itsol.8*
|
|
|
|
%{_mandir}/man8/idcmi.8*
|
2013-10-04 10:08:03 +02:00
|
|
|
%{_mandir}/man8/ismcoem.8*
|
|
|
|
|
2010-12-08 11:38:18 +01:00
|
|
|
%doc AUTHORS ChangeLog COPYING NEWS README TODO
|
|
|
|
%doc doc/UserGuide
|
|
|
|
|
2012-03-29 07:42:45 +02:00
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root)
|
2012-06-26 15:43:10 +02:00
|
|
|
%{_includedir}/ipmicmd.h
|
2012-03-29 07:42:45 +02:00
|
|
|
%{_datadir}/%{name}/ipmi_sample.c
|
|
|
|
%{_datadir}/%{name}/Makefile
|
|
|
|
%{_libdir}/libipmiutil.a
|
|
|
|
|
|
|
|
%post devel
|
|
|
|
/sbin/ldconfig
|
|
|
|
|
|
|
|
%pre
|
|
|
|
%if 0%{?req_systemd}
|
|
|
|
%service_add_pre ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service
|
|
|
|
%endif
|
2010-12-08 11:38:18 +01:00
|
|
|
|
|
|
|
%post
|
|
|
|
# POST_INSTALL, $1 = 1 if rpm -i, $1 = 2 if rpm -U
|
|
|
|
|
|
|
|
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}
|
|
|
|
|
|
|
|
%if 0%{?req_systemd}
|
|
|
|
%service_add_post ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service
|
|
|
|
%else
|
|
|
|
if [ -x /bin/systemctl ]; then
|
|
|
|
systemd_dir=%{_unitdir}
|
|
|
|
echo "IINITDIR=%{init_dir}" >>%{_datadir}/%{name}/ipmiutil.env
|
|
|
|
cp -f ${scr_dir}/ipmiutil_evt.service ${systemd_dir}
|
|
|
|
cp -f ${scr_dir}/ipmiutil_asy.service ${systemd_dir}
|
|
|
|
cp -f ${scr_dir}/ipmiutil_wdt.service ${systemd_dir}
|
|
|
|
cp -f ${scr_dir}/ipmi_port.service ${systemd_dir}
|
|
|
|
# systemctl enable ipmi_port.service >/dev/null 2>&1 || :
|
|
|
|
else
|
|
|
|
cp -f ${scr_dir}/ipmiutil_wdt %{init_dir}
|
|
|
|
cp -f ${scr_dir}/ipmiutil_asy %{init_dir}
|
|
|
|
cp -f ${scr_dir}/ipmiutil_evt %{init_dir}
|
|
|
|
cp -f ${scr_dir}/ipmi_port %{init_dir}
|
|
|
|
fi
|
|
|
|
%endif
|
2010-12-08 11:38:18 +01:00
|
|
|
|
|
|
|
# Run some ipmiutil command to see if any IPMI interface works.
|
2012-03-29 07:42:45 +02:00
|
|
|
%{_bindir}/ipmiutil sel -v >/dev/null 2>&1
|
2010-12-08 11:38:18 +01:00
|
|
|
IPMIret=$?
|
|
|
|
|
|
|
|
# If IPMIret==0, the IPMI cmd was successful, and IPMI is enabled locally.
|
|
|
|
if [ $IPMIret -eq 0 ]; then
|
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
|
|
|
|
if [ -f /etc/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
|
|
|
|
/sbin/chkconfig --add ipmiutil_wdt
|
|
|
|
/sbin/chkconfig --add ipmiutil_asy
|
|
|
|
/sbin/chkconfig --add ipmiutil_evt
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Capture a snapshot of IPMI sensor data once now for later reuse.
|
|
|
|
sensorout=$vardir/sensor_out.txt
|
|
|
|
if [ ! -f $sensorout ]; then
|
2012-03-29 07:42:45 +02:00
|
|
|
%{_bindir}/ipmiutil sensor -q >$sensorout
|
2010-12-08 11:38:18 +01:00
|
|
|
fi
|
|
|
|
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
|
|
|
%if 0%{?req_systemd}
|
|
|
|
%service_del_preun ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service
|
|
|
|
%else
|
2010-12-08 11:38:18 +01:00
|
|
|
if [ -x /sbin/service ]; then
|
|
|
|
/sbin/service ipmi_port stop >/dev/null 2>&1
|
|
|
|
/sbin/service ipmiutil_wdt stop >/dev/null 2>&1
|
|
|
|
/sbin/service ipmiutil_asy stop >/dev/null 2>&1
|
|
|
|
/sbin/service ipmiutil_evt stop >/dev/null 2>&1
|
|
|
|
fi
|
|
|
|
if [ -x /sbin/chkconfig ]; then
|
|
|
|
/sbin/chkconfig --del ipmi_port >/dev/null 2>&1
|
|
|
|
/sbin/chkconfig --del ipmiutil_wdt >/dev/null 2>&1
|
|
|
|
/sbin/chkconfig --del ipmiutil_asy >/dev/null 2>&1
|
|
|
|
/sbin/chkconfig --del ipmiutil_evt >/dev/null 2>&1
|
|
|
|
fi
|
2012-03-29 07:42:45 +02:00
|
|
|
if [ -x /bin/systemctl ]; then
|
2012-08-24 22:18:37 +02:00
|
|
|
if [ -f %{_unitdir}/ipmiutil_evt.service ]; then
|
2012-03-29 07:42:45 +02:00
|
|
|
systemctl disable ipmi_port.service >/dev/null 2>&1 || :
|
|
|
|
systemctl stop ipmiutil_evt.service >/dev/null 2>&1 || :
|
|
|
|
systemctl stop ipmiutil_asy.service >/dev/null 2>&1 || :
|
|
|
|
systemctl stop ipmiutil_wdt.service >/dev/null 2>&1 || :
|
|
|
|
systemctl stop ipmi_port.service >/dev/null 2>&1 || :
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
%endif
|
|
|
|
if [ -f %{_sysconfdir}/cron.daily/checksel ]; then
|
|
|
|
rm -f %{_sysconfdir}/cron.daily/checksel
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%if 0%{?req_systemd}
|
|
|
|
%service_del_postun ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service
|
|
|
|
%else
|
|
|
|
if [ -x /bin/systemctl ]; then
|
|
|
|
systemctl daemon-reload || :
|
|
|
|
if [ $1 -ge 1 ] ; then
|
2012-08-24 22:18:37 +02:00
|
|
|
# Package upgrade, not uninstall
|
|
|
|
systemctl try-restart ipmi_port.service || :
|
2012-03-29 07:42:45 +02:00
|
|
|
fi
|
2012-08-24 22:18:37 +02:00
|
|
|
systemd_dir=%{_unitdir}
|
|
|
|
rm -f ${systemd_dir}/ipmiutil_evt.service 2>/dev/null
|
|
|
|
rm -f ${systemd_dir}/ipmiutil_asy.service 2>/dev/null
|
|
|
|
rm -f ${systemd_dir}/ipmiutil_wdt.service 2>/dev/null
|
|
|
|
rm -f ${systemd_dir}/ipmi_port.service 2>/dev/null
|
|
|
|
else
|
|
|
|
rm -f %{init_dir}/ipmiutil_wdt 2>/dev/null
|
|
|
|
rm -f %{init_dir}/ipmiutil_asy 2>/dev/null
|
|
|
|
rm -f %{init_dir}/ipmiutil_evt 2>/dev/null
|
|
|
|
rm -f %{init_dir}/ipmi_port 2>/dev/null
|
2010-12-08 11:38:18 +01:00
|
|
|
fi
|
2012-03-29 07:42:45 +02:00
|
|
|
%endif
|
2010-12-08 11:38:18 +01:00
|
|
|
|
|
|
|
%changelog
|