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