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