]>
Commit | Line | Data |
---|---|---|
5cba9227 | 1 | Summary: MirBSD Korn Shell |
2 | Name: mksh | |
3 | Version: 31d | |
4 | Release: 0.1 | |
5 | License: BSD | |
6 | Group: Applications/Shells | |
7 | Source0: http://www.mirbsd.org/MirOS/dist/mir/mksh/%{name}-R%{version}.cpio.gz | |
8 | # Source0-md5: a7c77428bd2b887c1583095a00c84aac | |
9 | Source1: http://www.mirbsd.org/MirOS/dist/hosted/other/arc4random.c | |
10 | URL: http://mirbsd.de/mksh | |
11 | Requires(pre): FHS | |
12 | Requires: setup >= 2.4.6-2 | |
13 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
14 | ||
15 | %define _bindir /bin | |
16 | ||
17 | %description | |
18 | mksh is the MirBSD enhanced version of the Public Domain Korn shell | |
5110d1d3 | 19 | (pdksh), a bourne-compatible shell which is largely similar to the |
5cba9227 | 20 | original AT&T Korn shell. It includes bug fixes and feature |
21 | improvements in order to produce a modern, robust shell good for | |
22 | interactive and especially script use. It has UTF-8 support in the | |
5110d1d3 | 23 | emacs command line editing mode; corresponds to OpenBSD 4.2-current |
5cba9227 | 24 | ksh sans GNU bash-like $PS1; the build environment requirements are |
25 | autoconfigured; throughout code simplification/bugfix/enhancement has | |
26 | been done, and the shell has extended compatibility to other modern | |
27 | shells. | |
28 | ||
5cba9227 | 29 | %prep |
5110d1d3 | 30 | %setup -qcT |
5cba9227 | 31 | gzip -dc %{SOURCE0} | cpio -mid |
5110d1d3 ER |
32 | mv mksh/* ./ |
33 | rm -rf mksh | |
34 | cp %{SOURCE1} . | |
5cba9227 | 35 | |
36 | %build | |
5110d1d3 | 37 | CC="%{__cc}" CFLAGS="%{rpmcflags}" sh ./Build.sh -Q -r -j |
5cba9227 | 38 | ./test.sh -v |
39 | ||
40 | %install | |
41 | rm -rf $RPM_BUILD_ROOT | |
5110d1d3 | 42 | install -D mksh $RPM_BUILD_ROOT%{_bindir}/mksh |
5cba9227 | 43 | install -D mksh.1 $RPM_BUILD_ROOT%{_mandir}/man1/mksh.1 |
44 | ||
45 | %clean | |
46 | rm -rf $RPM_BUILD_ROOT | |
47 | ||
48 | %post -p <lua> | |
49 | t = {} | |
50 | f = io.open("/etc/shells", "r") | |
51 | if f then | |
5110d1d3 ER |
52 | for l in f:lines() do t[l]=l; end |
53 | f:close() | |
5cba9227 | 54 | end |
55 | for _, s in ipairs({"/bin/mksh", "/bin/sh"}) do | |
5110d1d3 ER |
56 | if not t[s] then |
57 | f = io.open("/etc/shells", "a"); f:write(s.."\n"); f:close() | |
58 | end | |
5cba9227 | 59 | end |
60 | ||
61 | %preun -p <lua> | |
62 | if arg[2] == "0" then | |
5110d1d3 ER |
63 | f = io.open("/etc/shells", "r") |
64 | if f then | |
65 | s="" | |
66 | for l in f:lines() do | |
67 | if not string.match(l,"^/bin/mksh$") then | |
68 | s=s..l.."\n" | |
69 | end | |
70 | end | |
71 | f:close() | |
72 | io.open("/etc/shells", "w"):write(s) | |
73 | end | |
5cba9227 | 74 | end |
75 | ||
76 | %files | |
77 | %defattr(644,root,root,755) | |
78 | %doc dot.mkshrc | |
79 | %attr(755,root,root) %{_bindir}/mksh | |
80 | %{_mandir}/man1/* |