2024-01-06 02:55:10 +01:00
|
|
|
%define pkg_version %(echo %version | tr . - )
|
|
|
|
Name: ksh
|
2024-01-06 02:55:10 +01:00
|
|
|
Version: 2020.0.0
|
2024-01-06 02:55:10 +01:00
|
|
|
Release: 1mamba
|
|
|
|
Summary: The Original ATT Korn Shell
|
|
|
|
Group: Applications/Shells
|
|
|
|
Vendor: openmamba
|
|
|
|
Distribution: openmamba
|
|
|
|
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
|
|
|
|
URL: http://www.kornshell.com/
|
2024-01-06 02:55:10 +01:00
|
|
|
Source: https://github.com/ksh2020/ksh.git/%{version}/ksh-%{version}.tar.bz2
|
|
|
|
#Source0: http://www2.research.att.com/~gsf/download/tgz/ast-ksh.%{pkg_version}.tgz
|
|
|
|
#Source1: http://www2.research.att.com/~gsf/download/tgz/INIT.%{pkg_version}.tgz
|
2024-01-06 02:55:10 +01:00
|
|
|
# from fedora
|
|
|
|
Source2: dotkshrc
|
|
|
|
Source3: kshrc.mamba
|
|
|
|
Source4: expectedresults.log
|
|
|
|
Patch0: ksh-20070328-builtins.patch
|
|
|
|
Patch1: ksh-20100826-fixregr.patch
|
|
|
|
License: Common Public License Version 1.0
|
|
|
|
BuildRequires: bison
|
|
|
|
BuildRequires: diffutils
|
|
|
|
## AUTOBUILDREQ-BEGIN
|
|
|
|
BuildRequires: glibc-devel
|
|
|
|
## AUTOBUILDREQ-END
|
|
|
|
BuildRequires: procps
|
|
|
|
Requires: coreutils
|
|
|
|
Requires: grep
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
|
|
|
|
|
|
|
%description
|
|
|
|
KSH-93 is the most recent version of the Korn Shell by David Korn of
|
|
|
|
AT&T Bell Laboratories.
|
|
|
|
Korn Shell is a shell programming language, which is upward compatible
|
|
|
|
with "sh" (the Bourne Shell).
|
|
|
|
|
2024-01-06 02:55:10 +01:00
|
|
|
%debug_package
|
|
|
|
|
2024-01-06 02:55:10 +01:00
|
|
|
%prep
|
2024-01-06 02:55:10 +01:00
|
|
|
%setup -q
|
|
|
|
#% setup -q -T -D -a 1
|
2024-01-06 02:55:10 +01:00
|
|
|
|
2024-01-06 02:55:10 +01:00
|
|
|
#%patch0 -p1
|
|
|
|
#%patch1 -p1
|
2024-01-06 02:55:10 +01:00
|
|
|
|
2024-01-06 02:55:10 +01:00
|
|
|
#sed -i 's|ls /dev/fd|ls /proc/self/fd|' src/cmd/ksh93/features/options
|
2024-01-06 02:55:10 +01:00
|
|
|
|
|
|
|
%build
|
2024-01-06 02:55:10 +01:00
|
|
|
%meson
|
2024-01-06 02:55:10 +01:00
|
|
|
|
2024-01-06 02:55:10 +01:00
|
|
|
%meson_build
|
2024-01-06 02:55:10 +01:00
|
|
|
|
|
|
|
%install
|
|
|
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
2024-01-06 02:55:10 +01:00
|
|
|
%meson_install
|
2024-01-06 02:55:10 +01:00
|
|
|
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/skel
|
|
|
|
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/skel/.kshrc
|
|
|
|
install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/kshrc
|
|
|
|
|
2024-01-06 02:55:10 +01:00
|
|
|
install -d -m0755 %{buildroot}/bin
|
|
|
|
mv %{buildroot}%{_bindir}/ksh %{buildroot}/bin/ksh
|
|
|
|
|
2024-01-06 02:55:10 +01:00
|
|
|
%check
|
|
|
|
export SHELL=$(ls $(pwd)/arch/*/bin/ksh)
|
|
|
|
cd src/cmd/ksh93/tests/
|
2024-01-06 02:55:10 +01:00
|
|
|
#ulimit -c unlimited
|
2024-01-06 02:55:10 +01:00
|
|
|
if [ ! -e /dev/fd ]
|
|
|
|
then
|
|
|
|
echo "ERROR: /dev/fd does not exist, regression tests skipped"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
$SHELL ./shtests 2>&1 | tee testresults.log
|
|
|
|
sed -e '/begins at/d' -e '/ 0 error/d' -e 's/at [^\[]*\[/\[/' testresults.log -e '/tests skipped/d' >filteredresults.log
|
|
|
|
if ! cmp filteredresults.log %{SOURCE4} >/dev/null || ls core.*
|
|
|
|
then
|
|
|
|
echo "Regression tests failed (ignoring)"
|
|
|
|
diff -Naurp %{SOURCE4} filteredresults.log || true
|
|
|
|
# exit -1
|
|
|
|
fi
|
|
|
|
:
|
|
|
|
|
|
|
|
%clean
|
|
|
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
|
|
|
|
|
|
|
%post
|
|
|
|
if [ ! -f %{_sysconfdir}/shells ]; then
|
|
|
|
echo "/bin/ksh" > %{_sysconfdir}/shells
|
|
|
|
else
|
|
|
|
if ! grep -q '^/bin/ksh$' %{_sysconfdir}/shells ; then
|
|
|
|
echo "/bin/ksh" >> %{_sysconfdir}/shells
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
%postun
|
|
|
|
if [ ! -f /bin/ksh ]; then
|
|
|
|
sed -i '/^\/bin\/ksh$/ d' %{_sysconfdir}/shells
|
|
|
|
fi
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%config(noreplace) %{_sysconfdir}/skel/.kshrc
|
|
|
|
%config(noreplace) %{_sysconfdir}/kshrc
|
|
|
|
/bin/ksh
|
|
|
|
%{_bindir}/shcomp
|
2024-01-06 02:55:10 +01:00
|
|
|
%{_mandir}/man1/ksh.1*
|
|
|
|
%doc LICENSE
|
2024-01-06 02:55:10 +01:00
|
|
|
|
|
|
|
%changelog
|
2024-01-06 02:55:10 +01:00
|
|
|
* Sun Sep 06 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 2020.0.0-1mamba
|
|
|
|
- update to 2020.0.0
|
|
|
|
|
2024-01-06 02:55:10 +01:00
|
|
|
* Sat Feb 12 2011 gil <puntogil@libero.it> 20110208-1mamba
|
|
|
|
- package created by autospec
|