eaf6cb5
%define _bindir   /bin
eaf6cb5
eaf6cb5
Summary:          MirBSD enhanced version of the Korn Shell
eaf6cb5
Name:             mksh
1924afd
Version:          39c
0d04dc8
Release:          1%{?dist}
1924afd
License:          MirOS
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
90ac14e
# 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
ae041df
CFLAGS="$RPM_OPT_FLAGS" sh Build.sh -r -combine
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
1924afd
%defattr(-,root,root,-)
ae041df
%doc dot.mkshrc
eaf6cb5
%{_bindir}/%{name}
eaf6cb5
%{_mandir}/man1/%{name}.1*
eaf6cb5
eaf6cb5
%changelog
1924afd
* Sat Feb 27 2010 Robert Scheck <robert@fedoraproject.org> 39c-1
1924afd
- Upgrade to 39c and updated arc4random.c file
1924afd
e653096
* Thu Aug 13 2009 Robert Scheck <robert@fedoraproject.org> 39-1
e653096
- Upgrade to 39 and updated arc4random.c file
e653096
e653096
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 38b-2
e653096
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
e653096
b8869e5
* Sun May 31 2009 Robert Scheck <robert@fedoraproject.org> 38b-1
b8869e5
- Upgrade to 38b
b8869e5
ae041df
* Sun May 31 2009 Robert Scheck <robert@fedoraproject.org> 38-1
ae041df
- Upgrade to 38 and updated arc4random.c file
ae041df
- Used -combine (-fwhole-program) rather the old -j switch
ae041df
0d04dc8
* Sun Apr 05 2009 Robert Scheck <robert@fedoraproject.org> 37b-1
0d04dc8
- Upgrade to 37b
0d04dc8
eb6975b
* Mon Feb 23 2009 Robert Scheck <robert@fedoraproject.org> 36b-2
eb6975b
- Rebuild against gcc 4.4 and rpm 4.6
eb6975b
f3c9d1d
* Sun Dec 14 2008 Robert Scheck <robert@fedoraproject.org> 36b-1
f3c9d1d
- Upgrade to 36b and updated arc4random.c file
f3c9d1d
58cf9f6
* Tue Dec 02 2008 Robert Scheck <robert@fedoraproject.org> 36-2
58cf9f6
- Upstream patch for command hang/high cpu workload (#474115)
58cf9f6
be846bc
* Sat Oct 25 2008 Robert Scheck <robert@fedoraproject.org> 36-1
be846bc
- Upgrade to 36
be846bc
0f795b1
* Sat Jul 19 2008 Robert Scheck <robert@fedoraproject.org> 35b-1
0f795b1
- Upgrade to 35b
0f795b1
90ac14e
* Sun Jul 13 2008 Robert Scheck <robert@fedoraproject.org> 35-1
90ac14e
- Upgrade to 35
90ac14e
cdc3b30
* Sat Apr 12 2008 Robert Scheck <robert@fedoraproject.org> 33d-1
cdc3b30
- Upgrade to 33d
cdc3b30
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