3 %bcond_without static # don't build static version
4 %bcond_with binsh # build with /bin/sh symlink
6 Summary: Original AT&T Korn Shell
7 Summary(pl.UTF-8): Oryginalna powłoka Korna z AT&T
11 License: AT&T Open Source
12 Group: Applications/Shells
13 Source0: http://www.research.att.com/~gsf/download/tgz/INIT.2001-01-01.0000.tgz
14 # Source0-md5: 799b061ff85c22e7efc9a3b9e610e5c6
15 Source1: http://www.research.att.com/~gsf/download/tgz/ast-base.2001-01-01.0000.tgz
16 # Source1-md5: 9315343c62c278bfdcb155bca8316dd7
17 Source2: %{name}-ldhack.sh
18 Patch0: %{name}-build.patch
19 Patch1: %{name}-echo-e.patch
20 Patch2: %{name}-login.patch
21 URL: http://www.kornshell.com/
23 BuildRequires: glibc-static
25 Requires(post): /sbin/ldconfig
26 Requires(preun): fileutils
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 KSH-93 is the most recent version of the KornShell Language described
31 in "The KornShell Command and Programming Language," by Morris Bolsky
32 and David Korn of AT&T Bell Laboratories, ISBN 0-13-182700-6. The
33 KornShell is a shell programming language, which is upward compatible
34 with "sh" (the Bourne Shell), and is intended to conform to the IEEE
35 P1003.2/ISO 9945.2 Shell and Utilities standard. KSH-93 provides an
36 enhanced programming environment in addition to the major
37 command-entry features of the BSD shell "csh". With KSH-93,
38 medium-sized programming tasks can be performed at shell-level without
39 a significant loss in performance. In addition, "sh" scripts can be
40 run on KSH-93 without modification.
42 %description -l pl.UTF-8
43 KSH-93 jest najświeższą wersją języka KornShell opisanego przez
44 Morrisa Blolsky'ego i Davida Korna z AT&T Bell Laboratories. Powłoka
45 Korna jest zgodna z "sh" (powłoką Bourne'a) i ma być zgodna z normą
46 IEEE P1003.2/ISO 9945.2.
49 Summary: Statically linked Korn Shell
50 Summary(pl.UTF-8): Skonsolidowana statycznie powłoka Korna
51 Group: Applications/Shells
53 Requires(preun): fileutils
56 KSH-93 is the most recent version of the KornShell Language described
57 in "The KornShell Command and Programming Language," by Morris Bolsky
58 and David Korn of AT&T Bell Laboratories, ISBN 0-13-182700-6. The
59 KornShell is a shell programming language, which is upward compatible
60 with "sh" (the Bourne Shell), and is intended to conform to the IEEE
61 P1003.2/ISO 9945.2 Shell and Utilities standard. KSH-93 provides an
62 enhanced programming environment in addition to the major
63 command-entry features of the BSD shell "csh". With KSH-93,
64 medium-sized programming tasks can be performed at shell-level without
65 a significant loss in performance. In addition, "sh" scripts can be
66 run on KSH-93 without modification.
68 This packege contains statically linked version of ksh93.
70 %description static -l pl.UTF-8
71 KSH-93 jest najświeższą wersją języka KornShell opisanego przez
72 Morrisa Blolsky'ego i Davida Korna z AT&T Bell Laboratories. Powłoka
73 Korna jest zgodna z "sh" (powłoką Bourne'a) i ma być zgodna z normą
74 IEEE P1003.2/ISO 9945.2.
76 Ten pakiet zawiera wersję ksh93 skonsolidowaną statycznie.
83 install -m755 %{SOURCE2} ldhack.sh
84 touch lib/package/gen/ast.license.accepted
85 rm -f src/cmd/ksh93/Mamfile
87 # at some moment build stops using CCFLAGS - fix it:
89 sed -e 's@CC_OPTIMIZE=\$optimize@CC_OPTIMIZE="%{rpmcflags}"@' make.probe > make.probe.n
90 mv -f make.probe.n make.probe
93 LC_ALL=POSIX; export LC_ALL
95 # Yes this sucks, but that's the way (I'm too lazy to fix this stuff)
96 CCFLAGS="%{rpmcflags}" LD="`pwd`/ldhack.sh" ./bin/package make ksh93 || :
97 CCFLAGS="%{rpmcflags}" LD="`pwd`/ldhack.sh" ./bin/package make ksh93 || :
98 CCFLAGS="%{rpmcflags}" LD="`pwd`/ldhack.sh" ./bin/package make ksh93
100 cd arch/*/src/cmd/ksh93
101 %{__cc} -o ksh93 pmain.o -L../../../lib -lksh \
102 ../../../lib/libdll.a -ldl ../../../lib/libcmd.a \
103 ../../../lib/libast.a -lm
106 %{__cc} -static -o ksh93.static pmain.o -L../../../lib -lksh \
107 ../../../lib/libdll.a -ldl ../../../lib/libcmd.a \
108 ../../../lib/libast.a -lm
112 rm -rf $RPM_BUILD_ROOT
113 install -d $RPM_BUILD_ROOT{%{_mandir}/man1,/lib,/bin,%{_sysconfdir}}
115 install arch/*/src/cmd/ksh93/ksh93 $RPM_BUILD_ROOT/bin
117 install arch/*/src/cmd/ksh93/ksh93.static $RPM_BUILD_ROOT/bin
119 install arch/*/src/cmd/ksh93/libksh.so.* $RPM_BUILD_ROOT/lib
120 install arch/*/man/man1/sh.1 $RPM_BUILD_ROOT%{_mandir}/man1/ksh93.1
123 echo ".so ksh93.1" > $RPM_BUILD_ROOT%{_mandir}/man1/sh.1
124 ln -sf ksh93 $RPM_BUILD_ROOT/bin/sh
127 cp -f lib/package/LICENSES/ast LICENSE
130 mv -f OBSOLETE OBSOLETE.mm
131 groff -mm -Tascii OBSOLETE.mm > OBSOLETE
132 groff -mm -Tascii sh.memo > memo.txt
133 groff -mm -Tascii PROMO.mm > PROMO
138 if [ ! -f /etc/shells ]; then
139 echo "/bin/ksh93" > /etc/shells
141 while read SHNAME; do
142 if [ "$SHNAME" = "/bin/ksh93" ]; then
146 if [ "$SHNAME" = "/bin/sh" ]; then
151 [ -n "$HAS_KSH" ] || echo "/bin/ksh93" >> /etc/shells
153 [ -n "$HAS_SH" ] || echo "/bin/sh" >> /etc/shells
159 if [ "$1" = "0" ]; then
160 while read SHNAME; do
161 [ "$SHNAME" = "/bin/ksh93" ] ||\
163 [ "$SHNAME" = "/bin/sh" ] ||\
166 done < /etc/shells > /etc/shells.new
167 mv -f /etc/shells.new /etc/shells
170 %postun -p /sbin/ldconfig
174 if [ ! -f /etc/shells ]; then
175 echo "/bin/ksh93.static" > /etc/shells
177 while read SHNAME; do
178 if [ "$SHNAME" = "/bin/ksh93.static" ]; then
182 [ -n "$HAS_KSH_STATIC" ] || echo "/bin/ksh93.static" >> /etc/shells
187 if [ "$1" = "0" ]; then
188 while read SHNAME; do
189 [ "$SHNAME" = "/bin/ksh93.static" ] ||\
191 done < /etc/shells > /etc/shells.new
192 mv -f /etc/shells.new /etc/shells
196 %defattr(644,root,root,755)
198 %doc src/cmd/ksh93/{COMPATIBILITY,RE*,builtins.mm,OBSOLETE,memo.txt,PROMO}
200 %attr(755,root,root) /bin/ksh93
201 %attr(755,root,root) /lib/libksh.so.*
206 %attr(755,root,root) /bin/sh
211 %defattr(644,root,root,755)
212 %attr(755,root,root) /bin/ksh93.static
216 rm -rf $RPM_BUILD_ROOT