]> git.pld-linux.org Git - SPECS.git/blob - ksh93.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / ksh93.spec
1 #
2 # Conditional build:
3 %bcond_without          static          # don't build static version
4 %bcond_with             binsh           # build with /bin/sh symlink
5 #
6 Summary:        Original AT&T Korn Shell
7 Summary(pl.UTF-8):      Oryginalna powłoka Korna z AT&T
8 Name:           ksh93
9 Version:        1.1
10 Release:        5
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/
22 %if %{with static}
23 BuildRequires:  glibc-static
24 %endif
25 Requires(post): /sbin/ldconfig
26 Requires(preun):        fileutils
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %description
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.
41
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.
47
48 %package static
49 Summary:        Statically linked Korn Shell
50 Summary(pl.UTF-8):      Skonsolidowana statycznie powłoka Korna
51 Group:          Applications/Shells
52 Requires:       %{name}
53 Requires(preun):        fileutils
54
55 %description static
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.
67
68 This packege contains statically linked version of ksh93.
69
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.
75
76 Ten pakiet zawiera wersję ksh93 skonsolidowaną statycznie.
77
78 %prep
79 %setup -q -c -a1
80 %patch0 -p1
81 %patch1 -p1
82 %patch2 -p1
83 install -m755 %{SOURCE2} ldhack.sh
84 touch lib/package/gen/ast.license.accepted
85 rm -f src/cmd/ksh93/Mamfile
86
87 # at some moment build stops using CCFLAGS - fix it:
88 cd src/cmd/nmake
89 sed -e 's@CC_OPTIMIZE=\$optimize@CC_OPTIMIZE="%{rpmcflags}"@' make.probe > make.probe.n
90 mv -f make.probe.n make.probe
91
92 %build
93 LC_ALL=POSIX; export LC_ALL
94
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
99
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
104
105 %if %{with static}
106 %{__cc} -static -o ksh93.static pmain.o -L../../../lib -lksh \
107         ../../../lib/libdll.a -ldl ../../../lib/libcmd.a \
108         ../../../lib/libast.a -lm
109 %endif
110
111 %install
112 rm -rf $RPM_BUILD_ROOT
113 install -d $RPM_BUILD_ROOT{%{_mandir}/man1,/lib,/bin,%{_sysconfdir}}
114
115 install arch/*/src/cmd/ksh93/ksh93 $RPM_BUILD_ROOT/bin
116 %if %{with static}
117 install arch/*/src/cmd/ksh93/ksh93.static $RPM_BUILD_ROOT/bin
118 %endif
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
121
122 %if %{with binsh}
123 echo ".so ksh93.1" > $RPM_BUILD_ROOT%{_mandir}/man1/sh.1
124 ln -sf ksh93 $RPM_BUILD_ROOT/bin/sh
125 %endif
126
127 cp -f lib/package/LICENSES/ast LICENSE
128
129 cd src/cmd/ksh93
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
134
135 %post
136 umask 022
137 /sbin/ldconfig
138 if [ ! -f /etc/shells ]; then
139         echo "/bin/ksh93" > /etc/shells
140 else
141         while read SHNAME; do
142                 if [ "$SHNAME" = "/bin/ksh93" ]; then
143                         HAS_KSH=1
144                 fi
145 %if %{with binsh}
146                 if [ "$SHNAME" = "/bin/sh" ]; then
147                         HAS_SH=1
148                 fi
149 %endif
150         done < /etc/shells
151         [ -n "$HAS_KSH" ] || echo "/bin/ksh93" >> /etc/shells
152 %if %{with binsh}
153         [ -n "$HAS_SH" ] || echo "/bin/sh" >> /etc/shells
154 %endif
155 fi
156
157 %preun
158 umask 022
159 if [ "$1" = "0" ]; then
160         while read SHNAME; do
161                 [ "$SHNAME" = "/bin/ksh93" ] ||\
162 %if %{with binsh}
163                 [ "$SHNAME" = "/bin/sh" ] ||\
164 %endif
165                 echo "$SHNAME"
166         done < /etc/shells > /etc/shells.new
167         mv -f /etc/shells.new /etc/shells
168 fi
169
170 %postun -p /sbin/ldconfig
171
172 %post static
173 umask 022
174 if [ ! -f /etc/shells ]; then
175         echo "/bin/ksh93.static" > /etc/shells
176 else
177         while read SHNAME; do
178                 if [ "$SHNAME" = "/bin/ksh93.static" ]; then
179                         HAS_KSH_STATIC=1
180                 fi
181         done < /etc/shells
182         [ -n "$HAS_KSH_STATIC" ] || echo "/bin/ksh93.static" >> /etc/shells
183 fi
184
185 %preun static
186 umask 022
187 if [ "$1" = "0" ]; then
188         while read SHNAME; do
189                 [ "$SHNAME" = "/bin/ksh93.static" ] ||\
190                 echo "$SHNAME"
191         done < /etc/shells > /etc/shells.new
192         mv -f /etc/shells.new /etc/shells
193 fi
194
195 %files
196 %defattr(644,root,root,755)
197 %doc LICENSE
198 %doc src/cmd/ksh93/{COMPATIBILITY,RE*,builtins.mm,OBSOLETE,memo.txt,PROMO}
199
200 %attr(755,root,root) /bin/ksh93
201 %attr(755,root,root) /lib/libksh.so.*
202
203 %{_mandir}/man1/*
204
205 %if %{with binsh}
206 %attr(755,root,root) /bin/sh
207 %endif
208
209 %if %{with static}
210 %files static
211 %defattr(644,root,root,755)
212 %attr(755,root,root) /bin/ksh93.static
213 %endif
214
215 %clean
216 rm -rf $RPM_BUILD_ROOT
This page took 0.470349 seconds and 3 git commands to generate.