Add alternatives switching for rksh

This commit is contained in:
Vincent Mihalkovic 2021-02-25 14:05:12 +01:00
parent f70b6dd42a
commit c1114c08a7

View File

@ -7,7 +7,7 @@ URL: http://www.kornshell.com/
License: EPL License: EPL
Epoch: 2 Epoch: 2
Version: %{releasedate} Version: %{releasedate}
Release: 253%{?dist} Release: 254%{?dist}
Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{release_date}.tgz Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{release_date}.tgz
Source1: http://www.research.att.com/~gsf/download/tgz/INIT.%{release_date}.tgz Source1: http://www.research.att.com/~gsf/download/tgz/INIT.%{release_date}.tgz
Source2: kshcomp.conf Source2: kshcomp.conf
@ -274,11 +274,12 @@ install -p -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/skel/.kshrc
install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/kshrc install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/kshrc
install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/binfmt.d/kshcomp.conf install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/binfmt.d/kshcomp.conf
ln -s %{_bindir}/ksh93 %{buildroot}/%{_bindir}/rksh
touch %{buildroot}%{_bindir}/ksh touch %{buildroot}%{_bindir}/ksh
touch %{buildroot}%{_mandir}/man1/ksh.1.gz touch %{buildroot}%{_mandir}/man1/ksh.1.gz
touch %{buildroot}%{_bindir}/rksh
touch %{buildroot}%{_mandir}/man1/rksh.1.gz
%check %check
[ -f ./skipcheck -o -f ./../skipcheck ] && exit 0 ||: [ -f ./skipcheck -o -f ./../skipcheck ] && exit 0 ||:
%if 0%{?rhel} > 6 %if 0%{?rhel} > 6
@ -307,20 +308,23 @@ then
fi fi
%post %post
if [ ! -f /etc/shells ]; then for s in /bin/ksh /bin/rksh /usr/bin/ksh /usr/bin/rksh
echo "/bin/ksh" > /etc/shells do
echo "/usr/bin/ksh" >> /etc/shells if [ ! -f /etc/shells ]; then
else echo "$s" > /etc/shells
if ! grep -q '^/bin/ksh$' /etc/shells ; then else
echo "/bin/ksh" >> /etc/shells if ! grep -q '^'"$s"'$' /etc/shells ; then
echo "$s" >> /etc/shells
fi fi
if ! grep -q '^/usr/bin/ksh$' /etc/shells ; then fi
echo "/usr/bin/ksh" >> /etc/shells done
fi
fi
%{_sbindir}/alternatives --install %{_bindir}/ksh ksh \ %{_sbindir}/alternatives --install %{_bindir}/ksh ksh \
%{_bindir}/ksh93 50 \ %{_bindir}/ksh93 50 \
--slave %{_bindir}/rksh rksh \
%{_bindir}/ksh93 \
--slave %{_mandir}/man1/rksh.1.gz ksh-man \
%{_mandir}/man1/ksh93.1.gz \
--slave %{_mandir}/man1/ksh.1.gz ksh-man \ --slave %{_mandir}/man1/ksh.1.gz ksh-man \
%{_mandir}/man1/ksh93.1.gz %{_mandir}/man1/ksh93.1.gz
@ -335,12 +339,12 @@ fi
/bin/systemctl try-restart systemd-binfmt.service >/dev/null 2>&1 || : /bin/systemctl try-restart systemd-binfmt.service >/dev/null 2>&1 || :
%postun %postun
if [ ! -f /bin/ksh ]; then for s in /bin/ksh /bin/rksh /usr/bin/ksh /usr/bin/rksh
sed -i '/^\/bin\/ksh$/ d' /etc/shells do
fi if [ ! -f $s ]; then
if [ ! -f /usr/bin/ksh ]; then sed -i '\|^'"$s"'$|d' /etc/shells
sed -i '/^\/usr\/bin\/ksh$/ d' /etc/shells fi
fi done
%preun %preun
if [ $1 = 0 ]; then if [ $1 = 0 ]; then
@ -361,15 +365,20 @@ fi
# LICENSE file is missing, temporarily? # LICENSE file is missing, temporarily?
%{_bindir}/ksh93 %{_bindir}/ksh93
%ghost %{_bindir}/ksh %ghost %{_bindir}/ksh
%{_bindir}/rksh %ghost %{_bindir}/rksh
%{_bindir}/shcomp %{_bindir}/shcomp
%{_mandir}/man1/* %{_mandir}/man1/*
%ghost %{_mandir}/man1/ksh.1.gz %ghost %{_mandir}/man1/ksh.1.gz
%ghost %{_mandir}/man1/rksh.1.gz
%config(noreplace) %{_sysconfdir}/skel/.kshrc %config(noreplace) %{_sysconfdir}/skel/.kshrc
%config(noreplace) %{_sysconfdir}/kshrc %config(noreplace) %{_sysconfdir}/kshrc
%config(noreplace) %{_sysconfdir}/binfmt.d/kshcomp.conf %config(noreplace) %{_sysconfdir}/binfmt.d/kshcomp.conf
%changelog %changelog
* Tue Feb 23 2021 Vincent Mihalkovic <vmihalko@redhat.com> - 2:20120801-253
- Add alternatives switching for rksh
Resolves #1893919
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2:20120801-253 * Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2:20120801-253
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild