Accepting request 34342 from shells

Copy from shells/ksh based on submit request 34342 from user WernerFink

OBS-URL: https://build.opensuse.org/request/show/34342
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ksh?expand=0&rev=38
This commit is contained in:
OBS User autobuild 2010-03-08 17:17:45 +00:00 committed by Git OBS Bridge
commit 71a50a3d1e
2 changed files with 38 additions and 25 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Mar 8 15:10:07 CET 2010 - werner@suse.de
- Make it build for SLES10 and SLES9
- Check if the shell used for build ignores SIGPIPE
-------------------------------------------------------------------
Fri Mar 5 20:07:06 UTC 2010 - guido+opensuse.org@berhoerster.name

View File

@ -19,13 +19,12 @@
Name: ksh
BuildRequires: bind-libs bind-utils bison flex gdbm-devel glibc-devel ncurses-devel procps psmisc pwdutils zlib-devel
BuildRequires: bind-utils bison flex gdbm-devel glibc-devel ncurses-devel procps psmisc pwdutils zlib-devel
%if %suse_version > 1020
BuildRequires: libbz2-devel
BuildRequires: bind-libs libbz2-devel
%endif
%if %suse_version > 1120
BuildRequires: update-alternatives
BuildRequires: gcc43
%endif
Url: http://www.research.att.com/~gsf/download/
License: Common Public License Version 1.0 (CPL1.0)
@ -36,7 +35,7 @@ PreReq: update-alternatives
%endif
AutoReqProv: on
Version: 93t
Release: 19
Release: 20
Summary: Korn Shell
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: INIT.2010-03-01.tar.bz2
@ -136,36 +135,39 @@ find share/ -type d -a -empty | xargs -r rm -vrf
%endif
%build
typeset -i IGNORED=0x$(ps --no-headers -o ignored $$)
typeset -i SIGPIPE=0x1000
if ((IGNORED & SIGPIPE)) ; then
# Warn ans show signal state of this working shell
echo Warning: signal SIGPIPE is ignored by this shell 1>&2
ps s $$ 1>&2
fi
# This package failed when testing with -Wl,-as-needed being default.
# So we disable it here, if you want to retest, just delete this comment and the line below.
# So we disable it here, if you want to retest, just delete this
# comment and the line below.
export SUSE_ASNEEDED=0
test -n "${!LC_*}" && unset "${!LC_*}"
%if %suse_version > 1120
CC=gcc-4.3
%else
CC=gcc
%endif
cflags ()
{
local flag=$1; shift
case "${RPM_OPT_FLAGS}" in
local var=$1; shift
test -n "${flag}" -a -n "${var}" || return
case "${!var}" in
*${flag}*) return
esac
test -z "$1" && return
case "$flag" in
-Wl,*)
set -o noclobber
echo 'int main () { return 0; }' > ldtest.c
if $CC -Werror $flag -o /dev/null -xc ldtest.c > /dev/null 2>&1 ; then
local var=$1; shift
if ${CC:-gcc} -Werror $flag -o /dev/null -xc ldtest.c > /dev/null 2>&1 ; then
eval $var=\${$var:+\$$var\ }$flag
fi
set +o noclobber
rm -f ldtest.c
;;
*)
if $CC -Werror $flag -S -o /dev/null -xc /dev/null > /dev/null 2>&1 ; then
local var=$1; shift
if ${CC:-gcc} -Werror $flag -S -o /dev/null -xc /dev/null > /dev/null 2>&1 ; then
eval $var=\${$var:+\$$var\ }$flag
fi
esac
@ -177,9 +179,14 @@ find share/ -type d -a -empty | xargs -r rm -vrf
# If _you_ are knowing how to fix this in the autogenerated
# sources of ksh/ast without breaking them, then let me know.
#
IGNORE="-Wno-missing-braces -Wno-unknown-pragmas -Wno-parentheses"
IGNORE="$IGNORE -Wno-char-subscripts -Wno-uninitialized -Wno-implicit"
IGNORE="$IGNORE -Wno-unused-value -Wno-unused-variable -Wno-type-limits"
cflags -Wno-missing-braces IGNORE
cflags -Wno-unknown-pragmas IGNORE
cflags -Wno-parentheses IGNORE
cflags -Wno-char-subscripts IGNORE
cflags -Wno-uninitialized IGNORE
cflags -Wno-implicit IGNORE
cflags -Wno-unused-value IGNORE
cflags -Wno-type-limits IGNORE
#
# Do not use -DSHOPT_SPAWN=1 and/or -DSHOPT_AMP=1 this would cause
# errors due race conditions while executing the test suite.
@ -318,13 +325,13 @@ find share/ -type d -a -empty | xargs -r rm -vrf
typeset -i failed=0
ln -sf ${root}/lib ${test}/../
${root}/bin/ksh.test shtests
killall -q -s 9 ${root}/bin/ksh.test || true
${root}/bin/ksh.test %{S:10}
${root}/bin/ksh.test %{S:11}
%if %suse_version <= 1120
# This fails in current factory (aka next 11.3) it
# seems not to be the gcc as gcc-4.3 also fails
${root}/bin/ksh.test -c 'g="false"; trap "print -u2 PIPED; \$g && exit 0 ; g=true" PIPE ; while true ; do echo hello ; done' | head -n 10
%endif
if test $((IGNORED & SIGPIPE)) -eq 0 ; then
# This may fail in current factory (aka next 11.3)
${root}/bin/ksh.test -c 'g="false"; trap "print -u2 PIPED; \$g && exit 0 ; g=true" PIPE ; while true ; do echo hello ; done' | head -n 10
fi
killall -q -s 9 ${root}/bin/ksh.test || true
popd
pushd ${root}/bin
@ -445,8 +452,8 @@ fi
%if %suse_version > 1120
%preun
if [ $1 -eq 0 ]; then
/usr/sbin/update-alternatives --remove ksh /%{_lib}/ast/bin/ksh
if test $1 -eq 0 ; then
%{_sbindir}/update-alternatives --remove ksh /%{_lib}/ast/bin/ksh
fi
%endif