From 59f3a6a56d89f67d8f53746c1212ac1d8dc25639 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 13 Mar 2019 09:47:48 +0000 Subject: [PATCH] Accepting request 684575 from openSUSE:Factory This is what was lost in Base:System due to the revert of bash in openSUSE:Factory See https://bugzilla.opensuse.org/show_bug.cgi?id=1129036 It is up to you to decide what to do with it - but at least in its current form, it is not working (install cycle with u-a/bash, detailed in the bug) At least the non-/bin/sh related changes, like the patches, are certainly still wanted though. - Update temporary patch from upstream to make sed testsuite work again - Requires(postun) -> Requires(preun) - Do not link /bin/sh as slave alternative to /usr/bin/sh - Add temporary patch from upstream to fix boo#1127700 - Refine and harden update-alternatives work flow - Move header and Makefile from bash-loadables to bash-devel - Make update-alternatives work flawless - Put "sh" under control of update-alternatives OBS-URL: https://build.opensuse.org/request/show/684575 OBS-URL: https://build.opensuse.org/package/show/Base:System/bash?expand=0&rev=286 --- bash-5.0-patches.tar.bz2 | 4 +- bash.changes | 37 +++++++++++++++++ bash.spec | 87 ++++++++++++++++++++++++---------------- 3 files changed, 91 insertions(+), 37 deletions(-) diff --git a/bash-5.0-patches.tar.bz2 b/bash-5.0-patches.tar.bz2 index 631ed5a1..e9c58eec 100644 --- a/bash-5.0-patches.tar.bz2 +++ b/bash-5.0-patches.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:451e4caf69166071183ad310964137ff0a239119bda68db692727bd9088338ec -size 2852 +oid sha256:33cf9f650dd932d8a2fdf23073741d7e2b2816b6d396fa7190fcfefa5d034315 +size 4261 diff --git a/bash.changes b/bash.changes index 4e0714ca..6e0ce813 100644 --- a/bash.changes +++ b/bash.changes @@ -1,3 +1,40 @@ +------------------------------------------------------------------- +Mon Mar 11 07:20:37 UTC 2019 - Dr. Werner Fink + +- Update temporary patch from upstream to make sed testsuite + work again + +------------------------------------------------------------------- +Wed Mar 6 11:06:10 UTC 2019 - Dr. Werner Fink + +- Requires(postun) -> Requires(preun) + +------------------------------------------------------------------- +Tue Mar 5 12:04:07 UTC 2019 - Dr. Werner Fink + +- Do not link /bin/sh as slave alternative to /usr/bin/sh + +------------------------------------------------------------------- +Mon Mar 4 14:30:38 UTC 2019 - Dr. Werner Fink + +- Add temporary patch from upstream to fix boo#1127700 + +------------------------------------------------------------------- +Mon Mar 4 10:14:12 UTC 2019 - Dr. Werner Fink + +- Refine and harden update-alternatives work flow +- Move header and Makefile from bash-loadables to bash-devel + +------------------------------------------------------------------- +Fri Mar 1 14:01:16 UTC 2019 - Dr. Werner Fink + +- Make update-alternatives work flawless + +------------------------------------------------------------------- +Fri Feb 8 10:30:17 UTC 2019 - Jan Engelhardt + +- Put "sh" under control of update-alternatives + ------------------------------------------------------------------- Thu Feb 7 15:06:12 UTC 2019 - Dr. Werner Fink diff --git a/bash.spec b/bash.spec index 12059c64..4fa94d44 100644 --- a/bash.spec +++ b/bash.spec @@ -20,18 +20,6 @@ %bcond_with sjis Name: bash -BuildRequires: audit-devel -BuildRequires: autoconf -BuildRequires: bison -BuildRequires: fdupes -BuildRequires: makeinfo -BuildRequires: ncurses-devel -BuildRequires: patchutils -BuildRequires: pkg-config -# This has to be always the same version as included in the bash its self -BuildRequires: readline-devel == 8.0 -BuildRequires: screen -BuildRequires: sed %define bextend %nil Version: 5.0 Release: 0 @@ -84,6 +72,21 @@ Patch47: bash-4.3-perl522.patch Patch48: bash-4.3-extra-import-func.patch # PATCH-EXTEND-SUSE Allow root to clean file system if filled up Patch49: bash-4.3-pathtemp.patch +BuildRequires: audit-devel +BuildRequires: autoconf +BuildRequires: bison +BuildRequires: fdupes +BuildRequires: makeinfo +BuildRequires: ncurses-devel +BuildRequires: patchutils +BuildRequires: pkg-config +# This has to be always the same version as included in the bash its self +BuildRequires: readline-devel == 8.0 +BuildRequires: screen +BuildRequires: sed +BuildRequires: update-alternatives +Requires(post): update-alternatives +Requires(preun): update-alternatives %global _sysconfdir /etc %global _incdir %{_includedir} %global _ldldir /%{_lib}/bash @@ -126,8 +129,8 @@ Group: Development/Languages/C and C++ %description devel This package contains the C header files for writing loadable new -builtins for the interpreter Bash. Use -I /usr/include/bash/ -on the compilers command line. +builtins for the interpreter Bash. Use the output of the command +`pkg-config bash --cflags' on the compilers command line. %package loadables Summary: Loadable bash builtins @@ -433,19 +436,24 @@ test ${rl1[2]} = ${rl2[2]} || exit 1 %install %make_install make -C examples/loadables/ install-supported DESTDIR=%{buildroot} libdir=/%{_lib} + mv -vf %{buildroot}%{_ldldir}/*.h %{buildroot}%{_includedir}/bash/ + mv -vf %{buildroot}%{_ldldir}/*.inc %{buildroot}%{_datadir}/bash rm -rf %{buildroot}%{_libdir}/bash rm -rf %{buildroot}/%{_lib}/pkgconfig sed -ri '/CC = gcc/s@(CC = gcc).*@\1@' %{buildroot}%{_libdir}/pkgconfig/bash.pc mkdir -p %{buildroot}/bin - mv %{buildroot}%{_bindir}/bash %{buildroot}/bin/ -%if %_minsh - install sh %{buildroot}/bin/sh - ln -sf ../../bin/sh %{buildroot}%{_bindir}/sh -%else - ln -sf bash %{buildroot}/bin/sh - ln -sf ../../bin/bash %{buildroot}%{_bindir}/sh -%endif - ln -sf ../../bin/bash %{buildroot}%{_bindir}/rbash + mkdir -p %{buildroot}%{_sysconfdir}/alternatives +# +# It should be noted that the move of /bin/bash to /usr/bin/bash +# had NOT done by me at 2019/02/08. Now only a symbolic link +# remains here :( +# The same had happen for the system POSIX shell /bin/sh +# + ln -sf %{_bindir}/bash %{buildroot}%{_sysconfdir}/alternatives/sh + ln -sf %{_bindir}/bash %{buildroot}/bin/bash + ln -sf %{_bindir}/sh %{buildroot}/bin/sh + ln -sf bash %{buildroot}%{_bindir}/rbash + ln -sf bash %{buildroot}%{_bindir}/sh install -m 644 COMPAT NEWS %{buildroot}%{_docdir}/%{name} install -m 644 COPYING %{buildroot}%{_docdir}/%{name} install -m 644 doc/FAQ %{buildroot}%{_docdir}/%{name} @@ -482,6 +490,15 @@ EOF %find_lang bash %fdupes -s %{buildroot}%{_datadir}/bash/helpfiles +%post -p /bin/bash +%{_sbindir}/update-alternatives --quiet --force \ + --install %{_bindir}/sh sh %{_bindir}/bash 10100 + +%preun -p /bin/bash +if test "$1" = 0; then + %{_sbindir}/update-alternatives --quiet --remove sh %{_bindir}/bash +fi + %post doc %install_info --info-dir=%{_infodir} %{_infodir}/bash.info.gz @@ -491,7 +508,7 @@ EOF %clean LD_LIBRARY_PATH=%{buildroot}/%{_lib} \ ldd -u -r %{buildroot}/bin/bash || true -%{?buildroot: %{__rm} -rf %{buildroot}} +%{?buildroot: %__rm -rf %{buildroot}} %files %defattr(-,root,root) @@ -499,12 +516,14 @@ ldd -u -r %{buildroot}/bin/bash || true %config %attr(600,root,root) %{_sysconfdir}/skel/.bash_history %config %attr(644,root,root) %{_sysconfdir}/skel/.bashrc %config %attr(644,root,root) %{_sysconfdir}/skel/.profile +%ghost %config %{_sysconfdir}/alternatives/sh +%dir %{_sysconfdir}/bash_completion.d /bin/bash /bin/sh -%dir %{_sysconfdir}/bash_completion.d +%{_bindir}/bash %{_bindir}/bashbug %{_bindir}/rbash -%{_bindir}/sh +%verify(not link mtime) %{_bindir}/sh %dir %{_datadir}/bash %dir %{_datadir}/bash/helpfiles %{_datadir}/bash/helpfiles/* @@ -521,18 +540,16 @@ ldd -u -r %{buildroot}/bin/bash || true %doc %{_mandir}/man1/rbash.1* %doc %{_docdir}/%{name} -%if 0%suse_version >= 1020 %files devel %defattr(-,root,root) -%dir /%{_includedir}/bash/ -%dir /%{_includedir}/bash/ -%dir /%{_includedir}/bash/builtins/ -%dir /%{_includedir}/bash/include/ -/%{_incdir}/bash/*.h -/%{_incdir}/bash/builtins/*.h -/%{_incdir}/bash/include/*.h +%dir %{_includedir}/bash/ +%dir %{_includedir}/bash/builtins/ +%dir %{_includedir}/bash/include/ +%{_incdir}/bash/*.h +%{_incdir}/bash/builtins/*.h +%{_incdir}/bash/include/*.h %{_libdir}/pkgconfig/bash.pc -%endif +%{_datadir}/bash/*.inc %files loadables %defattr(-,root,root)