ksh/ksh.spec

185 lines
5.4 KiB
RPMSpec
Raw Permalink Normal View History

2020-01-13 11:25:18 +08:00
Name: ksh
Version: 1.0.8
Release: 1
2020-01-13 11:25:18 +08:00
Summary: The Original ATT Korn Shell
License: EPL-2.0
2020-01-13 11:25:18 +08:00
URL: http://www.kornshell.com/
Epoch: 2
Source0: https://github.com/ksh93/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
2020-01-13 11:25:18 +08:00
Source1: kshcomp.conf
Source2: kshrc.rhs
Source3: dotkshrc
2022-12-06 16:22:10 +08:00
Patch9000: skip-some-test.patch
2022-08-27 15:30:01 +08:00
Provides: /bin/ksh /bin/rksh
BuildRequires: gcc bison glibc-langpack-ja ncurses procps tzdata util-linux
2020-01-13 11:25:18 +08:00
Conflicts: pdksh
Requires: coreutils, diffutils
Requires(post): grep, coreutils, systemd, chkconfig
2020-12-25 16:08:16 +08:00
Requires(preun): chkconfig
2020-01-13 11:25:18 +08:00
Requires(postun): sed
2020-12-25 16:08:16 +08:00
Provides: ksh-help = %{epoch}:%{version}-%{release}
Obsoletes: ksh-help < %{epoch}:%{version}-%{release}
2020-01-13 11:25:18 +08:00
%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).
2020-01-13 11:25:18 +08:00
%prep
%autosetup -p1
2020-01-13 11:25:18 +08:00
%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
2020-01-13 11:25:18 +08:00
%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
2020-01-13 11:25:18 +08:00
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
2022-03-10 20:24:49 +08:00
%check
script -q -e -c "bin/package test"
2022-03-10 20:24:49 +08:00
2020-01-13 11:25:18 +08:00
%post
for s in /bin/ksh /bin/rksh /usr/bin/ksh /usr/bin/rksh
2020-01-13 11:25:18 +08:00
do
if [ ! -f /etc/shells ]; then
2020-01-13 11:25:18 +08:00
echo "$s" > /etc/shells
else
2020-01-13 11:25:18 +08:00
if ! grep -q '^'"$s"'$' /etc/shells ; then
echo "$s" >> /etc/shells
2020-01-13 11:25:18 +08:00
fi
fi
2020-01-13 11:25:18 +08:00
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
2020-01-13 11:25:18 +08:00
%preun
if [ $1 = 0 ]; then
%{_sbindir}/alternatives --remove ksh %{_bindir}/ksh93
2020-01-13 11:25:18 +08:00
fi
%postun
for s in /bin/ksh /bin/rksh /usr/bin/ksh /usr/bin/rksh
2020-01-13 11:25:18 +08:00
do
if [ ! -f $s ]; then
sed -i '\|^'"$s"'$|d' /etc/shells
fi
2020-01-13 11:25:18 +08:00
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*
2020-01-13 11:25:18 +08:00
%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
2022-12-06 16:22:10 +08:00
* Tue Dec 6 2022 wangyuhang <wangyuhang27@huawei.com> - 1:2020.0.0-11
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:change patch name
2022-08-27 15:30:01 +08:00
* 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"
2022-06-30 14:38:23 +08:00
* 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
2022-04-13 15:18:17 +08:00
* Wed Apr 13 2022 renhongxun <renhongxun@h-partners.com> - 1:2020.0.0-8
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:udpate license
2022-03-15 10:23:58 +08:00
* 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
2022-03-10 20:24:49 +08:00
* Thu Mar 10 2022 wangjiang <wangjiang37@h-partners.com> - 1:2020.0.0-6
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:enable check
2020-12-25 16:08:16 +08:00
* 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
2020-04-21 17:18:46 +08:00
* 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
2020-01-13 11:25:18 +08:00
* Fri Jan 10 2020 Lijin Yang <yanglijin@huawei.com> - 1:2020.0.0-2
- Package init