Accepting request 554643 from home:arcress:branches:systemsmanagement

Added fix for openssl detection

OBS-URL: https://build.opensuse.org/request/show/554643
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/ipmiutil?expand=0&rev=34
This commit is contained in:
Klaus Kämpf 2017-12-06 07:17:46 +00:00 committed by Git OBS Bridge
parent 2ac0f37c79
commit 2a4382f5d4
3 changed files with 83 additions and 11 deletions

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
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

View File

@ -25,8 +25,9 @@ License: BSD-3-Clause
Group: System/Management
Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Url: http://ipmiutil.sourceforge.net
Patch0: warnings.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?sles_version} >= 10
%if 0%{?sles_version} > 10
%define bldreq0 libopenssl-devel
%else
%define bldreq0 openssl-devel
@ -65,7 +66,7 @@ detected, ipmiutil will use user-space direct I/Os instead.
%package devel
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
@ -74,7 +75,7 @@ useful for building custom IPMI applications.
%package static
Summary: Includes static libraries for the ipmiutil package
Group: Development/Libraries/C and C++
Requires: ipmiutil
Requires: ipmiutil-%{version}
%description static
The ipmiutil-static package contains static libraries which are
@ -82,6 +83,7 @@ useful for building custom IPMI applications.
%prep
%setup -q
%patch0 -p1
%build
autoreconf -fiv
@ -126,7 +128,6 @@ rm -rf %{buildroot}
%{_sbindir}/ifwum
%{_sbindir}/ihpm
%{_sbindir}/iuser
%{_libdir}/libipmiutil.so.1
%{_datadir}/%{name}/ipmiutil_evt
%{_datadir}/%{name}/ipmiutil_asy
%{_datadir}/%{name}/ipmiutil_wdt
@ -185,6 +186,7 @@ rm -rf %{buildroot}
%{_datadir}/%{name}/isensor.h
%{_datadir}/%{name}/ievents.h
%{_datadir}/%{name}/Makefile
%{_libdir}/libipmiutil.so.1
%{_libdir}/libipmiutil.so
%{_includedir}/ipmicmd.h
@ -230,7 +232,10 @@ then
# 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
@ -265,16 +270,21 @@ then
fi
fi
fi
fi
fi
else
# postinstall, doing rpm update
IPMIret=0
%{_bindir}/ipmiutil sel -v >/dev/null 2>&1 || IPMIret=1
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
%preun
# before uninstall, $1 = 1 if rpm -U, $1 = 0 if rpm -e

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