Group :: Shelss
RPM: bash5
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Name: bash5
%define bash_version 5.2
%define bash_patchlevel .15
Version: %bash_version%bash_patchlevel
Release: alt1
Summary: The GNU Bourne Again SHell (Bash)
Group: Shells
License: GPLv3+
Url: https://www.gnu.org/software/bash/
# https://ftp.gnu.org/gnu/bash/bash-%bash_version.tar.gz
# https://ftp.gnu.org/gnu/bash/bash-%bash_version-patches/
Source0: bash-%version.tar
Patch: bash-%version-%release.patch
# bashbug produces a lot of unneeded dependencies.
AutoReq: yes, noshell
Requires: sh5 = %EVR
BuildRequires: libreadline-devel >= 8, libtinfo-devel makeinfo texi2dvi
%package -n sh5
Summary: The GNU Bourne Again SHell (/bin/sh)
Group: Shells
Provides: /bin/sh5, %_libexecdir/%name
Requires: bashrc
Conflicts: %name < %version-%release
AutoReq: yes
%package doc
Group: Shells
Summary: Documentation for the GNU Bourne Again SHell
BuildArch: noarch
Requires: %name = %version-%release
AutoReq: yes
%package examples
Group: Development/Other
Summary: Examples for the GNU Bourne Again SHell
BuildArch: noarch
Requires: %name = %version-%release
AutoReq: yes
%package devel
Group: Development/Other
Summary: Bash loadable builtins development files
Requires: %name = %version-%release
Requires: libreadline-devel
%description
Bash is an sh-compatible command language interpreter that executes
commands read from the standard input or from a file. Bash also
incorporates useful features from the Korn and C shells (ksh and csh).
Most sh scripts can be run by bash without modification.
Bash is ultimately intended to be a conformant implementation of the
IEEE POSIX Shell and Tools specification (IEEE Working Group 1003.2).
%description -n sh5
Bash is an sh-compatible command language interpreter that executes
commands read from the standard input or from a file. Bash also
incorporates useful features from the Korn and C shells (ksh and csh).
Most sh scripts can be run by bash without modification.
Bash is ultimately intended to be a conformant implementation of the
IEEE POSIX Shell and Tools specification (IEEE Working Group 1003.2).
This package contains /bin/sh.
%description doc
Bash is an sh-compatible command language interpreter that executes
commands read from the standard input or from a file. Bash also
incorporates useful features from the Korn and C shells (ksh and csh).
Most sh scripts can be run by bash without modification.
Bash is ultimately intended to be a conformant implementation of the
IEEE POSIX Shell and Tools specification (IEEE Working Group 1003.2).
This package contains documentation for the GNU Bourne Again SHell.
%description examples
Bash is an sh-compatible command language interpreter that executes
commands read from the standard input or from a file. Bash also
incorporates useful features from the Korn and C shells (ksh and csh).
Most sh scripts can be run by bash without modification.
Bash is ultimately intended to be a conformant implementation of the
IEEE POSIX Shell and Tools specification (IEEE Working Group 1003.2).
This package contains examples for the GNU Bourne Again SHell.
%description devel
Bash can dynamically load new builtin commands.
Included are the necessary headers to compile custom builtins.
%prep
%setup -n bash-%version
%patch -p1
# Remove files which should be regenerated during build.
rm configure y.tab.? doc/*.info*
# Bundled texi2dvi is outdated.
install -pm755 /usr/bin/texi2dvi support/
# Fix builtins.1
{
sed -n '1,/^\.SH BASH BUILTIN COMMANDS/p' doc/builtins.1
sed -n '/^\.\\" start of bash_builtins/,/^\.\\" bash_builtins/p' doc/bash.1
sed -n '/^\.SH SEE ALSO/,$p' doc/builtins.1
} > builtins.1
mv builtins.1 doc/builtins.1
# Fix rbash.1
{
sed -n '1,/^\.SH RESTRICTED SHELL/p' doc/rbash.1
sed -n '/^\.\\" rbash\.1/,/^\.\\" end of rbash\.1/p' doc/bash.1
sed -n '/^\.SH SEE ALSO/,$p' doc/rbash.1
} > rbash.1
mv rbash.1 doc/rbash.1
th="$(sed '/^\.TH BASH 1[^"]*/!d;s///;q' doc/bash.1)"
sed -i "/^\\.TH /s/\".*/$th/" doc/builtins.1 doc/rbash.1
mv po/bash.pot po/%name.pot
%build
autoconf
export \
bash_cv_dev_fd=standard \
bash_cv_dev_stdin=present \
bash_cv_mail_dir=/var/mail \
bash_cv_termcap_lib=libc \
loadablesdir=%_libexecdir/%name \
%{?__buildreqs:bash_cv_must_reinstall_sighandlers=no} \
#
%define _configure_script ../configure
# Build sh.
mkdir build-sh
pushd build-sh
%configure \
--enable-glob-asciiranges-default \
--without-bash-malloc \
--disable-readline \
--disable-command-timing \
--disable-net-redirections \
--disable-help-builtin \
--disable-bang-history \
--disable-history \
--disable-progcomp \
--disable-restricted \
#
%make_build
popd
# Build bash.
mkdir build-bash
pushd build-bash
%configure \
--enable-glob-asciiranges-default \
--without-bash-malloc \
--with-installed-readline \
--disable-command-timing \
--disable-net-redirections \
--enable-separate-helpfiles \
#
%make_build
%make_build info
ln doc/*.info* ../doc/
popd
%install
%makeinstall -C build-bash \
loadablesdir=%buildroot%_libexecdir/%name
install -pD -m755 build-sh/bash %buildroot/bin/sh5
mv %buildroot%_bindir/bash %buildroot/bin/%name
# Make manpages for bash builtins as per suggestion in doc/README.
pushd doc
sed -e '
/^\.SH NAME/, /\\- bash built-in commands$/{
/^\.SH NAME/d
s/^bash, //
s/\\- bash built-in commands$//
s/,//g
b
}
d
' builtins.1 > man.pages
for f in $(cat man.pages); do
ln -s %{name}_builtins.1 %buildroot%_man1dir/%{name}_"$f".1
done
popd
ln -s %name %buildroot/bin/r%name
mv %buildroot%_bindir/{bash,%name}bug
mv %buildroot%_infodir/{bash,%name}.info
mv %buildroot%_man1dir/{bash,%name}.1
mv %buildroot%_man1dir/{bash,%name}bug.1
mv %buildroot%_man1dir/{bash,%name}_builtins.1
mv %buildroot%_man1dir/r{bash,%name}.1
ln -s %name.1 %buildroot%_man1dir/sh5.1
mv %buildroot%_pkgconfigdir/{bash,%name}.pc
# Include files for building custom builtins.
pushd build-bash
mkdir -p %buildroot%_includedir/%name
for f in ../examples/loadables/*.c; do
%__cc -MM -DHAVE_CONFIG_H -DSHELL -Iexamples/loadables -I. -I.. -I../lib -I../builtins -Ibuiltins -I../include "$f"
done |
tr -d '\:' |
tr -s '[:space:]' '\n' |
grep -F .h |
grep -Fv examples/loadables/ |
sort -u |
while read f; do
install -pm644 "$f" %buildroot%_includedir/%name/
done
popd
# Install additional headers required by bashdb.
for f in bashline.h input.h ; do
install -pm644 "$f" %buildroot%_includedir/%name/
done
# Prepare documentation.
%define docdir %_docdir/%name-%version
mkdir -p %buildroot%docdir/{html,ps,txt}
install -p -m644 \
AUTHORS CHANGES COMPAT NEWS NOTES POSIX RBASH doc/{FAQ,INTRO} \
%buildroot%docdir/
install -p -m644 doc/*.html %buildroot%docdir/html/
install -p -m644 doc/*.ps %buildroot%docdir/ps/
install -p -m644 doc/*.txt %buildroot%docdir/txt/
find %buildroot%docdir/{[A-Z],{ps,txt}/}* -type f -size +8k -print0 |
xargs -r0 xz -9 --
cp -a examples %buildroot%docdir/
find %buildroot%docdir/examples/ -type f -name 'Makefile*' -delete -print
cat >%buildroot%docdir/examples/loadables/Makefile <<'EOF'
CC = %__cc
CPPFLAGS = -DHAVE_CONFIG_H -I. -I%_includedir/bash
CFLAGS = %optflags_default %optflags_shared
LDFLAGS = -shared -Wl,-soname,$ at
%%.so: %%.c
$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $ at
EOF
rm %buildroot%_libexecdir/%name/Makefile.inc
rm -r %buildroot%_defaultdocdir/%name
%find_lang %name
%check
# These tests are almost useless because they always succeed.
make -k check -C build-sh
make -k check -C build-bash
%define _unpackaged_files_terminate_build 1
%files -n sh5
/bin/sh5
%dir %_libexecdir/%name
%files -f %name.lang
/bin/*%{name}*
%_bindir/*
%_libexecdir/%name/*
%exclude %_libexecdir/%name/*.h
%_datadir/%name
%_mandir/man?/*
%_infodir/*.info*
%dir %docdir
%docdir/[A-Z]*
%files doc
%dir %docdir
%docdir/html
%docdir/ps
%docdir/txt
%files examples
%dir %docdir
%docdir/examples
%files devel
%_includedir/*
%_pkgconfigdir/*
%_libexecdir/%name/*.h
%changelog
…
Todas as alterações você pod ver aqui
%define bash_version 5.2
%define bash_patchlevel .15
Version: %bash_version%bash_patchlevel
Release: alt1
Summary: The GNU Bourne Again SHell (Bash)
Group: Shells
License: GPLv3+
Url: https://www.gnu.org/software/bash/
# https://ftp.gnu.org/gnu/bash/bash-%bash_version.tar.gz
# https://ftp.gnu.org/gnu/bash/bash-%bash_version-patches/
Source0: bash-%version.tar
Patch: bash-%version-%release.patch
# bashbug produces a lot of unneeded dependencies.
AutoReq: yes, noshell
Requires: sh5 = %EVR
BuildRequires: libreadline-devel >= 8, libtinfo-devel makeinfo texi2dvi
%package -n sh5
Summary: The GNU Bourne Again SHell (/bin/sh)
Group: Shells
Provides: /bin/sh5, %_libexecdir/%name
Requires: bashrc
Conflicts: %name < %version-%release
AutoReq: yes
%package doc
Group: Shells
Summary: Documentation for the GNU Bourne Again SHell
BuildArch: noarch
Requires: %name = %version-%release
AutoReq: yes
%package examples
Group: Development/Other
Summary: Examples for the GNU Bourne Again SHell
BuildArch: noarch
Requires: %name = %version-%release
AutoReq: yes
%package devel
Group: Development/Other
Summary: Bash loadable builtins development files
Requires: %name = %version-%release
Requires: libreadline-devel
%description
Bash is an sh-compatible command language interpreter that executes
commands read from the standard input or from a file. Bash also
incorporates useful features from the Korn and C shells (ksh and csh).
Most sh scripts can be run by bash without modification.
Bash is ultimately intended to be a conformant implementation of the
IEEE POSIX Shell and Tools specification (IEEE Working Group 1003.2).
%description -n sh5
Bash is an sh-compatible command language interpreter that executes
commands read from the standard input or from a file. Bash also
incorporates useful features from the Korn and C shells (ksh and csh).
Most sh scripts can be run by bash without modification.
Bash is ultimately intended to be a conformant implementation of the
IEEE POSIX Shell and Tools specification (IEEE Working Group 1003.2).
This package contains /bin/sh.
%description doc
Bash is an sh-compatible command language interpreter that executes
commands read from the standard input or from a file. Bash also
incorporates useful features from the Korn and C shells (ksh and csh).
Most sh scripts can be run by bash without modification.
Bash is ultimately intended to be a conformant implementation of the
IEEE POSIX Shell and Tools specification (IEEE Working Group 1003.2).
This package contains documentation for the GNU Bourne Again SHell.
%description examples
Bash is an sh-compatible command language interpreter that executes
commands read from the standard input or from a file. Bash also
incorporates useful features from the Korn and C shells (ksh and csh).
Most sh scripts can be run by bash without modification.
Bash is ultimately intended to be a conformant implementation of the
IEEE POSIX Shell and Tools specification (IEEE Working Group 1003.2).
This package contains examples for the GNU Bourne Again SHell.
%description devel
Bash can dynamically load new builtin commands.
Included are the necessary headers to compile custom builtins.
%prep
%setup -n bash-%version
%patch -p1
# Remove files which should be regenerated during build.
rm configure y.tab.? doc/*.info*
# Bundled texi2dvi is outdated.
install -pm755 /usr/bin/texi2dvi support/
# Fix builtins.1
{
sed -n '1,/^\.SH BASH BUILTIN COMMANDS/p' doc/builtins.1
sed -n '/^\.\\" start of bash_builtins/,/^\.\\" bash_builtins/p' doc/bash.1
sed -n '/^\.SH SEE ALSO/,$p' doc/builtins.1
} > builtins.1
mv builtins.1 doc/builtins.1
# Fix rbash.1
{
sed -n '1,/^\.SH RESTRICTED SHELL/p' doc/rbash.1
sed -n '/^\.\\" rbash\.1/,/^\.\\" end of rbash\.1/p' doc/bash.1
sed -n '/^\.SH SEE ALSO/,$p' doc/rbash.1
} > rbash.1
mv rbash.1 doc/rbash.1
th="$(sed '/^\.TH BASH 1[^"]*/!d;s///;q' doc/bash.1)"
sed -i "/^\\.TH /s/\".*/$th/" doc/builtins.1 doc/rbash.1
mv po/bash.pot po/%name.pot
%build
autoconf
export \
bash_cv_dev_fd=standard \
bash_cv_dev_stdin=present \
bash_cv_mail_dir=/var/mail \
bash_cv_termcap_lib=libc \
loadablesdir=%_libexecdir/%name \
%{?__buildreqs:bash_cv_must_reinstall_sighandlers=no} \
#
%define _configure_script ../configure
# Build sh.
mkdir build-sh
pushd build-sh
%configure \
--enable-glob-asciiranges-default \
--without-bash-malloc \
--disable-readline \
--disable-command-timing \
--disable-net-redirections \
--disable-help-builtin \
--disable-bang-history \
--disable-history \
--disable-progcomp \
--disable-restricted \
#
%make_build
popd
# Build bash.
mkdir build-bash
pushd build-bash
%configure \
--enable-glob-asciiranges-default \
--without-bash-malloc \
--with-installed-readline \
--disable-command-timing \
--disable-net-redirections \
--enable-separate-helpfiles \
#
%make_build
%make_build info
ln doc/*.info* ../doc/
popd
%install
%makeinstall -C build-bash \
loadablesdir=%buildroot%_libexecdir/%name
install -pD -m755 build-sh/bash %buildroot/bin/sh5
mv %buildroot%_bindir/bash %buildroot/bin/%name
# Make manpages for bash builtins as per suggestion in doc/README.
pushd doc
sed -e '
/^\.SH NAME/, /\\- bash built-in commands$/{
/^\.SH NAME/d
s/^bash, //
s/\\- bash built-in commands$//
s/,//g
b
}
d
' builtins.1 > man.pages
for f in $(cat man.pages); do
ln -s %{name}_builtins.1 %buildroot%_man1dir/%{name}_"$f".1
done
popd
ln -s %name %buildroot/bin/r%name
mv %buildroot%_bindir/{bash,%name}bug
mv %buildroot%_infodir/{bash,%name}.info
mv %buildroot%_man1dir/{bash,%name}.1
mv %buildroot%_man1dir/{bash,%name}bug.1
mv %buildroot%_man1dir/{bash,%name}_builtins.1
mv %buildroot%_man1dir/r{bash,%name}.1
ln -s %name.1 %buildroot%_man1dir/sh5.1
mv %buildroot%_pkgconfigdir/{bash,%name}.pc
# Include files for building custom builtins.
pushd build-bash
mkdir -p %buildroot%_includedir/%name
for f in ../examples/loadables/*.c; do
%__cc -MM -DHAVE_CONFIG_H -DSHELL -Iexamples/loadables -I. -I.. -I../lib -I../builtins -Ibuiltins -I../include "$f"
done |
tr -d '\:' |
tr -s '[:space:]' '\n' |
grep -F .h |
grep -Fv examples/loadables/ |
sort -u |
while read f; do
install -pm644 "$f" %buildroot%_includedir/%name/
done
popd
# Install additional headers required by bashdb.
for f in bashline.h input.h ; do
install -pm644 "$f" %buildroot%_includedir/%name/
done
# Prepare documentation.
%define docdir %_docdir/%name-%version
mkdir -p %buildroot%docdir/{html,ps,txt}
install -p -m644 \
AUTHORS CHANGES COMPAT NEWS NOTES POSIX RBASH doc/{FAQ,INTRO} \
%buildroot%docdir/
install -p -m644 doc/*.html %buildroot%docdir/html/
install -p -m644 doc/*.ps %buildroot%docdir/ps/
install -p -m644 doc/*.txt %buildroot%docdir/txt/
find %buildroot%docdir/{[A-Z],{ps,txt}/}* -type f -size +8k -print0 |
xargs -r0 xz -9 --
cp -a examples %buildroot%docdir/
find %buildroot%docdir/examples/ -type f -name 'Makefile*' -delete -print
cat >%buildroot%docdir/examples/loadables/Makefile <<'EOF'
CC = %__cc
CPPFLAGS = -DHAVE_CONFIG_H -I. -I%_includedir/bash
CFLAGS = %optflags_default %optflags_shared
LDFLAGS = -shared -Wl,-soname,$ at
%%.so: %%.c
$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $ at
EOF
rm %buildroot%_libexecdir/%name/Makefile.inc
rm -r %buildroot%_defaultdocdir/%name
%find_lang %name
%check
# These tests are almost useless because they always succeed.
make -k check -C build-sh
make -k check -C build-bash
%define _unpackaged_files_terminate_build 1
%files -n sh5
/bin/sh5
%dir %_libexecdir/%name
%files -f %name.lang
/bin/*%{name}*
%_bindir/*
%_libexecdir/%name/*
%exclude %_libexecdir/%name/*.h
%_datadir/%name
%_mandir/man?/*
%_infodir/*.info*
%dir %docdir
%docdir/[A-Z]*
%files doc
%dir %docdir
%docdir/html
%docdir/ps
%docdir/txt
%files examples
%dir %docdir
%docdir/examples
%files devel
%_includedir/*
%_pkgconfigdir/*
%_libexecdir/%name/*.h
%changelog
…
Todas as alterações você pod ver aqui