185 lines
5.4 KiB
RPMSpec
185 lines
5.4 KiB
RPMSpec
Name: ksh
|
|
Version: 1.0.8
|
|
Release: 1
|
|
Summary: The Original ATT Korn Shell
|
|
License: EPL-2.0
|
|
URL: http://www.kornshell.com/
|
|
Epoch: 2
|
|
Source0: https://github.com/ksh93/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
|
|
Source1: kshcomp.conf
|
|
Source2: kshrc.rhs
|
|
Source3: dotkshrc
|
|
|
|
Patch9000: skip-some-test.patch
|
|
|
|
Provides: /bin/ksh /bin/rksh
|
|
BuildRequires: gcc bison glibc-langpack-ja ncurses procps tzdata util-linux
|
|
Conflicts: pdksh
|
|
Requires: coreutils, diffutils
|
|
Requires(post): grep, coreutils, systemd, chkconfig
|
|
Requires(preun): chkconfig
|
|
Requires(postun): sed
|
|
Provides: ksh-help = %{epoch}:%{version}-%{release}
|
|
Obsoletes: ksh-help < %{epoch}:%{version}-%{release}
|
|
|
|
%description
|
|
KSH-93 is the most recent version of the KornShell by David Korn of AT&T Bell Laboratories.
|
|
KornShell is a shell programming language, which is upward compatible with "sh" (the Bourne Shell).
|
|
|
|
%prep
|
|
%autosetup -p1
|
|
|
|
%build
|
|
XTRAFLAGS=""
|
|
for f in -Wno-unknown-pragmas -Wno-missing-braces -Wno-unused-result -Wno-return-type -Wno-int-to-pointer-cast -Wno-parentheses -Wno-unused -Wno-unused-but-set-variable -Wno-cpp -Wno-maybe-uninitialized -Wno-lto-type-mismatch
|
|
do
|
|
$CC $f -E - </dev/null >/dev/null 2>&1 && XTRAFLAGS="$XTRAFLAGS $f"
|
|
done
|
|
export CCFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing $XTRAFLAGS"
|
|
export LDFLAGS="$RPM_LD_FLAGS"
|
|
bin/package make
|
|
|
|
%install
|
|
mkdir -p %{buildroot}{%{_bindir},%{_mandir}/man1}
|
|
install -p -m 755 arch/*/bin/ksh %{buildroot}%{_bindir}/ksh93
|
|
install -p -m 755 arch/*/bin/shcomp %{buildroot}%{_bindir}/shcomp
|
|
install -p -m 644 arch/*/man/man1/sh.1 %{buildroot}%{_mandir}/man1/ksh93.1
|
|
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/binfmt.d/kshcomp.conf
|
|
install -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/kshrc
|
|
install -p -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/skel/.kshrc
|
|
|
|
touch %{buildroot}%{_bindir}/ksh
|
|
touch %{buildroot}%{_mandir}/man1/ksh.1.gz
|
|
|
|
touch %{buildroot}%{_bindir}/rksh
|
|
touch %{buildroot}%{_mandir}/man1/rksh.1.gz
|
|
|
|
%check
|
|
script -q -e -c "bin/package test"
|
|
|
|
%post
|
|
for s in /bin/ksh /bin/rksh /usr/bin/ksh /usr/bin/rksh
|
|
do
|
|
if [ ! -f /etc/shells ]; then
|
|
echo "$s" > /etc/shells
|
|
else
|
|
if ! grep -q '^'"$s"'$' /etc/shells ; then
|
|
echo "$s" >> /etc/shells
|
|
fi
|
|
fi
|
|
done
|
|
|
|
/bin/systemctl try-restart systemd-binfmt.service >/dev/null 2>&1 || :
|
|
|
|
%{_sbindir}/alternatives --install %{_bindir}/ksh ksh \
|
|
%{_bindir}/ksh93 50 \
|
|
--slave %{_bindir}/rksh rksh \
|
|
%{_bindir}/ksh93 \
|
|
--slave %{_mandir}/man1/rksh.1.gz rksh-man \
|
|
%{_mandir}/man1/ksh93.1.gz \
|
|
--slave %{_mandir}/man1/ksh.1.gz ksh-man \
|
|
%{_mandir}/man1/ksh93.1.gz
|
|
|
|
if [ ! -L %{_bindir}/ksh ]; then
|
|
%{_sbindir}/alternatives --auto ksh
|
|
ln -sf /etc/alternatives/ksh %{_bindir}/ksh
|
|
ln -sf /etc/alternatives/ksh-man %{_mandir}/man1/ksh.1.gz
|
|
fi
|
|
|
|
%preun
|
|
if [ $1 = 0 ]; then
|
|
%{_sbindir}/alternatives --remove ksh %{_bindir}/ksh93
|
|
fi
|
|
|
|
%postun
|
|
for s in /bin/ksh /bin/rksh /usr/bin/ksh /usr/bin/rksh
|
|
do
|
|
if [ ! -f $s ]; then
|
|
sed -i '\|^'"$s"'$|d' /etc/shells
|
|
fi
|
|
done
|
|
|
|
%files
|
|
%doc src/cmd/ksh93/{COMPATIBILITY,RELEASE,TYPES,README}
|
|
%doc README.md NEWS
|
|
%license LICENSE.md
|
|
%{_bindir}/ksh93
|
|
%ghost %{_bindir}/ksh
|
|
%ghost %{_bindir}/rksh
|
|
%{_bindir}/shcomp
|
|
%{_mandir}/man1/ksh93.1*
|
|
%ghost %{_mandir}/man1/ksh.1*
|
|
%ghost %{_mandir}/man1/rksh.1*
|
|
%config(noreplace) %{_sysconfdir}/skel/.kshrc
|
|
%config(noreplace) %{_sysconfdir}/kshrc
|
|
%config(noreplace) %{_sysconfdir}/binfmt.d/kshcomp.conf
|
|
|
|
%changelog
|
|
* Mon Feb 5 2024 wangyuhang <wangyuhang27@huawei.com> - 2:1.0.8-1
|
|
- Type:bugfix
|
|
- CVE:NA
|
|
- SUG:NA
|
|
- DESC:due to the upstream community no longer maintaining the previous version,
|
|
we have rolled back to the stable branch and switched to an active code repository.
|
|
new upstream release and update version to 1.0.8
|
|
|
|
* Tue Dec 6 2022 wangyuhang <wangyuhang27@huawei.com> - 1:2020.0.0-11
|
|
- Type:bugfix
|
|
- CVE:NA
|
|
- SUG:NA
|
|
- DESC:change patch name
|
|
|
|
* Sat Aug 27 2022 shixuantong <shixuantong@h-partners.com> - 1:2020.0.0-10
|
|
- Type:bugfix
|
|
- CVE:NA
|
|
- SUG:NA
|
|
- DESC:Change default build type to "minsize"
|
|
|
|
* Thu Jun 30 2022 wangjiang <wangjiang37@h-partners.com> - 1:2020.0.0-9
|
|
- Type:bugfix
|
|
- CVE:NA
|
|
- SUG:NA
|
|
- DESC:fix backport-Fix-hist_nearend.patch
|
|
backport-functions-with-not-loaded-autoloaded-functions.patch
|
|
backport-Fix-interactive-restricted-shell-behavior.patch
|
|
|
|
* Wed Apr 13 2022 renhongxun <renhongxun@h-partners.com> - 1:2020.0.0-8
|
|
- Type:bugfix
|
|
- ID:NA
|
|
- SUG:NA
|
|
- DESC:udpate license
|
|
|
|
* Tue Mar 15 2022 renhongxun <renhongxun@h-partners.com> - 1:2020.0.0-7
|
|
- Type:bugfix
|
|
- ID:NA
|
|
- SUG:NA
|
|
- DESC:fix buildin path not found
|
|
|
|
* Thu Mar 10 2022 wangjiang <wangjiang37@h-partners.com> - 1:2020.0.0-6
|
|
- Type:enhancement
|
|
- ID:NA
|
|
- SUG:NA
|
|
- DESC:enable check
|
|
|
|
* Fri Dec 25 2020 Liquor <lirui130@huawei.com> - 1:2020.0.0-5
|
|
- Type:bugfix
|
|
- ID:NA
|
|
- SUG:NA
|
|
- DESC:add package ksh-help to package ksh
|
|
|
|
* Tue Aug 4 2020 zhangxingliang <zhangxingliang3@huawei.com> - 1:2020.0.0-4
|
|
- Type:enhancement
|
|
- ID:NA
|
|
- SUG:NA
|
|
- DESC:update to stable release version 2020.0.0
|
|
|
|
* Tue Apr 21 2020 openEuler Buildteam <buildteam@openeuler.org> - 1:2020.0.0-3
|
|
- Type:cves
|
|
- ID:CVE-2019-14868
|
|
- SUG:restart
|
|
- DESC:fix CVE-2019-14868
|
|
|
|
* Fri Jan 10 2020 Lijin Yang <yanglijin@huawei.com> - 1:2020.0.0-2
|
|
- Package init
|
|
|