Accepting request 555052 from systemsmanagement

OBS-URL: https://build.opensuse.org/request/show/555052
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ipmiutil?expand=0&rev=16
This commit is contained in:
Dominique Leuenberger 2017-12-08 12:01:24 +00:00 committed by Git OBS Bridge
commit 4e26bdfde5
6 changed files with 208 additions and 81 deletions

View File

@ -1,13 +0,0 @@
Index: ipmiutil-2.9.6/configure.ac
===================================================================
--- ipmiutil-2.9.6.orig/configure.ac
+++ ipmiutil-2.9.6/configure.ac
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to p
AC_INIT(ipmiutil,2.9.6)
AC_CONFIG_SRCDIR(util/ipmiutil.c)
echo "ipmiutil version ${PACKAGE_VERSION}"
-AM_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADERS(config.h)
AC_PREFIX_DEFAULT(/usr)
AM_INIT_AUTOMAKE()

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:884c1f3d8bfb0b33c303973d286c3166f5a537976451a0312e3524af54771519
size 1672039

3
ipmiutil-3.0.7.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:defc2fad88c184d953b5e37c42a95b0b14ed9772c097b00471e157be3e23542f
size 1694854

View File

@ -1,3 +1,25 @@
-------------------------------------------------------------------
Wed Dec 6 22:46:22 UTC 2017 - arcress@users.sourceforge.net
- Fix devel Requires
-------------------------------------------------------------------
Tue Dec 5 20:47:59 UTC 2017 - arcress@users.sourceforge.net
- Added fix for openssl version detection
-------------------------------------------------------------------
Tue Dec 5 19:28:37 UTC 2017 - arcress@users.sourceforge.net
- Add warnings.patch for no-strict-aliasing and fix openssl version detection
-------------------------------------------------------------------
Tue Dec 5 17:43:40 UTC 2017 - arcress@users.sourceforge.net
- Update to 3.0.7
* for detailed changes see http://ipmiutil.sourceforge.net/docs/ChangeLog
- Drop automake-1_13.patch as it was included in upstream
-------------------------------------------------------------------
Fri Jun 5 17:00:29 UTC 2015 - mpluskal@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package ipmiutil
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2012 Andy Cress
#
# All modifications and additions to the file contributed by third parties
@ -18,28 +18,35 @@
Name: ipmiutil
Version: 2.9.6
Version: 3.0.7
Release: 1%{?dist}
Summary: Easy-to-use IPMI server management utilities
License: BSD-3-Clause
Group: System/Management
Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Patch0: automake-1_13.patch
Url: http://ipmiutil.sourceforge.net
Patch0: warnings.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?sles_version} > 10
%define bldreq0 libopenssl-devel
%else
%define bldreq0 openssl-devel
%endif
%if 0%{?suse_version} >= 1210
%define req_systemd 1
%endif
%{!?_unitdir: %define _unitdir /usr/lib/systemd/system}
%define unit_dir %{_unitdir}
%if 0%{?req_systemd}
BuildRequires: systemd
%define systemd_fls %{_unitdir}
%else
%define systemd_fls %{_datadir}/%{name}
%endif
BuildRequires: autoconf automake %{bldreq0}
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: openssl-devel
BuildRequires: perl(Exporter)
%define init_dir %{_initrddir}
@ -57,14 +64,23 @@ 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.
%package devel
Summary: The includes headers and static libraries from the ipmiutil package
Summary: Includes libraries and headers for the ipmiutil package
Group: Development/Libraries/C and C++
Requires: ipmiutil
Requires: ipmiutil >= %{version}
%description devel
The ipmiutil-devel package contains headers and libraries which are
useful for building custom IPMI applications.
%package static
Summary: Includes static libraries for the ipmiutil package
Group: Development/Libraries/C and C++
Requires: ipmiutil >= %{version}
%description static
The ipmiutil-static package contains static libraries which are
useful for building custom IPMI applications.
%prep
%setup -q
%patch0 -p1
@ -79,10 +95,11 @@ autoreconf -fiv
make
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
rm -rf %{buildroot}%{_datadir}/%{name}/ievents.[ch]
rm -rf %{buildroot}%{_datadir}/%{name}/ipmi_sample_evt.[ch]
rm -rf %{buildroot}%{_datadir}/%{name}/isensor.[ch]
%clean
rm -rf %{buildroot}
%files
%defattr(-, root, root, -)
@ -91,6 +108,7 @@ rm -rf %{buildroot}%{_datadir}/%{name}/isensor.[ch]
%{_bindir}/ipmiutil
%{_bindir}/idiscover
%{_bindir}/ievents
%{_sbindir}/iseltime
%{_sbindir}/ipmi_port
%{_sbindir}/ialarms
%{_sbindir}/iconfig
@ -109,7 +127,7 @@ rm -rf %{buildroot}%{_datadir}/%{name}/isensor.[ch]
%{_sbindir}/ifirewall
%{_sbindir}/ifwum
%{_sbindir}/ihpm
%{_sbindir}/iseltime
%{_sbindir}/iuser
%{_datadir}/%{name}/ipmiutil_evt
%{_datadir}/%{name}/ipmiutil_asy
%{_datadir}/%{name}/ipmiutil_wdt
@ -125,8 +143,8 @@ rm -rf %{buildroot}%{_datadir}/%{name}/isensor.[ch]
%{_datadir}/%{name}/ipmiutil.setup
%{_datadir}/%{name}/ipmi_if.sh
%{_datadir}/%{name}/evt.sh
%{_datadir}/%{name}/bmclanpet.mib
%{_datadir}/%{name}/ipmi.init.basic
%{_datadir}/%{name}/bmclanpet.mib
%{_mandir}/man8/isel.8*
%{_mandir}/man8/isensor.8*
%{_mandir}/man8/ireset.8*
@ -150,25 +168,38 @@ rm -rf %{buildroot}%{_datadir}/%{name}/isensor.[ch]
%{_mandir}/man8/ihpm.8*
%{_mandir}/man8/isunoem.8*
%{_mandir}/man8/idelloem.8*
%{_mandir}/man8/ismcoem.8*
%{_mandir}/man8/iekanalyzer.8*
%{_mandir}/man8/itsol.8*
%{_mandir}/man8/idcmi.8*
%{_mandir}/man8/ismcoem.8*
%{_mandir}/man8/iuser.8*
%doc AUTHORS ChangeLog COPYING NEWS README TODO
%doc doc/UserGuide
%files devel
%defattr(-,root,root)
%{_includedir}/ipmicmd.h
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/ipmi_sample.c
%{_datadir}/%{name}/ipmi_sample_evt.c
%{_datadir}/%{name}/isensor.c
%{_datadir}/%{name}/ievents.c
%{_datadir}/%{name}/isensor.h
%{_datadir}/%{name}/ievents.h
%{_datadir}/%{name}/Makefile
%{_libdir}/libipmiutil.a
%{_libdir}/libipmiutil.so.1
%{_libdir}/libipmiutil.so
%{_includedir}/ipmicmd.h
%files static
%defattr(-,root,root)
%{_libdir}/libipmiutil.a
%post devel
/sbin/ldconfig
%postun devel
/sbin/ldconfig
%pre
%if 0%{?req_systemd}
%service_add_pre ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service
@ -176,7 +207,7 @@ rm -rf %{buildroot}%{_datadir}/%{name}/isensor.[ch]
%post
# POST_INSTALL, $1 = 1 if rpm -i, $1 = 2 if rpm -U
/sbin/ldconfig
if [ "$1" = "1" ]
then
# doing rpm -i, first time
@ -186,28 +217,36 @@ then
%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 || :
if [ -x /bin/systemctl ] && [ -d %{unit_dir} ]; then
echo "IINITDIR=%{init_dir}" >>%{_datadir}/%{name}/ipmiutil.env
cp -f ${scr_dir}/ipmiutil_evt.service %{unit_dir}
cp -f ${scr_dir}/ipmiutil_asy.service %{unit_dir}
cp -f ${scr_dir}/ipmiutil_wdt.service %{unit_dir}
cp -f ${scr_dir}/ipmi_port.service %{unit_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}
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}
cp -f ${scr_dir}/ipmi_info %{init_dir}
fi
%endif
# Run some ipmiutil command to see if any IPMI interface works.
%{_bindir}/ipmiutil sel -v >/dev/null 2>&1
IPMIret=$?
# If IPMIret==0, the IPMI cmd was successful, and IPMI is enabled locally.
# Test whether an IPMI interface is known to the motherboard
IPMIret=1
which dmidecode >/dev/null 2>&1 && IPMIret=0
if [ $IPMIret -eq 0 ]; then
%{_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
if [ ! -x %{init_dir}/ipmi ]; then
cp -f %{scr_dir}/ipmi.init.basic %{init_dir}/ipmi
fi
# If IPMI is enabled, automate managing the IPMI SEL
if [ -d %{_sysconfdir}/cron.daily ]; then
cp -f %{_datadir}/%{name}/checksel %{_sysconfdir}/cron.daily
@ -218,17 +257,35 @@ then
touch ${scr_dir}/ipmi_port.service
elif [ -x /sbin/chkconfig ]; then
/sbin/chkconfig --add ipmi_port
/sbin/chkconfig --add ipmiutil_wdt
/sbin/chkconfig --add ipmiutil_asy
/sbin/chkconfig --add ipmiutil_evt
/sbin/chkconfig --add ipmi_info
# /sbin/chkconfig --add ipmiutil_wdt
# /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
%{_bindir}/ipmiutil sensor -q >$sensorout
%{_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
fi
fi
fi
else
# postinstall, doing rpm update
IPMIret=1
which dmidecode >/dev/null 2>&1 && IPMIret=0
if [ $IPMIret -eq 0 ]; then
%{_sbindir}/dmidecode |grep -q IPMI && IPMIret=0
if [ $IPMIret -eq 0 ]; then
if [ -d %{_sysconfdir}/cron.daily ]; then
cp -f %{_datadir}/%{name}/checksel %{_sysconfdir}/cron.daily
fi
fi
fi
fi
@ -239,25 +296,29 @@ then
%if 0%{?req_systemd}
%service_del_preun ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service
%else
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
if [ -x /bin/systemctl ]; then
if [ -f %{_unitdir}/ipmiutil_evt.service ]; then
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 || :
if [ -f %{unit_dir}/ipmiutil_evt.service ]; then
systemctl disable ipmi_port.service >/dev/null 2>&1 || :
systemctl disable ipmiutil_evt.service >/dev/null 2>&1 || :
systemctl disable ipmiutil_asy.service >/dev/null 2>&1 || :
systemctl disable ipmiutil_wdt.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
else
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
fi
%endif
@ -267,6 +328,8 @@ then
fi
%postun
# after uninstall, $1 = 1 if update, $1 = 0 if rpm -e
/sbin/ldconfig
%if 0%{?req_systemd}
%service_del_postun ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service
%else
@ -276,16 +339,19 @@ if [ -x /bin/systemctl ]; then
# Package upgrade, not uninstall
systemctl try-restart ipmi_port.service || :
fi
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
if [ -f %{unit_dir}/ipmiutil_evt.service ]; then
rm -f %{unit_dir}/ipmiutil_evt.service 2>/dev/null || :
rm -f %{unit_dir}/ipmiutil_asy.service 2>/dev/null || :
rm -f %{unit_dir}/ipmiutil_wdt.service 2>/dev/null || :
rm -f %{unit_dir}/ipmi_port.service 2>/dev/null || :
fi
else
if [ -f %{init_dir}/ipmiutil_evt.service ]; then
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 || :
fi
fi
%endif

52
warnings.patch Normal file
View File

@ -0,0 +1,52 @@
--- ipmiutil-3.0.7/configure.ac 2017-09-20 11:08:20.000000000 -0400
+++ ipmiutil-new/configure.ac 2017-12-05 14:10:10.773545568 -0500
@@ -342,6 +342,17 @@
echo "ok, suppress excess warnings"
fi
rm -f $tmpc $tmpo >/dev/null 2>&1
+ echo $ECHO_N "checking strict aliasing warning flags ... $ECHO_C"
+ cfalias="-fno-strict-aliasing"
+ echo "int main() { return(1); }" >$tmpc
+ $CC -o $tmpo -c $cfalias $tmpc >/dev/null 2>&1
+ if test $? -ne 0 ; then
+ cfalias=
+ echo "skip"
+ else
+ echo "ok, suppress aliasing warnings"
+ fi
+ rm -f $tmpc $tmpo >/dev/null 2>&1
echo $ECHO_N "checking compile fortify flags ... $ECHO_C"
cfhard="-fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
echo "int main() { alloca(100); return(1); }" >$tmpc
@@ -405,16 +416,19 @@
sed -i 's/# Default-Stop:/# Default-Stop: 0 1 2 6/' $init_scripts
fi
# The openssl rpm might not be installed
+ sslver=""
which rpm >/dev/null 2>&1
if test $? -eq 0 ; then
sslver=`rpm -q openssl-devel |cut -f3 -d'-' |cut -f1-2 -d'.'`
- else
- sslver=`openssl version |awk '{ print $2 }'|cut -f1-2 -d'.'`
- fi
+ fi
+ if test "$sslver" = ""; then
+ sslver=`openssl version |awk '{ print $2 }'|cut -f1-2 -d'.'`
+ fi
if test "$sslver" = "1.1"; then
echo "Detected openssl-$sslver"
MD2_CFLAGS="-DSKIP_MD2 -DSSL11"
else
+ echo "Detected openssl-$sslver"
if test -f "$LIB_DIR/libcrypto.so"; then
strings $LIB_DIR/libcrypto.so | grep EVP_md2 >/dev/null 2>&1
if test $? -ne 0; then
@@ -426,7 +440,7 @@
MD2_CFLAGS="-DSKIP_MD2"
fi
fi
- OS_CFLAGS="-DLINUX $MD2_CFLAGS -fPIC $cfwarn $cfgnu $cfhard"
+ OS_CFLAGS="-DLINUX $MD2_CFLAGS -fPIC $cfwarn $cfgnu $cfalias $cfhard"
else
macos=1 # =1 means not mac
# usually "x$sysname" = "xFreeBSD", but allow NetBSD