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