eaf6cb5
%define _bindir   /bin
eaf6cb5
eaf6cb5
Summary:          MirBSD enhanced version of the Korn Shell
eaf6cb5
Name:             mksh
0def56c
Version:          36b
0def56c
Release:          1%{?dist}
2d7354a
License:          BSD with advertising
eaf6cb5
Group:            System Environment/Shells
eaf6cb5
URL:              http://www.mirbsd.de/%{name}/
b07ea31
Source0:          http://www.mirbsd.org/MirOS/dist/mir/%{name}/%{name}-R%{version}.cpio.gz
b07ea31
Source1:          http://www.mirbsd.org/MirOS/dist/hosted/other/arc4random.c
eaf6cb5
Requires(post):   grep
eaf6cb5
Requires(postun): coreutils, grep
b07ea31
BuildRequires:    util-linux, ed
eaf6cb5
BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
eaf6cb5
eaf6cb5
%description
eaf6cb5
mksh is the MirBSD enhanced version of the Public Domain Korn shell (pdksh),
eaf6cb5
a bourne-compatible shell which is largely similar to the original AT&T Korn
eaf6cb5
shell. It includes bug fixes and feature improvements in order to produce a
eaf6cb5
modern, robust shell good for interactive and especially script use, being a
eaf6cb5
bourne shell replacement, pdksh successor and an alternative to the C shell.
eaf6cb5
eaf6cb5
%prep
eaf6cb5
%setup -q -T -c
eaf6cb5
0eade6e
# rpm.org has no support for *.cpio.gz
eaf6cb5
gzip -dc %{SOURCE0} | cpio -imd
eaf6cb5
mv %{name}/* . && rm -rf %{name}
b07ea31
cp -f %{SOURCE1} .
eaf6cb5
eaf6cb5
%build
7fc567a
CFLAGS="$RPM_OPT_FLAGS" sh Build.sh -r -j
eaf6cb5
eaf6cb5
%install
eaf6cb5
rm -rf $RPM_BUILD_ROOT
eaf6cb5
install -D -m 755 %{name} $RPM_BUILD_ROOT%{_bindir}/%{name}
eaf6cb5
install -D -m 644 %{name}.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
eaf6cb5
eaf6cb5
%check
3a6a943
echo > test.wait
3a6a943
script -qc './test.sh -v; x=$?; rm -f test.wait; exit $x'
3a6a943
maxwait=0
3a6a943
while test -e test.wait; do
3a6a943
  sleep 1
3a6a943
  maxwait=$(expr $maxwait + 1)
3a6a943
  test $maxwait -lt 900 || break
3a6a943
done
eaf6cb5
eaf6cb5
%post
eaf6cb5
if [ ! -f %{_sysconfdir}/shells ]; then
eaf6cb5
  echo "%{_bindir}/%{name}" >> %{_sysconfdir}/shells
eaf6cb5
else
eaf6cb5
  grep -q "^%{_bindir}/%{name}$" %{_sysconfdir}/shells || \
eaf6cb5
  echo "%{_bindir}/%{name}" >> %{_sysconfdir}/shells
eaf6cb5
fi
eaf6cb5
eaf6cb5
%postun
eaf6cb5
if [ ! -x %{_bindir}/%{name} ]; then
eaf6cb5
  grep -v "^%{_bindir}/%{name}$" %{_sysconfdir}/shells > %{_sysconfdir}/shells.rpm
eaf6cb5
  cat %{_sysconfdir}/shells.rpm > %{_sysconfdir}/shells && rm -f %{_sysconfdir}/shells.rpm
eaf6cb5
fi
eaf6cb5
eaf6cb5
%clean
eaf6cb5
rm -rf $RPM_BUILD_ROOT
eaf6cb5
eaf6cb5
%files
eaf6cb5
%defattr(-,root,root)
eaf6cb5
%doc copyright dot.mkshrc
eaf6cb5
%{_bindir}/%{name}
eaf6cb5
%{_mandir}/man1/%{name}.1*
eaf6cb5
eaf6cb5
%changelog
0def56c
* Sun Dec 14 2008 Robert Scheck <robert@fedoraproject.org> 36b-1
0def56c
- Upgrade to 36b and updated arc4random.c file
0def56c
ab84f7a
* Tue Dec 02 2008 Robert Scheck <robert@fedoraproject.org> 36-2
ab84f7a
- Upstream patch for command hang/high cpu workload (#474115)
ab84f7a
7fc567a
* Sat Oct 25 2008 Robert Scheck <robert@fedoraproject.org> 36-1
7fc567a
- Upgrade to 36
7fc567a
49d4c42
* Sat Jul 19 2008 Robert Scheck <robert@fedoraproject.org> 35b-1
49d4c42
- Upgrade to 35b
49d4c42
0eade6e
* Sun Jul 13 2008 Robert Scheck <robert@fedoraproject.org> 35-1
0eade6e
- Upgrade to 35
0eade6e
e3d5422
* Sat Apr 12 2008 Robert Scheck <robert@fedoraproject.org> 33d-1
e3d5422
- Upgrade to 33d
e3d5422
cbedcad
* Fri Apr 04 2008 Robert Scheck <robert@fedoraproject.org> 33c-1
cbedcad
- Upgrade to 33c and updated arc4random.c file
cbedcad
94658cd
* Mon Mar 03 2008 Robert Scheck <robert@fedoraproject.org> 33-1
94658cd
- Upgrade to 33
94658cd
94658cd
* Sun Feb 10 2008 Robert Scheck <robert@fedoraproject.org> 32-2
94658cd
- Rebuild against gcc 4.3
94658cd
3a6a943
* Sat Nov 10 2007 Robert Scheck <robert@fedoraproject.org> 32-1
3a6a943
- Upgrade to 32
3a6a943
- Solved fork problems in %%check (thanks to Thorsten Glaser)
3a6a943
5d8bd45
* Mon Oct 15 2007 Robert Scheck <robert@fedoraproject.org> 31d-1
5d8bd45
- Upgrade to 31d
5d8bd45
b07ea31
* Wed Sep 12 2007 Robert Scheck <robert@fedoraproject.org> 31c-1
b07ea31
- Upgrade to 31c
b07ea31
- Added a buildrequirement to ed, added arc4random.c file
b07ea31
9254e33
* Tue Sep 11 2007 Robert Scheck <robert@fedoraproject.org> 31b-1
9254e33
- Upgrade to 31b
9254e33
- Use script to get %%check happy (thanks to Thorsten Glaser)
9254e33
c987a09
* Sat Sep 08 2007 Robert Scheck <robert@fedoraproject.org> 31-1
c987a09
- Upgrade to 31
c987a09
2d7354a
* Tue Aug 28 2007 Robert Scheck <robert@fedoraproject.org> 30-2
2d7354a
- Updated the license tag according to the guidelines
2d7354a
40990d7
* Sat Jul 28 2007 Robert Scheck <robert@fedoraproject.org> 30-1
40990d7
- Upgrade to 30
40990d7
835ef0f
* Sat Jul 14 2007 Robert Scheck <robert@fedoraproject.org> 29g-1
835ef0f
- Upgrade to 29g
835ef0f
eaf6cb5
* Sun Jun 03 2007 Robert Scheck <robert@fedoraproject.org> 29f-1
eaf6cb5
- Upgrade to 29f
eaf6cb5
- Initial spec file for Fedora and Red Hat Enterprise Linux