run scripts with /bin/dash to avoid damage due to /bin/sh disappearing [release 0.5.7-4mamba;Tue Oct 15 2013]

This commit is contained in:
Silvan Calarco 2024-01-05 21:38:52 +01:00
parent 7c02bed6a3
commit 542ffee3d5
2 changed files with 91 additions and 0 deletions

View File

@ -1,2 +1,6 @@
# dash
DASH is a POSIX-compliant implementation of /bin/sh that aims to be as small as possible.
It does this without sacrificing speed where possible.
In fact, it is significantly faster than bash (the GNU Bourne-Again SHell) for most tasks.

87
dash.spec Normal file
View File

@ -0,0 +1,87 @@
Name: dash
Version: 0.5.7
Release: 4mamba
Summary: A lightweight POSIX-compliant implementation of /bin/sh
Group: Applications/Shells
Vendor: openmamba
Distribution: openmamba
Packager: Davide Madrisan <davide.madrisan@gmail.com>
URL: http://gondor.apana.org.au/~herbert/dash/
Source: http://gondor.apana.org.au/~herbert/dash/files/dash-%{version}.tar.gz
License: BSD
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
## AUTOBUILDREQ-END
Provides: /bin/sh
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
DASH is a POSIX-compliant implementation of /bin/sh that aims to be as small as possible.
It does this without sacrificing speed where possible.
In fact, it is significantly faster than bash (the GNU Bourne-Again SHell) for most tasks.
%prep
%setup -q
%build
%configure --bindir=/bin
%make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall
ln -s dash.1 %{buildroot}%{_mandir}/man1/sh.1
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -p /bin/dash
if [ $1 -ge 1 ]; then
sh=`readlink /bin/sh`
[ "$sh" != "/etc/alternatives/sh" -o ! -L /bin/sh ] && ln -sf dash /bin/sh
/usr/sbin/update-alternatives \
--install /bin/sh sh /bin/dash 10
fi
exit 0
%postun
if [ $1 -eq 0 ]; then
# remove legacy alternatives /usr/bin/ld
/usr/sbin/update-alternatives --remove sh /bin/dash 2>/dev/null
fi
exit 0
%posttrans -p /bin/dash
[ -e /bin/sh ] || ln -s /etc/alternatives/sh /bin/sh
exit 0
%files
%defattr(-,root,root)
/bin/dash
%{_mandir}/man1/dash.*
%{_mandir}/man1/sh.*
%doc COPYING
#ChangeLog
%changelog
* Tue Oct 15 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 0.5.7-4mamba
- run scripts with /bin/dash to avoid damage due to /bin/sh disappearing
* Tue Oct 15 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 0.5.7-3mamba
- configure /bin/sh as an alternative
* Mon Sep 30 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 0.5.7-2mamba
- provide /bin/sh symlink replacing bash as default sh interpreter
* Sat Jul 23 2011 Automatic Build System <autodist@mambasoft.it> 0.5.7-1mamba
- automatic update to 3.0.3.0 by autodist
* Wed Feb 02 2011 Automatic Build System <autodist@mambasoft.it> 0.5.6.1-1mamba
- automatic update by autodist
* Fri Jan 21 2011 Davide Madrisan <davide.madrisan@gmail.com> 0.5.6-1mamba
- update to 0.5.6
* Mon Nov 17 2008 Aleph0 <aleph0@openmamba.org> 0.5.4-1mamba
- package created by autospec