summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2012-11-05 18:42:03 +0100
committerRemi Collet <fedora@famillecollet.com>2012-11-05 18:42:03 +0100
commit980be375da8f010c7e83f354729d8742ae491226 (patch)
treefede8f894186a84812ac68837d42329ccfcd6704
parentfe8c89e13ffa9eb5a132e84bafc9a984044887b8 (diff)
php-horde-Horde-Constraint: cleanups + test
-rw-r--r--php-horde-Horde-Constraint.spec29
1 files changed, 27 insertions, 2 deletions
diff --git a/php-horde-Horde-Constraint.spec b/php-horde-Horde-Constraint.spec
index 1669191..388c9b5 100644
--- a/php-horde-Horde-Constraint.spec
+++ b/php-horde-Horde-Constraint.spec
@@ -3,6 +3,9 @@
%global pear_name Horde_Constraint
%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-Constraint
Version: 2.0.0
Release: 2%{?dist}
@@ -11,23 +14,31 @@ Summary: Horde Constraint library
Group: Development/Libraries
License: BSD
URL: http://pear.horde.org
-Source0: http://pear.horde.org/get/%{pear_name}-%{version}.tgz
+Source0: http://%{pear_channel}/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(language) >= 5.3.0
+Requires: php-pcre
+BuildRequires: php-pear(PEAR) >= 1.7.0
Requires: php-channel(%{pear_channel})
Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version}
+
%description
A programmatic way of building constraints that evaluate to true or false.
+
%prep
%setup -q -c -T
tar xif %{SOURCE0}
@@ -52,6 +63,16 @@ rm -rf %{buildroot}%{pear_metadir}/.??*
mkdir -p %{buildroot}%{pear_xmldir}
install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}
+
+%check
+%if %{with_tests}
+cd %{pear_name}-%{version}/test/$(echo %{pear_name} | sed -e s:_:/:g)
+phpunit -d date.timezone=UTC AllTests.php
+%else
+: Test disabled, missing '--with tests' option.
+%endif
+
+
%post
%{__pear} install --nodeps --soft --force --register-only \
%{pear_xmldir}/%{name}.xml >/dev/null || :
@@ -71,7 +92,11 @@ fi
%{pear_phpdir}/Horde/Constraint.php
%{pear_testdir}/Horde_Constraint
+
%changelog
+* Mon Nov 5 2012 Remi Collet <RPMS@FamilleCollet.com> - 2.0.0-2
+- make test optionnal
+
* Thu Nov 1 2012 Remi Collet <RPMS@FamilleCollet.com> - 2.0.0-1
- Update to 2.0.0 for remi repo