]>
Commit | Line | Data |
---|---|---|
d979d194 | 1 | %bcond_without static |
abf806a4 | 2 | %bcond_without tests |
d979d194 | 3 | # |
5cba9227 | 4 | Summary: MirBSD Korn Shell |
246a15d9 | 5 | Summary(pl.UTF-8): Powłoka Korna z MirBSD |
5cba9227 | 6 | Name: mksh |
471d39af | 7 | Version: 40d |
7e70f410 | 8 | Release: 1 |
5cba9227 | 9 | License: BSD |
10 | Group: Applications/Shells | |
11 | Source0: http://www.mirbsd.org/MirOS/dist/mir/mksh/%{name}-R%{version}.cpio.gz | |
471d39af | 12 | # Source0-md5: c6428401103367730a95b99284bf47dc |
bbdaf468 KK |
13 | Source1: %{name}-mkshrc |
14 | Patch0: %{name}-mkshrc_support.patch | |
118a1201 | 15 | Patch1: %{name}-circumflex.patch |
d4eb7072 | 16 | Patch2: %{name}-no_stop_alias.patch |
7de9f5a1 | 17 | Patch3: %{name}-distro.patch |
cc1ba712 | 18 | Patch4: %{name}-cmdline-length.patch |
15b50001 KK |
19 | URL: https://www.mirbsd.org/mksh.htm |
20 | %if %{with tests} | |
21 | BuildRequires: ed | |
22 | BuildRequires: perl-base | |
23 | %endif | |
d979d194 | 24 | %{?with_static:BuildRequires: glibc-static} |
64114d19 | 25 | BuildRequires: rpmbuild(macros) >= 1.462 |
d979d194 AM |
26 | # is needed for /etc directory existence |
27 | Requires(pre): FHS | |
28 | Requires: setup >= 2.4.6-2 | |
29 | Obsoletes: pdksh | |
5cba9227 | 30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
31 | ||
32 | %define _bindir /bin | |
33 | ||
34 | %description | |
35 | mksh 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 | 37 | original AT&T Korn shell. It includes bug fixes and feature |
38 | improvements in order to produce a modern, robust shell good for | |
39 | interactive and especially script use. It has UTF-8 support in the | |
5110d1d3 | 40 | emacs command line editing mode; corresponds to OpenBSD 4.2-current |
5cba9227 | 41 | ksh sans GNU bash-like $PS1; the build environment requirements are |
42 | autoconfigured; throughout code simplification/bugfix/enhancement has | |
43 | been done, and the shell has extended compatibility to other modern | |
44 | shells. | |
45 | ||
246a15d9 JB |
46 | %description -l pl.UTF-8 |
47 | mksh to pochodząca z MirBSD rozszerzona wersja powłoki Public Domain | |
48 | Korn Shell (pdksh) - kompatybilnej z powłoką Bourne'a, w większości | |
49 | zbliżonej do oryginalnej powłoki Korna z AT&T. Zawiera poprawki błędów | |
50 | i rozszerzenia mające na celu stworzenie współczesnej powłoki o | |
51 | bogatych możliwościach do użytku interaktywnego i (zwłaszcza) w | |
52 | skryptach. Ma obsługę UTF-8 w trybie edycji linii poleceń w stylu | |
53 | emacsa; $PS1 odpowiada temu z ksh obecnym w OpenBSD 4.2-current; | |
54 | środowisko budowania jest automatycznie konfigurowane; dzięki | |
55 | wykonanym uproszczeniom kodu, poprawkom i rozszerzeniom powłoka ma | |
56 | rozszerzoną kompatybilność z innymi współczesnymi powłokami. | |
57 | ||
d979d194 AM |
58 | %package static |
59 | Summary: Statically linked the MirBSD enhanced version of pdksh | |
60 | Summary(pl.UTF-8): Skonsolidowana statycznie powłoka mksh | |
61 | Group: Applications/Shells | |
62 | # requires base for /etc/mkshrc? | |
63 | Requires: %{name} = %{version}-%{release} | |
64 | ||
65 | %description static | |
66 | mksh is the MirBSD enhanced version of the Public Domain Korn shell | |
67 | (pdksh), a Bourne-compatible shell which is largely similar to the | |
68 | original AT&T Korn shell. | |
69 | ||
70 | This packege contains statically linked version of mksh. | |
71 | ||
72 | %description static -l pl.UTF-8 | |
73 | mksh to pochodząca z MirBSD rozszerzona wersja powłoki Public Domain | |
74 | Korn Shell (pdksh) - kompatybilnej z powłoką Bourne'a, w większości | |
75 | zbliżonej do oryginalnej powłoki Korna z AT&T. | |
76 | ||
7a5709f6 | 77 | W tym pakiecie jest mksh skonsolidowany statycznie. |
d979d194 | 78 | |
5cba9227 | 79 | %prep |
5110d1d3 | 80 | %setup -qcT |
5cba9227 | 81 | gzip -dc %{SOURCE0} | cpio -mid |
64114d19 | 82 | mv 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 | 90 | sed -i -e 's#@DISTRO@#PLD/Linux 3.0#g' check.t sh.h |
bbdaf468 | 91 | |
5cba9227 | 92 | %build |
d979d194 AM |
93 | install -d out |
94 | ||
95 | CC="%{__cc}" \ | |
96 | CFLAGS="%{rpmcppflags} %{rpmcflags}" \ | |
97 | LDFLAGS="%{rpmldflags}" \ | |
a06946c0 | 98 | sh ./Build.sh -Q -r -j -c lto |
abf806a4 | 99 | |
1281d680 AM |
100 | # skip some tests if not on terminal |
101 | if ! tty -s; then | |
e14f3193 | 102 | skip_tests="-C regress:no-ctty" |
1281d680 AM |
103 | fi |
104 | ||
e14f3193 | 105 | %{?with_tests:./test.sh -v $skip_tests} |
d979d194 AM |
106 | mv mksh out/mksh.dynamic |
107 | ||
108 | %if %{with static} | |
109 | CC="%{__cc}" \ | |
110 | CFLAGS="%{rpmcppflags} %{rpmcflags}" \ | |
111 | LDFLAGS="%{rpmldflags} -static" \ | |
a06946c0 | 112 | sh ./Build.sh -Q -r -j -c lto |
d979d194 | 113 | |
e14f3193 | 114 | %{?with_tests:./test.sh -v $skip_tests} |
d979d194 AM |
115 | mv mksh out/mksh.static |
116 | %endif | |
117 | ||
5cba9227 | 118 | %install |
119 | rm -rf $RPM_BUILD_ROOT | |
64114d19 | 120 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1} |
d979d194 AM |
121 | install -p out/mksh.dynamic $RPM_BUILD_ROOT%{_bindir}/mksh |
122 | %{?with_static:install -p out/mksh.static $RPM_BUILD_ROOT%{_bindir}/mksh.static} | |
123 | ||
64114d19 | 124 | cp -a mksh.1 $RPM_BUILD_ROOT%{_mandir}/man1/mksh.1 |
d979d194 AM |
125 | echo ".so mksh.1" > $RPM_BUILD_ROOT%{_mandir}/man1/sh.1 |
126 | ||
bbdaf468 | 127 | install -D %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mkshrc |
d76a7e70 | 128 | ln -sf mksh $RPM_BUILD_ROOT%{_bindir}/sh |
5cba9227 | 129 | |
53554a18 AM |
130 | # some pdksh scripts used that |
131 | ln -sf mksh $RPM_BUILD_ROOT%{_bindir}/ksh | |
132 | ||
5cba9227 | 133 | %clean |
134 | rm -rf $RPM_BUILD_ROOT | |
135 | ||
b4c63cbb AM |
136 | %post -p %add_etc_shells -p /bin/sh /bin/ksh /bin/mksh |
137 | %preun -p %remove_etc_shells -p /bin/sh /bin/ksh /bin/mksh | |
138 | ||
139 | %posttrans -p %add_etc_shells -p /bin/sh /bin/ksh | |
5cba9227 | 140 | |
53bc9e9e | 141 | |
d979d194 AM |
142 | %post static -p %add_etc_shells -p /bin/mksh.static |
143 | %preun static -p %remove_etc_shells -p /bin/mksh.static | |
5cba9227 | 144 | |
145 | %files | |
146 | %defattr(644,root,root,755) | |
147 | %doc dot.mkshrc | |
bbdaf468 | 148 | %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/mkshrc |
5cba9227 | 149 | %attr(755,root,root) %{_bindir}/mksh |
53554a18 | 150 | %attr(755,root,root) %{_bindir}/ksh |
7a5709f6 | 151 | %attr(755,root,root) %{_bindir}/sh |
64114d19 | 152 | %{_mandir}/man1/mksh.1* |
d979d194 AM |
153 | %{_mandir}/man1/sh.1* |
154 | ||
155 | %if %{with static} | |
156 | %files static | |
157 | %defattr(644,root,root,755) | |
158 | %attr(755,root,root) %{_bindir}/mksh.static | |
159 | %endif |