]> git.pld-linux.org Git - packages/ack.git/commitdiff
- don't run tests requiring pty auto/th/ack-2.02-1
authorKacper Kornet <draenog@pld-linux.org>
Tue, 23 Apr 2013 16:15:24 +0000 (17:15 +0100)
committerKacper Kornet <draenog@pld-linux.org>
Tue, 23 Apr 2013 16:15:24 +0000 (17:15 +0100)
- adapterized

ack-interactive-tests.patch [new file with mode: 0644]
ack.spec

diff --git a/ack-interactive-tests.patch b/ack-interactive-tests.patch
new file mode 100644 (file)
index 0000000..36719b0
--- /dev/null
@@ -0,0 +1,11 @@
+--- 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 {
index 4a4bb74d81b9d955290dcca0c92e799efa890fef..6b06d578df7db7f11ed47d11171144f61f8a5b0a 100644 (file)
--- a/ack.spec
+++ b/ack.spec
@@ -3,6 +3,7 @@
 #
 # 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
@@ -13,12 +14,14 @@ Version:    2.02
 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
@@ -59,6 +62,7 @@ ack perl library.
 %prep
 %setup -q -n %{pdir}-%{version}
 %patch0 -p0
+%patch1 -p0
 
 %build
 %{__perl} Makefile.PL \
@@ -67,7 +71,7 @@ ack perl library.
        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
This page took 0.077406 seconds and 4 git commands to generate.