From 7b1077654d371cd02aa7753dee8f59071bed8a86 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 5 Nov 2012 18:18:14 +0100 Subject: php-horde-Horde-Url: make test optionnal --- php-horde-Horde-Url.spec | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) (limited to 'php-horde-Horde-Url.spec') diff --git a/php-horde-Horde-Url.spec b/php-horde-Horde-Url.spec index 5ca6fda..27c11fc 100644 --- a/php-horde-Horde-Url.spec +++ b/php-horde-Horde-Url.spec @@ -3,9 +3,12 @@ %global pear_name Horde_Url %global pear_channel pear.horde.org +# Can run test because of circular dependency with Horde_Test +%global with_tests %{?_with_tests:1}%{!?_with_tests:0} + Name: php-horde-Horde-Url Version: 2.0.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Horde Url class Group: Development/Libraries @@ -15,15 +18,21 @@ Source0: http://pear.horde.org/get/%{pear_name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildArch: noarch -BuildRequires: php-pear +BuildRequires: php-pear(PEAR) >= 1.7.0 BuildRequires: php-channel(%{pear_channel}) +%if %{with_tests} +# To run unit tests +BuildRequires: php-pear(%{pear_channel}/Horde_Test) >= 2.0.0 +%endif Requires(post): %{__pear} Requires(postun): %{__pear} -Requires: php-pear(%{pear_channel}/Horde_Exception) >= 2.0.0 -Conflicts: php-pear(%{pear_channel}/Horde_Exception) >= 3.0.0 Requires: php(language) >= 5.3.0 +Requires: php-pcre +Requires: php-pear(PEAR) >= 1.7.0 Requires: php-channel(%{pear_channel}) +Requires: php-pear(%{pear_channel}/Horde_Exception) >= 2.0.0 +Conflicts: php-pear(%{pear_channel}/Horde_Exception) >= 3.0.0 Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version} @@ -33,7 +42,6 @@ This class represents a single URL and provides methods for manipulating URLs. %prep -%setup -q -c %setup -q -c -T tar xif %{SOURCE0} @@ -47,7 +55,6 @@ cd %{pear_name}-%{version} %install cd %{pear_name}-%{version} -rm -rf %{buildroot} %{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml # Clean up unnecessary files @@ -57,8 +64,15 @@ rm -rf %{buildroot}%{pear_metadir}/.??* mkdir -p %{buildroot}%{pear_xmldir} install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir} -%clean -rm -rf %{buildroot} + +%check +%if %{with_tests} +cd %{pear_name}-%{version}/test/$(echo %{pear_name} | sed -e s:_:/:g) +phpunit AllTests.php +%else +: Test disabled, missing '--with tests' option. +%endif + %post %{__pear} install --nodeps --soft --force --register-only \ @@ -78,7 +92,11 @@ fi %{pear_testdir}/Horde_Url %doc %{pear_docdir}/Horde_Url + %changelog +* Mon Nov 5 2012 Remi Collet - 2.0.0-2 +- make test optionnal + * Thu Nov 1 2012 Remi Collet - 2.0.0-1 - Update to 2.0.0 for remi repo -- cgit