eaf6cb5
%define _bindir   /bin
eaf6cb5
eaf6cb5
Summary:          MirBSD enhanced version of the Korn Shell
eaf6cb5
Name:             mksh
4a8a846
Version:          33c
0227da7
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
eaf6cb5
# RPM 4.4.2 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
4a8a846
CFLAGS="$RPM_OPT_FLAGS" sh Build.sh -r -Q -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
9f20604
echo > test.wait
9f20604
script -qc './test.sh -v; x=$?; rm -f test.wait; exit $x'
9f20604
maxwait=0
9f20604
while test -e test.wait; do
9f20604
  sleep 1
9f20604
  maxwait=$(expr $maxwait + 1)
9f20604
  test $maxwait -lt 900 || break
9f20604
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
4a8a846
* Fri Apr 04 2008 Robert Scheck <robert@fedoraproject.org> 33c-1
4a8a846
- Upgrade to 33c and updated arc4random.c file
4a8a846
0227da7
* Mon Mar 03 2008 Robert Scheck <robert@fedoraproject.org> 33-1
0227da7
- Upgrade to 33
0227da7
9ed6b26
* Sun Feb 10 2008 Robert Scheck <robert@fedoraproject.org> 32-2
9ed6b26
- Rebuild against gcc 4.3
9ed6b26
9f20604
* Sat Nov 10 2007 Robert Scheck <robert@fedoraproject.org> 32-1
9f20604
- Upgrade to 32
9f20604
- Solved fork problems in %%check (thanks to Thorsten Glaser)
9f20604
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