--- /dev/null
+--- t/Util.pm.orig 2013-04-23 16:50:35.000000000 +0100
++++ t/Util.pm 2013-04-23 16:51:34.000000000 +0100
+@@ -403,7 +403,7 @@
+ BEGIN {
+ my $has_io_pty = eval {
+ require IO::Pty;
+- 1;
++ !exists($ENV{RUN_INTERACTIVE}) || $ENV{RUN_INTERACTIVE};
+ };
+
+ sub has_io_pty {
#
# Conditional build:
%bcond_without tests # do not perform "make test"
+%bcond_with pty_tests # do not perform tests requiring a pty
#
%include /usr/lib/rpm/macros.perl
%define pdir ack
Release: 1
License: GPL v1+ or Artistic
Group: Development/Languages/Perl
-Source0: http://www.cpan.org/modules/by-authors/id/P/PE/PETDANCE/ack-%{version}.tar.gz
+Source0: http://www.cpan.org/modules/by-authors/id/P/PE/PETDANCE/%{name}-%{version}.tar.gz
# Source0-md5: 9ae2c3939d0f069c6781ee5b6de47c27
Patch0: %{name}-deps.patch
+Patch1: %{name}-interactive-tests.patch
URL: http://betterthangrep.com/
%if %{with tests}
BuildRequires: perl-File-Next >= 1.10
+%{?with_pty_tests:BuildRequires: perl-IO-Tty}
BuildRequires: perl-Test-Simple >= 0.98
%endif
BuildRequires: perl-devel >= 1:5.8.0
%prep
%setup -q -n %{pdir}-%{version}
%patch0 -p0
+%patch1 -p0
%build
%{__perl} Makefile.PL \
CC="%{__cc}" \
OPTIMIZE="%{rpmcflags}"
-%{?with_tests:%{__make} -j1 test}
+%{?with_tests:%{!?with_pty_tests: RUN_INTERACTIVE=0} %{__make} -j1 test}
%install
rm -rf $RPM_BUILD_ROOT