862fceb
#ExclusiveArch:  x86_64
4852349
%define       releasedate   2007-11-05
fd54fb9
#ExcludeArch:  ia64
cvsdist 7b811d5
cvsdist 00f58df
Name:         ksh
cvsdist 7b811d5
Summary:      The Original ATT Korn Shell
cvsdist 00f58df
URL:          http://www.kornshell.com/
cvsdist 7b811d5
Group:        Applications/Shells
c790c1f
License:      Common Public License Version 1.0
49ffebb
Version:      20071105
4852349
Release:      1%{?dist}
cvsdist 7b811d5
Source0:      http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{releasedate}.tgz
521d11f
Source1:      http://www.research.att.com/~gsf/download/tgz/INIT.%{releasedate}.tgz
4852349
Source2:      http://www.research.att.com/~gsf/download/tgz/ast-ksh-locale.%{releasedate}.tgz
4852349
#Patch0:       ksh-20041225-gcc4.patch
521d11f
Patch1:       ksh-20070328-uname.patch
521d11f
Patch2:       ksh-20070328-useex.patch
3de28ba
Patch3:       ksh-20070328-builtins.patch
3de28ba
Patch4:       ksh-20070328-ttou.patch
3de28ba
Patch5:       ksh-20070628-unaligned.patch
0f16643
# for debugging only:
0f16643
#Patch100:     ksh-20060124-iffedebug.patch
cvsdist 7b811d5
cvsdist 7b811d5
#   build information
0f16643
BuildRoot:    %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
cvsdist 7b811d5
Provides:     ksh93
cvsdist 7b811d5
Obsoletes:    ksh93
fd54fb9
Conflicts:    pdksh
8a6e4f2
Requires: coreutils, glibc-common, diffutils
0f16643
Requires(post): grep, coreutils
0f16643
Requires(preun): grep, coreutils
cvsdist 00f58df
cvsdist 00f58df
%description
cvsdist 7b811d5
KSH-93 is the most recent version of the KornShell by David Korn of 
cvsdist 7b811d5
AT&T Bell Laboratories.
cvsdist 7b811d5
KornShell is a shell programming language, which is upward compatible
cvsdist 7b811d5
with "sh" (the Bourne Shell).
cvsdist 7b811d5
cvsdist 00f58df
%prep
cvsdist 7b811d5
%setup -q -c
cvsdist 7b811d5
%setup -q -T -D -a 1
cvsdist 7b811d5
%setup -q -T -D -a 2
4852349
#%patch0 -p1 -b .gcc4
0f16643
%patch1 -p1 -b .uname
0f16643
%patch2 -p1 -b .use_ex
3de28ba
%patch3 -p1 -b .builtins
3de28ba
%patch4 -p1 -b .ttou
3de28ba
%patch5 -p1 -b .unaligned
0f16643
#patch100 -p1 -b .iffedebug
cvsdist 00f58df
cvsdist 00f58df
%build
cvsdist 7b811d5
./bin/package "read" ||:
8a6e4f2
export CCFLAGS="$RPM_OPT_FLAGS"
8a6e4f2
export CC=gcc
8a6e4f2
./bin/package "make"
cvsdist 7b811d5
cp lib/package/LICENSES/ast LICENSE
cvsdist 00f58df
cvsdist 00f58df
%install
cvsdist 00f58df
rm -rf $RPM_BUILD_ROOT
527ccdf
mkdir -p $RPM_BUILD_ROOT{/bin,/usr/bin,%{_mandir}/man1}
cvsdist 7b811d5
mkdir -p $RPM_BUILD_ROOT%{_datadir}/locale/{C,pt,fr,de,it,es}/LC_MESSAGES
59272c8
install -c -m 755 arch/*/bin/ksh $RPM_BUILD_ROOT/bin/ksh
cvsdist 7b811d5
install -c -m 644 arch/*/man/man1/sh.1 $RPM_BUILD_ROOT%{_mandir}/man1/ksh.1
cvsdist 7b811d5
for i in C pt fr de it es; do
cvsdist 7b811d5
install -m 644 share/lib/locale/$i/LC_MESSAGES/* \
cvsdist 7b811d5
               $RPM_BUILD_ROOT%{_datadir}/locale/$i/LC_MESSAGES/
cvsdist 7b811d5
done
527ccdf
ln -sf /bin/ksh $RPM_BUILD_ROOT/usr/bin/ksh
cvsdist 00f58df
cvsdist 7b811d5
%post
cvsdist 00f58df
if [ ! -f /etc/shells ]; then
cvsdist 00f58df
        echo "/bin/ksh" > /etc/shells
cvsdist 00f58df
else
cvsdist 00f58df
        if ! grep -q '^/bin/ksh$' /etc/shells ; then
cvsdist 00f58df
                echo "/bin/ksh" >> /etc/shells
cvsdist 00f58df
        fi
cvsdist 00f58df
fi
cvsdist 00f58df
cvsdist 7b811d5
%postun
cvsdist 00f58df
if [ ! -f /bin/ksh ]; then
cvsdist 7b811d5
        grep -v '^/bin/ksh$' /etc/shells >/etc/shells.new
cvsdist 00f58df
        mv /etc/shells.new /etc/shells
cvsdist 7b811d5
        chmod 644 /etc/shells
cvsdist 00f58df
fi
cvsdist 00f58df
cvsdist 7b811d5
%verifyscript
cvsdist 7b811d5
echo -n "Looking for ksh in /etc/shells... "
cvsdist 7b811d5
if ! grep '^/bin/ksh$' /etc/shells > /dev/null; then
cvsdist 7b811d5
    echo "missing"
cvsdist 7b811d5
    echo "ksh missing from /etc/shells" >&2
cvsdist 7b811d5
else
cvsdist 7b811d5
    echo "found"
cvsdist 7b811d5
fi
cvsdist 7b811d5
cvsdist 7b811d5
%files 
0f16643
%defattr(-, root, root,-)
cvsdist 7b811d5
%doc README LICENSE
cvsdist 7b811d5
/bin/*
527ccdf
/usr//bin/ksh
cvsdist 7b811d5
%{_datadir}/locale/*/LC_MESSAGES/*
cvsdist 00f58df
%{_mandir}/man1/*
cvsdist 7b811d5
cvsdist 7b811d5
%clean
cvsdist 7b811d5
    rm -rf $RPM_BUILD_ROOT
cvsdist 00f58df
cvsdist 00f58df
%changelog
4852349
* Wed Nov 07 2007 Tomas Smetana <tsmetana@redhat.com> 20071105-1
4852349
- new upstream version
4852349
b472a5e
* Wed Aug 22 2007 Tomas Smetana <tsmetana@redhat.com> 20070628-1.1
b472a5e
- rebuild
b472a5e
3de28ba
* Thu Jul 12 2007 Tomas Smetana <tsmetana@redhat.com> 20070628-1
3de28ba
- new upstream version
3de28ba
- fix unaligned access messages (Related: #219420)
3de28ba
8a6e4f2
* Tue May 22 2007 Tomas Smetana <tsmetana@redhat.com> 20070328-2
8a6e4f2
- fix wrong exit status of spawned process after SIGSTOP
8a6e4f2
- fix building of debuginfo package, add %%{?dist} to release
8a6e4f2
- fix handling of SIGTTOU in non-interactive shell
8a6e4f2
- remove useless builtins
8a6e4f2
521d11f
* Thu Apr 19 2007 Tomas Smetana <tsmetana@redhat.com> 20070328-1
521d11f
- new upstream source
521d11f
- fix login shell invocation (#182397)
521d11f
- fix memory leak
521d11f
0f16643
* Wed Feb 21 2007 Karsten Hopp <karsten@redhat.com> 20070111-1
0f16643
- new upstream version
0f16643
- fix invalid write in uname function
0f16643
e275b3a
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 20060214-1.1
e275b3a
- rebuild
e275b3a
a909292
* Thu Jun 01 2006 Karsten Hopp <karsten@redhat.de> 20060214-1
a909292
- new upstream source
a909292
6b025a3
* Mon Feb 27 2006 Karsten Hopp <karsten@redhat.de> 20060124-3
e059c66
- PreReq grep, coreutils (#182835)
e059c66
a5bc967
* Tue Feb 14 2006 Karsten Hopp <karsten@redhat.de> 20060124-2
a5bc967
- make it build in chroots (#180561)
a5bc967
c0b80f3
* Mon Feb 13 2006 Karsten Hopp <karsten@redhat.de> 20060124-1
c0b80f3
- version 20060124
c0b80f3
a9cc8bb
* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 20050202-5.1
a9cc8bb
- bump again for double-long bug on ppc(64)
a9cc8bb
d2c1e3e
* Fri Feb 10 2006 Karsten Hopp <karsten@redhat.de> 20050202-5
d2c1e3e
- rebuild
d2c1e3e
ab8bcbe
* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 20050202-4.1
ab8bcbe
- rebuilt for new gcc4.1 snapshot and glibc changes
ab8bcbe
997da7f
* Thu Feb 02 2006 Karsten Hopp <karsten@redhat.de> 20050202-4
fd54fb9
- fix uname -i output
fd54fb9
- fix loop (*-path.patch)
fd54fb9
- conflict pdksh instead of obsoleting it
fd54fb9
997da7f
* Fri Dec 16 2005 Jesse Keating <jkeating@redhat.com> 20050202-3.1
2e9b9f6
- rebuilt for new gcj
2e9b9f6
6700d03
* Tue May 10 2005 Karsten Hopp <karsten@redhat.de> 20050202-3
6700d03
- enable debuginfo
6700d03
527ccdf
* Tue Mar 15 2005 Karsten Hopp <karsten@redhat.de> 20050202-2
527ccdf
- add /usr/bin/ksh link for compatibility with pdksh scripts (#151134)
527ccdf
62e78ed
* Wed Mar 02 2005 Karsten Hopp <karsten@redhat.de> 20050202-1 
62e78ed
- update and rebuild with gcc-4
62e78ed
f313d49
* Tue Mar 01 2005 Karsten Hopp <karsten@redhat.de> 20041225-2 
f313d49
- fix gcc4 build 
f313d49
c790c1f
* Fri Jan 21 2005 Karsten Hopp <karsten@redhat.de> 20041225-1
c790c1f
- rebuild with new ksh tarball (license change)
c790c1f
954d490
* Tue Nov 02 2004 Karsten Hopp <karsten@redhat.de> 20040229-11
7e82c20
- disable ia64 for now
7e82c20
df9066f
* Fri Oct 15 2004 Karsten Hopp <karsten@redhat.de> 20040229-9 
df9066f
- rebuild
df9066f
cvsdist 7b811d5
* Thu Sep 02 2004 Nalin Dahyabhai <nalin@redhat.com> 20040229-8
cvsdist 7b811d5
- remove '&' from summary
cvsdist 7b811d5
cvsdist 7b811d5
* Thu Sep 02 2004 Bill Nottingham <notting@redhat.com> 20040229-7
cvsdist 7b811d5
- obsolete pdksh (#131303)
cvsdist 7b811d5
cvsdist 7b811d5
* Mon Aug 02 2004 Karsten Hopp <karsten@redhat.de> 20040229-6
cvsdist 7b811d5
- obsolete ksh93, provide ksh93
cvsdist 7b811d5
cvsdist 7b811d5
* Mon Jul 05 2004 Karsten Hopp <karsten@redhat.de> 20040229-3 
cvsdist 7b811d5
- add /bin/ksh to /etc/shells
cvsdist 7b811d5
cvsdist 7b811d5
* Wed Jun 16 2004 Karsten Hopp <karsten@redhat.de> 20040229-2 
cvsdist 7b811d5
- add ppc64 patch to avoid ppc64 dot symbol problem
cvsdist 7b811d5
cvsdist 7b811d5
* Fri May 28 2004 Karsten Hopp <karsten@redhat.de> 20040229-1 
cvsdist 7b811d5
- initial version
cvsdist 00f58df