[packages/ack] - don't run tests requiring pty - adapterized
draenog
draenog at pld-linux.org
Tue Apr 23 18:16:20 CEST 2013
commit 81f268ee361b3bdfb874c3b357df87f95be47fc6
Author: Kacper Kornet <draenog at pld-linux.org>
Date: Tue Apr 23 17:15:24 2013 +0100
- don't run tests requiring pty
- adapterized
ack-interactive-tests.patch | 11 +++++++++++
ack.spec | 8 ++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/ack.spec b/ack.spec
index 4a4bb74..6b06d57 100644
--- 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
diff --git a/ack-interactive-tests.patch b/ack-interactive-tests.patch
new file mode 100644
index 0000000..36719b0
--- /dev/null
+++ b/ack-interactive-tests.patch
@@ -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 {
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/ack.git/commitdiff/81f268ee361b3bdfb874c3b357df87f95be47fc6
More information about the pld-cvs-commit
mailing list