Dominique Leuenberger 2022-10-27 11:53:55 +00:00 committed by Git OBS Bridge
commit f527adce5b
2 changed files with 44 additions and 16 deletions

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Sat Oct 22 05:22:28 UTC 2022 - Luciano Santos <luc14n0@opensuse.org>
- Add zsh-sh subpackage to offer Zsh users a "native" way to handle
/bin/sh scripts and use an SH shell with the capabilities of Zsh
itself to emulate a Bourne shell. An 'sh' symlink pointing to the
Zsh binary is all that is needed for it to emulate the Bourne
shell, it is similar to the use of `emulate sh` Zsh's built-in
command or the `zsh --emulate sh` shell command.
- Drop deprecated use of install_info(_delete) post(un) macros. RPM
file triggers have replaced their functionality since 2019.
-------------------------------------------------------------------
Mon Sep 12 13:03:37 UTC 2022 - Dirk Müller <dmueller@suse.com>

View File

@ -95,6 +95,17 @@ mechanism, and more.
This package contains the Zsh manual in HTML format.
%package sh
Summary: Handle behaviour of /bin/sh
Group: System/Shells
Requires: zsh = %{version}
Conflicts: alternative(sh)
Provides: alternative(sh)
BuildArch: noarch
%description sh
Use zsh as /bin/sh implementation.
%prep
%setup -q
%if 0%{?suse_version}
@ -192,6 +203,13 @@ rm -f %{buildroot}/%{_infodir}/dir
%fdupes %{buildroot}
%endif
#
# Create the symlink required for zsh-sh to handle /bin/sh
#
%if 0%{?suse_version}
ln -s %{_bindir}/zsh %{buildroot}%{_bindir}/sh
%endif
%check
%if ! 0%{?qemu_user_space_build}
%if 0%{?suse_version}
@ -211,9 +229,7 @@ mv Test/E01options.ztst Test/E01options.ztst.mvd
%endif
%preun
%if 0%{?suse_version}
:
%else
%if ! 0%{?suse_version}
if [ "$1" = 0 ] ; then
/sbin/install-info --delete %{_infodir}/zsh.info.gz %{_infodir}/dir \
--entry="* zsh: (zsh). An enhanced bourne shell."
@ -221,23 +237,20 @@ mv Test/E01options.ztst Test/E01options.ztst.mvd
%endif
%post
%if 0%{?suse_version}
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%else
if [ ! -f %{_sysconfdir}/shells ]; then
echo "%{_bindir}/zsh" > %{_sysconfdir}/shells
else
grep -q "^%{_bindir}/zsh$" %{_sysconfdir}/shells || echo "%{_bindir}/zsh" >> %{_sysconfdir}/shells
fi
%if ! 0%{?suse_version}
if [ ! -f %{_sysconfdir}/shells ]; then
echo "%{_bindir}/zsh" > %{_sysconfdir}/shells
else
grep -q "^%{_bindir}/zsh$" %{_sysconfdir}/shells \
|| echo "%{_bindir}/zsh" >> %{_sysconfdir}/shells
fi
/sbin/install-info %{_infodir}/zsh.info.gz %{_infodir}/dir \
--entry="* zsh: (zsh). An enhanced bourne shell."
/sbin/install-info %{_infodir}/zsh.info.gz %{_infodir}/dir \
--entry="* zsh: (zsh). An enhanced bourne shell."
%endif
%postun
%if 0%{?suse_version}
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%else
%if ! 0%{?suse_version}
if [ "$1" = 0 ] ; then
if [ -f %{_sysconfdir}/shells ] ; then
TmpFile=`%{_bindir}/mktemp /tmp/.zshrpmXXXXXX`
@ -279,4 +292,7 @@ fi
%files htmldoc
%doc Doc/htmldoc/*
%files sh
%{_bindir}/sh
%changelog