]> git.pld-linux.org Git - packages/mksh.git/blame - mksh.spec
- up to 42
[packages/mksh.git] / mksh.spec
CommitLineData
d979d194 1%bcond_without static
abf806a4 2%bcond_without tests
d979d194 3#
5cba9227 4Summary: MirBSD Korn Shell
246a15d9 5Summary(pl.UTF-8): Powłoka Korna z MirBSD
5cba9227 6Name: mksh
5b678227 7Version: 42
cdde4aae 8Release: 1
5cba9227 9License: BSD
10Group: Applications/Shells
9b0c41bb 11Source0: http://www.mirbsd.org/MirOS/dist/mir/mksh/%{name}-R%{version}.tgz
5b678227 12# Source0-md5: f1ad261f79f6ac45e8d5cc5bea191090
bbdaf468
KK
13Source1: %{name}-mkshrc
14Patch0: %{name}-mkshrc_support.patch
118a1201 15Patch1: %{name}-circumflex.patch
d4eb7072 16Patch2: %{name}-no_stop_alias.patch
7de9f5a1 17Patch3: %{name}-distro.patch
cc1ba712 18Patch4: %{name}-cmdline-length.patch
15b50001
KK
19URL: https://www.mirbsd.org/mksh.htm
20%if %{with tests}
21BuildRequires: ed
22BuildRequires: perl-base
23%endif
d979d194 24%{?with_static:BuildRequires: glibc-static}
64114d19 25BuildRequires: rpmbuild(macros) >= 1.462
d979d194
AM
26# is needed for /etc directory existence
27Requires(pre): FHS
28Requires: setup >= 2.4.6-2
29Obsoletes: pdksh
5cba9227 30BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32%define _bindir /bin
33
34%description
35mksh is the MirBSD enhanced version of the Public Domain Korn shell
246a15d9 36(pdksh), a Bourne-compatible shell which is largely similar to the
5cba9227 37original AT&T Korn shell. It includes bug fixes and feature
38improvements in order to produce a modern, robust shell good for
39interactive and especially script use. It has UTF-8 support in the
5110d1d3 40emacs command line editing mode; corresponds to OpenBSD 4.2-current
5cba9227 41ksh sans GNU bash-like $PS1; the build environment requirements are
42autoconfigured; throughout code simplification/bugfix/enhancement has
43been done, and the shell has extended compatibility to other modern
44shells.
45
246a15d9
JB
46%description -l pl.UTF-8
47mksh to pochodząca z MirBSD rozszerzona wersja powłoki Public Domain
48Korn Shell (pdksh) - kompatybilnej z powłoką Bourne'a, w większości
49zbliżonej do oryginalnej powłoki Korna z AT&T. Zawiera poprawki błędów
50i rozszerzenia mające na celu stworzenie współczesnej powłoki o
51bogatych możliwościach do użytku interaktywnego i (zwłaszcza) w
52skryptach. Ma obsługę UTF-8 w trybie edycji linii poleceń w stylu
53emacsa; $PS1 odpowiada temu z ksh obecnym w OpenBSD 4.2-current;
54środowisko budowania jest automatycznie konfigurowane; dzięki
55wykonanym uproszczeniom kodu, poprawkom i rozszerzeniom powłoka ma
56rozszerzoną kompatybilność z innymi współczesnymi powłokami.
57
d979d194
AM
58%package static
59Summary: Statically linked the MirBSD enhanced version of pdksh
60Summary(pl.UTF-8): Skonsolidowana statycznie powłoka mksh
61Group: Applications/Shells
62# requires base for /etc/mkshrc?
63Requires: %{name} = %{version}-%{release}
64
65%description static
66mksh is the MirBSD enhanced version of the Public Domain Korn shell
67(pdksh), a Bourne-compatible shell which is largely similar to the
68original AT&T Korn shell.
69
70This packege contains statically linked version of mksh.
71
72%description static -l pl.UTF-8
73mksh to pochodząca z MirBSD rozszerzona wersja powłoki Public Domain
74Korn Shell (pdksh) - kompatybilnej z powłoką Bourne'a, w większości
75zbliżonej do oryginalnej powłoki Korna z AT&T.
76
7a5709f6 77W tym pakiecie jest mksh skonsolidowany statycznie.
d979d194 78
5cba9227 79%prep
5110d1d3 80%setup -qcT
5cba9227 81gzip -dc %{SOURCE0} | cpio -mid
64114d19 82mv mksh/* .; rmdir mksh
5cba9227 83
bbdaf468 84%patch0 -p0
118a1201 85%patch1 -p1
d4eb7072 86%patch2 -p1
53554a18 87%patch3 -p1
cc1ba712 88%patch4 -p1
a56c2c0a 89
e38ec2b8 90sed -i -e 's#@DISTRO@#PLD/Linux 3.0#g' check.t sh.h
bbdaf468 91
9b0c41bb
JR
92# we'll need this later due to -DMKSH_GCC55009
93cat >rtchecks <<'EOF'
94typeset -i sari=0
95typeset -Ui uari=0
96typeset -i x=0
97print -r -- $((x++)):$sari=$uari.
98let --sari --uari
99print -r -- $((x++)):$sari=$uari.
100sari=2147483647 uari=2147483647
101print -r -- $((x++)):$sari=$uari.
102let ++sari ++uari
103print -r -- $((x++)):$sari=$uari.
104let --sari --uari
105let 'sari *= 2' 'uari *= 2'
106let ++sari ++uari
107print -r -- $((x++)):$sari=$uari.
108let ++sari ++uari
109print -r -- $((x++)):$sari=$uari.
110sari=-2147483648 uari=-2147483648
111print -r -- $((x++)):$sari=$uari.
112let --sari --uari
113print -r -- $((x++)):$sari=$uari.
114EOF
115
116cat >rtchecks.expected <<'EOF'
1170:0=0.
1181:-1=4294967295.
1192:2147483647=2147483647.
1203:-2147483648=2147483648.
1214:-1=4294967295.
1225:0=0.
1236:-2147483648=2147483648.
1247:2147483647=2147483647.
125EOF
126
5cba9227 127%build
d979d194
AM
128install -d out
129
130CC="%{__cc}" \
9b0c41bb 131CFLAGS="%{rpmcflags} -DMKSH_GCC55009" \
d979d194 132LDFLAGS="%{rpmldflags}" \
eec2ce74 133CPPFLAGS="%{rpmcppflags}" \
a06946c0 134sh ./Build.sh -Q -r -j -c lto
abf806a4 135
1281d680
AM
136# skip some tests if not on terminal
137if ! tty -s; then
e14f3193 138 skip_tests="-C regress:no-ctty"
1281d680
AM
139fi
140
9b0c41bb
JR
141%if %{with tests}
142./mksh rtchecks >rtchecks.got 2>&1
143if ! cmp --quiet rtchecks.got rtchecks.expected ; then
144 echo "rtchecks failed"
145 diff -Naurp %{SOURCE3} rtchecks.got
146 exit 1
147fi
148./test.sh -v $skip_tests
149%endif
d979d194
AM
150mv mksh out/mksh.dynamic
151
152%if %{with static}
153CC="%{__cc}" \
9b0c41bb 154CFLAGS="%{rpmcflags} -DMKSH_GCC55009" \
d979d194 155LDFLAGS="%{rpmldflags} -static" \
eec2ce74 156CPPFLAGS="%{rpmcppflags}" \
a06946c0 157sh ./Build.sh -Q -r -j -c lto
d979d194 158
9b0c41bb
JR
159%if %{with tests}
160./test.sh -v $skip_tests
161./mksh rtchecks >rtchecks.got 2>&1
162if ! cmp --quiet rtchecks.got rtchecks.expected ; then
163 echo "rtchecks failed"
164 diff -Naurp %{SOURCE3} rtchecks.got
165 exit 1
166fi
167%endif
d979d194
AM
168mv mksh out/mksh.static
169%endif
170
5cba9227 171%install
172rm -rf $RPM_BUILD_ROOT
64114d19 173install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}
d979d194
AM
174install -p out/mksh.dynamic $RPM_BUILD_ROOT%{_bindir}/mksh
175%{?with_static:install -p out/mksh.static $RPM_BUILD_ROOT%{_bindir}/mksh.static}
176
64114d19 177cp -a mksh.1 $RPM_BUILD_ROOT%{_mandir}/man1/mksh.1
d979d194
AM
178echo ".so mksh.1" > $RPM_BUILD_ROOT%{_mandir}/man1/sh.1
179
bbdaf468 180install -D %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mkshrc
d76a7e70 181ln -sf mksh $RPM_BUILD_ROOT%{_bindir}/sh
5cba9227 182
53554a18
AM
183# some pdksh scripts used that
184ln -sf mksh $RPM_BUILD_ROOT%{_bindir}/ksh
185
5cba9227 186%clean
187rm -rf $RPM_BUILD_ROOT
188
b4c63cbb
AM
189%post -p %add_etc_shells -p /bin/sh /bin/ksh /bin/mksh
190%preun -p %remove_etc_shells -p /bin/sh /bin/ksh /bin/mksh
191
192%posttrans -p %add_etc_shells -p /bin/sh /bin/ksh
5cba9227 193
53bc9e9e 194
d979d194
AM
195%post static -p %add_etc_shells -p /bin/mksh.static
196%preun static -p %remove_etc_shells -p /bin/mksh.static
5cba9227 197
198%files
199%defattr(644,root,root,755)
200%doc dot.mkshrc
bbdaf468 201%config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/mkshrc
5cba9227 202%attr(755,root,root) %{_bindir}/mksh
53554a18 203%attr(755,root,root) %{_bindir}/ksh
7a5709f6 204%attr(755,root,root) %{_bindir}/sh
64114d19 205%{_mandir}/man1/mksh.1*
d979d194
AM
206%{_mandir}/man1/sh.1*
207
208%if %{with static}
209%files static
210%defattr(644,root,root,755)
211%attr(755,root,root) %{_bindir}/mksh.static
212%endif
This page took 0.09693 seconds and 4 git commands to generate.