From 4c6718029c6669db24226beb7e026a8e31a4af21 Mon Sep 17 00:00:00 2001 From: DistroBaker Date: Sun, 28 Mar 2021 01:25:15 +0000 Subject: [PATCH] Merged update from upstream sources This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/mksh.git#1ac01888485ba773f3db4a4b247f1f67b4c71eef --- mksh.spec | 50 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/mksh.spec b/mksh.spec index fd829f6..b8648a5 100644 --- a/mksh.spec +++ b/mksh.spec @@ -1,7 +1,7 @@ Summary: MirBSD enhanced version of the Korn Shell Name: mksh Version: 59c -Release: 2%{?dist} +Release: 3%{?dist} # BSD (setmode.c), ISC (strlcpy.c), MirOS (the rest) License: MirOS and ISC and BSD URL: https://www.mirbsd.org/mksh.htm @@ -12,6 +12,9 @@ Conflicts: filesystem < 3 Provides: /bin/ksh Provides: /bin/lksh Provides: /bin/mksh +%if 0%{?fedora} > 33 || 0%{?rhel} > 8 +Provides: /bin/rksh +%endif Provides: /bin/rlksh Provides: /bin/rmksh Requires(post): grep @@ -84,7 +87,11 @@ ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/rmksh ln -s lksh $RPM_BUILD_ROOT%{_bindir}/rlksh ln -s %{name}.1 $RPM_BUILD_ROOT%{_mandir}/man1/rmksh.1 ln -s lksh.1 $RPM_BUILD_ROOT%{_mandir}/man1/rlksh.1 +%if 0%{?fedora} > 33 || 0%{?rhel} > 8 +touch $RPM_BUILD_ROOT{%{_bindir}/{ksh,rksh},%{_mandir}/man1/{ksh,rksh}.1} +%else touch $RPM_BUILD_ROOT{%{_bindir}/ksh,%{_mandir}/man1/ksh.1} +%endif %check ./mksh rtchecks >rtchecks.got 2>&1 @@ -108,30 +115,45 @@ do done %post -grep -q "^/bin/%{name}$" %{_sysconfdir}/shells 2>/dev/null || \ - echo "/bin/%{name}" >> %{_sysconfdir}/shells -grep -q "^%{_bindir}/%{name}$" %{_sysconfdir}/shells 2>/dev/null || \ - echo "%{_bindir}/%{name}" >> %{_sysconfdir}/shells +for d in /bin %{_bindir}; do +%if 0%{?fedora} > 33 || 0%{?rhel} > 8 + for s in ksh %{name} rksh rmksh; do +%else + for s in ksh %{name} rmksh; do +%endif + grep -q '^'"$d/$s"'$' %{_sysconfdir}/shells 2>/dev/null || echo "$d/$s" >> /etc/shells + done +done %{_sbindir}/alternatives --install %{_bindir}/ksh ksh %{_bindir}/%{name} 10 \ - --slave %{_mandir}/man1/ksh.1.gz ksh-man %{_mandir}/man1/%{name}.1.gz +%if 0%{?fedora} > 33 || 0%{?rhel} > 8 + --slave %{_bindir}/rksh rksh %{_bindir}/%{name} \ +%endif + --slave %{_mandir}/man1/ksh.1.gz ksh-man %{_mandir}/man1/%{name}.1.gz \ +%if 0%{?fedora} > 33 || 0%{?rhel} > 8 + --slave %{_mandir}/man1/rksh.1.gz rksh-man %{_mandir}/man1/%{name}.1.gz +%endif %preun -if [ $1 = 0 ]; then +if [ $1 -eq 0 ]; then %{_sbindir}/alternatives --remove ksh %{_bindir}/%{name} fi %postun -if [ ! -x %{_bindir}/%{name} ]; then - sed -e 's@^/bin/%{name}$@POSTUNREMOVE@' -e '/^POSTUNREMOVE$/d' -i %{_sysconfdir}/shells - sed -e 's@^%{_bindir}/%{name}$@POSTUNREMOVE@' -e '/^POSTUNREMOVE$/d' -i %{_sysconfdir}/shells -fi +for d in /bin %{_bindir}; do + for s in ksh %{name} rksh rmksh; do + [ ! -x "$d/$s" ] && sed -e 's@^'"$d/$s"'$@POSTUNREMOVE@' -e '/^POSTUNREMOVE$/d' -i %{_sysconfdir}/shells + done +done %files %doc dot.mkshrc FAQ.htm %ghost %{_bindir}/ksh %{_bindir}/lksh %{_bindir}/%{name} +%if 0%{?fedora} > 33 || 0%{?rhel} > 8 +%ghost %{_bindir}/rksh +%endif %{_bindir}/rlksh %{_bindir}/rmksh %config(noreplace) %{_sysconfdir}/mkshrc @@ -139,10 +161,16 @@ fi %ghost %{_mandir}/man1/ksh.1* %{_mandir}/man1/lksh.1* %{_mandir}/man1/%{name}.1* +%if 0%{?fedora} > 33 || 0%{?rhel} > 8 +%ghost %{_mandir}/man1/rksh.1* +%endif %{_mandir}/man1/rlksh.1* %{_mandir}/man1/rmksh.1* %changelog +* Wed Mar 24 2021 Robert Scheck 59c-3 +- Add alternatives switching for rksh + * Tue Jan 26 2021 Fedora Release Engineering - 59c-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild