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