--- /dev/null
+Summary: Bash Automated Testing System
+Name: bats
+Version: 0.4.0
+Release: 1
+License: MIT
+Group: Development/Libraries
+Source0: https://github.com/sstephenson/bats/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: aeeddc0b36b8321930bf96fce6ec41ee
+Patch0: install.patch
+URL: https://github.com/sstephenson/bats
+BuildRequires: bash
+BuildRequires: sed >= 4.0
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define _libexecdir %{_prefix}/lib
+
+%description
+Bats is a TAP-compliant testing framework for Bash. It provides a
+simple way to verify that the UNIX programs you write behave as
+expected.
+
+Bats is most useful when testing software written in Bash, but you can
+use it to test any UNIX program.
+
+%prep
+%setup -q
+%patch0 -p1
+
+%{__sed} -i -e '1 s,#!.*bash,#!/bin/bash,' libexec/*
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_prefix},%{_libexecdir},%{_mandir}}
+./install.sh $RPM_BUILD_ROOT%{_prefix}
+ln -sf ../lib/bats $RPM_BUILD_ROOT%{_bindir}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc README.md LICENSE
+%attr(755,root,root) %{_bindir}/bats
+%attr(755,root,root) %{_libexecdir}/bats
+%attr(755,root,root) %{_libexecdir}/bats-exec-suite
+%attr(755,root,root) %{_libexecdir}/bats-exec-test
+%attr(755,root,root) %{_libexecdir}/bats-format-tap-stream
+%attr(755,root,root) %{_libexecdir}/bats-preprocess
+%{_mandir}/man1/bats.1*
+%{_mandir}/man7/bats.7*
--- /dev/null
+--- bats-0.4.0/install.sh~ 2015-05-20 10:35:36.000000000 +0300
++++ bats-0.4.0/install.sh 2015-05-20 10:35:37.614227321 +0300
+@@ -29,9 +29,9 @@
+
+ BATS_ROOT="$(abs_dirname "$0")"
+ mkdir -p "$PREFIX"/{bin,libexec,share/man/man{1,7}}
+-cp -R "$BATS_ROOT"/bin/* "$PREFIX"/bin
+-cp -R "$BATS_ROOT"/libexec/* "$PREFIX"/libexec
+-cp "$BATS_ROOT"/man/bats.1 "$PREFIX"/share/man/man1
+-cp "$BATS_ROOT"/man/bats.7 "$PREFIX"/share/man/man7
++cp -Rp "$BATS_ROOT"/bin/* "$PREFIX"/bin
++cp -Rp "$BATS_ROOT"/libexec/* "$PREFIX"/lib
++cp -p "$BATS_ROOT"/man/bats.1 "$PREFIX"/share/man/man1
++cp -p "$BATS_ROOT"/man/bats.7 "$PREFIX"/share/man/man7
+
+ echo "Installed Bats to $PREFIX/bin/bats"