]>
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 | |
19 | (pdksh), a bourne-compatible shell which is largely si- milar to the | |
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 | |
23 | emacs command line editing mode; corres- ponds to OpenBSD 4.2-current | |
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 | ||
29 | ||
30 | %prep | |
31 | %setup -q -T | |
32 | gzip -dc %{SOURCE0} | cpio -mid | |
33 | mv mksh/* ./ ; rm -fr mksh | |
34 | cp "%{SOURCE1}" ./ | |
35 | ||
36 | %build | |
37 | CC="%__cc" CFLAGS="%{optflags}" sh ./Build.sh -Q -r -j | |
38 | ./test.sh -v | |
39 | ||
40 | %install | |
41 | rm -rf $RPM_BUILD_ROOT | |
42 | ||
43 | install -D mksh $RPM_BUILD_ROOT%{_bindir}/mksh | |
44 | install -D mksh.1 $RPM_BUILD_ROOT%{_mandir}/man1/mksh.1 | |
45 | ||
46 | %clean | |
47 | rm -rf $RPM_BUILD_ROOT | |
48 | ||
49 | %post -p <lua> | |
50 | t = {} | |
51 | f = io.open("/etc/shells", "r") | |
52 | if f then | |
53 | for l in f:lines() do t[l]=l; end | |
54 | f:close() | |
55 | end | |
56 | for _, s in ipairs({"/bin/mksh", "/bin/sh"}) do | |
57 | if not t[s] then | |
58 | f = io.open("/etc/shells", "a"); f:write(s.."\n"); f:close() | |
59 | end | |
60 | end | |
61 | ||
62 | %preun -p <lua> | |
63 | if arg[2] == "0" then | |
64 | f = io.open("/etc/shells", "r") | |
65 | if f then | |
66 | s="" | |
67 | for l in f:lines() do | |
68 | if not string.match(l,"^/bin/mksh$") then | |
69 | s=s..l.."\n" | |
70 | end | |
71 | end | |
72 | f:close() | |
73 | io.open("/etc/shells", "w"):write(s) | |
74 | end | |
75 | end | |
76 | ||
77 | %files | |
78 | %defattr(644,root,root,755) | |
79 | %doc dot.mkshrc | |
80 | %attr(755,root,root) %{_bindir}/mksh | |
81 | %{_mandir}/man1/* |