eaf6cb5
%define _bindir   /bin
eaf6cb5
eaf6cb5
Summary:          MirBSD enhanced version of the Korn Shell
eaf6cb5
Name:             mksh
c473ffd
Version:          40d
16eae96
Release:          1%{?dist}
e2f293d
# BSD (setmode.c), ISC (strlcpy.c), MirOS (the rest)
e2f293d
License:          MirOS and ISC and BSD
eaf6cb5
Group:            System Environment/Shells
e2f293d
URL:              http://www.mirbsd.de/%{name}.htm
b07ea31
Source0:          http://www.mirbsd.org/MirOS/dist/mir/%{name}/%{name}-R%{version}.cpio.gz
e2f293d
Source1:          dot-mkshrc
eaf6cb5
Requires(post):   grep
e2f293d
Requires(postun): sed
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}
eaf6cb5
eaf6cb5
%build
a43097b
CFLAGS="$RPM_OPT_FLAGS" sh Build.sh -r -c lto
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
e2f293d
install -D -p -m 644 dot.mkshrc $RPM_BUILD_ROOT%{_sysconfdir}/mkshrc
e2f293d
install -D -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/skel/.mkshrc
eaf6cb5
eaf6cb5
%check
9f20604
echo > test.wait
b8686a6
# Do not run any test requiring openpty(3) until Fedora buildsystem is running
b8686a6
# mock 1.1.12 or better, which should fix the current issue in 1.1.8 (#726271).
b8686a6
# script -qc './test.sh -v; x=$?; rm -f test.wait; exit $x'
b8686a6
script -qc './test.sh -v -C regress:no-ctty; 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
e2f293d
grep -q "^%{_bindir}/%{name}$" %{_sysconfdir}/shells 2>/dev/null || \
eaf6cb5
  echo "%{_bindir}/%{name}" >> %{_sysconfdir}/shells
eaf6cb5
eaf6cb5
%postun
eaf6cb5
if [ ! -x %{_bindir}/%{name} ]; then
e2f293d
  sed -e 's@^%{_bindir}/%{name}$@POSTUNREMOVE@' -e '/^POSTUNREMOVE$/d' -i %{_sysconfdir}/shells
eaf6cb5
fi
eaf6cb5
eaf6cb5
%clean
eaf6cb5
rm -rf $RPM_BUILD_ROOT
eaf6cb5
eaf6cb5
%files
c142085
%defattr(-,root,root,-)
8a4f27b
%doc dot.mkshrc
eaf6cb5
%{_bindir}/%{name}
e2f293d
%config(noreplace) %{_sysconfdir}/mkshrc
e2f293d
%config(noreplace) %{_sysconfdir}/skel/.mkshrc
eaf6cb5
%{_mandir}/man1/%{name}.1*
eaf6cb5
eaf6cb5
%changelog
c473ffd
* Sun Dec 11 2011 Robert Scheck <robert@fedoraproject.org> 40d-1
c473ffd
- Upgrade to 40d
c473ffd
16eae96
* Tue Nov 22 2011 Robert Scheck <robert@fedoraproject.org> 40c-1
16eae96
- Upgrade to 40c
16eae96
a43097b
* Thu Jul 28 2011 Robert Scheck <robert@fedoraproject.org> 40b-2
a43097b
- Use new "Build.sh -r -c lto" rather "Build.sh -r -combine"
a43097b
c271438
* Thu Jul 28 2011 Robert Scheck <robert@fedoraproject.org> 40b-1
c271438
- Upgrade to 40b
c271438
fe4e10b
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 39c-5
fe4e10b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
fe4e10b
a3f709b
* Tue Jan 04 2011 Michal Hlavinka <mhlavink@redhat.com> 39c-4
a3f709b
- fix crash when bad substitution is used
a3f709b
5f11470
* Wed Jul 21 2010 Michal Hlavinka <mhlavink@redhat.com> 39c-3
5f11470
- fix crash when alias contains alias
5f11470
- fix crash when xtrace is enabled
5f11470
e2f293d
* Sun Jul 11 2010 Robert Scheck <robert@fedoraproject.org> 39c-2
e2f293d
- Added default configuration /etc/mkshrc & /etc/skel/.mkshrc
e2f293d
  as default skel (like at bash; thanks to Michal Hlavinka)
e2f293d
- Corrected the license tag (thanks to Michal Hlavinka)
e2f293d
- Removed the arc4random.c file (upstream is phasing it out)
e2f293d
c142085
* Sat Feb 27 2010 Robert Scheck <robert@fedoraproject.org> 39c-1
c142085
- Upgrade to 39c and updated arc4random.c file
c142085
3c7016b
* Thu Aug 13 2009 Robert Scheck <robert@fedoraproject.org> 39-1
3c7016b
- Upgrade to 39 and updated arc4random.c file
3c7016b
3909539
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 38b-2
3909539
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
3909539
d2c52f7
* Sun May 31 2009 Robert Scheck <robert@fedoraproject.org> 38b-1
d2c52f7
- Upgrade to 38b
d2c52f7
8a4f27b
* Sun May 31 2009 Robert Scheck <robert@fedoraproject.org> 38-1
8a4f27b
- Upgrade to 38 and updated arc4random.c file
8a4f27b
- Used -combine (-fwhole-program) rather the old -j switch
8a4f27b
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