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
This commit is contained in:
DistroBaker 2021-03-28 01:25:15 +00:00
parent 15eae25f85
commit 4c6718029c

View File

@ -1,7 +1,7 @@
Summary: MirBSD enhanced version of the Korn Shell Summary: MirBSD enhanced version of the Korn Shell
Name: mksh Name: mksh
Version: 59c Version: 59c
Release: 2%{?dist} Release: 3%{?dist}
# BSD (setmode.c), ISC (strlcpy.c), MirOS (the rest) # BSD (setmode.c), ISC (strlcpy.c), MirOS (the rest)
License: MirOS and ISC and BSD License: MirOS and ISC and BSD
URL: https://www.mirbsd.org/mksh.htm URL: https://www.mirbsd.org/mksh.htm
@ -12,6 +12,9 @@ Conflicts: filesystem < 3
Provides: /bin/ksh Provides: /bin/ksh
Provides: /bin/lksh Provides: /bin/lksh
Provides: /bin/mksh Provides: /bin/mksh
%if 0%{?fedora} > 33 || 0%{?rhel} > 8
Provides: /bin/rksh
%endif
Provides: /bin/rlksh Provides: /bin/rlksh
Provides: /bin/rmksh Provides: /bin/rmksh
Requires(post): grep 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 lksh $RPM_BUILD_ROOT%{_bindir}/rlksh
ln -s %{name}.1 $RPM_BUILD_ROOT%{_mandir}/man1/rmksh.1 ln -s %{name}.1 $RPM_BUILD_ROOT%{_mandir}/man1/rmksh.1
ln -s lksh.1 $RPM_BUILD_ROOT%{_mandir}/man1/rlksh.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} touch $RPM_BUILD_ROOT{%{_bindir}/ksh,%{_mandir}/man1/ksh.1}
%endif
%check %check
./mksh rtchecks >rtchecks.got 2>&1 ./mksh rtchecks >rtchecks.got 2>&1
@ -108,30 +115,45 @@ do
done done
%post %post
grep -q "^/bin/%{name}$" %{_sysconfdir}/shells 2>/dev/null || \ for d in /bin %{_bindir}; do
echo "/bin/%{name}" >> %{_sysconfdir}/shells %if 0%{?fedora} > 33 || 0%{?rhel} > 8
grep -q "^%{_bindir}/%{name}$" %{_sysconfdir}/shells 2>/dev/null || \ for s in ksh %{name} rksh rmksh; do
echo "%{_bindir}/%{name}" >> %{_sysconfdir}/shells %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 \ %{_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 %preun
if [ $1 = 0 ]; then if [ $1 -eq 0 ]; then
%{_sbindir}/alternatives --remove ksh %{_bindir}/%{name} %{_sbindir}/alternatives --remove ksh %{_bindir}/%{name}
fi fi
%postun %postun
if [ ! -x %{_bindir}/%{name} ]; then for d in /bin %{_bindir}; do
sed -e 's@^/bin/%{name}$@POSTUNREMOVE@' -e '/^POSTUNREMOVE$/d' -i %{_sysconfdir}/shells for s in ksh %{name} rksh rmksh; do
sed -e 's@^%{_bindir}/%{name}$@POSTUNREMOVE@' -e '/^POSTUNREMOVE$/d' -i %{_sysconfdir}/shells [ ! -x "$d/$s" ] && sed -e 's@^'"$d/$s"'$@POSTUNREMOVE@' -e '/^POSTUNREMOVE$/d' -i %{_sysconfdir}/shells
fi done
done
%files %files
%doc dot.mkshrc FAQ.htm %doc dot.mkshrc FAQ.htm
%ghost %{_bindir}/ksh %ghost %{_bindir}/ksh
%{_bindir}/lksh %{_bindir}/lksh
%{_bindir}/%{name} %{_bindir}/%{name}
%if 0%{?fedora} > 33 || 0%{?rhel} > 8
%ghost %{_bindir}/rksh
%endif
%{_bindir}/rlksh %{_bindir}/rlksh
%{_bindir}/rmksh %{_bindir}/rmksh
%config(noreplace) %{_sysconfdir}/mkshrc %config(noreplace) %{_sysconfdir}/mkshrc
@ -139,10 +161,16 @@ fi
%ghost %{_mandir}/man1/ksh.1* %ghost %{_mandir}/man1/ksh.1*
%{_mandir}/man1/lksh.1* %{_mandir}/man1/lksh.1*
%{_mandir}/man1/%{name}.1* %{_mandir}/man1/%{name}.1*
%if 0%{?fedora} > 33 || 0%{?rhel} > 8
%ghost %{_mandir}/man1/rksh.1*
%endif
%{_mandir}/man1/rlksh.1* %{_mandir}/man1/rlksh.1*
%{_mandir}/man1/rmksh.1* %{_mandir}/man1/rmksh.1*
%changelog %changelog
* Wed Mar 24 2021 Robert Scheck <robert@fedoraproject.org> 59c-3
- Add alternatives switching for rksh
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 59c-2 * Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 59c-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild