6217f31
%define _bindir   /bin
6217f31
6217f31
Summary:          MirBSD enhanced version of the Korn Shell
6217f31
Name:             mksh
e866716
Version:          31c
3fbfd67
Release:          1%{?dist}
ae2bc1b
License:          BSD with advertising
6217f31
Group:            System Environment/Shells
6217f31
URL:              http://www.mirbsd.de/%{name}/
e866716
Source0:          http://www.mirbsd.org/MirOS/dist/mir/%{name}/%{name}-R%{version}.cpio.gz
e866716
Source1:          http://www.mirbsd.org/MirOS/dist/hosted/other/arc4random.c
6217f31
Requires(post):   grep
6217f31
Requires(postun): coreutils, grep
e866716
BuildRequires:    util-linux, ed
6217f31
BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
6217f31
6217f31
%description
6217f31
mksh is the MirBSD enhanced version of the Public Domain Korn shell (pdksh),
6217f31
a bourne-compatible shell which is largely similar to the original AT&T Korn
6217f31
shell. It includes bug fixes and feature improvements in order to produce a
6217f31
modern, robust shell good for interactive and especially script use, being a
6217f31
bourne shell replacement, pdksh successor and an alternative to the C shell.
6217f31
6217f31
%prep
6217f31
%setup -q -T -c
6217f31
6217f31
# RPM 4.4.2 has no support for *.cpio.gz
6217f31
gzip -dc %{SOURCE0} | cpio -imd
6217f31
mv %{name}/* . && rm -rf %{name}
e866716
cp -f %{SOURCE1} .
6217f31
6217f31
%build
daa894e
CFLAGS="$RPM_OPT_FLAGS" sh Build.sh -r -Q
6217f31
6217f31
%install
6217f31
rm -rf $RPM_BUILD_ROOT
6217f31
install -D -m 755 %{name} $RPM_BUILD_ROOT%{_bindir}/%{name}
6217f31
install -D -m 644 %{name}.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
6217f31
6217f31
%check
459418d
script -qc "./test.sh -v"
6217f31
6217f31
%post
6217f31
if [ ! -f %{_sysconfdir}/shells ]; then
6217f31
  echo "%{_bindir}/%{name}" >> %{_sysconfdir}/shells
6217f31
else
6217f31
  grep -q "^%{_bindir}/%{name}$" %{_sysconfdir}/shells || \
6217f31
  echo "%{_bindir}/%{name}" >> %{_sysconfdir}/shells
6217f31
fi
6217f31
6217f31
%postun
6217f31
if [ ! -x %{_bindir}/%{name} ]; then
6217f31
  grep -v "^%{_bindir}/%{name}$" %{_sysconfdir}/shells > %{_sysconfdir}/shells.rpm
6217f31
  cat %{_sysconfdir}/shells.rpm > %{_sysconfdir}/shells && rm -f %{_sysconfdir}/shells.rpm
6217f31
fi
6217f31
6217f31
%clean
6217f31
rm -rf $RPM_BUILD_ROOT
6217f31
6217f31
%files
6217f31
%defattr(-,root,root)
6217f31
%doc copyright dot.mkshrc
6217f31
%{_bindir}/%{name}
6217f31
%{_mandir}/man1/%{name}.1*
6217f31
6217f31
%changelog
e866716
* Wed Sep 12 2007 Robert Scheck <robert@fedoraproject.org> 31c-1
e866716
- Upgrade to 31c
e866716
- Added a buildrequirement to ed, added arc4random.c file
e866716
459418d
* Tue Sep 11 2007 Robert Scheck <robert@fedoraproject.org> 31b-1
459418d
- Upgrade to 31b
459418d
- Use script to get %%check happy (thanks to Thorsten Glaser)
459418d
3fbfd67
* Sat Sep 08 2007 Robert Scheck <robert@fedoraproject.org> 31-1
3fbfd67
- Upgrade to 31
3fbfd67
ae2bc1b
* Tue Aug 28 2007 Robert Scheck <robert@fedoraproject.org> 30-2
ae2bc1b
- Updated the license tag according to the guidelines
ae2bc1b
daa894e
* Sat Jul 28 2007 Robert Scheck <robert@fedoraproject.org> 30-1
daa894e
- Upgrade to 30
daa894e
5e9e998
* Sat Jul 14 2007 Robert Scheck <robert@fedoraproject.org> 29g-1
5e9e998
- Upgrade to 29g
5e9e998
6217f31
* Sun Jun 03 2007 Robert Scheck <robert@fedoraproject.org> 29f-1
6217f31
- Upgrade to 29f
6217f31
- Initial spec file for Fedora and Red Hat Enterprise Linux