Blame bash.spec

Bernhard M. Wiedemann 3f54ce
#
Bernhard M. Wiedemann 3f54ce
# spec file for package bash
Bernhard M. Wiedemann 3f54ce
#
702f03
# Copyright (c) 2024 SUSE LLC
Bernhard M. Wiedemann 3f54ce
#
Bernhard M. Wiedemann 3f54ce
# All modifications and additions to the file contributed by third parties
Bernhard M. Wiedemann 3f54ce
# remain the property of their copyright owners, unless otherwise agreed
Bernhard M. Wiedemann 3f54ce
# upon. The license for this file, and modifications and additions to the
Bernhard M. Wiedemann 3f54ce
# file, is the same license as for the pristine package itself (unless the
Bernhard M. Wiedemann 3f54ce
# license for the pristine package is not an Open Source License, in which
Bernhard M. Wiedemann 3f54ce
# case the license is the MIT License). An "Open Source License" is a
Bernhard M. Wiedemann 3f54ce
# license that conforms to the Open Source Definition (Version 1.9)
Bernhard M. Wiedemann 3f54ce
# published by the Open Source Initiative.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
# Please submit bugfixes or comments via https://bugs.opensuse.org/
Bernhard M. Wiedemann 3f54ce
#
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
1294c0
%if 0%{?suse_version} > 1500
1294c0
%bcond_with alternatives
1294c0
%else
1294c0
%bcond_without alternatives
1294c0
%endif
b51812
# Unicode tests do alloc to much memory
b51812
%bcond_with altarray
608f74
%define rl_major 8
608f74
%define rl_version 8.2
1294c0
781344
%define         bextend %{nil}
b51812
%define         bversion 5.2
781344
%define         bpatchlvl %(bash %{_sourcedir}/get_version_number.sh %{_sourcedir})
781344
%global         _incdir     %{_includedir}
781344
%global         _ldldir     %{_libdir}/bash
781344
%global         _minsh      0
Bernhard M. Wiedemann 3f54ce
%bcond_with     import_function
Bernhard M. Wiedemann 3f54ce
%bcond_with     sjis
Bernhard M. Wiedemann 3f54ce
Name:           bash
Bernhard M. Wiedemann 493ed8
Version:        %{bversion}.%{bpatchlvl}
Bernhard M. Wiedemann 3f54ce
Release:        0
Bernhard M. Wiedemann 3f54ce
Summary:        The GNU Bourne-Again Shell
Bernhard M. Wiedemann 3f54ce
# The package bash-completion is a source of
Bernhard M. Wiedemann 3f54ce
# bugs which will hit at most this package
Bernhard M. Wiedemann 3f54ce
#Recommends:	bash-completion
Bernhard M. Wiedemann ec0161
License:        GPL-3.0-or-later
Bernhard M. Wiedemann ec0161
Group:          System/Shells
781344
URL:            https://www.gnu.org/software/bash/bash.html
6cd4c9
# Git:          https://git.savannah.gnu.org/cgit/bash.git
6cd4c9
Source0:        https://ftp.gnu.org/gnu/bash/bash-%{bversion}%{bextend}.tar.gz
Bernhard M. Wiedemann 493ed8
Source1:        bash-%{bversion}-patches.tar.bz2
781344
Source2:        get_version_number.sh
Bernhard M. Wiedemann 3f54ce
Source4:        run-tests
Bernhard M. Wiedemann 3f54ce
Source5:        dot.bashrc
Bernhard M. Wiedemann 3f54ce
Source6:        dot.profile
Bernhard M. Wiedemann 3f54ce
Source7:        bash-rpmlintrc
Bernhard M. Wiedemann 3f54ce
Source8:        baselibs.conf
Bernhard M. Wiedemann 3f54ce
# Remember unsafe method, compare with
6cd4c9
# https://lists.gnu.org/archive/html/bug-bash/2011-03/msg00070.html
6cd4c9
# https://lists.gnu.org/archive/html/bug-bash/2011-03/msg00071.html
6cd4c9
# https://lists.gnu.org/archive/html/bug-bash/2011-03/msg00073.html
Bernhard M. Wiedemann 3f54ce
Source9:        bash-4.2-history-myown.dif.bz2
dab942
Source10:       https://ftp.gnu.org/gnu/bash/bash-%{bversion}%{bextend}.tar.gz.sig
dab942
# GPG key 7C0135FB088AAF6C66C650B9BB5869F064EA74AB Chet Ramey
dab942
Source11:       bash.keyring
Bernhard M. Wiedemann 493ed8
Patch0:         bash-%{bversion}.dif
Bernhard M. Wiedemann 3f54ce
Patch1:         bash-2.03-manual.patch
Bernhard M. Wiedemann 3f54ce
Patch3:         bash-4.3-2.4.4.patch
Bernhard M. Wiedemann 3f54ce
Patch4:         bash-3.0-evalexp.patch
Bernhard M. Wiedemann 3f54ce
Patch5:         bash-3.0-warn-locale.patch
Bernhard M. Wiedemann 3f54ce
Patch7:         bash-4.3-decl.patch
Bernhard M. Wiedemann 3f54ce
Patch9:         bash-4.3-include-unistd.dif
Bernhard M. Wiedemann 3f54ce
Patch10:        bash-3.2-printf.patch
Bernhard M. Wiedemann 3f54ce
Patch11:        bash-4.3-loadables.dif
Bernhard M. Wiedemann 3f54ce
Patch12:        bash-4.1-completion.dif
Bernhard M. Wiedemann 3f54ce
Patch13:        bash-4.2-nscdunmap.dif
Bernhard M. Wiedemann 3f54ce
Patch14:        bash-4.3-sigrestart.patch
Bernhard M. Wiedemann 3f54ce
# PATCH-FIX-UPSTREAM bnc#382214 -- disabled due bnc#806628 by -DBNC382214=0
Bernhard M. Wiedemann 3f54ce
Patch16:        bash-4.0-setlocale.dif
Bernhard M. Wiedemann 3f54ce
# PATCH-EXTEND-SUSE bnc#828877 -- xterm resizing does not pass to all sub clients
Bernhard M. Wiedemann 3f54ce
Patch18:        bash-4.3-winch.dif
Bernhard M. Wiedemann 3f54ce
Patch40:        bash-4.1-bash.bashrc.dif
Bernhard M. Wiedemann 3f54ce
# PATCH-FIX-SUSE For bsc#1065158 add support for broken Japanese locale Shift JIS
Bernhard M. Wiedemann 3f54ce
Patch42:        bash-4.3-SJIS.patch
Bernhard M. Wiedemann 3f54ce
Patch46:        man2html-no-timestamp.patch
Bernhard M. Wiedemann 3f54ce
Patch47:        bash-4.3-perl522.patch
Bernhard M. Wiedemann 3f54ce
# PATCH-FIX-SUSE
Bernhard M. Wiedemann 3f54ce
Patch48:        bash-4.3-extra-import-func.patch
Bernhard M. Wiedemann 3f54ce
# PATCH-EXTEND-SUSE Allow root to clean file system if filled up
Bernhard M. Wiedemann 3f54ce
Patch49:        bash-4.3-pathtemp.patch
811409
# PATCH-FIX-SUSE
811409
Patch50:        quotes-man2html.patch
def706
# PATCH-FIX-UPSTREAM
def706
Patch51:        bash-5.2-gcc14.patch
Bernhard M. Wiedemann 3f54ce
BuildRequires:  autoconf
98aebd
# latest bash uses with patch 18 the tag YYEOF
Bernhard M. Wiedemann 3f54ce
BuildRequires:  bison
Bernhard M. Wiedemann 3f54ce
BuildRequires:  fdupes
b51812
BuildRequires:  glibc-locale
b51812
BuildRequires:  glibc-locale-base
Bernhard M. Wiedemann 3f54ce
BuildRequires:  makeinfo
Bernhard M. Wiedemann 3f54ce
BuildRequires:  patchutils
781344
BuildRequires:  pkgconfig
Bernhard M. Wiedemann 3f54ce
BuildRequires:  screen
Bernhard M. Wiedemann 3f54ce
BuildRequires:  sed
1294c0
%if %{with alternatives}
Bernhard M. Wiedemann 3f54ce
BuildRequires:  update-alternatives
1294c0
%endif
781344
BuildRequires:  pkgconfig(audit)
781344
BuildRequires:  pkgconfig(ncurses)
781344
# This has to be always the same version as included in the bash its self
702f03
BuildRequires:  pkgconfig(readline) >= %{rl_version}
1294c0
%if %{with alternatives}
Bernhard M. Wiedemann 3f54ce
Requires(post): update-alternatives
702f03
Requires(post): libreadline%{rl_major} >= %{rl_version}
71c797
Requires(preun):update-alternatives
1294c0
%endif
702f03
Requires:       libreadline%{rl_major} >= %{rl_version}
781344
Suggests:       bash-doc = %{version}
781344
Suggests:       command-not-found
81dd74
Provides:       /bin/bash
1294c0
%if %{with alternatives}
81dd74
Provides:       /bin/sh
1294c0
%else
1294c0
Suggests:       bash-sh
1294c0
%endif
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
%description
Bernhard M. Wiedemann 3f54ce
Bash is an sh-compatible command interpreter that executes commands
Bernhard M. Wiedemann 3f54ce
read from standard input or from a file.  Bash incorporates useful
Bernhard M. Wiedemann 3f54ce
features from the Korn and C shells (ksh and csh).  Bash is intended to
Bernhard M. Wiedemann 3f54ce
be a conformant implementation of the IEEE Posix Shell and Tools
Bernhard M. Wiedemann 3f54ce
specification (IEEE Working Group 1003.2).
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
%package doc
Bernhard M. Wiedemann 3f54ce
Summary:        Documentation how to Use the GNU Bourne-Again Shell
Bernhard M. Wiedemann 407ce2
Group:          Documentation/HTML
781344
Supplements:    (bash and patterns-base-documentation)
Bernhard M. Wiedemann 3f54ce
Provides:       bash:%{_infodir}/bash.info.gz
Bernhard M. Wiedemann 3f54ce
BuildArch:      noarch
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
%description doc
Bernhard M. Wiedemann 3f54ce
This package contains the documentation for using the bourne shell
Bernhard M. Wiedemann 3f54ce
interpreter Bash.
Bernhard M. Wiedemann 3f54ce
781344
%lang_package
Bernhard M. Wiedemann 3f54ce
1294c0
%if %{without alternatives}
1294c0
%package sh
1294c0
Summary:        Handle behaviour of /bin/sh
1294c0
Group:          System/Shells
1294c0
Provides:       alternative(sh)
1294c0
Conflicts:      alternative(sh)
0039fe
PreReq:         bash = %{version}
b51812
BuildArch:      noarch
1294c0
1294c0
%description sh
1294c0
Use bash as /bin/sh implementation.
1294c0
%endif
1294c0
Bernhard M. Wiedemann 3f54ce
%package devel
Bernhard M. Wiedemann 3f54ce
Summary:        Include Files mandatory for Development of bash loadable builtins
Bernhard M. Wiedemann 3f54ce
Group:          Development/Languages/C and C++
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
%description devel
Bernhard M. Wiedemann 3f54ce
This package contains the C header files for writing loadable new
Bernhard M. Wiedemann 3f54ce
builtins for the interpreter Bash. Use the output of the command
Bernhard M. Wiedemann 3f54ce
`pkg-config bash --cflags' on the compilers command line.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
%package loadables
Bernhard M. Wiedemann 3f54ce
Summary:        Loadable bash builtins
Bernhard M. Wiedemann 3f54ce
Group:          System/Shells
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
%description loadables
Bernhard M. Wiedemann 3f54ce
This package contains the examples for the ready-to-dynamic-load
Bernhard M. Wiedemann 3f54ce
builtins found in the source tar ball of the bash:
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
basename      Return non-directory portion of pathname.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
cut	      cut(1) replacement.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
dirname       Return directory portion of pathname.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
finfo	      Print file info.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
getconf       POSIX.2 getconf utility.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
head	      Copy first part of files.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
id	      POSIX.2 user identity.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
ln	      Make links.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
logname       Print login name of current user.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
mkdir	      Make directories.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
pathchk       Check pathnames for validity and portability.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
print	      Loadable ksh-93 style print builtin.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
printenv      Minimal builtin clone of BSD printenv(1).
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
push	      Anyone remember TOPS-20?
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
realpath      Canonicalize pathnames, resolving symlinks.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
rmdir	      Remove directory.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
sleep	      sleep for fractions of a second.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
strftime      Loadable builtin interface to strftime(3).
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
sync	      Sync the disks by forcing pending filesystem writes to
Bernhard M. Wiedemann 3f54ce
complete.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
tee	      Duplicate standard input.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
tty	      Return terminal name.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
uname	      Print system information.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
unlink	      Remove a directory entry.
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
whoami	      Print out username of current user.
Bernhard M. Wiedemann 3f54ce
3cc73c
%if 0%{?suse_version} >= 1550
81dd74
%package legacybin
81dd74
Summary:        Legacy usrmove helper files
81dd74
Group:          System/Shells
81dd74
Requires:       bash = %{version}-%{release}
81dd74
Requires:       this-is-only-for-build-envs
81dd74
Conflicts:      rpmlib(X-CheckUnifiedSystemdir)
b51812
BuildArch:      noarch
81dd74
81dd74
%description legacybin
81dd74
Legacy usrmove helper files for the build system. Do not install.
81dd74
%endif
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
%prep
Bernhard M. Wiedemann 3f54ce
%if %{with sjis}
811409
%{warn:Shift JIS support is enabled}
Bernhard M. Wiedemann 3f54ce
%else
811409
%{echo:Shift JIS support disabled}
Bernhard M. Wiedemann 3f54ce
%endif
Bernhard M. Wiedemann 493ed8
%setup -q -n bash-%{bversion}%{bextend} -b1
Bernhard M. Wiedemann 3f54ce
typeset -i level
b51812
set +x
dab942
for patch in ../bash-%{bversion}-patches/*-*[0-9]; do
Bernhard M. Wiedemann 3f54ce
    test -e $patch || break
dab942
Bernhard M. Wiedemann 3f54ce
    let level=0 || true
Bernhard M. Wiedemann 3f54ce
    file=$(lsdiff --files=1 $patch)
Bernhard M. Wiedemann 3f54ce
    if test ! -e $file ; then
Bernhard M. Wiedemann 3f54ce
	file=${file#*/}
Bernhard M. Wiedemann 3f54ce
	let level++ || true
Bernhard M. Wiedemann 3f54ce
    fi
Bernhard M. Wiedemann 3f54ce
    test -e $file || exit 1
Bernhard M. Wiedemann 493ed8
    sed -ri '/^\*\*\* \.\./{ s@\.\./bash-%{bversion}[^/]*/@@ }' $patch
Bernhard M. Wiedemann 3f54ce
    echo Patch $patch
Bernhard M. Wiedemann 3f54ce
    patch -s -p$level < $patch
Bernhard M. Wiedemann 3f54ce
done
b51812
set -x
98aebd
%patch -P1   -b .manual
98aebd
%patch -P3   -b .2.4.4
98aebd
%patch -P4   -b .evalexp
98aebd
%patch -P5   -b .warnlc
98aebd
%patch -P7   -b .decl
98aebd
%patch -P9   -b .unistd
98aebd
%patch -P10  -b .printf
98aebd
%patch -P11  -b .plugins
98aebd
%patch -P12  -b .completion
98aebd
%patch -P13  -b .nscdunmap
98aebd
%patch -P14  -b .sigrestart
98aebd
%patch -P16  -b .setlocale
98aebd
#%patch -P18 -p0 -b .winch
98aebd
%patch -P40  -b .bashrc
Bernhard M. Wiedemann 3f54ce
%if %{with sjis}
98aebd
%patch -P42  -b .sjis
Bernhard M. Wiedemann 3f54ce
%endif
98aebd
%patch -P46  -b .notimestamp
98aebd
%patch -P47  -b .perl522
Bernhard M. Wiedemann 3f54ce
%if %{with import_function}
98aebd
%patch -P48 -b .eif
Bernhard M. Wiedemann 3f54ce
%endif
98aebd
%patch -P49  -b .pthtmp
98aebd
%patch -P50  -b .qd
def706
%patch -P51  -b .gcc14
98aebd
%patch -P0   -b .p0
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
# This has to be always the same version as included in the bash its self
Bernhard M. Wiedemann 3f54ce
rl1=($(sed -rn '/RL_READLINE_VERSION/p' lib/readline/readline.h))
781344
rl2=($(sed -rn '/RL_READLINE_VERSION/p' %{_includedir}/readline/readline.h))
Bernhard M. Wiedemann 3f54ce
test ${rl1[2]} = ${rl2[2]} || exit 1
Bernhard M. Wiedemann 3f54ce
608f74
# Sometimes we face major ABI change(s) but only a minor version change
608f74
rl1=($(sed -rn '/RL_VERSION_MAJOR/p' lib/readline/readline.h))
608f74
test ${rl1[2]} = %{rl_major} || exit 1
608f74
rl2=($(sed -rn '/RL_VERSION_MINOR/p' lib/readline/readline.h))
608f74
test ${rl1[2]}.${rl2[2]} = %{rl_version} || exit 1
608f74
628ff5
%if 0%{?qemu_user_space_build}
628ff5
# Something in qemu clobbers the signal mask to block SIGALRM during the
628ff5
# execution of this test, causing it to hang.  Skip it.
628ff5
echo exit 0 > tests/read7.sub
628ff5
%endif
628ff5
Bernhard M. Wiedemann 3f54ce
%build
Bernhard M. Wiedemann 3f54ce
  LANG=POSIX
Bernhard M. Wiedemann 3f54ce
  LC_ALL=$LANG
Bernhard M. Wiedemann 3f54ce
  unset LC_CTYPE
Bernhard M. Wiedemann 3f54ce
  SCREENDIR=$(mktemp -d ${PWD}/screen.XXXXXX) || exit 1
Bernhard M. Wiedemann 3f54ce
  SCREENRC=${SCREENDIR}/bash
Bernhard M. Wiedemann 3f54ce
  export SCREENRC SCREENDIR
Bernhard M. Wiedemann 3f54ce
  exec 0< /dev/null
Bernhard M. Wiedemann 3f54ce
  SCREENLOG=${SCREENDIR}/log
Bernhard M. Wiedemann 3f54ce
  cat > $SCREENRC<<-EOF
Bernhard M. Wiedemann 3f54ce
	deflogin off
Bernhard M. Wiedemann 3f54ce
	deflog on
Bernhard M. Wiedemann 3f54ce
	logfile $SCREENLOG
Bernhard M. Wiedemann 3f54ce
	logfile flush 1
Bernhard M. Wiedemann 3f54ce
	logtstamp off
Bernhard M. Wiedemann 3f54ce
	log on
Bernhard M. Wiedemann 3f54ce
	setsid on
Bernhard M. Wiedemann 3f54ce
	scrollback 0
Bernhard M. Wiedemann 3f54ce
	silence on
Bernhard M. Wiedemann 3f54ce
	utf8 on
Bernhard M. Wiedemann 3f54ce
	EOF
781344
  HOSTTYPE=%{_target_cpu}
781344
  VENDOR=%{_target_vendor}
781344
  OSTYPE=%{_target_os}
781344
  MACHTYPE=${HOSTTYPE}-${VENDOR}-${OSTYPE}
781344
  export LANG LC_ALL HOSTTYPE VENDOR OSTYPE MACHTYPE
Bernhard M. Wiedemann 3f54ce
  cflags ()
Bernhard M. Wiedemann 3f54ce
  {
Bernhard M. Wiedemann 3f54ce
      local flag=$1; shift
Bernhard M. Wiedemann 3f54ce
      local var=$1; shift
Bernhard M. Wiedemann 3f54ce
      test -n "${flag}" -a -n "${var}" || return
Bernhard M. Wiedemann 3f54ce
      case "${!var}" in
Bernhard M. Wiedemann 3f54ce
      *${flag}*) return
Bernhard M. Wiedemann 3f54ce
      esac
Bernhard M. Wiedemann 3f54ce
      set -o noclobber
Bernhard M. Wiedemann 3f54ce
      case "$flag" in
Bernhard M. Wiedemann 3f54ce
      -Wl,*)
Bernhard M. Wiedemann 3f54ce
	  if echo 'int main () { return 0; }' | \
Bernhard M. Wiedemann 3f54ce
	     ${CC:-gcc} -Werror $flag -o /dev/null -xc - > /dev/null 2>&1 ; then
Bernhard M. Wiedemann 3f54ce
	      eval $var=\${$var:+\$$var\ }$flag
Bernhard M. Wiedemann 3f54ce
	  fi
Bernhard M. Wiedemann 3f54ce
	  ;;
Bernhard M. Wiedemann 3f54ce
      *)
Bernhard M. Wiedemann 3f54ce
	  if ${CC:-gcc} -Werror ${flag/#-Wno-/-W} -S -o /dev/null -xc /dev/null > /dev/null 2>&1 ; then
Bernhard M. Wiedemann 3f54ce
	      eval $var=\${$var:+\$$var\ }$flag
Bernhard M. Wiedemann 3f54ce
	  fi
Bernhard M. Wiedemann 3f54ce
	  if ${CXX:-g++} -Werror ${flag/#-Wno-/-W} -S -o /dev/null -xc++ /dev/null > /dev/null 2>&1 ; then
Bernhard M. Wiedemann 3f54ce
	      eval $var=\${$var:+\$$var\ }$flag
Bernhard M. Wiedemann 3f54ce
	  fi
Bernhard M. Wiedemann 3f54ce
      esac
Bernhard M. Wiedemann 3f54ce
      set +o noclobber
Bernhard M. Wiedemann 3f54ce
  }
Bernhard M. Wiedemann 3f54ce
  LARGEFILE="$(getconf LFS_CFLAGS)"
781344
  CFLAGS="%{optflags} $LARGEFILE -D_GNU_SOURCE -DRECYCLES_PIDS -Wall -g"
Bernhard M. Wiedemann 3f54ce
  LDFLAGS=""
Bernhard M. Wiedemann 3f54ce
  #
Bernhard M. Wiedemann 3f54ce
  # Never ever put -DMUST_UNBLOCK_CHLD herein as this breaks bash
Bernhard M. Wiedemann 3f54ce
  #
Bernhard M. Wiedemann 3f54ce
  cflags -Wuninitialized         CFLAGS
Bernhard M. Wiedemann 3f54ce
  cflags -Wextra                 CFLAGS
Bernhard M. Wiedemann 3f54ce
  cflags -Wno-unprototyped-calls CFLAGS
Bernhard M. Wiedemann 3f54ce
  cflags -Wno-switch-enum        CFLAGS
Bernhard M. Wiedemann 3f54ce
  cflags -Wno-unused-variable    CFLAGS
Bernhard M. Wiedemann 3f54ce
  cflags -Wno-unused-parameter   CFLAGS
Bernhard M. Wiedemann 3f54ce
  cflags -Wno-parentheses        CFLAGS
Bernhard M. Wiedemann 3f54ce
  cflags -ftree-loop-linear      CFLAGS
Bernhard M. Wiedemann 3f54ce
  cflags -pipe                   CFLAGS
Bernhard M. Wiedemann 3f54ce
  cflags -DBNC382214=0           CFLAGS
Bernhard M. Wiedemann 3f54ce
  cflags -DIMPORT_FUNCTIONS_DEF=0 CFLAGS
Bernhard M. Wiedemann 3f54ce
  cflags -Wl,--as-needed         LDFLAGS
Bernhard M. Wiedemann 3f54ce
  cflags -Wl,-O2                 LDFLAGS
Bernhard M. Wiedemann 3f54ce
  cflags -Wl,-rpath,%{_ldldir}		      LDFLAGS
Bernhard M. Wiedemann 3f54ce
  # /proc is required for correct configuration
Bernhard M. Wiedemann 3f54ce
  test -d /dev/fd || { echo "/proc is not mounted!" >&2; exit 1; }
Bernhard M. Wiedemann 3f54ce
  CC=gcc
781344
%if %{_minsh}
Bernhard M. Wiedemann 3f54ce
  cflags -Os CFLAGS
Bernhard M. Wiedemann 3f54ce
# cflags -U_FORTIFY_SOURCE CFLAGS
Bernhard M. Wiedemann 3f54ce
# cflags -funswitch-loops CFLAGS
Bernhard M. Wiedemann 3f54ce
# cflags -ftree-loop-im CFLAGS
Bernhard M. Wiedemann 3f54ce
# cflags -ftree-loop-ivcanon CFLAGS
Bernhard M. Wiedemann 3f54ce
# cflags -fprefetch-loop-arrays CFLAGS
Bernhard M. Wiedemann 3f54ce
# cflags -fno-stack-protector CFLAGS
Bernhard M. Wiedemann 3f54ce
# cflags -fno-unwind-tables CFLAGS
Bernhard M. Wiedemann 3f54ce
# cflags -fno-asynchronous-unwind-tables CFLAGS
Bernhard M. Wiedemann 3f54ce
%endif
30c975
  CFLAGS="$CFLAGS -DDEFAULT_LOADABLE_BUILTINS_PATH='\"%{_libdir}/%{name}\"'"
Bernhard M. Wiedemann 3f54ce
  CC_FOR_BUILD="$CC"
Bernhard M. Wiedemann 3f54ce
  CFLAGS_FOR_BUILD="$CFLAGS"
Bernhard M. Wiedemann 3f54ce
  export CC_FOR_BUILD CFLAGS_FOR_BUILD CFLAGS LDFLAGS CC
Bernhard M. Wiedemann 3f54ce
  autoconf
Bernhard M. Wiedemann 3f54ce
  #
Bernhard M. Wiedemann 3f54ce
  # We have a malloc with our glibc
Bernhard M. Wiedemann 3f54ce
  #
Bernhard M. Wiedemann 3f54ce
  SYSMALLOC="
Bernhard M. Wiedemann 3f54ce
	--without-gnu-malloc
Bernhard M. Wiedemann 3f54ce
	--without-bash-malloc
Bernhard M. Wiedemann 3f54ce
	--enable-mem-scramble
Bernhard M. Wiedemann 3f54ce
  "
Bernhard M. Wiedemann 3f54ce
  #
Bernhard M. Wiedemann 3f54ce
  # System readline library (comment out it not to be used)
Bernhard M. Wiedemann 3f54ce
  #
Bernhard M. Wiedemann 3f54ce
  READLINE="
Bernhard M. Wiedemann 3f54ce
	--with-installed-readline
Bernhard M. Wiedemann 3f54ce
  "
Bernhard M. Wiedemann 3f54ce
  bash support/mkconffiles -v
781344
%if %{_minsh}
Bernhard M. Wiedemann 3f54ce
  ./configure --build=%{_target_cpu}-suse-linux	\
Bernhard M. Wiedemann 3f54ce
	--prefix=%{_prefix}		\
Bernhard M. Wiedemann 3f54ce
	--mandir=%{_mandir}		\
Bernhard M. Wiedemann 3f54ce
	--infodir=%{_infodir}		\
Bernhard M. Wiedemann 3f54ce
	--libdir=%{_libdir}		\
Bernhard M. Wiedemann 3f54ce
	--with-curses			\
Bernhard M. Wiedemann 3f54ce
	--with-afs			\
Bernhard M. Wiedemann 3f54ce
	--with-gnu-ld			\
Bernhard M. Wiedemann 3f54ce
	$SYSMALLOC			\
Bernhard M. Wiedemann 3f54ce
	--enable-minimal-config		\
Bernhard M. Wiedemann 3f54ce
	--enable-arith-for-command	\
Bernhard M. Wiedemann 3f54ce
	--enable-array-variables	\
b51812
	--disable-alt-array-implementation \
Bernhard M. Wiedemann 3f54ce
	--enable-brace-expansion	\
Bernhard M. Wiedemann 3f54ce
	--enable-casemod-attributes	\
Bernhard M. Wiedemann 3f54ce
	--enable-casemod-expansion	\
Bernhard M. Wiedemann 3f54ce
	--enable-command-timing		\
Bernhard M. Wiedemann 3f54ce
	--enable-cond-command		\
Bernhard M. Wiedemann 3f54ce
	--enable-cond-regexp		\
Bernhard M. Wiedemann 3f54ce
	--enable-coprocesses		\
Bernhard M. Wiedemann 3f54ce
	--enable-directory-stack	\
Bernhard M. Wiedemann 3f54ce
	--enable-dparen-arithmetic	\
Bernhard M. Wiedemann 3f54ce
	--enable-extended-glob		\
Bernhard M. Wiedemann 3f54ce
	--enable-job-control		\
Bernhard M. Wiedemann 3f54ce
	--enable-net-redirections	\
Bernhard M. Wiedemann 3f54ce
	--enable-process-substitution	\
Bernhard M. Wiedemann 3f54ce
	--enable-glob-asciiranges-default \
Bernhard M. Wiedemann 3f54ce
	--disable-strict-posix-default	\
Bernhard M. Wiedemann 3f54ce
	--enable-separate-helpfiles=%{_datadir}/bash/helpfiles \
Bernhard M. Wiedemann 3f54ce
	$READLINE
b51812
  %make_build Program=sh sh
b51812
  %make_build distclean
Bernhard M. Wiedemann 3f54ce
%endif
Bernhard M. Wiedemann 3f54ce
  ./configure --build=%{_target_cpu}-suse-linux	\
Bernhard M. Wiedemann 3f54ce
	--prefix=%{_prefix}		\
Bernhard M. Wiedemann 3f54ce
	--mandir=%{_mandir}		\
Bernhard M. Wiedemann 3f54ce
	--infodir=%{_infodir}		\
Bernhard M. Wiedemann 3f54ce
	--libdir=%{_libdir}		\
Bernhard M. Wiedemann 3f54ce
	--docdir=%{_docdir}/%{name}	\
Bernhard M. Wiedemann 3f54ce
	--with-curses			\
Bernhard M. Wiedemann 3f54ce
	--with-afs			\
Bernhard M. Wiedemann 3f54ce
	--with-gnu-ld			\
Bernhard M. Wiedemann 3f54ce
	$SYSMALLOC			\
b51812
	--enable-threads=posix		\
Bernhard M. Wiedemann 3f54ce
	--enable-job-control		\
Bernhard M. Wiedemann 3f54ce
	--enable-net-redirections	\
Bernhard M. Wiedemann 3f54ce
	--enable-alias			\
Bernhard M. Wiedemann 3f54ce
	--enable-readline		\
Bernhard M. Wiedemann 3f54ce
	--enable-history		\
Bernhard M. Wiedemann 3f54ce
	--enable-bang-history		\
Bernhard M. Wiedemann 3f54ce
	--enable-directory-stack	\
Bernhard M. Wiedemann 3f54ce
	--enable-process-substitution	\
Bernhard M. Wiedemann 3f54ce
	--enable-prompt-string-decoding	\
Bernhard M. Wiedemann 3f54ce
	--enable-select			\
Bernhard M. Wiedemann 3f54ce
	--enable-help-builtin		\
Bernhard M. Wiedemann 3f54ce
	--enable-separate-helpfiles	\
Bernhard M. Wiedemann 3f54ce
	--enable-array-variables	\
b51812
%if %{with altarray}
b51812
	--enable-alt-array-implementation \
b51812
%else
b51812
	--disable-alt-array-implementation \
b51812
%endif
Bernhard M. Wiedemann 3f54ce
	--enable-brace-expansion	\
Bernhard M. Wiedemann 3f54ce
	--enable-command-timing		\
Bernhard M. Wiedemann 3f54ce
	--enable-disabled-builtins	\
Bernhard M. Wiedemann 3f54ce
	--enable-glob-asciiranges-default \
b51812
	--enable-translatable-strings	\
Bernhard M. Wiedemann 3f54ce
	--disable-strict-posix-default	\
Bernhard M. Wiedemann 3f54ce
	--enable-multibyte		\
Bernhard M. Wiedemann 3f54ce
	--enable-separate-helpfiles=%{_datadir}/bash/helpfiles \
Bernhard M. Wiedemann 3f54ce
	$READLINE
Bernhard M. Wiedemann 3f54ce
  sed -rn '/Configuration feature settings controllable by autoconf/,/End of configuration settings controllable by autoconf/p' <  config.h
Bernhard M. Wiedemann 3f54ce
  profilecflags=CFLAGS="$CFLAGS"
Bernhard M. Wiedemann 3f54ce
%if 0%{?do_profiling}
781344
  profilecflags=CFLAGS="$CFLAGS %{cflags_profile_generate}"
Bernhard M. Wiedemann 3f54ce
%endif
98aebd
  ulimit -Hv unlimited
98aebd
  ulimit -v unlimited
781344
  makeopts="Machine=${HOSTTYPE} OS=${OSTYPE} VENDOR=${VENDOR} MACHTYPE=${MACHTYPE}"
811409
  %make_build $makeopts "$profilecflags" \
Bernhard M. Wiedemann 3f54ce
	all printenv recho zecho xcase
Bernhard M. Wiedemann 3f54ce
  TMPDIR=$(mktemp -d /tmp/bash.XXXXXXXXXX) || exit 1
Bernhard M. Wiedemann 3f54ce
  > $SCREENLOG
Bernhard M. Wiedemann 3f54ce
  tail -q -s 0.5 -f $SCREENLOG & pid=$!
Bernhard M. Wiedemann 3f54ce
  env -i HOME=$PWD TERM=$TERM LD_LIBRARY_PATH=$LD_RUN_PATH TMPDIR=$TMPDIR \
Bernhard M. Wiedemann 3f54ce
	SCREENRC=$SCREENRC SCREENDIR=$SCREENDIR \
b51812
	screen -D -m %make_build -j1 TESTSCRIPT=%{SOURCE4} check
Bernhard M. Wiedemann 3f54ce
  kill -TERM $pid
Bernhard M. Wiedemann 3f54ce
%if 0%{?do_profiling}
Bernhard M. Wiedemann 3f54ce
  rm -f jobs.gcda
781344
  profilecflags=CFLAGS="$CFLAGS %{cflags_profile_feedback} -fprofile-correction"
811409
  %make_build $makeopts "$profilecflags" clean
Bernhard M. Wiedemann 3f54ce
%endif
811409
  %make_build $makeopts "$profilecflags" all
811409
  %make_build $makeopts -C examples/loadables/
811409
  %make_build $makeopts documentation
b51812
  grep -F '$'\' doc/bash.html %{nil:test for boo#1203091}
b51812
b51812
%check
98aebd
  rm -vf tests/*.p0
b51812
  %make_build -j1 check
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
%install
Bernhard M. Wiedemann 3f54ce
  %make_install
81dd74
  make -C examples/loadables/ install-supported DESTDIR=%{buildroot} libdir=%{_libdir}
Bernhard M. Wiedemann 3f54ce
  mv -vf %{buildroot}%{_ldldir}/*.h   %{buildroot}%{_includedir}/bash/
Bernhard M. Wiedemann 3f54ce
  mv -vf %{buildroot}%{_ldldir}/*.inc %{buildroot}%{_datadir}/bash
Bernhard M. Wiedemann 3f54ce
  rm -rf %{buildroot}/%{_lib}/pkgconfig
Bernhard M. Wiedemann 3f54ce
  sed -ri '/CC = gcc/s@(CC = gcc).*@\1@' %{buildroot}%{_libdir}/pkgconfig/bash.pc
1294c0
%if %{with alternatives}
Bernhard M. Wiedemann 3f54ce
  mkdir -p %{buildroot}%{_sysconfdir}/alternatives
1294c0
%endif
Bernhard M. Wiedemann 3f54ce
#
Bernhard M. Wiedemann 3f54ce
# It should be noted that the move of /bin/bash to /usr/bin/bash
Bernhard M. Wiedemann 3f54ce
# had NOT done by me at 2019/02/08. Now only a symbolic link
Bernhard M. Wiedemann 3f54ce
# remains here :(
Bernhard M. Wiedemann 3f54ce
# The same had happen for the system POSIX shell /bin/sh
Bernhard M. Wiedemann 3f54ce
#
81dd74
  mkdir -p %{buildroot}/bin
Bernhard M. Wiedemann 3f54ce
  ln -sf %{_bindir}/bash %{buildroot}/bin/bash
Bernhard M. Wiedemann 3f54ce
  ln -sf %{_bindir}/sh   %{buildroot}/bin/sh
Bernhard M. Wiedemann 3f54ce
  ln -sf bash            %{buildroot}%{_bindir}/rbash
1294c0
%if %{with alternatives}
Bernhard M. Wiedemann 974c2b
  ln -sf %{_sysconfdir}/alternatives/sh %{buildroot}%{_bindir}/sh
1294c0
%else
1294c0
  ln -sf %{_bindir}/bash %{buildroot}%{_bindir}/sh
1294c0
%endif
Bernhard M. Wiedemann 3f54ce
  install -m 644 COMPAT NEWS    %{buildroot}%{_docdir}/%{name}
Bernhard M. Wiedemann 3f54ce
  install -m 644 doc/FAQ        %{buildroot}%{_docdir}/%{name}
Bernhard M. Wiedemann 3f54ce
  install -m 644 doc/INTRO      %{buildroot}%{_docdir}/%{name}
Bernhard M. Wiedemann 3f54ce
  install -m 644 doc/*.html     %{buildroot}%{_docdir}/%{name}
8871fa
  install -m 644 doc/builtins.1 %{buildroot}%{_mandir}/man1/bash_builtins.1
Bernhard M. Wiedemann 3f54ce
  install -m 644 doc/rbash.1    %{buildroot}%{_mandir}/man1/rbash.1
Bernhard M. Wiedemann 3f54ce
  gzip -9f %{buildroot}%{_infodir}/*.inf*[^z] || true
Bernhard M. Wiedemann 3f54ce
  mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
Bernhard M. Wiedemann 3f54ce
  sed 's/^|//' > %{buildroot}%{_docdir}/%{name}/BUGS <<\EOF
Bernhard M. Wiedemann 3f54ce
Known problems
Bernhard M. Wiedemann 3f54ce
--------------
Bernhard M. Wiedemann 3f54ce
|
Bernhard M. Wiedemann 3f54ce
This version of bash/readline supports multi byte handling
Bernhard M. Wiedemann 3f54ce
that is e.g. wide character support for UTF-8.  This causes
Bernhard M. Wiedemann 3f54ce
problems in geting the current cursor position within the
Bernhard M. Wiedemann 3f54ce
readline runtime library:
Bernhard M. Wiedemann 3f54ce
|
Bernhard M. Wiedemann 493ed8
bash-%{bversion}> LANG=ja_JP
Bernhard M. Wiedemann 493ed8
bash-%{bversion}> echo -n "Hello"
Bernhard M. Wiedemann 493ed8
bash-%{bversion}>
Bernhard M. Wiedemann 3f54ce
|
Bernhard M. Wiedemann 3f54ce
In other words the prompt overwrites the output of the
Bernhard M. Wiedemann 3f54ce
echo comand.  The boolean variable byte-oriented
Bernhard M. Wiedemann 3f54ce
set in %{_sysconfdir}/inputrc or $HOME/.inputrc avoids this
Bernhard M. Wiedemann 3f54ce
but disables multi byte handling.
Bernhard M. Wiedemann 3f54ce
EOF
Bernhard M. Wiedemann 3f54ce
  # remove unpackaged files
Bernhard M. Wiedemann 3f54ce
  mkdir -p %{buildroot}%{_sysconfdir}/skel
781344
  install -m 644 %{SOURCE5}    %{buildroot}%{_sysconfdir}/skel/.bashrc
781344
  install -m 644 %{SOURCE6}    %{buildroot}%{_sysconfdir}/skel/.profile
Bernhard M. Wiedemann 3f54ce
  touch -t 199605181720.50 %{buildroot}%{_sysconfdir}/skel/.bash_history
Bernhard M. Wiedemann 3f54ce
  chmod 600                %{buildroot}%{_sysconfdir}/skel/.bash_history
Bernhard M. Wiedemann 3f54ce
  %find_lang bash
Bernhard M. Wiedemann 3f54ce
  %fdupes -s %{buildroot}%{_datadir}/bash/helpfiles
Bernhard M. Wiedemann 3f54ce
  sed -ri '1{ s@/bin/sh@/bin/bash@ }' %{buildroot}%{_bindir}/bashbug
Bernhard M. Wiedemann 3f54ce
1294c0
%if %{with alternatives}
781344
%post -p %{_bindir}/bash
Bernhard M. Wiedemann 3f54ce
%{_sbindir}/update-alternatives --quiet --force \
Bernhard M. Wiedemann 3f54ce
	--install %{_bindir}/sh sh %{_bindir}/bash 10100
Bernhard M. Wiedemann 3f54ce
781344
%preun -p %{_bindir}/bash
Bernhard M. Wiedemann 3f54ce
if test "$1" = 0; then
Bernhard M. Wiedemann 3f54ce
        %{_sbindir}/update-alternatives --quiet --remove sh %{_bindir}/bash
Bernhard M. Wiedemann 3f54ce
fi
1294c0
%endif
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
%files
Bernhard M. Wiedemann 3f54ce
%license COPYING
Bernhard M. Wiedemann 3f54ce
%config %attr(600,root,root) %{_sysconfdir}/skel/.bash_history
Bernhard M. Wiedemann 3f54ce
%config %attr(644,root,root) %{_sysconfdir}/skel/.bashrc
Bernhard M. Wiedemann 3f54ce
%config %attr(644,root,root) %{_sysconfdir}/skel/.profile
1294c0
%if %{with alternatives}
Bernhard M. Wiedemann 3f54ce
%ghost %config %{_sysconfdir}/alternatives/sh
1294c0
%endif
Bernhard M. Wiedemann 3f54ce
%dir %{_sysconfdir}/bash_completion.d
3cc73c
%if 0%{?suse_version} < 1550
Bernhard M. Wiedemann 3f54ce
/bin/bash
1294c0
%if %{with alternatives}
Bernhard M. Wiedemann 3f54ce
/bin/sh
81dd74
%endif
1294c0
%endif
Bernhard M. Wiedemann 3f54ce
%{_bindir}/bash
Bernhard M. Wiedemann 3f54ce
%{_bindir}/bashbug
Bernhard M. Wiedemann 3f54ce
%{_bindir}/rbash
1294c0
%if %{with alternatives}
Bernhard M. Wiedemann 974c2b
%{_bindir}/sh
1294c0
%endif
Bernhard M. Wiedemann 3f54ce
%dir %{_datadir}/bash
Bernhard M. Wiedemann 3f54ce
%dir %{_datadir}/bash/helpfiles
Bernhard M. Wiedemann 3f54ce
%{_datadir}/bash/helpfiles/*
781344
%{_mandir}/man1/bash.1%{?ext_man}
8871fa
%{_mandir}/man1/bash_builtins.1%{?ext_man}
781344
%{_mandir}/man1/bashbug.1%{?ext_man}
781344
%{_mandir}/man1/rbash.1%{?ext_man}
Bernhard M. Wiedemann 3f54ce
1294c0
%if %{without alternatives}
1294c0
%files sh
3cc73c
%if 0%{?suse_version} < 1550
1294c0
/bin/sh
1294c0
%endif
1294c0
%{_bindir}/sh
1294c0
%endif
1294c0
Bernhard M. Wiedemann 3f54ce
%files lang -f bash.lang
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
%files doc
781344
%{_infodir}/bash.info%{?ext_info}
Bernhard M. Wiedemann 3f54ce
%doc %{_docdir}/%{name}
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
%files devel
Bernhard M. Wiedemann 3f54ce
%dir %{_includedir}/bash/
Bernhard M. Wiedemann 3f54ce
%dir %{_includedir}/bash/builtins/
Bernhard M. Wiedemann 3f54ce
%dir %{_includedir}/bash/include/
Bernhard M. Wiedemann 3f54ce
%{_incdir}/bash/*.h
Bernhard M. Wiedemann 3f54ce
%{_incdir}/bash/builtins/*.h
Bernhard M. Wiedemann 3f54ce
%{_incdir}/bash/include/*.h
Bernhard M. Wiedemann 3f54ce
%{_libdir}/pkgconfig/bash.pc
Bernhard M. Wiedemann 3f54ce
%{_datadir}/bash/*.inc
Bernhard M. Wiedemann 3f54ce
Bernhard M. Wiedemann 3f54ce
%files loadables
Bernhard M. Wiedemann 3f54ce
%{_ldldir}
Bernhard M. Wiedemann 3f54ce
3cc73c
%if 0%{?suse_version} >= 1550
81dd74
%files legacybin
81dd74
/bin/bash
81dd74
/bin/sh
81dd74
%endif
81dd74
Bernhard M. Wiedemann 3f54ce
%changelog