From a70a866590f454ff4135bc8d4d133a37d331cca8bc6b497954ad5120f4636710 Mon Sep 17 00:00:00 2001 From: Paolo Perego Date: Tue, 25 Oct 2022 12:44:01 +0000 Subject: [PATCH] Accepting request 1030729 from home:luc14n0:branches:shells Add zsh-sh subpackage. OBS-URL: https://build.opensuse.org/request/show/1030729 OBS-URL: https://build.opensuse.org/package/show/shells/zsh?expand=0&rev=238 --- zsh.changes | 12 ++++++++++++ zsh.spec | 48 ++++++++++++++++++++++++++++++++---------------- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/zsh.changes b/zsh.changes index fcd04ac..bf2ff3d 100644 --- a/zsh.changes +++ b/zsh.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Sat Oct 22 05:22:28 UTC 2022 - Luciano Santos + +- 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 diff --git a/zsh.spec b/zsh.spec index bb370ab..e932e28 100644 --- a/zsh.spec +++ b/zsh.spec @@ -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